Merge codex/RAG_FIX modes (Differentials/Services/Forms/Favourites) restyled to Clinical White theme - #120
Conversation
…estyled to Clinical White theme Brings in the full codex/RAG_FIX content set (4 new app modes, document filter categories, tests, build scripts, Supabase governance migrations) while keeping the current Clinical White / Aegean Graphite theme as the styling authority: - globals.css: kept current token system, glow/de-halo shadows, and flat header/composer styling; carried over branch-only structural selectors (desktop-home/document-mobile search pills, forms hero edge) restyled to the flat recipe; dropped the branch's stale html:not(.dark) glass override layer and glassy .dark composer overrides - ClinicalSidebar: kept command/accent styling + theme toggle, added Services/Forms/Favourites nav items, upgraded collapsed-rail styles to command/accent role tokens - master-search-header: took branch structure (mode icons, headerVariant, utility menu), migrated all clinical-chat-teal refs to command/accent role tokens (also fixes undefined --clinical-chat-teal-strong) - removed .codex-screenshots/.qa-smoke/tmp artifacts and gitignored them Supabase migrations are merged as files only and have NOT been applied to the live project. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ode UI - migrate all clinical-chat-teal refs in differentials/services/forms/ favourites components and routes to clinical-accent role tokens - tokenize forms-search-results-page's hardcoded hex palette (navy rail -> app-shell, teals -> clinical-accent family, grays -> border/text tokens, semantic reds/blues -> danger/info tokens) - flatten glass patterns: gradients -> flat surfaces, colored halo shadows -> neutral shadow tokens, remove backdrop-blur from sticky headers and mobile bars - map off-token Tailwind palette colors (rose/blue/teal/orange/slate) to danger/info/accent/warning/border tokens with dark-mode variants removed (tokens flip automatically) - low-opacity accent borders -> clinical-accent-border; accent-filled surfaces use clinical-accent-contrast for text (dark-mode correct) - apply codeText (Geist Mono) to MHA form code badges Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves the retrieval-domain conflicts in favour of main's measured golden-eval work: - retrieval-selection.ts: taken from main verbatim — drops the codex flowchart-action boost block and its metadata-conditional weighting, which violates main's "governance must not reorder selection" contract (golden doc-recall@5 1.0 -> 0.76 when metadata weights selection) and was tuned against pre-optimization scoring - search/route.ts: keeps codex's isSourceLibrarySearchMode() so the new modes share the document-search result limits, combined with main's RC7 per-document diversity cap (3) - retrieval-selection.test.ts: keeps main's relevance-ordering contract test; removes the two codex-only tests asserting the superseded metadata-weighted ordering Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:80df1dcecd
ℹ️ 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.
…query, unmask CI smoke secrets Addresses Codex review on PR #120: - differentials-home: only render ranked differential results after a source-backed search returns document matches; show a no-evidence notice otherwise, and drop the fabricated 2065 reviewed-source fallback count (P1) - forms-search-results-page: reset the desktop draft query when the route query changes so refinements start from the term the results reflect (P2) - ci.yml: remove placeholder fallbacks for deployment smoke secrets so a missing secret fails with the explicit missing-env error instead of passing against a server without real production env (P2) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:f1f25d7149
ℹ️ 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".
| if (!autoRunSearch || !trimmedQuery || !canRunSearch || loading) return; | ||
| const signature = `${searchMode}:${trimmedQuery}`; | ||
| if (autoRunSearchSignatureRef.current === signature) return; | ||
| autoRunSearchSignatureRef.current = signature; | ||
| void ask(); |
There was a problem hiding this comment.
Do not auto-run URL searches twice
When landing on /?mode=answer&q=...&run=1, Home now passes autoRunSearch, but the existing URL-bootstrap effect in this component also calls executeSearch for the same run=1 URL. Both effects run from the initial render where loading is still false, so this path opens two /api/answer/stream requests for the same prompt (document searches are coalesced, answer streams are not), doubling model work and racing the displayed answer; gate this effect when the URL bootstrap handles the run or make only one path responsible.
Useful? React with 👍 / 👎.
| const targetMode = appModeCanUseSourceLibraryShortcut(searchMode) ? searchMode : "documents"; | ||
| void runDocumentSearchShortcut(searchText, nextFilters, true, targetMode); |
There was a problem hiding this comment.
Preserve runnable URLs for services/forms tag searches
When a tag/facet search is launched while searchMode is services or forms, this now passes that namespace mode into runDocumentSearchShortcut, but the URL writer still calls appModeHomeHref(mode, { query }) without run: true. That leaves /services?q=... or /forms?q=... in the address bar after results are displayed; reloading or sharing that URL does not render the results because the namespace shell only switches to ClinicalDashboard when run=1. Include run: true for these namespaced result URLs so the visible results are reproducible.
Useful? React with 👍 / 👎.
| alter table if exists public.ingestion_job_stages | ||
| add constraint ingestion_job_stages_job_id_fkey | ||
| foreign key (job_id) references public.ingestion_jobs(id) on delete cascade; |
There was a problem hiding this comment.
Put the stage FK repair in a forward migration
This adds the ingestion_job_stages.job_id cleanup/FK repair inside 20260625000000_indexing_v3_agent_worker_hardening.sql, which already exists in the base branch. Supabase records applied migration timestamps and subsequent db push skips versions already in schema_migrations (CLI docs), so any live/staging DB that has applied this migration will never run these new lines; the database will still lack the restored cascade FK and orphan cleanup. Move this SQL into a new timestamped migration so existing deployments receive it.
Useful? React with 👍 / 👎.
docs(rag): track differentials flowchart-action boost deferred from PR #120
Codex review was right: #121 ("Container Playwright browser build lags the pinned client") already tracks this exact condition — client 1234 versus container 1194, every browser test failing at launch — so #145 created a second canonical action for one problem. The row was allocated without first searching the open table, which is the dedupe step the issues skill requires. #145 is removed and its distinct content folded into #121: the reproduction on main at c5c1a86, the fact that the condition has now been misread twice (the handoff's 13 launch failures, and #120 filed as a gate defect under it), the detection command to run before trusting a browser gate, and the stop rule against filing a gate defect from a run whose tests never launched. #121's own workaround, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD note and open Next decision are unchanged. The id marker rolls back 146 -> 145 because #145 was never used by a live row. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018K7sEKH35KZkWxvCnQcNN2
…gn (#1455) * issues: close#122, capture the container Playwright pin mismatch Three related ledger items, each independently revertible. Close#122 (`ci/circleci: verify` fails on every branch). Its outcome allowed either "trustworthy signal again, or it stops reporting"; the second happened. `.circleci/config.yml` was deleted by 9779828 (PR #1412), and PR #1452's head reported 21 check runs with none named `ci/circleci: verify`, so the status no longer reports on new PRs. No operator log read is needed and the quota hypothesis is retired unproven. Capture #145: the remote container ships Chromium 1194 while the repo's Playwright pin wants 1234, so every browser test dies at launch and zero assertions run while the output reads like product breakage. This has cost time twice — the 2026-07-30 handoff records 13 launch failures read as a code defect, and #120 was filed on a gate reading taken under the same condition. The row gives the start-of-session check and keeps the existing "never run npx playwright install" stop rule. Fix a stale rule found while verifying #122: AGENTS.md cited `ci/circleci: verify` as a check that fails on unformatted files. It cannot report again, so the rule now names `Static PR checks` and records the CircleCI failures as history. The outstanding-issues diff is 4 insertions / 3 deletions ignoring whitespace; the rest is Prettier re-padding the archive table, because #122's original summary is wider than that column and was kept verbatim. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018K7sEKH35KZkWxvCnQcNN2 * issues: fold the Playwright pin evidence into #121, drop duplicate #145 Codex review was right: #121 ("Container Playwright browser build lags the pinned client") already tracks this exact condition — client 1234 versus container 1194, every browser test failing at launch — so #145 created a second canonical action for one problem. The row was allocated without first searching the open table, which is the dedupe step the issues skill requires. #145 is removed and its distinct content folded into #121: the reproduction on main at c5c1a86, the fact that the condition has now been misread twice (the handoff's 13 launch failures, and #120 filed as a gate defect under it), the detection command to run before trusting a browser gate, and the stop rule against filing a gate defect from a run whose tests never launched. #121's own workaround, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD note and open Next decision are unchanged. The id marker rolls back 146 -> 145 because #145 was never used by a live row. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018K7sEKH35KZkWxvCnQcNN2 * issues: record #98 delivery and #130 pre-paint guard design Sync main, then update two rows against evidence rather than adding new ones. #98: PR #1450 landed the counting proxy and answer-path budgets while this branch was open. Verified rather than assumed — the helper counts on execution not construction, tests/rag-round-trip-budget.test.ts pins two answer-path scenarios plus three counter self-tests, and it is registered in the offline contract fixture so it runs there. Ran it: Test Files 1 passed (1), Tests 5 passed (5). The row stays open with its Next narrowed to the two real gaps: /api/search has no budget, and eval-rag-offline/test-rag-offline were not wired. Also records the helper's own blind spot — it sees only traffic through the wrapped client. #130: already owns the unfiled pre-paint/cold-load guard, so its design goes there instead of a new row. Records what the guard must test (the pre-paint reserve seed, sampled before and after hydration rather than once after), why a zero-inset profile is required for it to be able to fail at all, and that it must be proven against the broken shape first. Also records the environment blocker: browser gates cannot launch here per #121, and the symlink bridge writes under /opt, which the sandbox refuses. No new ids allocated; both are updates to rows that already own the work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018K7sEKH35KZkWxvCnQcNN2 --------- Co-authored-by: Claude <noreply@anthropic.com>
* fix: fail Playwright gates before missing-browser false greens Root-cause #120: exit-0 with "N failed" came from shell pipelines without pipefail; Node runners already propagated Playwright status. Add a Chromium headless-shell preflight before the heavy lock/build, announce phone-chrome stage failures on stderr, and document the measurement trap. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> * fix: cover every Playwright browser preflight * docs: record PR 1432 review * fix: match Playwright shell layouts * test: type Playwright preflight fixtures * docs: update PR 1432 verification * test: preserve literal Playwright project contracts * docs: record final Playwright preflight review * test: settle sheet focus before phone scroll * docs: record final Playwright preflight review * fix: honor Playwright config project matrix * docs: record visual preflight follow-up * docs: record Playwright preflight review --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
… rows CodeRabbit found row #165 claiming its follow-ups "were renumbered again to #156/#157/#158" — ids that now belong to unrelated rows on main. A reference that resolves to the wrong row is worse than none in a ledger whose whole job is to be followable later. Two fixes: - Dropped the renumbering trail entirely rather than updating it. It listed superseded ids that main has since reissued, and it went stale again on the very next sync; the row now states that renumbering happened and why, without naming numbers that no longer mean anything. - Corrected a second stale reference the earlier renumber missed: row #165 pointed at #157 for the privacy sign-off that variant F would need. That is the answer-mode caveat row, now #166. The earlier pass only rewrote three known cross-reference phrasings and did not catch this one. Verified by extracting every backtick id reference from the three rows: #165 and #166 now point at each other and #167 at #120, all live. check:outstanding-issues: 165 rows (50 open, 115 archived), unique ids, next-id=168 above the highest, no ids deleted from base 3b4872f. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPyFcMfn1jMmphr6AqiWBg
Summary
codex/RAG_FIXcontent set into main's line: four new app modes (Differentials, Services, Forms, Favourites) with routes, components, mock-data lib modules, 10+ new document filter categories, tests, build scripts, and Supabase governance migration files. Supersedes Refactor clinical KB search and UI flows #111 (recommend closing it once this merges).globals.css,ClinicalSidebar.tsx,master-search-header.tsx) in favour of the current Clinical White / Aegean Graphite theme + de-halo polish; none of the codex branch's stale palette survives.--commandgraphite for primary CTAs,--clinical-accentrole family for selection/accent/focus, flat surfaces + hairline borders instead of glass/gradients, neutral shadows instead of colored halos,codeText(Geist Mono) for MHA form codes. The 865-line forms search page's hardcoded hex palette was fully tokenized (navy rail →--app-shell, teals → accent family, semantic reds/blues → danger/info tokens) so it now theme-switches correctly..codex-screenshots/,.qa-smoke/, tmp files) and gitignores them.guard-next-build.mjs, wrapped test runners, next.config turbopack root.Verification
npm run verify:cheap— lint, typecheck, 726 unit tests passnpm run verify:ui— 54/54 Chromium tests pass (includes new differentials/services/forms suites)npm run verify:release— not run (not a release handoff)npm run format:checknpm run check:production-readiness— env-key FAILs are pre-existing worktree conditions (no.env.localin the worktree); identical on mainnpm run check:deployment-readiness— deployment behavior unchanged beyond the webpack build switch, whichnpm run buildverified locallyClinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)src/lib/{differentials,services,forms}.ts)Notes
--webpack+ guard script) per the codex branch's deliberate change; builds are slower but verified working.🤖 Generated with Claude Code