Skip to content

Record PR #1383 verification, the branch-cleanup review, and the shallow-clone analysis trap - #1387

Merged
BigSimmo merged 15 commits into
mainfrom
claude/test-coverage-analysis-2vcd8a
Jul 29, 2026
Merged

Record PR #1383 verification, the branch-cleanup review, and the shallow-clone analysis trap#1387
BigSimmo merged 15 commits into
mainfrom
claude/test-coverage-analysis-2vcd8a

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Documentation and ledger bookkeeping only. The entire diff against main is docs/branch-review-ledger.md and docs/outstanding-issues.md — no source, config or test change.

1. PR #1383 post-merge verification (prlanded @ f4a3f50). The content diff between the squash commit and the pre-merge branch tip bebc6c0 is empty, so nothing was orphaned by the auto-merge race despite four concurrent pushes during the merge window. Also records that the coverage follow-ups were renumbered #098/#099#106/#107 when main concurrently claimed #098#105 (both rows verified intact, next-id at 108), and that the three red PR required results at 0922d7f / 6f476b5 / b72bc20 were concurrency cancellations — tracked issue #095 — not defects; every upstream job reported cancelled.

2. PR #1383 babysit closeout (5145dc9). This row was committed on this branch by a concurrent session but never reached main, because the squash merge took the branch at bebc6c0 and those commits landed afterwards. Carrying it here is what stops it being lost.

3. Branch-cleanup review (branch-cleanup-deletion-pending @ 855aa291). All 92 remote branches reviewed against main. Five are 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 could not be completed: the session git proxy rejects ref deletion with HTTP 403, and the GitHub MCP toolset exposes no delete-branch capability. The scope is therefore branch-cleanup-deletion-pending, which docs/branch-cleanup-guide.md deliberately does not count as complete, and the work is tracked as #108. The other 87 branches were not cleared — their touched files still differ from main, which is the conservative direction.

4. New issue #109 — shallow clones silently invalidate branch analysis. This is the substantive finding. The session clone had git rev-parse --is-shallow-repository = true with only 74 commits of origin/main against a real history of 2829. In that state every merge-base, --cherry-pick and ahead/behind result was wrong: local main reported ahead 52 and refusing to merge unrelated histories (it is actually 0 ahead on a shared base), and a full sweep reported 90 of 91 branches as carrying unmerged work. Acting on those numbers would have meant either deleting live branches or abandoning cleanup as impossible. git fetch --unshallow corrected both. The proposed fix is to make the shallow check an explicit fail-closed precondition in the cleanup guide and in scripts/sweep-branch-ledger.mjs.

Worth noting for anyone repeating this: cherry-pick matching alone finds only 2 of the 5 landed branches, because squash merges collapse N commits into 1 so per-commit patch-ids never match. The content test — files touched vs merge-base, compared between branch tip and main — is what finds the rest.

Verification

Risk and rollout

  • Risk: low — append-only ledger rows plus two rows in the outstanding-issues table. No executable code, schema, configuration or gate behaviour is affected. docs/branch-review-ledger.md is merge=union by design, so concurrent appends from other sessions do not conflict. No branch was deleted, so nothing is destructive.
  • Rollback: revert this PR. The review ledger is append-only, so the correct correction for a bad record is a superseding row (--supersede) rather than an edit; nothing depends on these rows at runtime.
  • Provider or production effects: None. No provider-backed gate was run and no deploy step is involved.

Clinical Governance Preflight

Not applicable to this diff. classifyPullRequestFiles reports clinicalRisk: false — the only changed paths are docs/branch-review-ledger.md and docs/outstanding-issues.md, neither of which matches a clinical-risk pattern in scripts/pr-policy.mjs. No ingestion, answer generation, search/ranking, source rendering, document access, privacy or clinical output behaviour is touched.

Notes

The #095 false-failure mode — a red PR required produced purely by cancel-in-progress cancellations — was demonstrated three times on PR #1383 in a single afternoon and nearly triggered a remediation loop when an agent was asked to fix "every failing CI check". It is currently filed P3; the evidence recorded here may justify re-rating it, since a red required check that does not mean failure teaches both people and agents to discount red.

claude and others added 10 commits July 29, 2026 04:39
…atrix coverage (#99)

Both recorded from the 2026-07-29 test-coverage analysis with measured
evidence so the follow-ups survive the session context.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
…L route

Adds executing coverage to the two highest-risk surfaces that had none, and
re-ratchets the broad coverage floor that had drifted well below measured.

Clinical calculator scoring (src/components/calculators/calculator-ui.tsx,
previously 0% executed lines). The exported pure functions carry the scoring
and interpretation for eight validated instruments — PHQ-9, GAD-7, K10, MDQ,
CAGE, AUDIT-C, SAD PERSONS, Y-BOCS — and the only calculator test in the repo
asserted mockup import boundaries. A wrong severity band renders as an ordinary
result, so it needs a floor. tests/calculator-scoring.test.ts covers band-table
integrity for all eight instruments (contiguous, spanning the declared range,
exactly one band per reachable score, range actually reachable from the items),
PHQ-9/GAD-7 boundary scores either side of every cut point, itemScore edge
cases, band suppression for scales that cannot read zero (K10, CAGE), the MDQ
three-criterion rule, and the result summary text. No live defect was found —
the band tables are correct today; nothing was holding them there.

Batch image signed URLs (src/app/api/images/signed-urls/route.ts, previously 0%
executed lines, no test references). The route mints up to 100 signed URLs per
call and carries its own owner-scope and committed-generation implementation,
parallel to /api/images/[id]/signed-url which already had five cases.
check:owner-scope-api cannot cover the real protection because document_images
has no owner_id column: the only thing excluding another owner's image is the
documentMap join filter in the handler. Nine cases now pin that filter,
including the batch-specific case where one unowned id rides along with an
owned one. Added to tests/private-access-routes.test.ts rather than a new file
so it reuses that harness; createSignedUrls was added to the storage mock.

Both additions were mutation-checked. Overlapping a PHQ-9 band fails three
tests including "scores 5 as Mild"; loosening the MDQ impairment threshold from
moderate to minor fails one; making the batch route allow a documentMap miss
fails the two cross-owner cases. Before this change that last mutation passed
the entire suite silently.

Coverage floor: the broad group measured 63.99/55.29/57.6/66.19 against floors
of 48/38/43/50 — 14-17pp of slack, so a change could delete a large amount of
coverage and still pass. Each floor now sits ~2pp under measured.

Kept deliberately in the cheap tiers: the unit suite is 46% test execution and
54% import/environment overhead, so a new file costs ~0.37s before it asserts
anything while an assertion in an existing file costs ~0.03s. The calculator
file runs 60 tests in 514ms (27ms of that is assertions). Nothing was added to
the Playwright gate, which runs ~231 journeys serially against a 45-minute
budget.

Verified: npm run verify:cheap (exit 0; 423 files, 4340 passed | 4 skipped) and
npm run test:coverage (exit 0, no threshold errors).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
Main already claimed #98#105 for the latency audit. Renumber this
branch's coverage follow-ups to #106/#107 and bump next-id to 108 so
the ledger stays monotonic with no duplicate IDs.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Ledger row for HEAD 0922d7f: conflict cleared by renumbering
coverage follow-ups to #106/#107; verify:cheap and coverage green.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…analysis-2vcd8a

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…analysis-2vcd8a

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
PR required / Unit coverage / Static / Safety / Migration replay /
CircleCI all passed on tip bebc6c0; squash auto-merge landed as
f4a3f50. No remaining code defects or review threads.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Confirms the squash merge landed by content: the diff between squash
commit f4a3f50 and branch tip bebc6c0 is empty, so nothing was orphaned
by the auto-merge race despite four concurrent pushes during the merge
window. Also records that the coverage follow-ups were renumbered
#98/#99 -> #106/#107 (main claimed #98-#105 concurrently) with both
rows verified intact, and that the three red `PR required` results were
concurrency cancellations rather than defects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
@supabase

supabase Bot commented Jul 29, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 1 minute

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 318090c6-e955-4b0a-9db0-376314fcc399

📥 Commits

Reviewing files that changed from the base of the PR and between 8605cf7 and 1289441.

📒 Files selected for processing (2)
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md

Comment @coderabbitai help to get the list of available commands.

Branch-cleanup review of all 92 remote branches against main, recorded
with scope `branch-cleanup-deletion-pending` because deletion could not
be completed: the session git proxy rejects ref deletion with HTTP 403
and no delete-branch capability is exposed.

Five branches are verified safe to delete (empty diff against main, no
open PR) and are tracked as #108. The other 87 were deliberately not
cleared — their touched files still differ from main, the conservative
direction.

#109 records the trap that made the first pass wrong: the session clone
was shallow (74 of 2829 commits), which silently invalidated every
merge-base, cherry-pick and ahead/behind result. In that state local
main read as "ahead 52" with unrelated histories, and 90 of 91 branches
read as unmerged. `git fetch --unshallow` corrected both, and the guide
and sweep script should check for it rather than report silently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
@BigSimmo BigSimmo changed the title Record PR #1383 prlanded verification and babysit closeout in the review ledger Record PR #1383 verification, the branch-cleanup review, and the shallow-clone analysis trap Jul 29, 2026
@BigSimmo
BigSimmo marked this pull request as ready for review July 29, 2026 13:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 873d28df85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/branch-review-ledger.md
Comment thread docs/outstanding-issues.md Outdated
Comment thread docs/branch-review-ledger.md
… classification

Three P2 findings from the Codex review of 873d28d, all documentation
correctness on rows added in this PR.

Record each deletion candidate's HEAD (finding 2, the substantive one).
`hasCompletedCleanupReview` in scripts/sweep-branch-ledger.mjs matches a
completed row on branch name AND HEAD together, and the aggregate row was
keyed only to main@855aa291. Once the five refs are deleted their HEADs
are unrecoverable, so no later operator could append the required
`branch-cleanup` rows. Each candidate now has its own pending row keyed to
its own HEAD, and #108 carries the same SHAs.

Record the two-tree evidence explicitly (finding 1). The rows now state
the merge-base and the `git diff --name-only <merge-base> <tip>` result
per branch rather than only the three-dot form. Two tips
(df29f31, c9bec8f) are themselves the merge-base with main, i.e. direct
ancestors; the other three have tree(merge-base) == tree(tip).

Correct the provider-backed classification (finding 3). The prior checks
cell said "no provider-backed checks" while the outcome described GitHub
open-PR cross-checks and an HTTP 403 deletion attempt. The new rows
enumerate the GitHub reads and the rejected mutation, and reserve the
"no provider-backed" wording for genuinely local work.

The ledger is append-only, so these are superseding rows; the original
aggregate row is left intact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cb33ed148

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/outstanding-issues.md Outdated
claude added 2 commits July 29, 2026 13:40
…ting refs

Codex review of 4cb33ed found the documented order unexecutable, and it
is right. #108 said to delete the five branches and then append the
completed `branch-cleanup` rows, but `resolveHead`
(scripts/branch-review-ledger.mjs:155-167) runs
`git rev-parse --verify <sha>^{commit}` and refuses a HEAD that is not a
commit in the repository. Once the refs are gone and their objects are
pruned, the append can never succeed, so recording the SHAs in the
previous commit was necessary but not sufficient.

Order is now append-then-delete, and the note explains why the
`n/a - <reason>` escape hatch is not an acceptable substitute:
`hasCompletedCleanupReview` matches only a 7-40 char hex HEAD, so an
`n/a` row would leave each branch resurfacing in every future sweep.

Verified locally: all five recorded SHAs resolve in this checkout, and an
absent SHA produces `refusing to append: head "..." is not a commit in
this repository`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
@BigSimmo
BigSimmo merged commit f505ab4 into main Jul 29, 2026
27 checks passed
@BigSimmo
BigSimmo deleted the claude/test-coverage-analysis-2vcd8a branch July 29, 2026 13:56
Sign up for free to 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.

3 participants