fix(worker): label the current /health surface and /api/signups intake as The Website Appraisal, not the retired Agent Desk - #164
Conversation
…e as The Website Appraisal, not the retired Agent Desk The public /health endpoint on tinystudio.io reported surface=agent-desk and the current appraisal intake persisted every lead with the retired self-serve source label. Both machine-readable truth surfaces contradicted the current offer. Rename to website-appraisal; the legacy /api/agent-audit path keeps its agent-self-serve labels. Add deterministic worker tests: /health names the current offer, current signups carry the current source, and the legacy path keeps its own label.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe worker now labels current signup intake as ChangesWebsite Appraisal health contract
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant HealthClient
participant WorkerHealth
participant Database
HealthClient->>WorkerHealth: Request /health
WorkerHealth->>Database: Check database and email_signups availability
Database-->>WorkerHealth: Return availability status
WorkerHealth-->>HealthClient: Return Website Appraisal surface and readiness
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
… the retired Agent Desk machinery The /health surface is machine-readable public truth. Its ok verdict previously gated on the retired self-serve Agent Desk's dependencies — the AI binding and the agent_runs / agent_usage_limits tables — none of which the current Website Appraisal product uses. The appraisal's only backend dependency is the D1 email_signups table behind /api/signups, so /health could report ok:false (503) while the current product was healthy, or ok:true while the signup intake was broken. The verdict now keys off db + signupsTable; the AI binding and legacy tables remain reported as informational legacy checks. Tests and a deterministic source guard pin the shape so the legacy machinery cannot silently gate the current product's readiness again. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/test-agent-worker.mjs (1)
1048-1077: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a negative readiness case for a missing
email_signupstable.The current test only verifies the healthy intake case. The source guard accepts expressions such as
checks.db && checks.signupsTable || checks.ai, which can return a false healthy result whenemail_signupsis unavailable.
scripts/test-agent-worker.mjs#L1048-L1077: Add a case where the database is configured,email_signupsis absent, andAIis present. Assert status503andbody.ok === false.scripts/check-site.mjs#L183-L198: Require the complete readiness declarationconst ok = checks.db && checks.signupsTable;, or parse the readiness expression. Do not use a partial substring check.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/test-agent-worker.mjs` around lines 1048 - 1077, Extend the health tests around the existing worker.fetch health case in scripts/test-agent-worker.mjs lines 1048-1077 with a configured DB where email_signups is absent and AI is present, asserting status 503 and body.ok is false. In scripts/check-site.mjs lines 183-198, validate the complete readiness declaration “const ok = checks.db && checks.signupsTable;” or parse the readiness expression rather than relying on a partial substring match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@scripts/test-agent-worker.mjs`:
- Around line 1048-1077: Extend the health tests around the existing
worker.fetch health case in scripts/test-agent-worker.mjs lines 1048-1077 with a
configured DB where email_signups is absent and AI is present, asserting status
503 and body.ok is false. In scripts/check-site.mjs lines 183-198, validate the
complete readiness declaration “const ok = checks.db && checks.signupsTable;” or
parse the readiness expression rather than relying on a partial substring match.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3cfabe5e-2eb1-4c87-af6c-67d5e0db474b
📒 Files selected for processing (3)
scripts/check-site.mjsscripts/test-agent-worker.mjssrc/worker.js
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25b2f905c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('email_signups', 'agent_runs', 'agent_usage_limits')" | ||
| ).all(); | ||
| const tables = new Set((tableResult.results || []).map((row) => row.name)); | ||
| checks.signupsTable = tables.has("email_signups"); |
There was a problem hiding this comment.
Verify the intake schema before returning healthy
When email_signups exists but migration 0004_signup_website.sql has not been applied, this name-only check sets signupsTable to true and /health returns 200, although saveEmailSignup immediately fails because its insert references the missing website column. This recreates the green-health/broken-intake state the change is intended to prevent; validate the required columns or migration version rather than only the table name.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
… as already fixed and live (#205) PR #164 (aeb34a9, merged 2026-08-13) already labeled the live worker /health surface and the /api/signups intake as The Website Appraisal (website-appraisal); the item queued [unreviewed-by-opus] against already-fixed state. Re-verified on current main (533ee19): worker tests 76/76 including the two /health surface guards, npm run check green, and live https://tinystudio.io/health reports surface:"website-appraisal" with ok:true as probed 2026-08-14. Co-authored-by: nish3451 <nish3451@users.noreply.github.com> Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
What
Self-directed cycle item (tier-1/2 public-promise gap): the worker's machine-readable public truth surfaces still named the retired Agent Desk as the current product, and the /health verdict measured the retired product's machinery.
GET /health(unauthenticated, served on tinystudio.io) returned"surface": "agent-desk"— the demoted, retired surface — while every owned public surface says the current offer is The Website Appraisal./api/signups— used only by the current appraisal intake on/and/audit— persisted every lead withsource: "agent-self-serve", the retired surface's name, contaminating the D1 lead labels./healthok verdict gated on the retired Agent Desk's runtime dependencies — theAIbinding and theagent_runs/agent_usage_limitstables — none of which the current Website Appraisal uses. The appraisal's only backend dependency is the D1email_signupstable behind/api/signups, so /health could reportok:false(503) while the current product was healthy, orok:truewhile the signup intake was broken.Fix
src/worker.js: newAPPRAISAL_SURFACE = "website-appraisal"constant used for the/healthsurface label and the/api/signupssource label. The legacy/api/agent-auditpath keeps its ownagent-self-servelabels (it IS the retired surface).src/worker.js:/healthreadiness verdict now keys offdb+signupsTable(the current intake path). The retired AI binding and legacy tables stay reported as informationalchecks— never as the current product's readiness.scripts/test-agent-worker.mjs: four deterministic tests —/healthnames the current offer (not agent-desk), the verdict stays green with the current intake present and all retired machinery absent, the current intake signup carrieswebsite-appraisal(neveragent-self-serve), and the legacy agent-audit path keepsagent-self-serve.scripts/check-site.mjs: static source guards pin the truthful health verdict shape so the legacy machinery cannot silently gate /health again.Non-duplication
Checked all 57 open PRs: none touch
healthResponse,signupResponse, theagent-self-servelabel, or the/healthverdict logic. Existing #116 (monthly cap) and #161 (rate-limit test branches) are adjacent but disjoint.Verification
npm run checkgreen (TinyStudio.io checks passed)npm test: 58/58 worker tests, 16/16 contract, 8/8 product-contract, 6/6 headings, 7/7 sitemapnpm run check:render-blocking: all six pages PASSnpm run deploy:dry-run: greengit diff --checkcleanLive walk (2026-08-12): all 8 routes 200; desktop 1280 + mobile 390x844 zero overflow, zero console errors (only the known /brief-requested gtag CSP error owned by #136/#52); no broken internal links.
Summary by CodeRabbit