Platform fixes: public access, schema health, eval hardening, and UI cleanup - #269
Closed
BigSimmo wants to merge 10 commits into
Closed
Platform fixes: public access, schema health, eval hardening, and UI cleanup#269BigSimmo wants to merge 10 commits into
BigSimmo wants to merge 10 commits into
Conversation
The golden retrieval set was 100% lexical fast-path (embedding_skipped_rate=1.0), so it could not measure whether a re-index changes vector/embedding retrieval quality. - forceEmbedding option on searchChunksWithTelemetry (SearchChunksArgs): bypasses every lexical text-fast-path so retrieval always exercises the embedding/vector stage. Diagnostic/eval-only; folded into the search cache key; never set on production paths. - eval-retrieval.ts: per-case `forceEmbedding` field + a global `--force-embedding` flag. - 10 `vector-*` cases (psychiatric monographs: PTSD, OCD, panic, anorexia, GAD, Tourette, postnatal, bipolar, ADHD, opioid) with forceEmbedding=true. Each is a clinical query that must be answered by vector retrieval of the right monograph — verified live at document_recall@5=1.0, content_recall@5=1.0, all via strategy=hybrid (embedding used). Rationale: forcing embedding is the correct instrument for re-index measurement — you want to measure the vector index directly, not have a lexical shortcut mask a regression. Wording alone can't reliably force the vector path (the fast-path is driven by emergent lexical-match strength), so the flag makes these probes deterministic. Live golden eval: 34/34 pass (24 existing + 10 new), no regression. verify:cheap green (980). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wire forceEmbedding through eval runners and retrieval cache keys, bypass coverage/lexical shortcuts when forced, and add golden-case failure metrics so vector regressions cannot hide behind text-fast-path or cache hits.
- Degrade invalid bearer tokens to anonymous scope instead of 401 - Allow public document read routes (list, detail, signed-url, search, images) - Align registry routes with medications/differentials auth-signal short-circuit - Let DocumentViewer load public sources without requiring sign-in - Add regression tests and update access-control expectations
Create missing retrieval-support indexes (trgm, composite btree, partial miss log) that were absent or only present under legacy names on live. Update search_schema_health() to accept verified functional equivalents during rollout. Set search_path for pg_trgm gin_trgm_ops in extensions. Verified on linked project: search_schema_health() ok=true, missing=[].
…board Delete post-extraction dead code left in the monolith and trim unused imports. Also fix minor lint issues in favourites-hub, visual-evidence, and services-navigator.
This pull request has been ignored for the connected project Preview Branches by Supabase. |
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
BigSimmo
commented
Jul 5, 2026
OwnerAuthor
Closing as superseded by merged work on \main:
Production is live with these fixes. Any remaining unique commits should be cherry-picked onto a fresh branch from current \main. |
auto-merge was automatically disabled
July 5, 2026 17:45
Pull request was closed
3 tasks
BigSimmo added a commit
that referenced
this pull request
Aug 8, 2026
Same defect Codex flagged on PR #1719: the commits recording these measurements were authored 2026-08-08 (07:xx UTC), so a 2026-08-09 stamp places every re-measurement after the commit that recorded it. Four occurrences, in the #118, #269 and #270 rows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
BigSimmo added a commit
that referenced
this pull request
Aug 8, 2026
BigSimmo added a commit
that referenced
this pull request
Aug 8, 2026
…provenance contract (#1729) * test(visual): adopt the six linux visual baselines from CI run 31251091603 `tests/__screenshots__/` has held only a README since the visual gate landed, so every target sat in `AWAITING_BASELINE`, skipped rather than compared, and no PR could prove it had not moved the look. That is the blocker `#118` records and the one `#269` is formally waiting on. Adopted from the ubuntu CI artifact `visual-baseline-31251091603` — a `push` on `main` at `bc33d414e`, never from a developer machine: `snapshotPathTemplate` is platform-scoped, so win32 PNGs land in `win32/` and the ubuntu job never reads them, and font hinting alone would make every later run red. All six goldens were reviewed before committing, and stability was measured rather than assumed: five of the six are byte-identical by SHA-256 to the candidates from the earlier independent run 31249978408 at `2069b1f5c`. Only `document-viewer` differs, and those two runs straddle #1705, which changed `DocumentViewer.tsx`. `AWAITING_BASELINE` is now empty, so a missing golden is once again unambiguously a fault rather than a declared exemption. The two honesty tests keep that list from rotting in either direction. Deliberately NOT included: promotion. `visual-baseline` stays `continue-on-error` and outside `pr-required`. The workflow comment asks for a soak first, and adding the job to `pr-required` and dropping `continue-on-error` belong in one later edit. Known limitation recorded in the README rather than papered over: the `document-viewer` target clips a ~2900px `#main-content` against a 900px viewport and contains viewport-pinned chrome (`sm:sticky` header, `sm:fixed` composer), which composites partway down the stitched capture and overlaps content. It is deterministic, so the comparison still means something, but it predates #1705 and would be quieter with a narrower clip or a mask. Refs #118 * test(visual): satisfy the committed baseline provenance contract The first commit adopted the six PNGs but missed `tests/design-system-adoption.test.ts`, a committed contract that governs exactly this adoption and that no handover in this series mentions. It was dormant only because it had no committed baselines to check. `npm run verify:cheap` caught it: 9 failed / 5586 passed. Three things it requires, all now met: - `tests/__screenshots__/linux/provenance.json` (schemaVersion 2) binding the goldens to their capture: platform `linux`, runner `ubuntu-24.04`, hosted-CI artifact `visual-baseline-31251091603`, candidateSourceHead `bc33d414e`, and a SHA-256 plus pixel dimensions per candidate. The reviewer attestation is a human one — recorded after the six PNGs were actually looked at, not asserted on their behalf. - `AWAITING_BASELINE` must stay a *static literal* `new Set([...])`, and the suite may differ from the capture commit in nothing but those values. The explanatory comment added in the first commit violated that, and `new Set<string>()` did not parse as a literal set at all. Both reverted; the suite diff is now exactly the six ids. - Only an allowlisted set of paths may change alongside the adoption, which is why the `tests/__screenshots__/README.md` note from the first commit is reverted here. The document-viewer limitation it recorded is in the PR description instead. The fixture change is the one substantive fix. `initialiseCandidateRepository` seeded its candidate-source commit from the *live* `tests/ui-visual-baseline.spec.ts`, so every fixture silently depended on the repository not having adopted its baselines yet — and the commit that empties `AWAITING_BASELINE`, the outcome the contract exists to permit, made the fixture's own candidate head fail "must contain exactly the canonical six ids". It now defaults to the explicit canonical list. A fixture states its precondition rather than borrowing it from the tree under test. Verified: tests/design-system-adoption.test.ts 51 passed (51). Mutation-tested by corrupting a provenance SHA-256, which fails with the expected mismatch. Refs #118
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidated platform fixes (supersedes closed PRs #264–#268):
Updates in this push
main(includes fix: restore anonymous production setup-status for psychiatry.tools #277 setup-status hotfix already on main)ClinicalDashboard.tsx,rag.ts,public-access-deep.test.ts)Merge strategy
#271 supersedes this PR for final merge — it contains all commits here plus mobile UI fixes. Options:
Verification
format:check— pass after this pushverify— re-running on pushui-smoke— passed on prior run (format was the verify blocker)Production follow-up
Set
OPENAI_API_KEYin hosting env and redeploy after merge.