Skip to content

fix(repo-fleet-hygiene): report bare repos with live working trees - #2633

Merged
kyle-sexton merged 1 commit into
mainfrom
cursor/fix-fleet-bare-live-tree-f8b0
Aug 15, 2026
Merged

fix(repo-fleet-hygiene): report bare repos with live working trees#2633
kyle-sexton merged 1 commit into
mainfrom
cursor/fix-fleet-bare-live-tree-f8b0

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Closes #2602

Summary

A repository with core.bare=true but a populated working tree / linked worktrees was rejected as not-a-working-tree before classification and appeared nowhere in the report.

Fix

Surface the administrative anomaly in the report instead of silent omission; do not abort the whole audit.

Verification

See collector tests on PR checks.

Related

Refs #2597 — fleet hygiene epic.
Refs #2598 — non-repo path degradation.

Open in Web Open in Cursor 

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 13s —— View job


Security review complete

  • Gather context (PR diff, changed files)
  • Apply skip gate (open PR, security-relevant surface present in audit-fleet.sh)
  • Review changed files for security-relevant issues
  • Report findings

No security issues found.

Reviewed the full diff (plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.sh, its test file, SKILL.md, confidence-model.md, CHANGELOG.md, plugin.json) against origin/main. This is a read-only fleet-audit collector; the change adds a new bare-repo-with-working-tree classification path instead of silently rejecting a repo whose core.bare=true coincides with live working-tree content or linked worktrees.

Specifically checked:

  • New Git probes are properly allowlisted. classify_bare_live_tree and count_worktree_registrations call run_git_probe -C "$dir" rev-parse --is-bare-repository and ... worktree list --porcelain -z --. Both are added to git_probe_allowed() (audit-fleet.sh#L131, #L143) with exact arg-count/shape matching — no new arbitrary-command surface, and run_git_probe's existing GIT_CONFIG/GIT_DIR sanitization subshell (#L176-191) still wraps every call.
  • Path/value output stays through display_value/print_field (#L76-92), which uses printf '%s' (value as argument, not format string) and %q-escapes non-printable input — the new BARE_LIVE_TREE_PATHS/BARE_LIVE_TREE_EVIDENCE fields reported via print_field/emit_finding can't be used for format-string or terminal-escape injection.
  • directory_has_non_git_entries (#L603-614) uses safe glob expansion + basename, no eval/command substitution of file content.
  • No auto-remediation. The finding's disposition explicitly says "Manual review only; never auto-rewrite core.bare" and only names the remediation command in output text — it doesn't execute it. Good: avoids a destructive write path for an anomaly detector.
  • No secrets, credentials, or permission/workflow changes; plugin.json/CHANGELOG.md/SKILL.md/confidence-model.md changes are version bump and documentation only.

Nothing to flag.

@kyle-sexton
kyle-sexton enabled auto-merge (squash) August 14, 2026 22:58
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

Last security-reviewed head: 6fb48429629e4aaf943675780c53cbcf3c9620fc. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@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: ab8a1f834c

ℹ️ 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 plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.sh
@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 5m 8s —— View job


Claude finished the code review

  • Gather context (diff, PR, related files)
  • Run /review:code-review procedure
  • Post findings as inline PR comments
  • Post summary review comment

Summary

Reviewed the diff against origin/main (scope: plugin.json, CHANGELOG.md, SKILL.md, confidence-model.md, audit-fleet.sh, audit-fleet.test.sh). This is the code-review lane; security findings are out of scope here since a claude-security-review workflow exists in this repo.

1 Important finding posted inline on audit-fleet.sh (lines 605-616):

directory_has_non_git_entries classifies any top-level entry other than a literally-named .git as "checkout debris". That heuristic only holds for the anomaly this PR targets (a former non-bare checkout whose .git admin dir got left in place after core.bare was flipped to true). A genuine, correctly-configured bare repository has no nested .git at all — HEAD, config, description, hooks/, info/, objects/, refs/ sit directly in the top-level directory — so this function returns true for essentially every bare repo, including the bare-hub-with-linked-worktrees pattern this plugin's own confidence-model.md calls out as legitimate. The result: --repo <bare-hub> against a real, healthy bare hub gets misreported as bare-repo-with-working-tree (MEDIUM), with fabricated "populated working-tree content" evidence and a disposition telling the operator to disable core.bare — wrong advice for a repo working as intended. The audit-fleet.test.sh fixtures (bare-pure/bare-live) don't catch this because the whole suite is git-mocked and both fixtures are built with a nested .git dir, a shape that matches neither a real bare repo nor a real misconfigured one. See the inline comment for a suggested fix direction (key off presence of a nested .git entry, which real bare repos never have, rather than "any non-.git-named entry").

No other high-signal findings — the rest of the change (deferred-finding bookkeeping, dedup-by-common-dir, report-loop placement, version bump, docs) is consistent with the existing patterns in this file.
· Branch

@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch from ab8a1f8 to ac2cd92 Compare August 14, 2026 23:13
Comment thread plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.sh Outdated
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude has reviewed this PR 5 times. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch from ac2cd92 to a0cfeec Compare August 14, 2026 23:18
@kyle-sexton
kyle-sexton force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch from a0cfeec to abd39d7 Compare August 14, 2026 23:20
@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 15s —— View job


Security review complete

  • Gather context (PR diff since last-reviewed head, changed files)
  • Apply skip gate (open PR; two new commits landed since the last security review of ab8a1f834c)
  • Review new commits for security-relevant issues
  • Report findings

No security issues found.

Since the last security review (head ab8a1f834c), two follow-up commits landed, both scoped entirely to directory_has_non_git_entries() in plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.sh:

  • abd39d7 — adds default case arms to satisfy shellcheck's SC2249 gate (no behavior change).
  • 6fb4842 — re-keys the "checkout debris" heuristic off presence of a nested .git entry ([[ -e "$dir/.git" || -L "$dir/.git" ]] || return 1) instead of "any non-.git-named top-level entry", fixing the false-positive-on-genuine-bare-hubs bug flagged in the prior code-review pass (Codex + Claude review comments on this PR).

Both commits are pure logic refinements to an existing classification helper — no new Git probes were added (git_probe_allowed() at audit-fleet.sh#L97 is unchanged by this diff), no new external/untrusted input reaches the function, and the glob-expansion + basename pattern used to enumerate directory entries is unchanged and still free of eval/command substitution of file content. run_git_probe's config-sanitization subshell (audit-fleet.sh#L174-191) still wraps every Git invocation. This lane already reviewed the rest of the PR's diff against origin/main with no findings; nothing in the new commits changes that assessment.
· Branch

@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 23s —— View job


Security review complete

  • Gather context (PR diff, changed files)
  • Invoke /review:security-review and follow its procedure
  • Review changed files for security-relevant issues
  • Report findings

No security issues found.

Reviewed the full diff (origin/main...HEAD, commit 6fb4842) against the /review:security-review criteria: injection surfaces, unsafe secret/token handling, authorization gaps, and dangerous GitHub Actions patterns. This PR only touches plugins/repo-fleet-hygiene/ (a read-only fleet-audit collector) plus its docs/version files — no workflow files changed.

Note: this HEAD includes two commits (abd39d7, 6fb4842) landed after the earlier automated security-review comment on this PR, so I re-reviewed the current diff rather than relying on that stale pass. Those two commits are a correctness fix for a false-positive bug flagged by the code-review/Codex passes (directory_has_non_git_entries was misclassifying every ordinary bare hub); not a security-relevant change, and the new audit-fleet.test.sh fixture (bare-pure, admin files at the repo root with no nested .git) now covers that shape.

Specifically checked on the current HEAD:

  • New Git probes stay allowlisted. classify_bare_live_tree and count_worktree_registrations call run_git_probe -C "$dir" rev-parse --is-bare-repository and ... worktree list --porcelain -z --. Both are exact-shape entries in git_probe_allowed()--is-bare-repository, worktree list --porcelain -z -- (the latter already existed for main_worktree, just reused). No new arbitrary-command surface, and run_git_probe's GIT_CONFIG/GIT_DIR sanitization subshell still wraps every call regardless of args.
  • Path/evidence output stays through print_field/emit_finding, which use printf '%s' (value as argument, never a format string) — the new BARE_LIVE_TREE_PATHS/BARE_LIVE_TREE_EVIDENCE fields can't be used for format-string or terminal-escape injection. See analyze_repo reporting loop.
  • directory_has_non_git_entries (L603-616) uses safe glob expansion + basename, no eval or command substitution of file/directory content — read-only classification, no privilege boundary crossed.
  • No auto-remediation. The finding's disposition explicitly says "Manual review only; never auto-rewrite core.bare" and only names the remediation command in output text (L1590-1593) — it never executes it.
  • plugin.json/CHANGELOG.md/SKILL.md/confidence-model.md changes are version bump and documentation only; no workflow/permissions changes.

This is a correctness/logic bug fix (already flagged separately by the code-review lane and addressed in this HEAD), not a security finding — nothing to report from the security lens.
· Branch

@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch from 6fb4842 to 322f9cc Compare August 14, 2026 23:33
@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @cursor[bot]'s task in 3m 4s —— View job


Code review complete

  • Gather context (PR diff since origin/main, prior review comments)
  • Apply skip gate (open PR, non-trivial change, no unresolved prior finding — see below)
  • Review changed files for correctness/maintainability findings
  • Verify the nested-.git fix for directory_has_non_git_entries (flagged in a prior review pass)
  • Post findings as inline PR comments — none met the bar, see below
  • Post summary review comment

Summary

Reviewed origin/main...HEAD (322f9cc) against the code-review criteria (correctness, maintainability; security is scoped to the dedicated security lane on this repo). Scope: plugin.json, CHANGELOG.md, SKILL.md, confidence-model.md, audit-fleet.sh, audit-fleet.test.sh.

No new findings. The current head resolves the false-positive bug both Codex and this lane flagged on the prior head (ab8a1f8): directory_has_non_git_entries previously treated any top-level entry other than a literally-named .git as checkout debris, which misclassified every ordinary git init --bare hub (admin files at the repo root, no nested .git) as bare-repo-with-working-tree.

The current implementation (audit-fleet.sh#L604-L618) now gates on presence of a nested .git entry first ([[ -e "$dir/.git" || -L "$dir/.git" ]] || return 1) before treating other entries as debris — a real bare hub never has a nested .git, so it now correctly falls through to "not this finding." I traced the surrounding logic and confirmed it's sound:

  • count_worktree_registrations (L620-629) reuses the established worktree list --porcelain -z NUL-record-counting idiom already used by main_worktree (L588-598) — consistent with existing code, not a new pattern.
  • classify_bare_live_tree (L631-651) correctly short-circuits to "not this finding" only when both has_content=false and wt_count<=1; I checked the wt_count - 1 arithmetic in the evidence-detail branches and confirmed it can't go negative (the only reachable path through that branch already guarantees wt_count > 1).
  • record_bare_live_tree's common-dir dedup (L654-663) keeps the three parallel arrays (BARE_LIVE_TREE_PATHS/_EVIDENCE/_COMMON_KEYS) in sync — no desync path.
  • Both new Git probes (rev-parse --is-bare-repository, worktree list --porcelain -z --) are pre-existing allowlist entries reused, not new surface (L131).
  • audit-fleet.test.sh now has fixtures for both shapes: bare-live (nested .git + debris + a linked worktree → finding fires) and bare-pure (HEAD/config/description/objects/refs at root, no nested .git → still hard-rejects as "not a Git working tree", finding does not fire). This is exactly the shape gap the earlier review comments called out as untested.

Docs (CHANGELOG.md, SKILL.md, confidence-model.md) and the version bump (0.14.00.15.0) are consistent with the code change.

Note: this sandbox's allowed-tools for this lane don't include running the test suite directly (bash audit-fleet.test.sh required approval I don't have here), so I traced the fixture/assertion logic by reading rather than executing it. The PR's own checks (referenced in the description) should be the source of truth for actual pass/fail.
· Branch

@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch 2 times, most recently from 83e80ff to 15f3c06 Compare August 14, 2026 23:58
@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Claude finished @cursor[bot]'s task in 3m 13s —— View job


Code review complete

  • Gather context (PR diff, changed files, prior review comments)
  • Run /review:code-review procedure
  • Post findings as inline PR comments
  • Post summary review comment

Summary

Reviewed git diff origin/main...HEAD (head 83e80ffe) in full, including the two follow-up commits that already landed in response to the earlier Codex/Claude review comments (directory_has_non_git_entries now correctly keys off a nested .git entry instead of "any non-.git entry," fixing the false-positive-on-genuine-bare-hubs bug that was flagged inline on this PR). That part of the change is solid: classify_bare_live_tree and its helpers are well-scoped, git_probe_allowed() covers both new probes, and audit-fleet.test.sh now has a bare-pure fixture shaped like a real git init --bare hub.

1 Critical finding posted inline on plugins/disk-hygiene/.claude-plugin/plugin.json (the version-bump line): this commit reverts an unrelated, already-shipped feature.

  • disk-hygiene is downgraded 0.19.00.18.0.
  • hygiene.py loses entry_is_empty_directory, inventory_parent_paths, and empty_directory_count (152 lines), and test_hygiene.py loses all their tests (139 lines).
  • CHANGELOG.md, README.md, SKILL.md, and evals.json all lose the matching [0.19.0] (disk-hygiene: reporting is framed around reclaimed bytes, but safe tidiness is the primary objective #2590) documentation/eval coverage.
  • None of this is mentioned in the PR title or description, and disk-hygiene has nothing to do with the stated goal (bare-repo-with-live-working-tree detection in repo-fleet-hygiene). This is almost certainly the branch/agent having built its patch against a stale snapshot of these files rather than diffing against current origin/main. See the inline comment for the suggested fix (restore plugins/disk-hygiene/** to origin/main).

A second, equally serious regression in scope — same root cause, within repo-fleet-hygiene itself: this commit also fully reverts b7793d3 (#2630, "degrade non-repo paths under --root"), which is the immediate parent commit of this PR's branch on origin/main. Specifically, comparing audit-fleet.sh on origin/main to this PR's HEAD:

  • The unreadable-directory guard in discover_repositories ([[ ! -r "$dir" || ! -x "$dir" ]] → count and continue, never descend) is gone. An unreadable path under --root (e.g. a permission-denied directory, called out in the removed comment as "ordinary under a volume-wide --root, e.g. Windows $RECYCLE.BIN") is now silently skipped by glob-expansion failure instead of being counted and reported — exactly the "silence is not mistaken for a complete walk" problem fix(repo-fleet-hygiene): degrade non-repo paths under --root #2630 fixed.
  • DISCOVERY_SKIP_PATHS/DISCOVERY_NONREPO_COUNT/DISCOVERY_UNREADABLE_COUNT, discovery_skip_reason(), record_rejected_target's discovery branch, the discovery-skip finding, and the Discovery skips: N non-repository, M unreadable header line are all deleted.
  • SKILL.md's "Graceful degradation" section and confidence-model.md's discovery-skip row (both describing fix(repo-fleet-hygiene): degrade non-repo paths under --root #2630's behavior) are deleted.
  • audit-fleet.test.sh drops the mix-husk/unreadable-dir fixtures and their three assertions (discovery-skip finding present, header skip counts, explicit --repo on a husk still hard-fails) and replaces them with new bare-live-tree assertions only — so no test in this suite now exercises unreadable-directory or discovery-husk degradation at all.
  • The PR description even lists "Refs repo-fleet-hygiene: one non-repository path under --root aborts the entire audit #2598 — non-repo path degradation" as related, unaffected context — but the diff actually deletes that feature rather than building on it, which strongly suggests this wasn't intentional.

Both regressions look like the same underlying issue: this commit's parent is directly b7793d3 (verified via git log), so the diff isn't a rebase artifact — the commit itself is built from file content that predates both #2630 and disk-hygiene's #2590, overwriting the newer work on origin/main instead of layering the bare-repo fix on top of it.

Suggested resolution: rebuild this commit as a true diff against current origin/main — keep the bare-repo-with-working-tree addition (which is good), drop every unrelated plugins/disk-hygiene/** change, and restore the --root discovery-skip degradation (DISCOVERY_SKIP_PATHS et al., the discovery-skip finding, the header skip-count line, the SKILL.md/confidence-model.md sections, and the mix-husk/unreadable-dir test fixtures) alongside the new bare-live-tree logic rather than in place of it.

Branch ·

@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch from 15f3c06 to 6c80dd3 Compare August 15, 2026 00:00
Comment thread plugins/disk-hygiene/.claude-plugin/plugin.json Outdated
@cursor
cursor Bot force-pushed the cursor/fix-fleet-bare-live-tree-f8b0 branch 10 times, most recently from a6496a0 to f16ec77 Compare August 15, 2026 00:34
cursor Bot pushed a commit that referenced this pull request Aug 15, 2026
Re-apply the conformance report lost when #2640's squash only restored
GraphQL/rollups after the #2633 regression. Classify linked worktrees
against melodic.worktreeroot / source-control worktree_root. Version 0.20.0.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
kyle-sexton added a commit that referenced this pull request Aug 15, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Closes #2606

## Summary

Restores the #2606 worktree-root conformance feature that PR #2640
claimed to close but did not keep when the squash (`6f0a3110`) only
re-integrated GraphQL/rollups after the #2633 regression.

## Fix

- Per-repo and fleet counts: conforming / outside-or-wrong-layout /
tool-owned
- Non-conforming findings name the expected
`<root>/<owner>-<repo>-<slug>` location
- Codex/Cursor tool-owned paths distinguished from misplaced
- Unset root → placement only (no invented convention)
- Config reads gated on `rev-parse --git-dir`; attribution via
`--show-origin`
- Hardened evidence: physical-path compare;
`worktree-root-pluginconfigs-unreadable` when `jq` is missing
- Bump `repo-fleet-hygiene` to **0.21.0**

## Verification

```
bash plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.test.sh
# 133 PASS
```

## Related

Refs #2597 — fleet epic parent.
Refs #2640 — claimed Closes #2606 but landed without the feature.
Refs #2633 — regression that dropped collector surfaces.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-eb3f5ee5-6c9f-48a3-8e46-071bd363f8b0?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-eb3f5ee5-6c9f-48a3-8e46-071bd363f8b0&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 15, 2026
Restore bare-live/bare-pure fixtures and assertions lost in the #2633/#2640
squash cycle, and add a finding-kind coverage gate so a self-consistent
rewrite cannot drop the defender again. Closes #2656.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
kyle-sexton added a commit that referenced this pull request Aug 15, 2026
#2658)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Closes #2656

## Summary

`bare-repo-with-working-tree` shipped on `main` with zero suite coverage
after the #2633/#2640 squash cycle. This restores the regression tests
and adds a repo-level gate outside `audit-fleet.test.sh` so a
self-consistent rewrite cannot delete the defender again.

## Fix

- Restore `bare-live` / `bare-pure` fixtures and end-to-end assertions
(positive bare+live tree with remedy, discovery under `--root`, ordinary
bare hub still rejects)
- Unit-cover `directory_has_non_git_entries` and `BARE_LIVE_TREE_*`
dedup via `record_bare_live_tree`
- Add `scripts/check-fleet-finding-test-coverage.sh` (+ baseline,
self-test, CI lane) asserting every emitted finding kind is named in the
suite or grandfathered

## Verification

```
bash plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.test.sh
bash scripts/check-fleet-finding-test-coverage.test.sh
scripts/check-fleet-finding-test-coverage.sh --check
```

## Related

Refs #2633 — bare-live feature squash.
Refs #2640 — recovery squash that dropped the suite coverage.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-eb3f5ee5-6c9f-48a3-8e46-071bd363f8b0?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-eb3f5ee5-6c9f-48a3-8e46-071bd363f8b0&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 15, 2026
The skill body told an agent to reject `audit D:` while the bundled
script accepted it. #2638 shipped bare positional paths and drive roots
and replaced the project-directory fallback with a hard scope failure;
#2646 landed eight minutes later from a branch cut before it, and its
rebase carried the pre-#2638 prose forward as a revert.

Restores, against the script as it actually behaves on main:

- the bare positional `<dir>` form, in the argument list and the hint
- `--project-dir` as a config rung only, not a scope fallback
- the no-scope paragraph, which now describes the hard failure and its
  remedies instead of the removed project-directory target
- the reject-outside-this-grammar clause, which now says plainly that a
  bare path IS in the grammar and only unknown flags are refused

Also documents `bare-repo-with-working-tree` (#2633/#2602), whose
handoff row was dropped by the same revert, and corrects the
machine-wide-discovery claim in the README and plugin description: the
ladder is not built, a no-scope run fails, and #2599 tracks it.

Catalog regenerated from the manifest.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
kyle-sexton added a commit that referenced this pull request Aug 15, 2026
)

No linked issue


## Summary

The skill body instructed an agent to **reject
`/repo-fleet-hygiene:audit D:`** — the exact invocation #2599 exists to
enable — while the bundled script accepted it. This restores the
documented grammar to match the script as it actually behaves on `main`.

## Fix

PR #2638 shipped bare positional paths and drive roots, and replaced the
project-directory scope fallback with a hard failure that names its
remedies. PR #2646 merged eight minutes later from a branch cut before
it; the rebase was textually clean but carried pre-#2638 prose forward,
reverting the skill layer while leaving the script untouched.

Restored, each verified against `origin/main`'s `audit-fleet.sh`:

| Restored | Script behaviour it now matches |
|---|---|
| bare positional `<dir>` in the argument list and `argument-hint` |
`:484` `[[ -n "$1" ]] \|\| fail "bare path requires a directory"`, with
`normalize_discovery_root` mapping `D:` → `D:/` |
| `--project-dir` documented as a config rung only | project dir is no
longer a scope target anywhere in the script |
| the no-scope paragraph, rewritten to describe the hard failure |
`:1069` `fail "no scope resolved: no bare path, --root, or --repo, and
no config-supplied fleet.root/fleet.repo"` |
| the reject-outside-the-grammar clause | now says plainly that a bare
path **is** in the grammar; only an unrecognized `-`-prefixed flag is
refused, matching the script's `-*)` arm |

Also restores the `bare-repo-with-working-tree` handoff row (#2633 /
#2602), dropped by the same revert — `git grep -c` on `main` returned 0
— with its documented remedy (`git config --local core.bare false`) and
the fact that linked worktrees keep working, since the state looks
alarming and is not.

## Also corrected: an unimplemented capability claimed as shipped

`README.md` and the plugin description both claimed **machine-wide**
repository discovery. It does not exist: `grep -n "ghq\|claude\.json"`
over the landed script returns nothing, only the configured-roots rung
is implemented, and a no-argument run hard-fails. The README row is
split into what shipped (bounded discovery via bare path, drive root,
`--root`, `--repo`, config rungs) and what did not (the ghq /
configured-roots / agent-state / bounded-sweep ladder, still unshipped
remaining contract work). The plugin description now says
"Cross-repository" rather than "Machine-wide".

`docs/CATALOG.md` regenerated from the manifest rather than hand-edited.

## Verification

```
node scripts/generate-catalog.mjs --check     → Catalog is in sync with the manifests.
node scripts/generate-cheatsheet.mjs --check  → Cheat sheet is in sync with skill frontmatter.
markdownlint-cli2 (SKILL.md, README.md)       → 0 error(s)
check-skill.sh audit                          → all 8 base-ref trigger phrases preserved
                                                description 642/1536 chars
                                                SKILL.md 302/500 lines
                                                markdownlint clean
```

The trigger-preservation check matters here specifically: the plugin
description was reworded, and that gate fails on a silently dropped
trigger phrase.

Version bumped to 0.22.1 with a CHANGELOG entry so changelog-parity
clears for the plugin-file edits.

## Why nothing caught this

`scripts/docs-only-paths.txt` contains exactly one prefix
(`docs/topics/`), so `plugin-gate` **did** run the full suite on #2646 —
all 38 checks green. There is simply no assertion tying `SKILL.md` prose
to the script's actual argument parser. That gap is worth its own issue:
this is the second silent revert on `main` in a day (the first was
#2633's stale-base squash, repaired by #2640), and both passed CI.

## Related

Refs #2599 (already closed by #2638; this PR only restores the
documented grammar that #2638 shipped).

---------

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 15, 2026
)

No linked issue


## Summary

The skill body instructed an agent to **reject
`/repo-fleet-hygiene:audit D:`** — the exact invocation #2599 exists to
enable — while the bundled script accepted it. This restores the
documented grammar to match the script as it actually behaves on `main`.

## Fix

PR #2638 shipped bare positional paths and drive roots, and replaced the
project-directory scope fallback with a hard failure that names its
remedies. PR #2646 merged eight minutes later from a branch cut before
it; the rebase was textually clean but carried pre-#2638 prose forward,
reverting the skill layer while leaving the script untouched.

Restored, each verified against `origin/main`'s `audit-fleet.sh`:

| Restored | Script behaviour it now matches |
|---|---|
| bare positional `<dir>` in the argument list and `argument-hint` |
`:484` `[[ -n "$1" ]] \|\| fail "bare path requires a directory"`, with
`normalize_discovery_root` mapping `D:` → `D:/` |
| `--project-dir` documented as a config rung only | project dir is no
longer a scope target anywhere in the script |
| the no-scope paragraph, rewritten to describe the hard failure |
`:1069` `fail "no scope resolved: no bare path, --root, or --repo, and
no config-supplied fleet.root/fleet.repo"` |
| the reject-outside-the-grammar clause | now says plainly that a bare
path **is** in the grammar; only an unrecognized `-`-prefixed flag is
refused, matching the script's `-*)` arm |

Also restores the `bare-repo-with-working-tree` handoff row (#2633 /
#2602), dropped by the same revert — `git grep -c` on `main` returned 0
— with its documented remedy (`git config --local core.bare false`) and
the fact that linked worktrees keep working, since the state looks
alarming and is not.

## Also corrected: an unimplemented capability claimed as shipped

`README.md` and the plugin description both claimed **machine-wide**
repository discovery. It does not exist: `grep -n "ghq\|claude\.json"`
over the landed script returns nothing, only the configured-roots rung
is implemented, and a no-argument run hard-fails. The README row is
split into what shipped (bounded discovery via bare path, drive root,
`--root`, `--repo`, config rungs) and what did not (the ghq /
configured-roots / agent-state / bounded-sweep ladder, still unshipped
remaining contract work). The plugin description now says
"Cross-repository" rather than "Machine-wide".

`docs/CATALOG.md` regenerated from the manifest rather than hand-edited.

## Verification

```
node scripts/generate-catalog.mjs --check     → Catalog is in sync with the manifests.
node scripts/generate-cheatsheet.mjs --check  → Cheat sheet is in sync with skill frontmatter.
markdownlint-cli2 (SKILL.md, README.md)       → 0 error(s)
check-skill.sh audit                          → all 8 base-ref trigger phrases preserved
                                                description 642/1536 chars
                                                SKILL.md 302/500 lines
                                                markdownlint clean
```

The trigger-preservation check matters here specifically: the plugin
description was reworded, and that gate fails on a silently dropped
trigger phrase.

Version bumped to 0.22.1 with a CHANGELOG entry so changelog-parity
clears for the plugin-file edits.

## Why nothing caught this

`scripts/docs-only-paths.txt` contains exactly one prefix
(`docs/topics/`), so `plugin-gate` **did** run the full suite on #2646 —
all 38 checks green. There is simply no assertion tying `SKILL.md` prose
to the script's actual argument parser. That gap is worth its own issue:
this is the second silent revert on `main` in a day (the first was
#2633's stale-base squash, repaired by #2640), and both passed CI.

## Related

Refs #2599 (already closed by #2638; this PR only restores the
documented grammar that #2638 shipped).

---------

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Detects a merge that silently deleted content another recently-merged
commit had just added, with nothing in its own message saying it meant
to. This is item 4 of #2691.

The canary blames the lines each merge removed against its parent and
reports when a large block traces to a single commit inside a recency
window. Volume, recency, constrained intent markers, and a
non-blocking post-merge-only trigger keep the firing rate at 1% over
the last 500 first-parent commits of main.

Two designs were measured and rejected first. Merge-base staleness
exonerates all three real incidents, because every reverting branch
was up to date with main in HISTORY and stale only in CONTENT --
`git merge-base --is-ancestor f603880 refs/pull/2641/head` is true
while that branch's tree carried zero occurrences of #2639's markers.
Curated marker strings only catch what somebody pre-registered, and
nobody had registered the fixes that were lost.

That evidence also corrects the issue's premise: this was not a
stale-BASE failure, so `strict_required_status_checks_policy` would
have passed all three merges, and so would a merge queue (CI was green
-- the tests were deleted alongside the code). No ruleset is touched
here.

Calibration surfaced a third, previously unfiled incident: #2633's
squash dropped #2632's rollups (853 lines), which #2640 restored by
hand.

Refs #2691

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018S8a1S71VxhLTRWBtMuEvp
kyle-sexton added a commit that referenced this pull request Aug 16, 2026
No linked issue

## Summary

A post-merge canary for the failure class in #2691: a merge that
silently deletes content another recently-merged commit had just added,
leaving no `Revert:` marker and no failing test. Item 4 of that issue.
Detection only — it runs on `push` to `main`, is not in `ci.yml`, and is
not wired into `ci-status`, so it can never gate a merge.

**It also corrects the issue's premise.** This was not a stale-*base*
failure, which means `strict_required_status_checks_policy` would not
have prevented it. Details below.

## Fix

`scripts/check-silent-revert.sh` blames the lines each merge deleted
against its own parent and reports when a large block traces to a
**single** commit inside a recency window. Plus
`scripts/check-silent-revert.test.sh` (26 hermetic cases), two data
files, and `.github/workflows/silent-revert-canary.yml`.

### Why blame-of-deleted-lines, and not the alternatives

Three designs were measured against the real history before one was
chosen.

**Merge-base staleness — tested and rejected on evidence.** It
exonerates all three real incidents:

```
$ git merge-base --is-ancestor f603880 refs/pull/2641/head && echo YES
YES
$ git grep -c "read-only supporting allowlist" refs/pull/2641/head -- 'plugins/disk-hygiene/**'
(no output — zero occurrences)
$ git grep -c "read-only supporting allowlist" f603880 -- 'plugins/disk-hygiene/**'
f603880:plugins/disk-hygiene/skills/clean/SKILL.md:1
f603880:plugins/disk-hygiene/skills/clean/scripts/destructive_guard.py:1
```

PR #2641's head had #2639 **in its ancestry** and **zero occurrences of
#2639's content in its tree**. #2639 shows the identical shape against
#2635. These branches were up to date with `main` in *history* and stale
only in *content* — a bad conflict resolution or a force-push from an
older worktree.

So `strict` would have passed all three merges, and a merge queue would
have too (CI was green — the tests were deleted alongside the code).
**That reframes the canary: for this class it is not defence in depth
behind a real fix, it is the only control that fires at all.** No
ruleset is touched here and nothing in `github-iac` changes; ADR 0001
stands as written.

**Curated marker strings (the issue's own suggestion 3) — rejected.**
Only catches what someone pre-registered, and nobody had registered
#2632, #2635 or #2639. Registration happens *after* you know a fix
matters, which is the knowledge the incident destroys.

**PR-creation-time overlap — rejected as non-discriminating.** At the
17-concurrent-PR rate ADR 0001 records, nearly every PR has siblings
landing while it is open.

### False-positive strategy

A canary that cries wolf gets disabled, which is worse than none.

1. **Volume**, aggregated **per culprit commit** — summing across
culprits would re-admit ordinary iteration.
2. **Recency window** (40 first-parent commits). Stated limitation:
content reverted from outside the window is missed by design.
3. **Intent, in constrained forms only** — a `Revert "` subject, a `This
reverts commit <sha>` line, or an explicit `Intentional-removal:`
trailer. Deliberately *not* a substring search for "revert": a body
reading "this does not revert X" would silence a real finding.
4. **Non-blocking** — post-merge only, outside `ci-status`.

**Measured, not assumed** — and measured by running *the shipped script
itself* over the last **500** first-parent commits of `main`, not a
stand-in:

```
FIRE    853 cc58cbc fix(repo-fleet-hygiene): report bare repos with live working trees (#2633)
FIRE    451 9239f15 feat(disk-hygiene): verify redundant checkout evidence (#2641)
FIRE    390 6f0a311 fix(repo-fleet-hygiene): restore GraphQL merge evidence and rollups after #2633
FIRE    346 f603880 fix(disk-hygiene): session-honest belt, read-only allowlist, ... (#2639)
FIRE    340 91e77fc fix(hook-utils): stop a NUL in a payload value from voiding two blocking guards
MEASUREMENT COMPLETE over 500 commits
```

**5 fires in 500 merges — 1%**, zero errors. Three are the confirmed
incidents. The other two are real and are not detector bugs: #2640 (390)
is the manual *restore* of #2633's revert, and #2135 (340) is a
deliberate merge reconciliation the author argues at length in the PR
body. Both are pre-recorded in the acknowledgment file so `main` starts
green.

**Rename detection is deliberately left ON.** An earlier revision passed
`--no-renames`, which silently made the shipped detector a *different*
detector from the calibrated one: without detection a `git mv`
decomposes into delete + add, the delete side reaches the
`--diff-filter=MD` enumeration as a whole-file removal, and relocating a
large file a recent commit had added would fire. In a repo that
restructures skills and docs this often, that is a live false-positive
class. With detection on, the shipped script reproduces the calibration
corpus exactly (the five rows above), and a test pins the rename case.
The narrow cost, stated rather than hidden: content gutted in the same
commit that renames its file is not attributed.

**The uncomfortable part, stated plainly: 340 is the largest false
positive and 346 is the smallest true one. No threshold separates
them.** Picking a number inside that 2% gap would be overfitting, so the
threshold is 200 — which costs nothing (200 and 300 fire on the
identical five commits) and leaves headroom for a smaller future revert.
Precision is traded for recall because the miss is expensive and the
fire is cheap.

Cheap requires a disposition path in **both** directions in time, so
there are two: the prospective `Intentional-removal:` trailer (one line
in the PR body, which GitHub carries into the squash message), and
`scripts/silent-revert-acknowledged.txt` for a fire that can only be
judged after the fact — a commit message cannot be amended post-merge.
Without the second, one legitimate fire leaves the canary permanently
red, and a permanently red canary is one on its way to being deleted. It
matches `changelog-parity-baseline.txt` in shape, matches full 40-char
SHAs only, and requires a recorded reason, so it is an audit trail
rather than a mute button.

### A third incident, previously unfiled

Calibration surfaced one #2691 never identified: **#2633's squash
dropped #2632's finding rollups (853 lines)**, which #2640 restored by
hand the same night. Nobody filed it. That is the clearest argument for
automating the detection.

## Verification

Real output, all from this branch.

**Catches the actual incident** (requirement 1) — replayed against the
real merges, and pinned in `scripts/silent-revert-incidents.txt` so CI
re-proves it on every run:

```
$ scripts/check-silent-revert.sh --verify-known-incidents
ok   f603880 fires as recorded  (#2639 dropped #2635 (346 lines), 13 minutes later)
ok   9239f15 fires as recorded  (#2641 dropped #2639 (451 lines), 10 minutes later)
ok   cc58cbc fires as recorded  (#2633 dropped #2632's rollups (853 lines) -- unfiled until now)
ok   c8470ef stays clean as recorded  (docs(conventions) rewrote 129 lines of a doc #2679 had just added)

Canary reproduces every recorded incident at the shipped settings.
```

Range mode over the incident window — both fire, the interleaved
unrelated merges stay clean:

```
$ scripts/check-silent-revert.sh a95f240~1..9239f15
ok a95f240 feat(disk-hygiene): prioritize tidiness over reclaimable bytes in reports (#2635)
ok b7793d3 fix(repo-fleet-hygiene): degrade non-repo paths under --root (#2630)
SILENT REVERT SUSPECTED
  removed by   f603880  fix(disk-hygiene): session-honest belt, ... (#2639)
  content from a95f240  feat(disk-hygiene): prioritize tidiness over ... (#2635)
  lines lost   346  (threshold 200, window 40 commits)
ok eda5ae5 feat(repo-fleet-hygiene): gather merge evidence via aliased GraphQL (#2642)
SILENT REVERT SUSPECTED
  removed by   9239f15  feat(disk-hygiene): verify redundant checkout evidence (#2641)
  content from f603880  fix(disk-hygiene): session-honest belt, ... (#2639)
  lines lost   451  (threshold 200, window 40 commits)
```

**Actionable when it fires** (requirement 4) — it names what
disappeared, which commit removed it, which commit added it, the
per-file split, and the sample quotes back the very content #2691
reported as lost:

```
  by file:
     235  plugins/disk-hygiene/skills/clean/scripts/destructive_guard.py
     156  plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py
      26  plugins/disk-hygiene/skills/clean/SKILL.md
      ...
  sample of the removed content:
      | - The skill-frontmatter guard is a fail-closed allowlist. It permits canonical bundled scan/preview
      | calls made from literal shell words, a small read-only supporting set for cleanup inspection
```

**Tests** (requirement 5) — `scripts/check-silent-revert.test.sh`,
hermetic synthetic repos, following the `scripts/*.test.sh` +
`test-git-helpers.sh` convention. 27 cases: attribution, per-culprit
aggregation, the recency window, the pure-rename negative, every intent
form, the "prose mentioning revert must still fire" negative, the
empty-trailer negative, abbreviated-SHA rejection, whole-file deletion,
the shipped default in both directions, and fail-closed exit 2 on an
unresolvable range, a malformed range, and an unreachable pinned commit.

```
$ bash scripts/check-silent-revert.test.sh
check-silent-revert.test.sh: 27 passed, 0 failed
```

**Verified in real CI on this PR, not just locally.** The lane runs on
`pull_request` (scoped by `paths` to the canary's own files) so the
detector is exercised before it lands — the scan step is gated off for
PR events, so nothing on a PR inspects that PR. From the actual run log
([job](https://github.com/melodic-software/claude-code-plugins/actions/runs/31918399785/job/95094057983),
12s):

```
Test the silent-revert detector    check-silent-revert.test.sh: 27 passed, 0 failed
Replay the recorded incidents      ok   f603880 fires as recorded  (#2639 dropped #2635 (346 lines), 13 minutes later)
Replay the recorded incidents      ok   9239f15 fires as recorded  (#2641 dropped #2639 (451 lines), 10 minutes later)
Replay the recorded incidents      ok   cc58cbc fires as recorded  (#2633 dropped #2632's rollups (853 lines) -- unfiled until now)
Replay the recorded incidents      ok   c8470ef stays clean as recorded  (docs(conventions) rewrote 129 lines ...)
Replay the recorded incidents      Canary reproduces every recorded incident at the shipped settings.
```

That run matters for a specific reason. The blame-header pattern
originally used an ERE interval (`{40}`), and interval support is an
awk-implementation variable — the runner's default awk is mawk,
development machines run gawk. Had it not matched, attribution would
emit nothing and **every commit would report `ok`**: a false green, the
exact failure class this canary exists to remove. It is now
interval-free and proven against the runner's own awk above.

**Cannot block a merge — verified, not just asserted.** The required
contexts on `main` are:

```
$ gh api repos/melodic-software/claude-code-plugins/rules/branches/main \
    --jq '.[] | select(.type=="required_status_checks") | .parameters.required_status_checks[].context'
pr-title / pr-title
pr-issue-linkage / pr-issue-linkage
do-not-merge / do-not-merge
ci-status
```

`Silent-revert canary` is not among them, and its only appearance in
`ci.yml` is the `workflow_schema` filename list — never `ci-status`'s
`needs`. A non-required check cannot gate a merge.

**Repo gates**, all run locally on this branch: `shellcheck
--rcfile=.shellcheckrc -x` (exit 0, and this repo enables
`require-double-brackets` and `add-default-case`),
`check-shell-portability.sh --paths` and `--all` (exit 0), `zizmor` (no
findings), `actionlint` (exit 0), `typos` (exit 0),
`editorconfig-checker` (exit 0), `check-jsonschema --builtin-schema
vendor.github-workflows` (ok), `check-silent-skips.sh` (exit 0). The new
workflow is registered in `ci.yml`'s `workflow_schema` file list; the
shell scripts are committed `100755`.

### Design notes for review

- **No cancelling `concurrency` group**, unlike `ci.yml` — a cancelled
canary run is a silently missed detection.
- **Fail-closed on an unusable push range.** `github.event.before` is
all-zeros on a first push or history rewrite; the workflow falls back to
the head commit and emits a `::warning::` saying earlier commits were
not scanned, rather than reporting a clean scan of nothing. An
unresolvable range exits **2**, never 0.
- **Self-test runs before every scan**, so a broken detector cannot mask
a regression behind a green canary — the same never-skip,
self-test-first shape the `ci.yml` gates use.
- **What runs on a PR is the detector's unit tests, never detection.**
The `pull_request` trigger is `paths`-scoped to the canary's own five
files, so it is inert on every other PR, and both scan steps carry `if:
github.event_name != 'pull_request'`.
- **Remaining limitations, stated rather than hidden:** content reverted
from outside the 40-commit recency window is missed by design; content
gutted in the same commit that renames its file is not attributed; and
no threshold separates a large deliberate rewrite from a silent revert,
which is what the acknowledgment file exists to absorb.

## Related

Refs #2691 — this is item 4; the issue covers more and stays open.
Refs #2713 — the docs-only silent-revert blind spot, same class from the
test-coverage side.
Refs melodic-software/github-iac
`docs/adr/0001-relax-strict-required-status-checks.md` — unchanged; the
evidence above argues it was never the relevant control for this failure
mode.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
kyle-sexton pushed a commit that referenced this pull request Aug 16, 2026
…fers to

The 0.54.9 entry quoted the removed "#2635 then #2639" citation and then said
"all three incidents" without naming them. Name the three reverting merges
(#2633, #2639, #2641) and mark the earlier numbers as a quotation of the text
being removed. Changelog prose only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 16, 2026
…2832)

Closes #2831.

The silent-revert canary merged in #2808 ships an incident corpus that
misattributes one of its three incidents. Since
`--verify-known-incidents`
replays that corpus on every `push: main`, the corpus is the guard's own
honesty proof, and a wrong row costs it the credibility it exists to
earn.

The guard already contradicts its own fixture. Running the shipped
detector on
the incident commit prints:

```
$ scripts/check-silent-revert.sh --commit cc58cbc
  content from bfb66be  feat(repo-fleet-hygiene): add finding rollups and scalable handoff plans (#2644)
  lines lost   853
  content from eda5ae5  feat(repo-fleet-hygiene): gather merge evidence via aliased GraphQL (#2642)
  lines lost   301
```

while the corpus recorded that commit as
`#2633 dropped #2632's rollups (853 lines) -- unfiled until now`.

## What was wrong, and what it is now

**The named victim never merged.** PR #2632 is CLOSED, not merged:
`mergeCommit` null, `mergedAt` null, closed unmerged
2026-08-14T23:19:00Z, head
`2b9391be` not an ancestor of `origin/main`, and zero occurrences of
`rollup`
in its diff.

**There were two victims, and neither was #2632.** Attributing each of
the 1165
lines `cc58cbc53` (#2633) deleted to the commit `git blame` credits it
to:

| culprit | PR | lines |
| --- | --- | ---: |
| `bfb66beb8` | #2644 — finding rollups and handoff plans | 853 |
| `eda5ae5ed` | #2642 — aliased GraphQL merge evidence | 301 |
| 11 other commits, ≤4 lines each | — | 11 |
| **total** | | **1165** |

1165 matches the squash diffstat exactly
(`6 files changed, 549 insertions(+), 1165 deletions(-)`). #2642 was not
mentioned in the corpus at all, despite the detector reporting it as a
separate
finding. Corroboration:
`plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.sh` went
2178
lines / 8 `graphql` / 9 `rollup` at `bfb66beb8` → 1700 / 0 / 0 at
`cc58cbc53` →
2348 with both restored at `6f0a31109` (#2640) → 2933 on current
`origin/main`.

**853 was correct but unqualified.** It is a blame attribution against
one
culprit — not the deleting squash's diffstat total (1165) and not what
#2644
added (942 insertions in its own squash commit, per
`git diff --shortstat d55ffbf bfb66be`). Both 853 and 301 now say
what they
measure, in the fixture and in the script header.

Worth noting for anyone re-measuring: `gh pr view 2644 --json additions`
says
947, not 942, because the PR-level count is three-dot against the merge
base
while the commit diffstat is two-dot against the parent, and main moved
under
the branch in between. #2640 diverges the same way (`+1281/−463` as a
commit,
`1269/451` as a PR). The branch text avoids the trap by citing no
lines-added figure at all — it just says the blame counts are not that.

**"Unfiled until now" was false.** #2656 recorded this merge event,
pinned to
the same commits, roughly 23 hours before #2808 merged — from the
test-coverage
angle rather than as a silent revert. The corpus now cites it and frames
the
canary's contribution as detection speed and automation rather than
discovery.

## Two judgement calls worth reviewing

**The `#2632` string still appears twice**, in a new note recording that
the
row previously named it and why that was wrong. That is a refutation,
not an
attribution; it is there so the error is not silently reintroduced. Say
the
word if you would rather it be dropped entirely.

**`check-silent-revert.sh` said the canary "fires 5 times" over 500
commits.**
Measured per commit: `f603880da` 1 finding, `9239f1541` 1, `cc58cbc53`
2,
`6f0a31109` 1 (pre-acknowledgment, 390 lines), `91e77fc16` 1
(pre-acknowledgment, 340 lines) — 5 commits, 6 findings. The number was
counting commits, so the count is unchanged; the units are now stated so
the
6-vs-5 gap is not read as an error.

## Blast radius

Comments and free-text fixture notes only.

- `diff <(git show HEAD~1:scripts/check-silent-revert.sh | grep -v
'^\s*#') <(grep -v '^\s*#' scripts/check-silent-revert.sh)`
  is empty — no non-comment line of the detector changed.
- No threshold, window, or expectation moved. The fixture parser reads
`expect sha note`; only `note` text changed, and both `expect` and `sha`
are
  untouched.
- `shellcheck`, `bash -n`, `actionlint`, and `typos` all pass.

`scripts/check-silent-revert.sh --verify-known-incidents` after the
change:

```
ok   f603880 fires as recorded  (#2639 dropped #2635 (346 lines), 13 minutes later)
ok   9239f15 fires as recorded  (#2641 dropped #2639 (451 lines), 10 minutes later)
ok   cc58cbc fires as recorded  (#2633 dropped #2644's rollups (853 blamed lines) and #2642's GraphQL merge evidence (301); already recorded in #2656)
ok   c8470ef stays clean as recorded  (docs(conventions) rewrote 129 lines of a doc #2679 had just added)

Canary reproduces every recorded incident at the shipped settings.
```

## Related

- Refs #2808 — the PR that merged the canary and introduced the
misattributed
  corpus row.
- Refs #2691 — the original silent-revert audit the corpus is built
from. Its
two incidents (#2639/#2635 and #2641/#2639) were already recorded
correctly
  and are untouched here.
- Refs #2656 — the pre-existing record of this merge event, now cited by
the
corpus in place of the "unfiled until now" claim. Stays
CLOSED/COMPLETED.
- Refs #2644, #2642, #2633, #2640 — the merges measured above. Refs
#2632,
  which is not one of them: it never merged, which is the whole point.
- Refs #2833 — follow-up raised in review here: the replay checks only
that a
recorded commit still fires, never which culprit or how many lines, so a
row
can keep printing a reproduction it no longer performs. Pre-existing,
and out
  of scope for a change constrained to leave the detector untouched.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018S8a1S71VxhLTRWBtMuEvp

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 16, 2026
…alsified

Recording #2642 as a second victim of #2633's squash added a fourth true
finding at 301 lines, and two surviving sentences still described a corpus
that no longer exists:

  check-silent-revert.sh    "340 is the largest false positive and 346 is the
                             smallest true one ... that 2% gap"
  silent-revert-acknowledged.txt
                            "At 340 lines this is the largest measured false
                             positive, six lines below the smallest real
                             incident (346)"

Measured at the shipped settings, the smallest true finding is 301, and BOTH
verified-legitimate fires score above it -- 340 (#2135) and 390 (#2640). The
relationship is inverted, not narrowed: the ranges overlap outright and there
is no gap to split. That strengthens the existing conclusion rather than
changing it, so the threshold stays at 200 and the disposition path stays the
thing that makes the canary livable. Also records that 200 and 300 still fire
on the identical five commits, with the 301 finding surviving 300 by one line.

Separately, #2656 was mischaracterized. It does record the event as a silent
revert -- "#2633 was a stale-base squash that silently reverted two merged
features" -- and it is what it ASKED for, not what it recorded, that was
coverage-shaped. Corrected and quoted.

Comments and fixture note text only. The non-comment body of
check-silent-revert.sh is byte-identical to origin/main, both fixtures' parsed
fields (expect/sha and sha) are unchanged, and 27/27 detector tests plus
--verify-known-incidents pass at the unchanged shipped settings.

Refs: #2831

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 17, 2026
…ributions (#2843)

Closes #2837. Closes #2833.

## Summary

Three defects in the silent-revert canary, plus one unfiled
harness-safety fix
in a file this change already owns. Branched off `2de57a379` (#2832),
which had
already merged.

## Fix

## 1. `declares_removal()` could not read the only revert subject that
merges here (#2837)

The detector accepted three intent forms. This repo is squash-only with
`squash_merge_commit_title: PR_TITLE`, so the squash subject is the PR
title,
and `.github/workflows/pr-title.yml` gates every title through a
required
Conventional-Commits check whose default type list is all-lowercase — it
admits
`revert:` and contains nothing a `Revert "…"` subject could match. So a
deliberate revert reached `main` wearing a subject the detector could
not read.

`declares_removal()` now also accepts the Conventional-Commits revert
type,
anchored at the start of the **subject**, requiring the literal
lowercase token,
its optional `(scope)` and/or `!`, its colon, and a non-empty
description:

```
^revert(\([^()]+\))?!?:[[:space:]]*[^[:space:]]
```

Never a substring search for "revert" — kept exactly as constrained as
the three
forms beside it.

### Before / after on the repo's one real deliberate revert

`1d1fca6e8` — `revert: remove Cursor dual-target marketplace manifests
(#1835) (#1839)`

Before (at `2de57a379`, shipped detector, thresholds unmodified):

```
$ bash scripts/check-silent-revert.sh --commit 1d1fca6

SILENT REVERT SUSPECTED

  removed by   1d1fca6  revert: remove Cursor dual-target marketplace manifests (#1835) (#1839)
               2026-07-30 19:41:47 -0400
  content from b6c4b58  feat: add Cursor dual-target marketplace manifests (#1835)
               2026-07-30 18:17:36 -0400  (1 commit(s) earlier on main)
  lines lost   3361  (threshold 200, window 40 commits)
  [... 102 files, sample block and "What to do" block elided; 130 lines total ...]

EXIT=1
```

After:

```
$ bash scripts/check-silent-revert.sh --commit 1d1fca6
declared 1d1fca6 revert: remove Cursor dual-target marketplace manifests (#1835) (#1839)
         removal is declared: the subject carries the Conventional-Commits revert type
EXIT=0
```

### Suppression is not widened over anything the corpus records

- No recorded incident has a `revert`-prefixed subject — `f603880da`
`fix(disk-hygiene): …`, `9239f1541` `feat(disk-hygiene): …`, `cc58cbc53`
`fix(repo-fleet-hygiene): …`, `c8470efd0` `docs(conventions): …`. All
four rows
  still hold (green run below).
- Neither acknowledgment-file commit is revert-prefixed either —
`6f0a31109`
`fix(repo-fleet-hygiene): …`, `91e77fc16` `fix(hook-utils): …` — so no
ack row
goes dead now that `declares_removal()` short-circuits ahead of
`ack_reason()`.
- The header's "fires on 5 commits — 1%" calibration figure is therefore
  unchanged; none of those five is revert-prefixed.

New tests pin both directions. `revert:`, `revert(scope):`, `revert!:`
and
`revert(scope)!:` suppress; `feat: do not revert the alpha guard (#99)`,
`reverted: drop the alpha guard (#99)`, `Revert: drop the alpha guard
(#99)` and
a bare `revert:` with no description all still fire. The pre-existing
case only
covered a *body* mention of "revert"; the subject is what the new form
reads, so
that is where a substring bug would widen.

## 2. `verify_known_incidents` asserted only "something fired" (#2833)

A `fires` row passed on `scan_commit`'s exit status while the note
beside it
named a specific culprit and a specific line count that nothing checked.
On
`cc58cbc53`, whose deletions trace to two culprits, losing the
`eda5ae5ed`
attribution entirely would still have printed `ok` on the surviving
`bfb66beb8`
finding — the canary announcing a reproduction it did not perform.

A `fires` row may now carry a bracketed attribution expectation after
its sha:

```
fires <sha> [<culprit-full-sha>=<blamed-lines>,<culprit-full-sha>=<blamed-lines>] <note>
```

and the replay asserts the run's findings are **exactly** that set —
same
culprits, same per-culprit counts, no extras, no omissions. Full
40-character
culprit shas only, the same discipline `silent-revert-acknowledged.txt`
uses.

Counts come from a new `FINDINGS_SINK` file that `report_finding`
appends
`<full-culprit-sha> <count>` to, not from scraping the human report —
the report
prints a 9-character abbreviation, which is not enough sha to assert on.
Nothing
else sets `FINDINGS_SINK`, so `--commit` and range mode are
byte-identical.

Every recorded figure was **measured, not transcribed from the notes** —
the
sink was wired first and the observed values recorded:

```
f603880 -> a95f240 346
9239f15 -> f603880 451
cc58cbc -> bfb66be 853
             eda5ae5 298
```

Three of the four agree with the notes #2832 corrected; the fourth is
298 rather
than 301, for the reason in section 5. A malformed field is exit 2
(cannot
run), never a FAIL and never a pass — a silently misread expectation is
the same
false green this file exists to remove. The field is optional so a row
can be
pinned before its attribution is measured, but a new well-formedness
assertion
requires every *shipped* `fires` row to carry one.

## 3. The workflow header stated a reason that was not true (unfiled)

`.github/workflows/silent-revert-canary.yml` asserted *"There is no
`pull_request` trigger, so it can never gate a PR"* — while its own
`on:` block
has a paths-filtered `pull_request` trigger, added by #2808 to run the
detector's
unit tests, and explained at length 20 lines further down in the same
file. The
conclusion holds for a different reason: both scan steps are gated
`if: github.event_name != 'pull_request'`, and the lane sits outside
`ci.yml`
and its `ci-status` aggregate. Wording corrected to the actual reason.

**No trigger and no `if:` changed.** `git diff` on that file is comment
lines
only — one hunk, `@@ -13,6 +13,9 @@`, entirely inside the `#` header.

## 4. The detector's line counts depended on ambient git config
(unfiled, found by #2833's new assertion)

The first CI run of this branch went red, and the failure is the most
valuable
thing in this PR. The runner reported the `eda5ae5ed` attribution as
**298**
lines where my machine measured **301**:

```
FAIL cc58cbc fires, but NOT as recorded
     recorded attribution:   eda5ae5…  301
     what the detector reported:  eda5ae5…  298
```

Cause: `attribute_file` called bare `git diff --unified=0`, so it
inherited
whatever `diff.algorithm` the caller's config carried. I have
`diff.algorithm = histogram` set globally; CI has nothing set and
therefore uses
git's default `myers`. The algorithm changes which lines a hunk calls
deleted,
so it changes the per-culprit counts this canary **thresholds on**.
Reproduced
directly:

```
$ GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=diff.algorithm GIT_CONFIG_VALUE_0=myers \
    FINDINGS_SINK=… scripts/check-silent-revert.sh --commit cc58cbcbfb66be…  853
eda5ae5…  298      # 301 under histogram
```

Three lines is harmless in itself. The principle is not: the same drift
can
carry a count across the 200-line threshold, so a commit could fire on
one
machine and stay silent on another, and the header's "fires on 5 commits
over
500 — 1%" calibration only ever described one algorithm.

`attribute_file` now pins `--diff-algorithm=myers -M` explicitly, and
the file
enumeration pins `-M` too. **Both are git's defaults, so this does not
change
what CI detects today** — CI already had no `diff.algorithm` set. It
makes a
local run match CI, not the reverse. `-M` covers the same exposure for
rename
detection, which the existing header calls "load-bearing rather than
incidental": `diff.renames = false` in a developer's config would
decompose a
`git mv` into delete + add and make relocating a large recent file fire.

The recorded figure is now **298**, and the prose figures in the script
header
and the corpus are corrected with the refutation attached, so nobody
re-measuring on a histogram machine "corrects" it back to 301.

Worth stating plainly: nothing asked for this. #2833's exact-count
assertion
turned a silent, config-dependent divergence into a red build on its
first run —
which is precisely the argument for asserting attributions instead of
exit
status.

## 5. The test harness could commit the developer's work as `test
<t@t.test>` (unfiled)

Found the hard way while developing this. `mk_repo` is called as
`repo="$(mk_repo)"`, so a `return 1` inside the command substitution
cannot abort
the suite — the caller just gets `""`. And `""` is not inert: `git -C
""` is
documented as a no-op, so the next `add -A` + `commit` staged and
committed my
uncommitted work into the checkout, authored `test <t@t.test>`. Such a
commit
cannot be pushed here — it fails `required_signatures` with `no_user`.

`mk_repo` now yields a path derived from `SELF_DIR` that does not exist,
so every
git call against it fails loudly and the assertions go red —
fail-closed, which
is what a harness that cannot build its fixture should do. Scoped to
this file
only; if the same `repo="$(mk_repo)"` shape exists in sibling harnesses
that is a
separate follow-up.

## Verification

`scripts/check-silent-revert.sh --verify-known-incidents`, run on a
machine with
`diff.algorithm = histogram` set globally — it now agrees with CI
exactly,
because the flags are pinned:

```
ok   f603880 fires as recorded, 1 attribution(s) reproduced exactly  (#2639 dropped #2635 (346 blamed lines), 13 minutes later)
ok   9239f15 fires as recorded, 1 attribution(s) reproduced exactly  (#2641 dropped #2639 (451 blamed lines), 10 minutes later)
ok   cc58cbc fires as recorded, 2 attribution(s) reproduced exactly  (#2633 dropped #2644's rollups (853 blamed lines) and #2642's GraphQL merge evidence (298); already recorded in #2656)
ok   c8470ef stays clean as recorded  (docs(conventions) rewrote 129 lines of a doc #2679 had just added)

Canary reproduces every recorded incident at the shipped settings.
```

Injected failure against the **shipped** corpus (`853` changed to `852`
in a
copy) — the mechanism is proven on real rows, not only on synthetic
fixtures:

```
$ SILENT_REVERT_INCIDENTS=<copy with 298 -> 297> scripts/check-silent-revert.sh --verify-known-incidents
ok   f603880 fires as recorded, 1 attribution(s) reproduced exactly  (...)
ok   9239f15 fires as recorded, 1 attribution(s) reproduced exactly  (...)
FAIL cc58cbc fires, but NOT as recorded  (#2633 dropped #2644's rollups (853 blamed lines) and #2642's GraphQL merge evidence (298); already recorded in #2656)
     recorded attribution:
       bfb66be 853
       eda5ae5 297
     what the detector reported:
       bfb66be 853
       eda5ae5 298
     A row that fires for the wrong reason is not a reproduction.
     Do NOT edit the row to match; find out why the attribution moved.
ok   c8470ef stays clean as recorded  (...)

The canary no longer reproduces the incidents it was built for.
Do not relax the recorded expectations to make this pass.
EXIT=1
```

The commit still fires — exit status alone would have passed this row.
Note the
row is red on a **one-line** discrepancy in one of two attributions,
which is
exactly the regression #2833 describes.

`scripts/check-silent-revert.test.sh`: **49 passed, 0 failed**,
including
`replay fails when the finding is attributed to a different culprit`,
`replay fails when the recorded line count no longer reproduces`, and
`replay fails when one of two recorded attributions stops reproducing`.
So the
assertion is proven by permanent tests, not only by a one-off injection.

## 6. Review follow-up: an unterminated attribution field read as
*absent*

Both automated review lanes independently flagged the same real gap, and
they
were right. A `fires` row whose field opened with `[` but never closed
it failed
the `[[ "$rest" == \[*\]* ]]` glob, so `attribution` stayed empty, the
remainder
became free-text `note`, and the row fell back to passing on exit status
alone —
reintroducing the exact pre-#2833 gap by the one route nobody would look
at, and
contradicting the contract documented directly above it.

A leading `[` now COMMITS the row to carrying an attribution;
unterminated takes
the malformed path. Reproduced against the real corpus with the closing
bracket
stripped from the `f603880da` row:

```
check-silent-revert: unterminated attribution field for f603880… (no closing ']'): [a95f240…=346 #2639 dropped #2635 …
EXIT=2
```

The four malformed shapes already pinned all carried a closing `]`, so
this one
was untested; `[<sha>=40` and a bare `[` are now pinned too. The shipped
corpus
was never at risk — `t_shipped_data_files_are_wellformed`'s regex covers
it —
but that is a separate layer and does not hold for a custom
`SILENT_REVERT_INCIDENTS`.

## 7. Verification follow-up: `git blame` was still ambient-config
dependent

Fresh-context verification of section 4 found that fix was only half of
one.
Pinning the diff flags left `attribute_file`'s `git blame` call bare, so
`blame.ignoreRevsFile` — an ordinary setting in any repo carrying a
bulk-reformat commit — still decided the per-culprit counts the replay
now
asserts on. On the real corpus, with that setting naming `bfb66beb8`:

| culprit | pinned | with `blame.ignoreRevsFile` |
| --- | ---: | ---: |
| `bfb66beb8…` | 853 | **259** |
| `eda5ae5ed…` | 298 | **322** |

On a synthetic fixture it is worse than a wrong number. With the pin
absent and
that config present, the detector reports **no finding at all** on a
genuine
silent revert:

| | clean config | hostile config |
| --- | --- | --- |
| pinned | `culprit 40` | `culprit 40` |
| unpinned | `culprit 40` | **(nothing — the canary goes silent)** |

That is a false green reached through the developer's own gitconfig —
the
precise failure this canary exists to remove.

**The obvious fix does not work, and the comment says so.**
`-c blame.ignoreRevsFile=` does *not* clear it: the documented "an empty
file
name resets the list" applies to the **option**, and the `-c` form was
measured
leaving the hostile value fully in effect (853 → 259 with the reset
supposedly
applied). Only `--no-ignore-revs-file` actually resets. The symmetry
with the
`-c` pins above is wrong here and is deliberately not used.

`t_counts_are_immune_to_ambient_git_config` pins the property: the same
fixture
scanned twice, once under a hostile `GIT_CONFIG_GLOBAL` setting
`blame.ignoreRevsFile`, `diff.algorithm` and `diff.renames`, asserting
identical
exit status and identical per-culprit findings. **Confirmed
discriminating** —
with the blame pin stripped it fails, and it fails because the hostile
run
reports nothing at all.

`shellcheck`, `actionlint`, `typos`, `bash -n` and
`scripts/check-shell-portability.sh` all pass.

## Test plan

Run from a clean checkout of this branch, with `unset GIT_DIR
GIT_WORK_TREE`:

1. `bash scripts/check-silent-revert.test.sh` — the detector's own unit
suite.
Expect **49 passed, 0 failed**. Covers all four `revert:` spellings, the
   four negative subject cases (`feat: do not revert ...`, `reverted:`,
`Revert:`, bare `revert:`), the wrong-culprit / wrong-count / missing-
   attribution replay regressions, all six malformed-field shapes, and
   `t_counts_are_immune_to_ambient_git_config`.
2. `bash scripts/check-silent-revert.sh --verify-known-incidents` — the
real
   corpus. Expect exit 0 with all three `fires` rows reporting
`attribution(s) reproduced exactly` and the `clean` row staying clean.
3. Negative control for step 2: edit
`scripts/silent-revert-incidents.txt` to
inject a wrong culprit sha (leaving the count correct, so the commit
still
   fires) and, separately, a wrong line count. Each must exit **1** with
   `fires, but NOT as recorded`. Restore the file afterwards.
4. Set `diff.algorithm = histogram` in global git config and repeat
steps 1-2.
   The numbers must not move — that is what the new flag pins buy.
5. `git diff origin/main...HEAD --
.github/workflows/silent-revert-canary.yml`
   must show comment-only changes; no executable YAML line may differ.

## Related

- Refs #2808 — the PR that merged the canary and its three intent forms.
- Refs #2832 / #2831 — the corpus-attribution correction this branches
off;
  #2833 was raised in its review.
- Refs #2691 — the original silent-revert audit the corpus is built
from.
- Refs #1839 — the deliberate revert (`1d1fca6e8`) used as the
real-history
  fixture for #2837.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 17, 2026
…alsified

Recording #2642 as a second victim of #2633's squash added a fourth true
finding at 301 lines, and two surviving sentences still described a corpus
that no longer exists:

  check-silent-revert.sh    "340 is the largest false positive and 346 is the
                             smallest true one ... that 2% gap"
  silent-revert-acknowledged.txt
                            "At 340 lines this is the largest measured false
                             positive, six lines below the smallest real
                             incident (346)"

Measured at the shipped settings, the smallest true finding is 301, and BOTH
verified-legitimate fires score above it -- 340 (#2135) and 390 (#2640). The
relationship is inverted, not narrowed: the ranges overlap outright and there
is no gap to split. That strengthens the existing conclusion rather than
changing it, so the threshold stays at 200 and the disposition path stays the
thing that makes the canary livable. Also records that 200 and 300 still fire
on the identical five commits, with the 301 finding surviving 300 by one line.

Separately, #2656 was mischaracterized. It does record the event as a silent
revert -- "#2633 was a stale-base squash that silently reverted two merged
features" -- and it is what it ASKED for, not what it recorded, that was
coverage-shaped. Corrected and quoted.

Comments and fixture note text only. The non-comment body of
check-silent-revert.sh is byte-identical to origin/main, both fixtures' parsed
fields (expect/sha and sha) are unchanged, and 27/27 detector tests plus
--verify-known-incidents pass at the unchanged shipped settings.

Refs: #2831

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 17, 2026
…tector

PR #2843 pinned attribute_file's diff and blame flags to git's own defaults.
Three of the figures the calibration prose quotes move under those pins,
because the original calibration was taken on a machine carrying
diff.algorithm = histogram: #2640 reads 447 rather than 390, #2135 reads 323
rather than 340, and #2642's share of #2633's squash reads 298 rather than 301.
A calibration comment that states a number the shipped detector no longer
produces is the defect this branch exists to fix, so every sentence carrying a
figure was re-measured rather than patched.

The overlap argument survives and is stated more strongly. The smallest true
finding is 298 and both cleared fires score above it, at 323 and 447, so the
populations invert rather than merely abut.

The 200-versus-300 sentence inverted outright and was rewritten from
measurement. It claimed the finding survived a threshold of 300 by a single
line; under the pins that finding is 298 and disappears instead. The commit set
at 200 and 300 is still identical, because cc58cbc keeps its 853-line
finding, but the finding set is not, and running the replay at 300 reports
cc58cbc as firing but not as recorded.

Three further corrections the re-measurement surfaced. The corpus endpoint is
now named as a sha rather than written as "the last 500 first-parent commits",
which is a moving window that falsifies itself on the next merge. Detection and
disposition are now distinguished: five commits cross the threshold but two are
cleared by the acknowledgment file, so a reader sees three. And the two recall
gaps are acknowledged rather than implied, so the corpus figures read as floors
by construction: attribute_file swallows git's stderr (#2880), and paths marked
-diff or binary in .gitattributes contribute nothing (#2883).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwdkpWf6bptu3AqTMoeg2H
kyle-sexton added a commit that referenced this pull request Aug 17, 2026
…tor's counts (#2847)

Closes #2846.

## Summary

The calibration comments in `scripts/check-silent-revert.sh` carry the
argument that
justifies the 200-line threshold. Two of their sentences depended on
which finding is
the smallest, and #2832 had already falsified both by recording a fourth
true finding.
This PR repairs them — and re-derives every figure they rest on against
the detector as
PR #2843 pins it, because three of those figures move under the pins.

Found by fresh-context verification of #2832, after it had merged.

## Why the numbers moved

PR #2843 pins `attribute_file`'s git invocations to git's own defaults

(`--diff-algorithm=myers`, `--no-ext-diff`, `--no-textconv`,
`--no-ignore-revs-file`,
`-M`). The original calibration was taken on a machine carrying
`diff.algorithm = histogram`, and the algorithm choice changes which
lines a hunk calls
deleted. Every figure below was re-measured against the pinned detector
and reproduced
byte-identically with `GIT_CONFIG_GLOBAL` emptied, which is the property
`t_counts_are_immune_to_ambient_git_config` asserts.

| commit | PR | pre-pin | pinned | class |
| --- | --- | ---: | ---: | --- |
| `cc58cbc53` | #2633 | 853 | **853** | incident |
| `cc58cbc53` | #2633 (#2642's share) | 301 | **298** | incident |
| `9239f1541` | #2641 | 451 | **451** | incident |
| `f603880da` | #2639 | 346 | **346** | incident |
| `6f0a31109` | #2640 | 390 | **447** | cleared |
| `91e77fc16` | #2135 | 340 | **323** | cleared |

## Fix

**The overlap argument survives; every sentence stating it was
re-derived.** The
smallest true finding is 298 and both cleared fires score above it, at
323 and 447. The
relationship is an inversion, not a narrow gap — so `NO THRESHOLD
SEPARATES THEM` is
now true by a wider margin than the six-line version it replaces.
THRESHOLD stays 200.

**The 200-vs-300 sentence inverted and was rewritten from measurement,
not patched.**
The old text said "at 300 the 301-line finding survives by a single
line". Under the
pins that finding is 298, so at 300 it VANISHES. The COMMIT set at 200
and 300 is still
identical — `cc58cbc53` keeps its 853-line finding — but the FINDING set
is not, and
that is the sharper argument against tuning. Measured:

```
$ SILENT_REVERT_THRESHOLD=300 scripts/check-silent-revert.sh --verify-known-incidents
FAIL cc58cbc fires, but NOT as recorded
     recorded attribution:
       bfb66be 853
       eda5ae5 298
     what the detector reported:
       bfb66be 853
EXIT=1
```

Without #2833's attribution expectations that row would have passed on
the surviving
853-line finding and announced a reproduction it never performed. The
passage now says
that, and cites `t_replay_asserts_the_recorded_attribution`, which pins
the same
two-culprit shape.

**Detection and disposition are now distinguished.** The corpus sentence
said the canary
"fires on 5 commits" and left a reader to assume that is what CI shows.
It is not:
`6f0a31109` and `91e77fc16` are in
`scripts/silent-revert-acknowledged.txt`, so
`scan_commit` clears each before it attributes a line. Five commits
cross the threshold;
three print `SILENT REVERT SUSPECTED`. The prose now states both and
says which one the
threshold is calibrated against.

**The corpus endpoint is pinned.** "the last 500 first-parent commits of
main" is a
moving window that falsifies itself on the next merge — the same defect
class this PR
closes. It now reads "the 500 first-parent commits of main ending at
`738791c45`".

**Two recall gaps are acknowledged rather than implied.**

- `attribute_file` swallows `git` stderr on both commands that produce a
count, so a
failed diff or blame is indistinguishable from nothing-to-attribute and
can only
subtract. Every corpus enumeration is therefore a floor, and the prose
is worded so
  the caveat is structural rather than an appended qualifier (#2880).
- Paths the repository's `.gitattributes` marks `-diff` or `binary`
produce no hunks, so
their deletions attribute to zero on every machine including CI (#2883).
This is a
RECALL gap, not a calibration one: no path of that class appears in any
commit whose
figure is quoted, and the largest such deletion anywhere in the sweep
was 72 lines
  from a `package-lock.json` — well under the threshold.

**Also corrects a mischaracterization of #2656** that #2832 introduced,
which said that
issue recorded the event "rather than as a silent revert". Its Evidence
section opens
with *"#2633 was a stale-base squash that silently reverted two merged
features."* It
recorded it exactly as a silent revert — what was coverage-shaped was
what it **asked
for**. Now quoted rather than paraphrased.

## Not fixed here

The fresh-context verifier confirmed each of these; every one sits in
prose this PR does
not own, and each needs a rewording rather than a renumber.

- **"main's 1527-commit history"** (twice). Reproduces at no named
endpoint — measured
1546 at `738791c45`, 1549 at `origin/main`. The claims it supports are
unaffected and
do reproduce: `Revert "` = 0, `revert:` = 1, that one being `1d1fca6e8`
(#1839).
Renumbering it would be falsified by the next merge, which is the same
moving-window
  defect this PR removes elsewhere.
- **"the replay exited 0 for 31h28m"**. The duration reproduces exactly,
but it is the
content-absence window; the replay itself only existed for about 6h13m
of it. #2873's
prose, and the same conflation appears once in
`silent-revert-incidents.txt`.
- **"a four-row corpus"**. There are 5 `marker` rows, and 3 `fires` + 1
`clean`
expectation rows; the sentence's own unit is one read per marker, so 5.
#2873's prose.
- **The repo-wide-grep counterfactual.** Its present-tense half holds,
but at the tree
where both markers were actually missing, a repo-wide grep would have
falsely cleared
only the README half — the CHANGELOG copy that makes the claim true
today was added by
  the restore commit itself. #2873's prose.
- **The `clean` row's "129 lines"** reads 136 under the pins. Issue
#2865 owns that row;
  correcting it here would collide.

## Related

- PR #2843 — merged ahead of this one; it added the pins that move three
of the figures
here, and its pin table records the pre-pin and pinned columns side by
side. This PR
  layers prose on top of it and changes no pin.
- PR #2873 — merged ahead of both; added the restoration markers and the
`marker) continue ;;` arm. Untouched here and verified intact after the
rebase.
- Refs #2880 — `attribute_file` swallows git stderr, which is why the
corpus figures are
worded as floors rather than exact counts. Acknowledged here, not fixed.
- Refs #2883 — paths marked `-diff` or `binary` contribute zero to
attribution.
  Acknowledged here as a recall gap, not fixed.
- Refs #2865 — owns the `clean` row whose "129 lines" reads 136 under
the pins.
  Deliberately left to that lane.
- Refs #2832 — the corpus attribution correction that added the fourth
finding and
  falsified the two sentences this PR repairs.

## Verification

- Every figure re-measured against the shipped detector on this branch,
twice — once
inheriting ambient config and once with `GIT_CONFIG_GLOBAL` emptied —
with identical
  results.
- `scripts/check-silent-revert.test.sh` (101 passed, 0 failed) and both
replay modes run
  green against the merged content.
- An independent fresh-context verifier re-measured every number in the
calibration
comments without access to this reasoning, running the full 500-commit
corpus sweep
rather than per-commit checks alone. Every figure this PR states
reproduced. It raised
two defects in the new prose, both fixed here: "the number a reader sees
in CI is 3"
read as findings when it means commits (three commits, four findings
between them),
and "roughly once a month" was 12-19x off — the corpus spans 7.9 days
with four of its
five crossings inside 76 minutes, so that rate claim was removed rather
than
renumbered, because the corpus measures a burst and no per-month figure
is defensible
from it. Its full verdict, including drift it confirmed in prose this PR
does not own,
  is recorded in the PR comments.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

repo-fleet-hygiene: a bare repository with a live working tree is rejected before classification and appears nowhere in the report

1 participant