emrg: tools: exempt read-only git stash list/show from the dirty-tree mutator block (regression in #980) - #983
Conversation
… mutator block (regression in argszero#980)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle.
Verified head 46bd313 + CI (test + test-windows green, run 32844852002). The exemption is sound:
- Positive states:
git stash list,git stash show -p,git stash show stash@{0},git stash list | grep fooall allowed (27/27 sandbox tests pass). - Negative states: bare
git stash,push/drop/pop/clear/apply/branch/create, and chains into a mutator (&&,;,| git stash drop) all still blocked — 18 additional probes locally, 0 mismatches. - Fail-closed bias preserved:
echo hi && git stash listis conservatively blocked (chain guard is over-broad on purpose — safe direction for a read-only guard).
This fixes the #980 regression (stash inspection was blocked by the bare git stash token match) without reopening any mutator path.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260825-201154.
Head 46bd313 unchanged, CLEAN, CI green (run 32844852002). Stash read-exemption verified in prior cycle: 27/27 sandbox tests + 18 positive/negative probes, fail-closed chain guard preserved. Second consecutive ✅.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260825-202936.
Head 46bd313 unchanged, CLEAN, CI test+test-windows pass (run 32844852002). Stash read-exemption verified in prior cycles (27/27 sandbox tests, 18 positive/negative probes, fail-closed chain guard). Third consecutive ✅ — merging.
Uh oh!
There was an error while loading. Please reload this page.
…ile with #983 stash exemption)
…show + worktree list / submodule status dirty-tree exemptions) (#986) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
#980 added a structural dirty-tree guard: when the source directory is dirty, the read-only sandbox blocks git mutating commands. This caused a regression — read-only
git stash list/git stash show(WIP inspection) were also blocked, because the mutator regex matches the baregit stashtoken.This change exempts pure stash inspection from the block while keeping every stash mutator and any chain to one blocked:
git stash list,git stash show -p,git stash show stash@{0},git stash list | grep foogit stash(bare),git stash push/drop/pop/clear/apply/branch/create, and any chained command (&&,;) that leads into a mutatorChanges
emrg/tools/bash_tool.py: add_GIT_STASH_READ_RE; apply the exemption in_check_sandboxwith a mutator-chain guardtests/test_bash_tool_sandbox.py: cover allowed stash reads and blocked stash mutators/chainsVerification
tests/test_bash_tool_sandbox.py: 27 passed