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
End the Write Guard's Allexport Reading at an Unconditional set +a #3395
agentsAgents instructionsgateA rule with no mechanical check, or a check that misses a shapeintroducedReview finding classed introduced per local-strict-review Disposing of Findings
The write guard's _export_events keeps allexport on once a set -a or set -o allexport has been read, so a later set +a does not end it. Constructed case: in set -a; set +a; GIT_CONFIG_COUNT=1; GIT_CONFIG_KEY_0=core.hooksPath; GIT_CONFIG_VALUE_0=/example/hooks; git commit -m msg, the config assignments are not exported, yet the guard reads them as exported and denies. origin/main allows it. The reading is conservative: it fails closed.
A first attempt to model the off switch (apply each set flag in order) allowed what develop denies, so it was dropped. Review of that attempt found these must stay denied: a set +a inside a function never called, a subshell, a pipeline, a background job, a branch (if false; then set +a; fi, false && set +a), a loop or function rerun that runs a set -a again, and words after -- or the first non-option word, which set does not read as options. A cluster holding o such as -eo allexport or -ao pipefail must still turn it on.
Fix direction: honor +a and +o allexport only for a top-level unconditional set with no subshell, pipeline, background, function, or loop around it, and only where _reruns is false. Add the denied shapes above as self-test cases beside the allow control.
Introduced by the allexport reading in the write guard, found by Copilot on promotion pull request 3393.
Closed as out of the write guard's scope under the maintainer's decision (ptr727, 2026-10-23) on #3391, item 1. The guard bounds a good-faith agent's mistake rather than an adversary, so a parse gap reached only by a command shape no agent plausibly types in a coding session is closed rather than fixed, and the guard's own growth is a cost each later review pays again. The scope statement lands in the guard's docstring and README under #3391. Reopen only with a command a session actually produced.
agentsAgents instructionsgateA rule with no mechanical check, or a check that misses a shapeintroducedReview finding classed introduced per local-strict-review Disposing of Findings
Activity
ptr727 commentedon Oct 23, 2026
Closed as out of the write guard's scope under the maintainer's decision (ptr727, 2026-10-23) on #3391, item 1. The guard bounds a good-faith agent's mistake rather than an adversary, so a parse gap reached only by a command shape no agent plausibly types in a coding session is closed rather than fixed, and the guard's own growth is a cost each later review pays again. The scope statement lands in the guard's docstring and README under #3391. Reopen only with a command a session actually produced.