Skip to content

fix(hygiene): the unwrap ratchet pins to the MEASURED count, and its failure stops calling tree-first entries "new" - #4213

Merged
joelteply merged 1 commit into
canaryfrom
fix/unwrap-ratchet-baseline-to-measured
Sep 19, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/unwrap-ratchet-baseline-to-measured

Conversation

@joelteply

@joelteply joelteply commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Card ca365c81. Follow-up to #4212 (which wrote the four reasons and re-greened canary).

What this does

  1. BASELINE_UNJUSTIFIED 2267 → 2264, the count the tree measures with fix(deploy): canary green again — #4208's five unjustified unwraps carry their reasons; the consumer enters the repo before reboot (ca365c81) #4212's reasons written. Read from the test's own output, not computed:
    unjustified production unwraps: 2264 (baseline 2264) — 1 passed, REAL_EXIT 0.
  2. The failure message stops saying "First few new ones:". The scan has no old set and cannot know what is new; it was printing the tree-first entries (anthropic_adapter.rs:52…), which predate the guard. Tonight that sent the reader to the wrong file and the four real lines took a CI bisect across eleven commits to find. It now says what it prints ("in tree order, NOT necessarily new"), how to find yours (diff your branch for added unwrap shapes with no same-line comment), and names the green-alone / red-on-merge shape so nobody files the next one as a flake.
  3. The count prints under --nocapture on a PASS too, so lowering the baseline after a clean-up is one build and a read, not a deliberately-failing second build.

Why the baseline matters more than the comments

7fe1d21 went red with every PR in the batch green on its own head: the ratchet had three of slack under 2267, #4208 and #4209 each spent it, and only the merge was over. A baseline pinned to the measured count has no slack to share — the next unjustified unwrap is red on ITS branch, where its author is, not on canary where everyone's deploy is.

Not in this PR: any code change outside the guard's own file. One file, +15/−2.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…failure stops calling tree-first entries "new"

Card ca365c81. canary 7fe1d21 went red on this guard (2268 > 2267) after
a batch whose PRs were each green alone: the ratchet had three of slack
under 2267, two branches spent it independently, and only the merge was
over. #4212 writes the four reasons; this pins the baseline to what the
tree measures with them written — 2264, read from the test's own output —
so the slack that made tonight possible is gone and the next unjustified
unwrap is red on ITS branch, not on the merge.

Two things about the failure message, both paid for tonight:

- It said "First few new ones:" and listed anthropic_adapter.rs:52 onward.
  The scan has no old set and cannot know what is new; it was printing the
  tree-first entries, which predate the guard. Finding the four real lines
  took a CI bisect across eleven commits. The message now says what it
  prints ("in tree order, NOT necessarily new"), says how to find yours
  (diff your branch for added unwrap shapes without a same-line comment),
  and names the green-alone/red-on-merge shape so the next reader does not
  file it as a flake.
- The count now prints under --nocapture on a PASS too, so lowering the
  baseline after a clean-up is one build and a read, not a deliberately
  failing second build to make the number appear.

Measured: cargo test --lib the_unjustified_unwrap_count_never_rises --
--nocapture → "unjustified production unwraps: 2264 (baseline 2264)",
1 passed, REAL_EXIT 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit 32dcb82 into canary Sep 19, 2026
6 checks passed
@joelteply
joelteply deleted the fix/unwrap-ratchet-baseline-to-measured branch September 19, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant