Skip to content

Platform fixes: public access, schema health, eval hardening, and UI cleanup - #269

Closed
BigSimmo wants to merge 10 commits into
mainfrom
cursor/consolidated-platform-fixes-d6c9
Closed

Platform fixes: public access, schema health, eval hardening, and UI cleanup#269
BigSimmo wants to merge 10 commits into
mainfrom
cursor/consolidated-platform-fixes-d6c9

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Consolidated platform fixes (supersedes closed PRs #264#268):

  • Public/anonymous document access hardening
  • Live Supabase search schema health reconciliation
  • Force-embedding eval hardening + golden vector cases
  • ClinicalDashboard dead-code cleanup
  • Anonymous setup-status on production deployments

Updates in this push

Merge strategy

#271 supersedes this PR for final merge — it contains all commits here plus mobile UI fixes. Options:

  1. Recommended: Merge fix(ui): mobile hero search centering, touch targets, and portal hardening #271 only (single PR), close Platform fixes: public access, schema health, eval hardening, and UI cleanup #269 as superseded
  2. Sequential: Merge Platform fixes: public access, schema health, eval hardening, and UI cleanup #269 first, then rebase/merge fix(ui): mobile hero search centering, touch targets, and portal hardening #271

Verification

  • format:check — pass after this push
  • CI verify — re-running on push
  • ui-smoke — passed on prior run (format was the verify blocker)

Production follow-up

Set OPENAI_API_KEY in hosting env and redeploy after merge.

Open in WebOpen in Cursor

BigSimmoand others added 8 commits July 3, 2026 21:00
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.
@supabase

supabaseBot commented Jul 5, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cursor

cursorBot commented Jul 5, 2026

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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.

@BigSimmoBigSimmo closed this Jul 5, 2026
auto-merge was automatically disabled July 5, 2026 17:45

Pull request was closed

@BigSimmo
BigSimmo deleted the cursor/consolidated-platform-fixes-d6c9 branch July 9, 2026 13:01
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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@BigSimmo