Repository navigation
Description
Summary
plugins/guardrails/hooks/stale-path-verify.test.sh carries a comment that states the opposite of
the shipped behaviour, and the opposite of the test case sitting 9 lines below it.
The hook exempts both skip-worktree spellings
(plugins/guardrails/hooks/stale-path-verify.sh:395):
[[ "$ls_tag" == [Ss] ]] && continuels-files -v lowercases the tag letter when the assume-unchanged bit is also set, so a
skip-worktree entry can be tagged S or s; both carry the skip-worktree bit and both are
exempt. That is exactly what the plugin CHANGELOG says (plugins/guardrails/CHANGELOG.md, 0.17.2):
ls-files -vtags a sparse entryS— lowercaseswhen the assume-unchanged bit is also set
[...] Only the skip-worktree letter, in either case, is exempted
But stale-path-verify.test.sh:419 says:
# skip-worktree; only `S` earns the exemption, and this case pins that.
That claim is false in two ways:
- It contradicts the shipped
[Ss]comparison — lowercasesis exempt too. - It contradicts the very next test in the same file (
:428-438), whose own comment reads "an
exact-uppercase comparison would misread the combination as a genuine deletion" and whose
assertion isassert_silent "lowercase s still carries the skip-worktree exemption → silent".
The comment reads as residue from before the [Ss] widening landed. The tests are correct and
green — only the prose is wrong.
Impact
No behavioural defect; the gate does the right thing. The cost is that a future reader (or agent)
auditing this hook is told by an in-file comment that the exemption is uppercase-only, which is the
precise misreading the [Ss] fix exists to prevent — and comment-vs-code contradictions in a
security-adjacent guard are how a correct fix gets "corrected" back out.
Suggested fix
Reword :419 to state what the comparison actually does — the exemption is the skip-worktree bit in
either letter case, and what this case pins is that assume-unchanged alone (h) does not earn
it. One-line prose change; no code or test change.
Repro
$ grep -n '\[Ss\]' plugins/guardrails/hooks/stale-path-verify.sh
395: [[ "$ls_tag" == [Ss] ]] && continue
$ sed -n '419p;438p' plugins/guardrails/hooks/stale-path-verify.test.sh
# skip-worktree; only `S` earns the exemption, and this case pins that.
assert_silent "lowercase s still carries the skip-worktree exemption → silent" "$OUT"Verified against origin/main at 403873d0.
Related
- fix(guardrails): bound stale-path reconstruction and narrow its sparse exemption #1541 (narrowed the sparse exemption to the skip-worktree bit; introduced the
[Ss]comparison) - guardrails: stale-path-verify's sparse-checkout exemption also suppresses unstaged deletions #1509 (the acceptance text the stale comment cites)
- feat(guardrails): rescope the withdrawn path guard onto a provenance gate #1432 (where both findings were originally raised in review)
Filed from a concurrent PR-drain sweep; found while checking whether any statement on main
contradicts the shipped [Ss] behaviour. The CHANGELOG does not — this test comment does.
Activity
kyle-sexton commentedon Jul 26, 2026
Triage: verified → briefed, delegable
Category: Bug (prose contradicts shipped behavior). No behavioral defect; the gate is correct
and its tests are green.
Verification — REPRODUCED this pass, not accepted on report. Ran the two commands from the
item's repro block against the working tree. Both confirm exactly as filed:
so both skip-worktree spellings are exempt.
earns the exemption.
tag still carries the skip-worktree exemption and stays silent.
So the contradiction is three-way and real: comment versus shipped comparison, and comment versus
the neighbouring assertion in its own file. The plugin changelog entry that introduced the widening
states the correct behavior ("in either case"), which corroborates the reading that the comment is
residue predating the widening.
Redundancy check. Searched the guard, its test file, and the plugin changelog for any other
statement asserting an uppercase-only exemption: this one comment is the sole contradicting
statement on the branch. Nothing has already fixed it. No
docs/out-of-scope/ledger in this repo.Why delegable — no open decision. The correct behavior is already shipped, already tested, and
already documented correctly in the changelog. Only the prose is wrong, and what it should say is
determined by the code rather than chosen. There is no fork for a maintainer to resolve.
Brief
Behavioral contract. No statement in the stale-path-verify surface may assert that the
skip-worktree exemption is uppercase-only.
Acceptance:
skip-worktree bit in either letter case.
alone does not earn the exemption. That is the distinction the case exists to protect, and
the current wording obscures it.
Why it is worth the pass despite zero behavioral impact. A comment contradicting the code inside
a security-adjacent guard is the exact misreading the widening exists to prevent, and is the
mechanism by which a correct fix gets "corrected" back out by a future reader or agent auditing the
hook.
Durability note. The site is named by symbol and by role rather than by line number, per the
brief contract; the item body carries the exact lines.
Labels applied:
priority: medium— the assessed default. Held there rather than lower becausethe cost is a future incorrect "fix" to a security-adjacent guard, and not raised because nothing is
blocked and no behavior is wrong today. Raw marker cleared.
kyle-sexton commentedon Jul 26, 2026
This was generated by AI during triage.
Admission gate: carries
agent-readybut nowork-class:label and no body-recorded class trailer — unclassified → fail-closed human-gated per the work-loop lane's admission table. Routed to human-gated; not dispatched.fix(guardrails): align stale-path-verify test comment with [Ss] exemp…
fix(guardrails): align stale-path-verify test comment with [Ss] exemp…
fix(guardrails): align stale-path-verify test comment with [Ss] exemp…
docs(guardrails): name 0.27.0, not 0.26.0, as the release that made b…
docs(guardrails): name 0.27.0, not 0.26.0, as the release that made b…
docs(guardrails): name 0.27.0, not 0.26.0, as the release that made b…