Skip to content

docs(claude): stop coverage from vetoing a better design - #3580

Merged
max-sixty merged 1 commit into
mainfrom
coverage-policy
Jul 24, 2026
Merged

max-sixty merged 1 commit into
mainfrom
coverage-policy

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The failure this fixes

A session working on the picker found a structural improvement: routing both removal dispatches through a spawn_removal helper, so the uninterruptible-cancellation exemption lives in one place instead of being remembered at each spawn site. It declined to make the change, because the helper re-indents the morph closure's body and pulls two pre-existing uncovered lines (a failure-path warn and a revert_morph call) into the patch. Projected codecov/patch: ~97.3% against an auto target of ~97.8%. Red. The improvement was shelved.

The section it was reading said "NEVER merge a PR with failing codecov/patch without explicit user approval," then "on failure, investigate and fix the gap," then "if you believe it's a false positive, ask." Every route treats a red patch as a defect in the change. The cheapest way to satisfy all three is to not make the change.

What changed

The Coverage section now separates the two decisions it was conflating. The check gates the merge; it never gates the design. A predicted red patch is not a reason to shelve or water down an improvement, and neither the code nor the tests get contorted to move the number. The merge rule is unchanged: still never merge red without approval. What is new is the route through it when the gap isn't real (misses that predate the change, or a path with no deterministic trigger): push the change and ask, handing over which lines, why they can't be covered, and what the patch percentage comes to.

Two smaller corrections ride along:

  • "Remove unused code" to green the number now excludes a rarely-reached backstop that's load-bearing. The picker lines in question guard a TOCTOU window during rename-based removal, and the repo's Data Safety rules would rather keep them.
  • tests/CLAUDE.md's note on rename false positives now covers the mechanism that caused this. Codecov counts any line the diff relocates as a patch line, re-indentation included, not just a git mv.

The spawn_removal refactor itself is not in this PR: it touches picker code mid-flight on #3560.

This was written by Claude Code on behalf of @max-sixty

A session that found a structural improvement in the picker's removal
dispatch declined to make it, because routing both call sites through a
helper re-indents a closure body and pulls two pre-existing uncovered
lines into the patch. The projected `codecov/patch` came to ~97.3%
against an `auto` target of ~97.8%, so the improvement was shelved
rather than written.

Nothing in the Coverage section said the improvement was not negotiable.
It read as "a red patch means your change is defective," with the only
escape a false-positive appeal, so the cheapest way through was to not
make the change. The section now separates the two decisions: the check
gates the merge, never the design. Write the change the design calls
for, close the gap where it's real, and where it isn't — misses that
predate the change, or a path with no deterministic trigger — push and
ask before merging with the arithmetic in hand.

Two smaller corrections ride along. Deleting "unused" code to green the
number now excludes a rarely-reached backstop that's load-bearing, which
matters given the Data Safety rules. And the `tests/CLAUDE.md` note on
rename false positives now covers the mechanism that caused this: any
line the diff relocates counts as a patch line, re-indentation included,
not just a `git mv`.

Co-Authored-By: Claude Opus 5 <[email protected]>
@max-sixty
max-sixty marked this pull request as ready for review July 24, 2026 23:10
@max-sixty
max-sixty merged commit a07cf60 into main Jul 24, 2026
39 checks passed
@max-sixty
max-sixty deleted the coverage-policy branch July 24, 2026 23:18
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.

2 participants