diff --git a/docs/branch-review-ledger.md b/docs/branch-review-ledger.md index bdf370389..4c131227a 100644 --- a/docs/branch-review-ledger.md +++ b/docs/branch-review-ledger.md @@ -1268,6 +1268,14 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie | 2026-07-29 | codex/document-reader-condensed-view | 7cefb24e99f9745a61843c7e48c4889f7324ec42 | pr-1380-main-merge-coderabbit-density | merged origin/main; resolved source-panels conflict (kept condensed details + tracking-eyebrow); density in-memory fallback when storage blocked; summary keys + search/plain compact tests; local vitest/lint/typecheck/format/playwright condensed pass; awaiting hosted CI | vitest document suites 20/20; lint; typecheck; format:check; playwright condensed 4/4; merge-tree clean | | 2026-07-29 | claude/test-coverage-analysis-2vcd8a | 0922d7f56624ef84be8abcb2bbc89205027cf9a6 | PR #1383 babysit | BLOCKER CLEARED: merged origin/main; renumbered coverage follow-ups #098/#099 -> #106/#107 (main claimed #098-#105). Before: CONFLICTING/DIRTY, 4 behind; CI green on prior tip; 0 review threads; 0 Bugbot findings. After: mergeable expected; verify:cheap 424 files/4371 passed; test:coverage exit 0; format:changed + check:rag:fixtures pass. | verify:cheap PASS (424 files, 4371 passed \| 4 skipped); test:coverage PASS (no threshold errors); format:changed PASS; check:rag:fixtures PASS (36 golden); Bugbot: no findings; no provider-backed checks | | 2026-07-29 | claude/test-coverage-analysis-2vcd8a | 6f476b5f741627cb622af57d1b4665e3989789ca | PR #1383 babysit | CLOSEOUT at tip after ledger bookkeeping commit. Merge conflict cleared; coverage follow-ups live as #106/#107; local gates green; awaiting hosted CI on tip. | same as prior tip 0922d7f5 plus ledger append only; no product code change | +| 2026-07-29 | claude/test-coverage-analysis-2vcd8a | 5145dc990af47fba8b4c68f2b4537f21406535b6 | PR #1383 babysit | Hosted CI green on prior tip bebc6c02 (PR required / Unit coverage / Static / Safety / Migration replay / CircleCI all PASS). Synced one more clean main commit (ledger-only). MERGEABLE; 0 unresolved threads; 0 Bugbot findings; no code defects. | hosted: PR required PASS, Unit coverage PASS 4m41s, Static PR PASS, Safety PASS, Migration replay PASS, CircleCI verify PASS; local prior: verify:cheap + test:coverage PASS; Bugbot none | | 2026-07-29 | agent/document-topbar-actions (PR #1381) | 9da8ccfb19ff81b876a9bfff4e6b5870641e44d8 | PR #1381 CI triage | merged via squash auto-merge after main sync; all required checks green; no product code fix; no Bugbot/review threads | hosted CI pr-required pass; Production UI pass; CircleCI pass; lint; typecheck; document-viewer-shell.dom; Bugbot none | | 2026-07-29 | codex/chat-document-header-overlay-document-header-overlay-20260729 | 48ed6cc95f886837f4ddbb369fdbc611a0958f17 | document phone header overlay | No high-confidence findings; physical iPhone acceptance remains | verify:pr-local unit 4373 pass; build PASS; focused Playwright 2 pass; phone gate contended | | 2026-07-29 | codex/document-reader-condensed-view | 5678e878d4fe681d33bb58df5b5b3468a138a1c8 | pr-1380-ci-green-resync | hosted CI green on 7150899a (Static/Build/Unit/Advisory/Production UI/PR required/CircleCI); CodeRabbit density fallback + summary keys + search/plain compact tests landed; unresolved review threads none; resynced main after tip went BEHIND by 1 | hosted CI success on 7150899a; merge-tree clean; bugbot no P0/P1 | +| 2026-07-29 | claude/test-coverage-analysis-2vcd8a | f4a3f50048fa113d5e4e704defdafad2d37ba8d2 | prlanded | MERGED AND VERIFIED. PR #1383 squash-merged as f4a3f50. Content diff between the squash commit and branch tip bebc6c02 is EMPTY — nothing orphaned by the auto-merge race despite four concurrent pushes during the merge window. Landed on main: tests/calculator-scoring.test.ts (60 tests, 8 validated instruments), 9 batch signed-URL cases in tests/private-access-routes.test.ts, coverage floors raised 48/38/43/50 -> 62/53/55/64. Follow-ups renumbered #098/#099 -> #106/#107 during the main merge (main had claimed #098-#105); both rows verified present with content intact and next-id marker at 108. The three red 'PR required' results at 0922d7f/6f476b5/b72bc20 were concurrency cancellations (issue #095), not defects — all upstream jobs reported 'cancelled'; the clean run 30447852418 at tip bebc6c0 superseded them. | post-merge verification only: content diff squash-vs-tip EMPTY; origin/main content spot-checks PASS (test file present, floors 62/53/55/64, #106/#107 rows, 13 signed-urls refs); pre-merge local gates on the merged tree: test:coverage PASS exit 0 (424 files, 4371 passed \| 4 skipped, no threshold errors); no provider-backed checks | +| 2026-07-29 | main | 855aa2914fd9cf29f9ce34f67e197d7a2d0c1a86 | branch-cleanup-deletion-pending | Full-history branch-cleanup review of all 92 remote branches. IMPORTANT PRECONDITION: the session clone was SHALLOW (74 commits of origin/main); every merge-base and cherry-pick result computed before 'git fetch --unshallow' was invalid, and an initial pass wrongly showed 90/91 branches as carrying unmerged work. After unshallowing (2829 commits) the analysis is sound. Cherry-pick matching alone finds only 2 candidates because squash merges collapse N commits into 1 so per-commit patch-ids never match; a content test (files touched vs merge-base, compared between branch tip and main) finds 5. VERIFIED SAFE TO DELETE — each introduces an empty diff against main and backs no open PR: claude/clinical-kb-pwa-review-asi3wb, claude/dazzling-blackwell-f348d0, codex/document-reader-condensed-view, cursor/page-anchored-search-composer-30ee, cursor/pr-1379-babysit-ledger-9365. DELETION BLOCKED: the session git proxy rejects ref deletion with HTTP 403 and the GitHub MCP toolset exposes no delete-branch capability, so the five remain and must be removed from the GitHub UI or an interactive session. The other 87 were NOT cleared: their touched files still differ from main, which is the conservative direction (a branch whose files main later modified reads as not-landed). Local cleanup done: stale local main fast-forwarded to origin/main (0 ahead, 0 patch-unique after unshallow — its earlier 'ahead 52 / unrelated histories' was purely the shallow-clone artifact); redundant local claude/prlanded-ledger-1383 deleted after confirming its row is in the pushed branch. | npm run sweep:branch-ledger (report-only, 2 candidates); full-history recompute after git fetch --unshallow; per-branch git diff origin/main... empty for all 5; open-PR head cross-check against PRs #1374/#1377/#1384/#1385/#1386/#1387; no branch deleted (HTTP 403); no provider-backed checks | +| 2026-07-29 | claude/clinical-kb-pwa-review-asi3wb | df29f311b60cadf8e43bf51283a9d6f496b295e3 | branch-cleanup-deletion-pending | DELETION PENDING — content proven fully on main. Branch tip IS the merge-base with main (df29f311), so the tip is a direct ancestor of main; tree comparison of merge-base vs tip shows 0 changed files. Backs no open PR. Deletion blocked by HTTP 403; HEAD recorded here so the later branch-cleanup row can be keyed to it after the ref is gone. Supersedes the aggregate main-keyed row at 855aa291, which recorded no candidate HEADs. | local git only for the content proof: git merge-base, git diff --name-only (0 files), git diff --name-only origin/main... (0 files), full history after git fetch --unshallow. PROVIDER-BACKED evidence obtained (GitHub reads, authorised repo-scope): open-PR head cross-check via GitHub API against PRs #1374/#1377/#1384/#1385/#1386/#1387, and GitHub MCP capability inspection. PROVIDER-BACKED MUTATION ATTEMPTED AND REJECTED: git push origin --delete returned HTTP 403; no branch was deleted. No OpenAI/Supabase/hosted-CI calls. | +| 2026-07-29 | claude/dazzling-blackwell-f348d0 | c9bec8f9dce38cb647de9aa64ebf08bf7823a524 | branch-cleanup-deletion-pending | DELETION PENDING — content proven fully on main. Branch tip IS the merge-base with main (c9bec8f9), so the tip is a direct ancestor of main; tree comparison of merge-base vs tip shows 0 changed files. Backs no open PR. Deletion blocked by HTTP 403; HEAD recorded here so the later branch-cleanup row can be keyed to it after the ref is gone. Supersedes the aggregate main-keyed row at 855aa291, which recorded no candidate HEADs. | local git only for the content proof: git merge-base, git diff --name-only (0 files), git diff --name-only origin/main... (0 files), full history after git fetch --unshallow. PROVIDER-BACKED evidence obtained (GitHub reads, authorised repo-scope): open-PR head cross-check via GitHub API against PRs #1374/#1377/#1384/#1385/#1386/#1387, and GitHub MCP capability inspection. PROVIDER-BACKED MUTATION ATTEMPTED AND REJECTED: git push origin --delete returned HTTP 403; no branch was deleted. No OpenAI/Supabase/hosted-CI calls. | +| 2026-07-29 | codex/document-reader-condensed-view | b5cdbf301d517239ffe9ed941b9ebe809aea0bfd | branch-cleanup-deletion-pending | DELETION PENDING — content proven fully on main. Merge-base with main is 855aa291 and tree(merge-base) equals tree(tip): git diff --name-only 855aa291 b5cdbf30 reports 0 files, so the tip introduces nothing beyond a state already in main. Its work landed as main's tip via squash. Backs no open PR. Deletion blocked by HTTP 403; HEAD recorded here so the later branch-cleanup row can be keyed to it after the ref is gone. Supersedes the aggregate main-keyed row at 855aa291, which recorded no candidate HEADs. | local git only for the content proof: git merge-base, git diff --name-only (0 files), git diff --name-only origin/main... (0 files), full history after git fetch --unshallow. PROVIDER-BACKED evidence obtained (GitHub reads, authorised repo-scope): open-PR head cross-check via GitHub API against PRs #1374/#1377/#1384/#1385/#1386/#1387, and GitHub MCP capability inspection. PROVIDER-BACKED MUTATION ATTEMPTED AND REJECTED: git push origin --delete returned HTTP 403; no branch was deleted. No OpenAI/Supabase/hosted-CI calls. | +| 2026-07-29 | cursor/page-anchored-search-composer-30ee | 7ff134ca7f614db527b8d142676640305533669d | branch-cleanup-deletion-pending | DELETION PENDING — content proven fully on main. Merge-base with main is 79d1c879 and tree(merge-base) equals tree(tip): git diff --name-only 79d1c879 7ff134ca reports 0 files, so the tip introduces nothing beyond a state already in main. Backs no open PR. Deletion blocked by HTTP 403; HEAD recorded here so the later branch-cleanup row can be keyed to it after the ref is gone. Supersedes the aggregate main-keyed row at 855aa291, which recorded no candidate HEADs. | local git only for the content proof: git merge-base, git diff --name-only (0 files), git diff --name-only origin/main... (0 files), full history after git fetch --unshallow. PROVIDER-BACKED evidence obtained (GitHub reads, authorised repo-scope): open-PR head cross-check via GitHub API against PRs #1374/#1377/#1384/#1385/#1386/#1387, and GitHub MCP capability inspection. PROVIDER-BACKED MUTATION ATTEMPTED AND REJECTED: git push origin --delete returned HTTP 403; no branch was deleted. No OpenAI/Supabase/hosted-CI calls. | +| 2026-07-29 | cursor/pr-1379-babysit-ledger-9365 | be2de03f855cb7fdfccea4bb74d05eb4c9bf6c61 | branch-cleanup-deletion-pending | DELETION PENDING — content proven fully on main. Merge-base with main is b2740480 and tree(merge-base) equals tree(tip): git diff --name-only b2740480 be2de03f reports 0 files, so the tip introduces nothing beyond a state already in main. Backs no open PR. Deletion blocked by HTTP 403; HEAD recorded here so the later branch-cleanup row can be keyed to it after the ref is gone. Supersedes the aggregate main-keyed row at 855aa291, which recorded no candidate HEADs. | local git only for the content proof: git merge-base, git diff --name-only (0 files), git diff --name-only origin/main... (0 files), full history after git fetch --unshallow. PROVIDER-BACKED evidence obtained (GitHub reads, authorised repo-scope): open-PR head cross-check via GitHub API against PRs #1374/#1377/#1384/#1385/#1386/#1387, and GitHub MCP capability inspection. PROVIDER-BACKED MUTATION ATTEMPTED AND REJECTED: git push origin --delete returned HTTP 403; no branch was deleted. No OpenAI/Supabase/hosted-CI calls. | diff --git a/docs/outstanding-issues.md b/docs/outstanding-issues.md index d72da481b..d07013388 100644 --- a/docs/outstanding-issues.md +++ b/docs/outstanding-issues.md @@ -84,7 +84,7 @@ removed after current-main verification; it is not missing recommended work. | 36 | `#101` | A3 | Specialist — retrieval/ranking | Only after `#098` sizes the win | 1–2 days plus canary | Outcome: independent retrieval stages stop running serially. Gate: live eval-canary pair, explicit approval, ~$1–2. Verification: 36/36 golden, document/content recall 1.0, zero per-case rr regressions. Stop on any regression and revert in a single commit. Resolved `#075` and `#083` are the precedents for why this is gated rather than free. | | 37 | `#104` | A3 | Standard — ingestion worker | Any ingestion-touching session | 30–60 minutes | Outcome: ingestion reads each extracted image once instead of up to three times (`worker/main.ts:997`). Gate: `verify:cheap`. Verification: targeted worker test plus one ingestion smoke run. Throughput only — no clinician-facing latency, so do not prioritise it above anything above. Stop if the read is load-bearing for OCR retry semantics. | - + ## Open items @@ -149,6 +149,8 @@ removed after current-main verification; it is not missing recommended work. | #105 | P3 | task | `#017`-exempt client latency wins | **Outcome:** zero-payload client latency fixes are not trapped behind the `#017` measurement gate. `#017` gates _payload_ decisions (#012/#013/#016 are all byte-count items); a `loading` fallback ships zero bytes and a resource hint ships ~60, so neither can be justified or refuted by a Lighthouse number. **Done 2026-07-28:** 10 of 11 `ssr:false` dashboard surfaces had NO `loading` fallback and rendered nothing between HTML arrival and chunk execution — all now use the shared `LoadingPanel` (`role="status"` + accessible label); Supabase `preconnect`/`dns-prefetch` added, since `AuthProvider` awaits a cross-origin `getUser()` on mount that every auth-gated fetch queues behind and there were no resource hints anywhere in `src/`. **Next:** verify with `verify:ui` once the heavy-run lock is free. Sidebar dialogs intentionally excluded (they mount on open). | `docs/audit/latency-audit-2026-07-28.md` L3-4/L3-5; `src/components/clinical-dashboard/clinical-dashboard-lazy.tsx` | 2026-07-28 | | #106 | P2 | rec | Ingestion worker and indexing agent are verified by grepping their own source | **Outcome:** the ingestion worker and indexing agent are verified by executing code, not by asserting on their own source text. **Detail:** measured 2026-07-29 via `npm run test:coverage` — `worker/main.ts` (2,015 lines) and `supabase/functions/indexing-v3-agent/index.ts` (1,966 lines) each report **0% executed lines**; no test imports either module. Both are covered only by `readFileSync` + `toContain` assertions in `worker-safe-logging.test.ts`, `worker-visual-capture.test.ts` and `document-metadata-merge.test.ts`, which pass whenever a string is present and break on harmless refactors; `document-metadata-merge.test.ts` additionally reimplements the SQL deep-merge in TypeScript and tests the reimplementation rather than the worker. Area totals: `worker/` 18.6% lines, `supabase/functions/` 4.5%. **Next:** continue the extraction pattern that already works here — `indexing-v3-agent/behavior.ts` (167 lines, 96%) and `ingestion-worker/auth.ts` (30 lines, 90%) — pulling the highest-risk decision points out of `worker/main.ts` (job claim/retry, generation commit, failure classification) into importable modules with executing tests, retiring the matching source-text assertion as each lands. Roughly cost-neutral: each extracted test replaces a grep assertion. **Stop:** do not try to make the 2,000-line entrypoint importable in one pass; extract incrementally and keep each step green. | session 2026-07-29 test-coverage analysis | 2026-07-29 | | #107 | P2 | rec | Component state matrices are the largest untested surface | **Outcome:** loading / empty / error / disabled states on interactive components are covered by executing tests, not only by E2E happy paths. **Detail:** measured 2026-07-29 — production components (excluding mockups) sit at **38.2% lines / 22.8% branch** across 12,602 lines, with **83 of 208 files at zero executed lines**; there are 51 `.dom.test.tsx` files against 195 components. Playwright does visit these routes, so they are smoke-covered, but branch coverage is where the state matrix lives and smoke journeys rarely reach it. Worst by uncovered lines: `global-search-shell.tsx` (7%), `mode-action-popup.tsx` (21%), `answer-content.tsx` (27%), `document-search-results.tsx` (32%), `universal-search-command-surface.tsx` (39%), `master-search-header.tsx` (43%). A concrete first target with clinical meaning: `calculator-ui.tsx` now covers all exported scoring logic, but `seedCheckboxDefaults`, `toggleCheckboxAnswer` and `selectOptionAnswer` stay uncovered because they are module-private and only reachable through React event handlers — `seedCheckboxDefaults` is what makes an all-negative CAGE / SAD PERSONS screen read as a valid 0 rather than incomplete, so a regression there is a false-negative risk. **Next:** treat as a per-PR convention rather than a backfill push — `docs/testing.md` already prescribes the state matrix, so the gap is enforcement. Start with `global-search-shell.tsx`, which `docs/search-chrome-behaviour.md` treats as a contract surface. Keep additions in the jsdom tier (measured ~0.54s per file) instead of new Playwright journeys (~231 production journeys already run serially at `workers: 1` against a 45-minute CI budget). **Stop:** do not chase the coverage percentage by backfilling low-risk components; the re-ratcheted broad floor in `vitest.config.mts` holds the line. | session 2026-07-29 test-coverage analysis | 2026-07-29 | +| #108 | P3 | task | Five verified-landed remote branches await deletion (blocked in-session) | **Outcome:** the five branches whose content is fully on `main` are gone. **Detail:** a full-history branch-cleanup review on 2026-07-29 verified these introduce an empty diff against `main` and back no open PR: `claude/clinical-kb-pwa-review-asi3wb` @ `df29f311b60cadf8e43bf51283a9d6f496b295e3`, `claude/dazzling-blackwell-f348d0` @ `c9bec8f9dce38cb647de9aa64ebf08bf7823a524`, `codex/document-reader-condensed-view` @ `b5cdbf301d517239ffe9ed941b9ebe809aea0bfd`, `cursor/page-anchored-search-composer-30ee` @ `7ff134ca7f614db527b8d142676640305533669d`, `cursor/pr-1379-babysit-ledger-9365` @ `be2de03f855cb7fdfccea4bb74d05eb4c9bf6c61`. **The HEADs are recorded because they are unrecoverable once the refs are deleted:** `hasCompletedCleanupReview` (`scripts/sweep-branch-ledger.mjs:83-93`) matches a completed row on branch name AND HEAD together, so without them no later operator could ever append the required `branch-cleanup` rows. Each candidate now also has its own `branch-cleanup-deletion-pending` ledger row keyed to its own HEAD. Deletion could not be performed: the session git proxy rejects ref deletion with **HTTP 403**, and the GitHub MCP toolset exposes no delete-branch capability. The remaining 87 were deliberately NOT cleared — their touched files still differ from `main`, which is the conservative direction. **Next — ORDER MATTERS:** append the completed `branch-cleanup` row for each branch FIRST, from a checkout that still has the objects, and only then delete the refs. `resolveHead` (`scripts/branch-review-ledger.mjs:155-167`) runs `git rev-parse --verify ^{commit}` and refuses to append a HEAD that is not a commit in the repository, so the reverse order is unexecutable once the refs are gone and their objects are pruned. The `n/a - ` escape hatch does not help here: `hasCompletedCleanupReview` only matches a 7-40 char hex HEAD, so an `n/a` row would leave the branch resurfacing in every future sweep. Delete the five from the GitHub UI or an interactive session once their rows are recorded (the existing row is `branch-cleanup-deletion-pending`, which by design does not count as complete). **Stop:** do not widen to the other 87 without per-branch content proof. | session 2026-07-29 branch cleanup; ledger `branch-cleanup-deletion-pending` @ 855aa291 | 2026-07-29 | +| #109 | P2 | issue | Remote sessions clone shallow, silently invalidating all branch/merge analysis | **Outcome:** no session draws branch conclusions from a truncated history. **Detail:** on 2026-07-29 this repo's remote session had `git rev-parse --is-shallow-repository` = **true** with only **74** commits of `origin/main` (full history is 2829). Every merge-base, `--cherry-pick`, and ahead/behind number computed in that state was wrong: local `main` reported `ahead 52` and `refusing to merge unrelated histories` (it is actually 0 ahead with a shared base), and an all-branch sweep wrongly showed **90 of 91** branches as carrying unmerged work. Acting on that would have meant either deleting live branches or abandoning cleanup entirely. `git fetch --unshallow` corrected both. **Next:** make `is-shallow-repository` an explicit precondition check in `docs/branch-cleanup-guide.md` §Safety Rules and in `scripts/sweep-branch-ledger.mjs`, failing closed with the `--unshallow` remedy rather than silently reporting. **Stop:** never delete a branch, or report a branch as unmerged, from a shallow clone. | session 2026-07-29; `docs/branch-cleanup-guide.md`; `scripts/sweep-branch-ledger.mjs` | 2026-07-29 | ## Resolved / archive