Repository navigation
Description
Problem
guardrails 4.0.0 removed the reference-verify pre-push git-hook entry (#18205, commit c4c251a),
because it ran far over the 3 s push budget. A clone that installed it with an earlier
/guardrails:setup apply install-git-hooks keeps running the old copy at every push until someone
removes it by hand, and nothing in the plugin tells the operator it is there:
plugins/guardrails/CHANGELOG.md(4.0.0, Removed) andplugins/guardrails/README.md(end of
### Git hooks) give manual removal steps only.plugins/guardrails/skills/setup/SKILL.md:179-187says "verifyno longer lists a copy an
earlier release installed, so look for one" and leaves the search to the agent's own reading.plugins/guardrails/retirements.yamlholds onlyguardrails-r001toguardrails-r004(the
retiredinstall-commit-msgandinstall-pre-commit-contenthooks). Thecheck-retirements.sh
detection that setupcheckruns (SKILL.md:101) therefore cannot see this entry's leftovers.lib/git-hooks/install.mjsdetects drift for current entries only:copyStatereturnsstale
(install.mjs:660-675) anddriftLineprints
guardrails: git hook <entry> stale; run /guardrails:setup apply install-git-hooks
(install.mjs:1617-1625). Leftover detection (leftoverSources,install.mjs:1428-1455) covers
onlyearlierNamesandearlierEntries. AnearlierEntriesrule cannot record a removal with no
successor, sinceearlierEntryErrorsrequires a non-emptytonaming current entries
(install.mjs:309-318).- The documented removal list names only the marker, the
reference-verify.shcopy, lefthook jobs,
a husky line and the shared.githookscopy. It omits the eight assets the entry copied beside
its script. Before c4c251a,git-hooks/entries.jsonlisted them forreference-verify:
hooks/run-guards.sh,hooks/abort-boundary.sh,hooks/hook-utils.sh,
hooks/cli-flag-verify.sh,hooks/skill-reference-verify.sh,hooks/stale-path-verify.sh,
lib/verification/verify-cli-flag.sh,lib/verification/cli-flag-cache.sh. No current entry
lists any of them (git-hooks/entries.jsonon main).
This is the mechanism that hit the reporting clone. That clone, on Windows Git Bash, ran a local
plain-hooks copy (checks-dispatcher v1, markers pre-push.d/guardrails.reference-verify and
guardrails.pre-push-content) whose reference-verify.sh was dated 2026-11-04, older than the
installed plugin. One push took about 5.5 minutes in reference-verify.sh. A later push over SSH
failed when GitHub closed the connection while the hook was still running (exit 141, SIGPIPE), and
the retry went over HTTPS.
Evidence
Verified this pass on origin/main (guardrails 4.0.0):
git log origin/main -- plugins/guardrailssince 2026-11-10. The relevant work:
perf(guardrails): start reference-verify ranges at the nearest pushed ref so stacked branches skip re-verifying #10829 (7e6187b)nearest_pushed_base, so a stacked branch skips its pushed parent;
perf(guardrails): skip pushed lines from merged branches in reference-verify #16398 (e03d210)pushed_merge_basesandnarrow_to_branch, which drop lines a merged,
already-pushed branch brings in (git-hooks/reference-verify.sh:165-220);
feat(source-control)!: run one quick changed-files check before a PR opens and cap git hooks at 3 s #18205 (c4c251a) removes the entry from pre-push and adds--base <ref>for the pre-PR check
and CI.- Read
retirements.yaml,lib/git-hooks/install.mjs(lines cited above),
skills/setup/SKILL.md:90-148,172-190, and the README### Git hookssection. git show c4c251a1d5^:plugins/guardrails/git-hooks/entries.jsongives the asset list above.- Read-only listing of the reporting clone's hooks directory (no hook run). The
pre-push.d/guardrails.reference-verifymarker andguardrails/reference-verify.share already
gone, so that clone no longer runs the check. All eight retired assets are still there under
guardrails/(run-guards.sh,hook-utils.sh,abort-boundary.sh, the three verifiers,
verify-cli-flag.sh,cli-flag-cache.sh). This confirms the documented removal list leaves
orphans. - Searched issues (open and closed) for retired-entry leftover detection. No duplicate.
Did not reproduce: the push timing and the SSH failure. Both are the reporting session's single
observation, not re-measured. The item's question of whether the old copy already narrowed merges
is moot for this issue: 4.0.0 runs no reference-verify at push at all.
Proposed approach
Give a removed entry a manifest record, so detection and cleanup run through the paths setup
already has.
- Preferred: add retirement records to
plugins/guardrails/retirements.yaml(append-only; next ids
guardrails-r005onward, perdocs/contracts/retired-conventions/README.md):kind: file,.git/hooks/pre-push.d/guardrails.reference-verify,action: delete, with a
content_matchthat matches the marker text the old installer wrote.kind: file,.git/hooks/guardrails/reference-verify.sh,action: delete,content_match
on a stable line of the old script header.- One
kind: filerecord per orphaned asset under.git/hooks/guardrails/,action: delete,
each with acontent_match. Only assets no current entry ships qualify, and today that is all
eight. .githooks/guardrails/reference-verify.sh(shared scope) and the sharedpre-push.dmarker
askind: filerecords.- A
guardrails-reference-verifyjob inlefthook.ymlorlefthook-local.ymlas a
kind: blockrecord if the block kind fits the job's shape (harness-ops: retirement clean for r002/r003 deletes the whole harness-ops.yaml #14251 added it). Otherwise leave
the lefthook job to the SKILL.md prose and say so in the record'snote.
Setupcheckthen reports them, and bareapplycleans each one on the operator's yes.
- Alternative: extend
entries.jsonwith aretiredEntrieslist (name, event, script, assets),
and haveinstall.mjsleftovers()report a marker, copy or job for a retired entry as a
superseded-style drift row. That gives a session-start drift line too, but it adds a new
manifest field and validator to the shared installer, which other plugins vendor. Choose it only
if the retirement manifest cannot express hooks-path-relative files (see gotchas). - Update
skills/setup/SKILL.md:179-187, the README### Git hookstail and the 4.0.0 removal
text: name the detection, and list the eight assets in the manual steps.
Refresh vs removal: for a current entry, a stale copy is refreshed with
/guardrails:setup apply install-git-hooks (the command driftLine prints). For the retired
reference-verify entry there is nothing to refresh; the fix is removal, which this issue makes
detectable.
Files: plugins/guardrails/retirements.yaml, plugins/guardrails/git-hooks/retired-installs.test.sh
(or a new sibling test), plugins/guardrails/skills/setup/SKILL.md, plugins/guardrails/README.md,
plugins/guardrails/CHANGELOG.md, the plugin manifest version.
Acceptance criteria
- In a throwaway repository with a 3.x-style local install of
reference-verify(marker, script
and the eight assets under.git/hooks/guardrails/),check-retirements.sh --manifest retirements.yamlreports every one of those files, and nothing for a clone with only the
current entries installed. -
--clean <id>removes exactly that record's file. The current entries' files (dispatcher,
guardrails.pre-push-contentmarker,pre-push-content.sh,content-scan.sh, pattern
libraries,check-lib.sh) are untouched, and the next push still runspre-push-content. - A file at a recorded path whose content does not match
content_match(a user's own) is not
reported or removed. - The same detection works in a linked worktree and when
core.hooksPathpoints at
.githooks(shared scope), or the records say which they do not cover and SKILL.md keeps
the manual step for that case. - SKILL.md, the README and the CHANGELOG name the detection and list all eight assets in the
manual removal steps. - The test suite for the changed files passes on Linux and in Windows CI.
Constraints and gotchas
- Retirement ids are append-only and never reused.
check-retirements.shskipskind: filerecords when the root is$HOMEor not a git work
tree (CHANGELOG, fix(lib): check-retirements reads the user-global .claude layer as a retired file at a home or non-repository root #13504). Check how it resolves.git/hooks/...in a linked worktree and under
core.hooksPath;lib/check-retirements-worktree.test.shand
plugins/harness-config/lib/check-retirements.test.shcover the existing cases.check-retirements.sh
is a shared copy synced across plugins, so a change to it is a cross-plugin sync, not a local edit.- Test fixtures must be throwaway repositories under
mktemp -dwith the host git config
isolated (GIT_CONFIG_GLOBAL,GIT_CONFIG_NOSYSTEM), asretired-installs.test.shdoes. Never
point a test at a real clone. hook-utils.sh,run-guards.shandabort-boundary.share also plugin hook files under
plugins/guardrails/hooks/. The records target only the copies under a clone's git hooks
directory.- Version bump and CHANGELOG entry per the repository's release rules.
Context
Source: local handoff item 20261119-213200-guardrails-reference-verify-push-cost.md (retired into
this issue and #18577). Related:
#18205 and #18209 (entry removed from pre-push), #17985 (Windows pre-push timing, 44-67 s for the
remote reference-verify), #16398 and #16389 (merged-branch narrowing), #9861 (earlier 8-17 min
stacked-branch pushes).
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity
github-actions commentedon Nov 23, 2026
Size: Medium
Complexity: Medium
Uncertainty: Knowable
Flags: none
Blocked by: none
Blast radius: guardrails plugin retirements.yaml, its tests, setup SKILL.md, README and CHANGELOG, plus a version bump; read by operators running setup
checkandapply.Reversible: yes; revert the change. Files already deleted from a clone by an operator's
applyare not restored.Open questions: none
I understood this as a request to make guardrails detect and clean what the retired
reference-verifypre-push entry left in a clone. The issue picks the retirement-records approach and gives acceptance criteria. Theentries.jsonretiredEntriesalternative is named only as a fallback if the manifest cannot express the paths, so I treated it as settled. The check for howcheck-retirements.shresolves linked worktrees andcore.hooksPathis part of the work. I found no duplicate among the open issues. #18205 is the merged change that removed the entry. It does not add this detection.Automated triage. A maintainer reviews it.
melodic-automation-lanes commentedon Nov 23, 2026
{"v":1,"actor_id":337595936,"title_sha256":"c7368710ed3f0a1057bbef60d79d3446e27534c86f31e39a3abbc56a79efbc48","body_sha256":"1ad02b43eefc260acfb21c6ab8cd10d82ae2510112c2a8e89175002035f8a1ed"}
melodic-automation-lanes commentedon Nov 23, 2026
This records a re-fire of an earlier stop, not a new one. The start gate stopped run 45278169359, the work-resolve-issue run that
agent-readystarted, before any model turn, because the GITHUB_TOKEN budget was under its start-gate share, or the window was projected to have under its start-project share of the header's limit left by the run's expected end (github-token start-gate, start-project and start-run-minutes in rate-limits.json; the run's start-gate notice names which); that run ended at 2026-11-23T22:33:41Z. work-unblock has now removed and addedagent-readyback to start a fresh run. A budget stop is the lanes' load, not a fault in this issue: it never counts toward limits.limit-stops-per-issue or thekill-switchwait.github-actions commentedon Nov 23, 2026