fix: deployment boot smoke fails with 500 due to missing production env vars - #110
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:0eb2fbd4db
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Database/src/app/api/answer/stream/route.ts
Lines 174 to 178 in 2993c37
When a dangerous source-governance warning triggers this refusal, the streamed final payload is confidence: "unsupported" with empty sources and no relevance/smartPanel context. The dashboard's answerPayloadIsUsable rejects unsupported answers unless one of those context fields is present, so users get the generic no-usable-results fallback instead of the intended safety refusal and governance warning.
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Resolves the `docs/outstanding-issues.md` conflict. Two independent causes: 1. Rows #98–#105 diverged. `main` carries the newer text (PR #1377 landed "Done 2026-07-29" outcomes and rewrote several summaries); this branch carried the pre-#1377 wording. Took `main`'s rows wholesale — the branch made no edits to that range, it simply forked before them. 2. `#108`/`#109` were allocated twice. `main` used them for the verified-landed branch deletions and the shallow-clone finding; this branch had used the same two ids for the design-system token manifest and the `ui-overlap` flake. The `issues:next-id` marker has no concurrency protection, which is exactly the failure the branch's own PR notes predicted. Renumbered this branch's two rows to #110/#111 and bumped the marker to 112. No content was dropped from either side; all 111 rows are unique. Also records #111 as done, since this branch is what fixes it: the ui-overlap inset measurement now retries inside `toPass` with the 2px symmetry tolerance and the assertions unchanged. Leaving it open with a "Next: apply the retry shape" action would have re-queued work this PR already did.
(#1391) Follow-ups to #1375 (Clinical Sky design system), which merged before these landed. `text-4xs` was dead on main. #1375 retired the `--text-4xs` token, so Tailwind emits no such rule and every remaining `text-4xs` class was a silent no-op with the text falling back to inherited size. Two files carrying it landed from main while #1375 was in flight and were dead on arrival. Repointed to `text-3xs`, the 10px floor, and guarded: the design-token contract now fails if any tracked file under `src/` references the retired class outside a comment. Mockups are deliberately not exempt — a dead utility breaks a mockup exactly as it breaks production. Six hydration races fixed at the source. In this app visible never implies interactive: the server-rendered tree paints before React owns it, so a single un-retried action asserted once is a coin flip under load. Every fix retries the action together with the effect it should produce, so a swallowed first attempt retries while a genuine regression still fails. Both retries added to ui-smoke are idempotent, which review caught and which matters more than it looks. `toPass` schedules another attempt whenever the inner assertion's own deadline expires — which can happen after the click already landed. Without a guard, `openGuide` clicked a Settings trigger the modal was already covering, and the mode-menu retry clicked a TOGGLE a second time, closing a menu that had just opened and oscillating until the budget ran out. The mobile branch needed a second guard: a swallowed Settings click leaves the phone menu open, so re-running `openMobileClinicalGuideMenu` would toggle it shut and then fail to find Settings inside it — meaning the <768px branch could not recover on retry at all. The ui-overlap phone-inset measurement now retries inside `toPass` with the 2px symmetry tolerance and the assertions byte-for-byte unchanged, so a genuinely asymmetric header still fails once the retry budget is spent. Documentation records that the intermediate font weights on the variable face are deliberate rather than drift, and that redefining Tailwind's own leading names silently retunes every existing call site. Also resolves an `issues:next-id` double-allocation: #108/#109 were claimed concurrently by two branches, so this branch's two rows are renumbered #110/#111 and the marker moved to 112. #111 is archived rather than left open, since this change is what closes it. RAG impact: no retrieval behaviour change — test robustness, two mockup class names, and docs only; nothing under `src/lib/rag/**`, clinical-search, ranking-config, the eval harness or the golden fixture is touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
check:deployment-readinesswas consistently timing out with "Unexpected status: 500" becauseinstrumentation.ts'sregister()hook callsrequireServerEnv()+requireOpenAIEnv()atnext start, which throw whenSUPABASE_SERVICE_ROLE_KEYandOPENAI_API_KEYare absent — causing Next.js to mark the server unhealthy and 500 every route including the trivial/api/local-project-idprobe.Summary
scripts/deployment-boot-smoke.mjs— pass placeholder fallbacks forSUPABASE_SERVICE_ROLE_KEYandOPENAI_API_KEYin the spawned server's env when real secrets aren't present. The smoke target (/api/local-project-id) uses neither; routes that do will still error if exercised. Real secrets are used when available.scripts/deployment-boot-smoke.mjs— fix log cleanup ordering:rmSyncwas running inside thefinallyblock beforedumpLogTailcould read the file. Moved cleanup out offinallyinto separate success/failure paths so server stderr is visible on future failures.Verification
npm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedClinical Governance Preflight
Not applicable — CI tooling only, no clinical workflow or data path affected.
Notes