You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read Commit and Clean Short-Option Clusters Only Up to a Value-Taking Letter in the Write Guard #3783
Found by the local strict review of the fix for #3720, on code that change did not touch. Both are in host-setup/agent-safety/claude/gh-write-guard.py, and both are the class #3720 fixed in _push_targets: a short-option cluster read past its first value-taking letter.
_skips_hooks, commit (requirement 4).i += a[-1] in "mFcCt" consumes the next word whenever the cluster's last letter takes a value, even when the value is attached. So git commit -mtest --no-verify skips --no-verify as the message's value, and _skips_hooks("commit", ["-mtest", "--no-verify"]) returns False. -mwip --no-verify returns True. Any attached message ending in m, F, c, C, or t bypasses the explicit-bypass check, -n as well as --no-verify. The next word should be consumed only when the value-taking letter is the last character of the word.
_primary_checkout_verdict, clean (requirement 6).git clean takes a value through -e <pattern>, but the reader looks for n or f anywhere in an all-letter cluster. So git clean -fen reads n as a dry run although git reads it as force with exclude n. git clean -fe.env is not all letters, so its f is missed. Each is allowed in a primary checkout, and each deletes untracked files. The attached -e form is rare.
The review also raised the design point that the guard now reads short clusters three different ways. One helper returning the flags before the first value-taking letter, and whether the next word is consumed, would serve _push_targets, _skips_hooks, and the clean reader. #3720 fixed only _push_targets, since that was the approved scope.
Self-test rows for -mtest --no-verify, -mtest -n, clean -fen, and clean -fe.env would pin it.
A further site of the same class, raised by the next local pass on #3720: the git branch rename check (re.fullmatch(r"-[A-Za-z]*[mM][A-Za-z]*|--mo.*", a), in the branch-switch reader) reads an m inside an attached -u value as -m. So git branch -umain && git push is read as a command that may switch the branch. That only denies more, so it is no bypass, but the shared helper should cover this site too.
This fix edits host-setup/agent-safety/, so the design needs the maintainer's approval before an attended run implements it. What design should replace the guard's three or four short-option-cluster readers, so a commit, clean, and branch cluster is read only up to its first value-taking letter?
Options, recommended first:
(Recommended) One shared helper, extended to separated values. A helper taking a word, its value-taking letters, and its optional-value letters returns the flags before the first value letter, and whether the next word is consumed (only when that letter ends the word). _push_targets, _skips_hooks, the clean reader, and the git branch rename check all call it. The clean reader also skips the word after -e and --exclude, because the separated forms clean -f -e -n and clean -f --exclude -n are read as dry runs while git takes -n as the exclude pattern, a gap the issue does not list. It replaces inline readers rather than adding one, against a 2208-line guard and a 2500-line ceiling.
Fail closed on clean plus the commit patch. In a primary checkout, deny any clean carrying -e, --exclude, or an e in a short cluster, and give _skips_hooks the one-line fix. Nothing to parse for the rare exclude form, and the remedy is a worktree. It over-denies a dry run with an exclude pattern and leaves the readers divergent.
Evidence:#3783 (comment); host-setup/agent-safety/claude/gh-write-guard.py on develop 23c7d78: :854-856 (_push_targets, fixed by #3784), :976-991 (_skips_hooks), :1022-1023 (branch rename), :1143-1147 (clean reader); #3784 body (2208 lines against tests/test_guard_size.pyMAX_LINES = 2500); host-setup/agent-safety/README.md:39,43. Constructed cases against the develop guard functions: _skips_hooks("commit", ["-mtest", "--no-verify"]) returns False, and the primary-checkout verdict allows clean -fen, -fe.env, -f -e -n, and -f --exclude -n, each of which deletes untracked files in a fresh repository.
Blocks: none. Merging the resulting PR still waits on the maintainer's go-ahead after reading its diff.
Maintainer answer (2026-11-02, via decision triage): approves the design "one shared helper, extended to separated values".
One helper taking a word, its value-taking letters, and its optional-value letters returns the flags before the first value letter and whether the next word is consumed. _push_targets, _skips_hooks, the clean reader, and the git branch rename check all call it, and the clean reader also skips the word after -e and --exclude. This approval covers the design, so an attended run may implement it and drive its pull request. Merging that pull request still waits on the maintainer's go-ahead after reading its diff, and an away-mode run holds it.
Released (2026-11-10): PR #4032 merged into develop at 4673434 on the maintainer's go-ahead, and its branch and worktree are removed, so this claim holds no files.
Backlog burndown claim (attended run 2026-11-10, round 1, group G2). Branch: burndown/1172-agent-safety-launcher-and-clusters. Issues: #1172, #3783.
Predicted file set:
host-setup/agent-safety/claude/install.py
host-setup/agent-safety/claude/install.sh
host-setup/agent-safety/claude/test_install.py
host-setup/agent-safety/claude/README.md
host-setup/agent-safety/README.md
host-setup/agent-safety/ guard files including gh-write-guard.py
tests/test_guard_size.py
No other group may edit these files while this claim stands. The orchestrator releases it at cleanup.
Stopped for the maintainer (burndown round 1, 2026-11-10). PR #4032 carries this fix, at head 6818c267.
Waiting on the maintainer: the merge go-ahead, given after reading the diff, since the change is under host-setup/agent-safety/. The run's merge grant does not reach it.
Review state: three recorded local strict-review passes, the last with no findings. Copilot's four findings were answered with evidence and resolved, and no thread is open.
Activity
ptr727 commentedon Nov 1, 2026
A further site of the same class, raised by the next local pass on #3720: the
git branchrename check (re.fullmatch(r"-[A-Za-z]*[mM][A-Za-z]*|--mo.*", a), in the branch-switch reader) reads anminside an attached-uvalue as-m. Sogit branch -umain && git pushis read as a command that may switch the branch. That only denies more, so it is no bypass, but the shared helper should cover this site too.Read a Push Option Attached to -o as Its Value in the Write Guard (#3784
ptr727 commentedon Nov 2, 2026
Decision triage: researched question
This fix edits
host-setup/agent-safety/, so the design needs the maintainer's approval before an attended run implements it. What design should replace the guard's three or four short-option-cluster readers, so acommit,clean, andbranchcluster is read only up to its first value-taking letter?Options, recommended first:
_push_targets,_skips_hooks, thecleanreader, and thegit branchrename check all call it. Thecleanreader also skips the word after-eand--exclude, because the separated formsclean -f -e -nandclean -f --exclude -nare read as dry runs while git takes-nas the exclude pattern, a gap the issue does not list. It replaces inline readers rather than adding one, against a 2208-line guard and a 2500-line ceiling._skips_hooksconsume the next word only when the breaking letter ends the word, and make thecleanreader stop ateand skip the value after-eand--exclude. Leave the branch site, since it only over-denies. Smallest diff, but it keeps four readers, which is how Read a Push Option Attached to -o as Its Value in the Write Guard #3720 and then Read Commit and Clean Short-Option Clusters Only Up to a Value-Taking Letter in the Write Guard #3783 were each found by successive review passes.cleanplus the commit patch. In a primary checkout, deny anycleancarrying-e,--exclude, or anein a short cluster, and give_skips_hooksthe one-line fix. Nothing to parse for the rare exclude form, and the remedy is a worktree. It over-denies a dry run with an exclude pattern and leaves the readers divergent.Evidence: #3783 (comment);
host-setup/agent-safety/claude/gh-write-guard.pyon develop 23c7d78::854-856(_push_targets, fixed by #3784),:976-991(_skips_hooks),:1022-1023(branch rename),:1143-1147(cleanreader); #3784 body (2208 lines againsttests/test_guard_size.pyMAX_LINES = 2500);host-setup/agent-safety/README.md:39,43. Constructed cases against the develop guard functions:_skips_hooks("commit", ["-mtest", "--no-verify"])returns False, and the primary-checkout verdict allowsclean -fen,-fe.env,-f -e -n, and-f --exclude -n, each of which deletes untracked files in a fresh repository.Blocks: none. Merging the resulting PR still waits on the maintainer's go-ahead after reading its diff.
ptr727 commentedon Nov 2, 2026
Maintainer answer (2026-11-02, via decision triage): approves the design "one shared helper, extended to separated values".
One helper taking a word, its value-taking letters, and its optional-value letters returns the flags before the first value letter and whether the next word is consumed.
_push_targets,_skips_hooks, thecleanreader, and thegit branchrename check all call it, and thecleanreader also skips the word after-eand--exclude. This approval covers the design, so an attended run may implement it and drive its pull request. Merging that pull request still waits on the maintainer's go-ahead after reading its diff, and an away-mode run holds it.ptr727 commentedon Nov 10, 2026
Released (2026-11-10): PR #4032 merged into
developat 4673434 on the maintainer's go-ahead, and its branch and worktree are removed, so this claim holds no files.Backlog burndown claim (attended run 2026-11-10, round 1, group G2). Branch:
burndown/1172-agent-safety-launcher-and-clusters. Issues: #1172, #3783.Predicted file set:
host-setup/agent-safety/claude/install.pyhost-setup/agent-safety/claude/install.shhost-setup/agent-safety/claude/test_install.pyhost-setup/agent-safety/claude/README.mdhost-setup/agent-safety/README.mdhost-setup/agent-safety/guard files includinggh-write-guard.pytests/test_guard_size.pyNo other group may edit these files while this claim stands. The orchestrator releases it at cleanup.
ptr727 commentedon Nov 10, 2026
Stopped for the maintainer (burndown round 1, 2026-11-10). PR #4032 carries this fix, at head
6818c267.host-setup/agent-safety/. The run's merge grant does not reach it.Run the Hook Launcher Before Trusting It and Read Short-Option Cluste…