From e449eccc7e050736519588a89d2c35b2348e4380 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 28 Jul 2026 07:46:29 +0000 Subject: [PATCH 1/4] docs: keep PR bodies full-prose under caveman output styles Rebase the useful #1322 guidance onto current main: pr-policy parses titles/bodies verbatim, so handoff and AGENTS must forbid caveman- compressed PR descriptions while preserving ledger:append recording. Co-authored-by: BigSimmo --- .claude/skills/handoff/SKILL.md | 10 ++++++++-- AGENTS.md | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.claude/skills/handoff/SKILL.md b/.claude/skills/handoff/SKILL.md index 8a95b55c66..305e80dbe4 100644 --- a/.claude/skills/handoff/SKILL.md +++ b/.claude/skills/handoff/SKILL.md @@ -35,8 +35,14 @@ force-push, or discard work. 5. **Push** the feature branch: `git push -u origin `. The pre-push guards run (auto-merge sentinel, format, drift) — heed a block rather than overriding blindly. 6. **Open a PR** with `gh pr create --base main`, body ending with the Claude Code - attribution line. Enabling squash-auto-merge (`gh pr merge --squash --auto`) is the - repo norm but requires explicit user confirmation before enabling; the PR lands on green. + attribution line. Write the body from `.github/pull_request_template.md` in full normal + prose — exact `## Summary` / `## Verification` / `## Risk and rollout` / (when clinical-risk + or RAG-ranking files are touched) `## Clinical Governance Preflight` headings, every governance + box checked, and a satisfying `RAG impact:` line — never caveman-compressed; `pr-policy.yml` + parses this text verbatim and hard-blocks the merge on a paraphrased or dropped item (see + AGENTS.md "External skill precedence"). Enabling squash-auto-merge is the repo norm but + requires explicit user confirmation before enabling (`gh pr merge --squash --auto`); the + PR lands on green. 7. **Record** the review with `npm run ledger:append`, passing `--ref `, `--head` (the full 40-character SHA), `--scope`, `--outcome`, and `--checks`. Do not hand-write the row into `docs/branch-review-ledger.md`. diff --git a/AGENTS.md b/AGENTS.md index bbd0c367dc..1bfd7cc38b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -262,6 +262,18 @@ Output-style plugins such as caveman mode may compress prose. They must never co inspecting already-fetched local refs (`git log`, `git show`) first; `git fetch` or other network/provider access requires explicit user confirmation per the "API and provider confirmation boundary" section. +- **PR titles and descriptions are parsed input, not prose.** `.github/workflows/pr-policy.yml` + runs `scripts/pr-policy.mjs` against the exact PR title/body text and hard-blocks the merge + when a clinical-risk diff lacks a complete `## Clinical Governance Preflight` (every item from + `requiredClinicalGovernanceItems` checked) or a RAG-ranking-surface diff lacks a satisfying + `RAG impact:` line (see "RAG ranking protection" below). Caveman-style fragment-dropping breaks + this exact-format contract — a paraphrased checklist item or a shortened `RAG impact:` reason can + silently fail `governanceItemSatisfied`/`ragImpactDeclared` even though the PR is otherwise fine. + `gh pr create`/`gh pr edit` bodies and any `PR_POLICY_BODY.md` content therefore always get + written in full normal prose from `.github/pull_request_template.md`, regardless of the active + output style — this is "commits" territory under the caveman carve-out, not chat. Before + push, sanity-check clinical-risk/RAG-ranking bodies against `scripts/pr-policy.mjs`'s + `evaluatePullRequestPolicy` shape (run `npm run check:pr-policy` if the script itself changed). From c0fe85980b998a7790e99e4a0ab4a04c01934536 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 28 Jul 2026 07:47:10 +0000 Subject: [PATCH 2/4] docs(ledger): record six-PR consolidation review outcomes Append ledger rows for closed #1318/#1319/#1322/#1323/#1324/#1326 and replacement PRs #1335/#1336 after the keep/drop consolidation pass. Co-authored-by: BigSimmo --- docs/branch-review-ledger.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/branch-review-ledger.md b/docs/branch-review-ledger.md index bb52230af5..02f1fff043 100644 --- a/docs/branch-review-ledger.md +++ b/docs/branch-review-ledger.md @@ -1159,3 +1159,11 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie | 2026-07-28 | codex/universal-search-live-test-fix | 9f5994069cddb8a58308d9d5acb9403948a7f617 | live universal-search owner test handoff | APPROVE. Test-only fix aligns live owner coverage with the intentional federated and focused document timeout contract; no production behavior changed. | Node TypeScript syntax PASS; git diff --check PASS; full local gates blocked by an active exclusive repository lease; hosted required checks pending; no live provider tests run. | | 2026-07-28 | PR #1310 / `claude/branch-review-ledger-fixes-42575f` (merged) | 422e43d86a69c88368454065c2b117f5982a43d6 | prlanded | LANDED as squash 422e43d86. Ledger repair + lookup/append tooling + hardened guard all present on main; guard PASS at 1107 records and repo-hygiene 25/25. Review improved the branch before merge and main is ahead of the authoring branch: findReviews now compares scope exactly (the original substring match would have let a branch-cleanup-deletion-pending row satisfy a branch-cleanup lookup and skip a branch that still needed cleanup), refTokens no longer false-hits on bare parenthetical prose, headMatches accepts an annotated 'sha (squash)' cell and rejects 'n/a - see ', and resolveHead now verifies full-length hex so a mistyped 40-char string cannot become an unmatchable HEAD. Authoring branch was deleted at merge; its unpushed local ledger-record commit was superseded by this row rather than pushed. | npm run check:branch-review-ledger PASS (1107 records) and vitest tests/repo-hygiene.test.ts 25/25 PASS, both run against origin/main after the merge. Pre-merge npm run verify:pr-local PASS on the merged tree (405 files / 4126 tests, build 3.7min). No provider-backed checks run. | | 2026-07-28 | PR #1305 / execute-audit-remediation-fixes | b101b69631edfe51bcbbc8f6c07e47157fe2c4e8 | CI green closeout after main re-sync | APPROVE for merge by human. Hosted PR required + Production UI PASS on tip after merging origin/main (#1320). MERGEABLE. Unresolved review threads 0. Bugbot-equivalent: no P0/P1/P2 on unique product delta; @cursor review requested. Product delta retained: clinical-notes trust gating answer wipe, SettingsStateProvider wiring, z-index ladder, OverlayProvider/card fixes, phone chrome viewport breakpoints. | Hosted PR policy/Static/Build/Unit/Safety/Advisory/Production UI/PR required PASS on b101b696; check:branch-review-ledger PASS; no provider-backed checks. | +| 2026-07-28 | pr-1318 | 134b006b7ff42412e727292c6c03fa4c404252ae | six-pr-consolidation | close-superseded: already on main via #1177/#1204/#1215 | diff-vs-main,merge-tree,gh-merged-history | +| 2026-07-28 | pr-1319 | db7fee69d13239de92800ff83e85610884bdde7d | six-pr-consolidation | ported-to-#1336; tip closed | diff-vs-main,merge-tree,port-review | +| 2026-07-28 | pr-1322 | 29c58693d6e63f8174386e6a8cdc94e39f0f8343 | six-pr-consolidation | ported-to-#1335; tip closed | diff-vs-main,content-proofread | +| 2026-07-28 | pr-1323 | b8f4c658412d8f546f47b64b77e7f274a11018ff | six-pr-consolidation | close-superseded: mockups via #1278 | diff-vs-main,gh-merged-history | +| 2026-07-28 | pr-1324 | c0e8a126bfdba0e7ee22ba8da236c452592524b7 | six-pr-consolidation | close-superseded: canary/eval already on main | diff-vs-main,merge-tree | +| 2026-07-28 | pr-1326 | 9f93b1a56fa557e15fa1df8526d28d0b10bd1d21 | six-pr-consolidation | close-superseded: matcher evolved on main | diff-vs-main,merge-tree | +| 2026-07-28 | cursor/pr-policy-caveman-docs-dc4e | e449eccc7e050736519588a89d2c35b2348e4380 | pr-1335 | docs-ready: caveman×pr-policy guidance | content-proofread | +| 2026-07-28 | cursor/mode-secondary-navigation-dc4e | 3712edca0a4ea0638668d316c8696a695d180256 | pr-1336 | nav-port-ready; UI chrome gate pending | vitest-51+58+4186,tsc,eslint | From 5270dc942c2c0fac5346481d5d2105e8a8dd7be6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 28 Jul 2026 07:47:20 +0000 Subject: [PATCH 3/4] docs(ledger): pin #1335 tip after consolidation ledger commit Co-authored-by: BigSimmo --- docs/branch-review-ledger.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/branch-review-ledger.md b/docs/branch-review-ledger.md index 02f1fff043..1c663479d7 100644 --- a/docs/branch-review-ledger.md +++ b/docs/branch-review-ledger.md @@ -1167,3 +1167,4 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie | 2026-07-28 | pr-1326 | 9f93b1a56fa557e15fa1df8526d28d0b10bd1d21 | six-pr-consolidation | close-superseded: matcher evolved on main | diff-vs-main,merge-tree | | 2026-07-28 | cursor/pr-policy-caveman-docs-dc4e | e449eccc7e050736519588a89d2c35b2348e4380 | pr-1335 | docs-ready: caveman×pr-policy guidance | content-proofread | | 2026-07-28 | cursor/mode-secondary-navigation-dc4e | 3712edca0a4ea0638668d316c8696a695d180256 | pr-1336 | nav-port-ready; UI chrome gate pending | vitest-51+58+4186,tsc,eslint | +| 2026-07-28 | cursor/pr-policy-caveman-docs-dc4e | c0fe85980b998a7790e99e4a0ab4a04c01934536 | pr-1335 | docs-ready: caveman×pr-policy + consolidation ledger | content-proofread,check:branch-review-ledger | From 1b1dc920aa0f9ced21a0b1c85ad74275e4e92456 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 28 Jul 2026 16:17:03 +0000 Subject: [PATCH 4/4] docs(ledger): use resolvable branch refs for six-pr consolidation rows Codex P2: pr-1318-style refs cannot resolveHead, so ledger:lookup never throttles. Point each closeout row at the PR head branch name instead. Co-authored-by: BigSimmo --- docs/branch-review-ledger.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/branch-review-ledger.md b/docs/branch-review-ledger.md index bbccafa47e..6807325885 100644 --- a/docs/branch-review-ledger.md +++ b/docs/branch-review-ledger.md @@ -1195,12 +1195,12 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie | 2026-07-28 | PR #1304 / `fix-test-run-lock` | `7cc32c053c752bef19f3de408a1376428e54af74` | CI babysit: sync main | FIXED. GitHub CONFLICTING/DIRTY was staleness only (`git merge-tree` CLEAN; 7 behind). Merged origin/main. Required CI was already SUCCESS on prior tip `e6b826ed`; no product conflicts. Unique vs main remains knip.json (+ ledger). Bugbot/review threads: none unresolved. | merge-tree CLEAN; merge origin/main; no provider-backed checks. | | 2026-07-28 | PR #1310 / `claude/branch-review-ledger-fixes-42575f` (merged) | 422e43d86a69c88368454065c2b117f5982a43d6 | prlanded | LANDED as squash 422e43d86. Ledger repair + lookup/append tooling + hardened guard all present on main; guard PASS at 1107 records and repo-hygiene 25/25. Review improved the branch before merge and main is ahead of the authoring branch: findReviews now compares scope exactly (the original substring match would have let a branch-cleanup-deletion-pending row satisfy a branch-cleanup lookup and skip a branch that still needed cleanup), refTokens no longer false-hits on bare parenthetical prose, headMatches accepts an annotated 'sha (squash)' cell and rejects 'n/a - see ', and resolveHead now verifies full-length hex so a mistyped 40-char string cannot become an unmatchable HEAD. Authoring branch was deleted at merge; its unpushed local ledger-record commit was superseded by this row rather than pushed. | npm run check:branch-review-ledger PASS (1107 records) and vitest tests/repo-hygiene.test.ts 25/25 PASS, both run against origin/main after the merge. Pre-merge npm run verify:pr-local PASS on the merged tree (405 files / 4126 tests, build 3.7min). No provider-backed checks run. | | 2026-07-28 | PR #1305 / execute-audit-remediation-fixes | b101b69631edfe51bcbbc8f6c07e47157fe2c4e8 | CI green closeout after main re-sync | APPROVE for merge by human. Hosted PR required + Production UI PASS on tip after merging origin/main (#1320). MERGEABLE. Unresolved review threads 0. Bugbot-equivalent: no P0/P1/P2 on unique product delta; @cursor review requested. Product delta retained: clinical-notes trust gating answer wipe, SettingsStateProvider wiring, z-index ladder, OverlayProvider/card fixes, phone chrome viewport breakpoints. | Hosted PR policy/Static/Build/Unit/Safety/Advisory/Production UI/PR required PASS on b101b696; check:branch-review-ledger PASS; no provider-backed checks. | -| 2026-07-28 | pr-1318 | 134b006b7ff42412e727292c6c03fa4c404252ae | six-pr-consolidation | close-superseded: already on main via #1177/#1204/#1215 | diff-vs-main,merge-tree,gh-merged-history | -| 2026-07-28 | pr-1319 | db7fee69d13239de92800ff83e85610884bdde7d | six-pr-consolidation | ported-to-#1336; tip closed | diff-vs-main,merge-tree,port-review | -| 2026-07-28 | pr-1322 | 29c58693d6e63f8174386e6a8cdc94e39f0f8343 | six-pr-consolidation | ported-to-#1335; tip closed | diff-vs-main,content-proofread | -| 2026-07-28 | pr-1323 | b8f4c658412d8f546f47b64b77e7f274a11018ff | six-pr-consolidation | close-superseded: mockups via #1278 | diff-vs-main,gh-merged-history | -| 2026-07-28 | pr-1324 | c0e8a126bfdba0e7ee22ba8da236c452592524b7 | six-pr-consolidation | close-superseded: canary/eval already on main | diff-vs-main,merge-tree | -| 2026-07-28 | pr-1326 | 9f93b1a56fa557e15fa1df8526d28d0b10bd1d21 | six-pr-consolidation | close-superseded: matcher evolved on main | diff-vs-main,merge-tree | +| 2026-07-28 | cursor/search-correctness-030-075-6273 | 134b006b7ff42412e727292c6c03fa4c404252ae | six-pr-consolidation | close-superseded: already on main via #1177/#1204/#1215 | diff-vs-main,merge-tree,gh-merged-history | +| 2026-07-28 | codex/chat-mode-page-navigation-2328 | db7fee69d13239de92800ff83e85610884bdde7d | six-pr-consolidation | ported-to-#1336; tip closed | diff-vs-main,merge-tree,port-review | +| 2026-07-28 | claude/pr-policy-caveman-fix-6875bb | 29c58693d6e63f8174386e6a8cdc94e39f0f8343 | six-pr-consolidation | ported-to-#1335; tip closed | diff-vs-main,content-proofread | +| 2026-07-28 | codex/chat-top-nav-mockups-b3ce | b8f4c658412d8f546f47b64b77e7f274a11018ff | six-pr-consolidation | close-superseded: mockups via #1278 | diff-vs-main,gh-merged-history | +| 2026-07-28 | codex/backlog-diagnostics-reconciliation | c0e8a126bfdba0e7ee22ba8da236c452592524b7 | six-pr-consolidation | close-superseded: canary/eval already on main | diff-vs-main,merge-tree | +| 2026-07-28 | codex/comparison-alias-distinctness | 9f93b1a56fa557e15fa1df8526d28d0b10bd1d21 | six-pr-consolidation | close-superseded: matcher evolved on main | diff-vs-main,merge-tree | | 2026-07-28 | cursor/pr-policy-caveman-docs-dc4e | e449eccc7e050736519588a89d2c35b2348e4380 | pr-1335 | docs-ready: caveman×pr-policy guidance | content-proofread | | 2026-07-28 | cursor/mode-secondary-navigation-dc4e | 3712edca0a4ea0638668d316c8696a695d180256 | pr-1336 | nav-port-ready; UI chrome gate pending | vitest-51+58+4186,tsc,eslint | | 2026-07-28 | cursor/pr-policy-caveman-docs-dc4e | c0fe85980b998a7790e99e4a0ab4a04c01934536 | pr-1335 | docs-ready: caveman×pr-policy + consolidation ledger | content-proofread,check:branch-review-ledger |