chore(tooling): optimize AGENTS.md tokens, repair session worktrees, and reconcile governance runbooks - #2404
Conversation
Adds /mockups/favourites-phone-perfected — one perfected phone-first direction for the signed-in Favourites page, drawn across the nine states that actually occur plus a desktop reference. Measured at 390x844 against the dev server with getBoundingClientRect(): the shipped /favourites puts the first row of the saved list at y=1141, about 300px below the fold, behind a hint strip, an in-flow composer, a privacy notice, a results band, a Continue card and a Recent card, and spends 228px on each item card. Nothing of the library is on the first screen. This direction spends 165px of chrome and 72px a row: seven rows fully above the fold, an eighth partly. Five decisions: one header rather than six bands; sets as the primary navigation; one-line rows; a real control for `pinnedAt`, which has been in the schema and the PATCH contract with no UI anywhere; and the shared composer kept as the only input, which the one-composer contract requires and the six existing favourites mockups each break with a second search bar. Draws only service | form | differential | therapy, the four types favouriteContentTypeSchema permits. The existing favourites mockups draw saved medications, documents, quotes and searches, none of which has a content type and none of which can be persisted. A weighted segment track was tried first and dropped: eight sets across 390px leaves each segment about 48px, under the width a set name needs. Phone frame geometry and both desktop grid tracks are pinned inline. On this route --spacing-phone-frame resolved to the empty string and the frame rendered 2661px tall with square corners, and the desktop grid collapsed to one stacked column — the same class-generation trap mockups/README.md records against a bare grid-cols-6. tests/favourites-phone-perfected-mockups.test.ts pins the content-type honesty, the controlled set vocabulary, clinical-state colour staying off decoration, and the 48px tap knob. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtKvCY1d3cGd5EBvGNQouv
Owner feedback on the first pass: the Continue card and the Recent card from the shipped page are worth keeping. Measured at 390px, the three derived cards above the list are Continue 113px, Recent 277px and Your sets 255px — 645px of the 1141px before the first saved row. They are not one decision, so they are not treated as one. Continue returns, rebuilt so the strip IS the button rather than stacking a full-width button under a title: 72px, exactly one row, pinned above the list so it does not scroll away. It answers a different question from the list beneath it — what was I in the middle of, not what have I saved. Cost, measured: six saved rows above the fold instead of seven. Frame 10 draws the same library without it so the trade is visible rather than argued. Recent does not return. It costs 277px to show the three most recently opened items, and the list beneath it is already sorted by recency, so those are its first three rows. The resumed item is drawn once. The shipped page shows it in Continue, again in Recent and again in the table; lifting it out of the list keeps one 72px row from being spent twice on the same thing. Frame 11 offers the shipped Recent card's type pill in place of the coloured type word. It scans faster down a column of mixed kinds, which is what that card got right, and costs about 14px of the metadata line. Two defects found while wiring this up and fixed: counting matches after Continue was lifted out made an unfiltered library read "31 of 32 saved" while the All chip still said 32, so the count is now taken before the lift; and the Continue strip's icon was missing aria-hidden, which require-lucide-icon-aria caught. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtKvCY1d3cGd5EBvGNQouv
Frame 10 restores both shipped cards as the owner asked for them, rather than only the compressed Continue strip: Continue with its own full-width action, Recent with View all, type pills and a per-row Open button. The library beneath them groups by set rather than by recency. That is what makes the arrangement coherent — a Recent card above a recency-sorted list repeats its own three rows, so keeping the card means the list should be the user's own filing. Continue, Recent and the library then answer three different questions: what was I mid-way through, what did I just touch, and what have I organised. View all switches the list to recency, so the control does something rather than sitting there. The cost is measured and drawn on the frame: Continue 152px (its title wraps at 390px where the shipped specimen's did not), Recent 271px, and one saved row above the fold against six with the compact strip. Both arrangements are kept because the choice is real and is the owner's. The shipped card tints its rule and kicker with --success. TOKENS.md scopes the clinical-state layer to source state and sanctioned urgency, and a resume affordance is neither, so the accent carries the same visual job inside the information layer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtKvCY1d3cGd5EBvGNQouv
The owner chose the Continue + Recent arrangement over the compressed resume strip, so it stops being frame 10 and becomes the design: it leads the study, and it is drawn across every state rather than one screen. The strip is kept as frame 10, the record of the choice. Drawing it across the states needed a rule, because the cards cost the fold. This is it: Continue and Recent are the landing surface, and nothing else. Tap a set or type in the composer and they hand the screen back to the list. Narrowing means you are hunting for something specific, and a resume affordance is not what you asked for. Measured: one saved row above the fold on arrival, seven the moment you narrow — so the cards are paid for on the only screen where arriving, rather than searching, is the task. That rule also fixed a defect it exposed. In the partial-load state the failure notice plus both full cards left ZERO saved rows above the fold — the one screen that most needs to show what survived was showing none of it. A degraded load now falls back to the 72px strip, which puts five rows back and keeps resume reachable. The library groups by the user's own sets rather than by recency, since a recency-sorted list under a Recent card is a second copy of it. Type pills are now the default on rows; the coloured word is kept as frame 11. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtKvCY1d3cGd5EBvGNQouv
Resolve the data/repo-awareness-snapshot.json conflict after main advanced so PR mergeability and pull_request CI can run again. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…and reconcile governance runbooks
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedNext included review available in 45 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 97 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (21)
📒 Files selected for processing (9)
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_8ae7288f-fc5f-4b5b-b917-04b03848fa79) |
…ing-workstations # Conflicts: # AGENTS.md # data/outstanding-issues-snapshot.json # data/repo-awareness-snapshot.json # docs/openai-cross-border-basis.md # docs/scripts-index.md
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ee49a747-196a-4e4f-ab7c-596a382a2d3f) |
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #14109 (failure). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
…tion cleanup tests/test-runner-safety.test.ts flags any recursive fs.rmSync call in a test file that skips the repo's bounded-retry wrapper (scripts/retryable-fs.mjs). Switch the afterAll temp-dir cleanup to removePathSync to match convention and clear the Unit coverage failure.
…ing-workstations # Conflicts: # data/outstanding-issues-snapshot.json # data/repo-awareness-snapshot.json # docs/openai-cross-border-basis.md
PR #2404's own branch (aaa3bc4) and main's PR #2406 (89f84b5) independently queued "done" requests for the same three tickets (#TF6TPJ, #HVTYAT, #9X40BT), each against the same baseRowFingerprint. Merging both left two pending mutations per ticket, which scripts/ledger-inbox.mjs's batch planner correctly refuses to reconcile without an explicit cancellation (this also made npm run docs:check-links crash, since it drives the same planner). Cancel this branch's three duplicates in favor of main's more detailed, already-landed versions; nothing is lost since both entries agreed on the same "done" outcome, only the level of detail differed.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Verification
Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
> [!NOTE]
> Low Risk
> Mostly documentation, agent instructions, and offline diagnostics; the shadow-extraction script can query Supabase with admin credentials when run live, but PR does not change production app or auth paths.
>
> Overview
> Shrinks root
AGENTS.mdfor agent sessions by moving long Codex/Cursor blocks (dependency shortcut, review throttling, GitHub review/auto-resolve, Cloud/Desktop worktree setup, productivity defaults) intodocs/agents/*.md, leaving short pointers andBEGIN/ENDmarkers inAGENTS.md. Check scripts follow the split:check-codex-autofix-workflow.mjsnow pins againstdocs/agents/codex-github-review.md, andcheck-codex-cloud-setup.mjsvalidates the modular Cloud section plus a single pointer section inAGENTS.md.>
> Operational and governance docs reconcile ledger work: OpenAI DPA/ZDR status in
docs/openai-cross-border-basis.mdanddocs/operator-backlog.md, Supabase preview branching compute cap indocs/launch-operator-runbook.md/ backlog, and shadow-extraction ops via newscripts/inspect-shadow-extraction.ts(aggregatesmetadata.shadow_extraction, >10% timeout →ROLLBACK_RECOMMENDED, exit code 2) with runbook references indocs/worker-deploy-runbook.md.>
> Repo hygiene:
.gitignoreadds Node compile/cache dir1/; outstanding-issues snapshot/inbox records closed items (#8A00R7, #RVK6BJ, etc.);data/repo-awareness-snapshot.jsonpicks up new docs routes and mockup page count.>
> Separate product design deliverable: runnable mockup
/mockups/favourites-phone-perfected(phone-first Favourites study, layout chrome suppressed inmockups-layout-client.tsx), documented inmockups/README.mdwithtests/favourites-phone-perfected-mockups.test.ts.>
> Reviewed by Cursor Bugbot for commit aaa3bc4. Configure here.
Note
Low Risk
Documentation, agent instructions, offline diagnostics, and test-only guard validation; the new script can query Supabase with admin credentials when run live but does not change app runtime, auth, or clinical paths.
Overview
Shrinks per-turn agent context by replacing long Codex/Cursor instruction blocks in root
AGENTS.mdwith short pointers into newdocs/agents/*.mdmodules (dependency shortcut, review throttling/thread resolution, GitHub review/auto-resolve, Cloud environment, Desktop worktree setup, productivity defaults, Cursor Cloud). Validation follows the split:check-codex-autofix-workflow.mjsnow pins againstdocs/agents/codex-github-review.md;check-codex-cloud-setup.mjsenforces the full Cloud section indocs/agents/codex-cloud-environment.mdplus a single pointer inAGENTS.md.Adds
scripts/inspect-shadow-extraction.tsto aggregatedocuments.metadata.shadow_extraction, surface health metrics, and emitROLLBACK_RECOMMENDEDwhen timeout rate exceeds the ratified >10% threshold (exit code 2), with runbook updates indocs/worker-deploy-runbook.mdand extensive tests.Governance/docs reconciliation: OpenAI DPA/ZDR status aligned with ledger #53 in
docs/openai-cross-border-basis.mdanddocs/operator-backlog.md; Supabase preview branching compute cap documented indocs/launch-operator-runbook.mdand backlog. CI guard fix: newguard-pushtest ensures merge commits resolvegit merge-basewithorigin/mainso main-only files are not falsely flagged.Housekeeping:
.gitignorefor Node v24 compile cache dir1/; outstanding-issues snapshot/inbox closed items;repo-awareness-snapshot.jsonregisters newdocs/agents/routes.Reviewed by Cursor Bugbot for commit fe5df58. Configure here.