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
Fail Closed When the Write Guard's @{push} Read Times Out or Cannot Run #3036
Found by the local review of the change that answers a Copilot finding on #3030. That change makes a failed git remote read in _read_branch answer unresolved, so a bare push fails closed when the guard cannot read the remote names. The @{push} read just before it still treats its own failure as "no push target", and develop's guard shares this shape.
A Failed @{push} Read Falls Back to the Local Branch Name
_current_push_branch reads rev-parse --symbolic-full-name @{push} first and rev-parse --abbrev-ref HEAD second. _git_stdout answers None alike for a non-zero exit, a timeout, and a command that could not run, so _read_branch cannot tell "this branch has no push target" from "the read failed". In each case it moves on to the HEAD read.
A constructed case: push.default=upstream, with feature/two tracking refs/remotes/up/stream/develop. Where the @{push} read times out or raises and the HEAD read then succeeds, the guard reads the targets as feature/two and two and allows the push, while git writes develop.
#3019 covers the same fallback when @{push} exits non-zero because the destination is not stored as a remote-tracking branch. This issue covers the read failing for any other reason.
Possible Direction
Have _git_stdout, or a variant of it, tell a non-zero exit apart from a timeout or a failure to run, and make the second answer unresolved in _read_branch. Where #3019 moves the read onto branch configuration, the same distinction applies to those reads.
Activity
Fail Closed When the Write Guard Cannot Read the Remote Names (#3037)
ptr727 commentedon Oct 15, 2026
Claimed for an engineering-track lane (handoff #3040 resume). Branch:
feature/guard-bare-push-target-3019. Predicted file set:host-setup/agent-safety/claude/gh-write-guard.py,host-setup/agent-safety/claude/test_install.py,host-setup/agent-safety/README.md,host-setup/agent-safety/claude/README.md.Read a Bare Push's Destination From Branch Config, a Persisted Mirror…