Originally created by: lodar
Arm F of tests/version_assign_unit.sh commits PROBE_FILES (src/cmd_task.sh, src/header.sh, 5dive, 5dive.sha256), soft-resets, then git restore --source=HEAD --staged --worktree over the same list — which discards both copies of any uncommitted edit to exactly those paths. The DIVE-2143 narrowing (no commit -am, no reset --hard) protects everything outside the list and nothing inside it, so the blast radius landed on the most-edited file in the CLI. It ate a working tree again on DIVE-2318.
The second half was worse: the SENTINEL graded README.md, chosen because it is not a probe file, so the arm printed "an unrelated uncommitted edit survived the probe" on the very runs that destroyed the operator's work.
This PR
probe_dirty() — dirty PROBE_FILES, staged or worktree (-uno: an untracked path is not in HEAD and cannot be restored over).probe_dirty() would imitate exactly.Verified
src/cmd_task.sh (worktree, then staged-only): REFUSED, path named, exit 1, marker survives both times. Old code deleted it.src/cmd_goal.sh (non-probe): arm F still runs, 42/42 — the guard is scoped.probe_dirty(){ :; } → F0 worktree+staged red; probe_dirty(){ echo src/cmd_task.sh; } → F0 clean+scope red. F0 is not vacuous in either direction.version_assign_unit.sh is the only one that mutates the real repo's git state — every other file's git verbs run inside an mktemp fixture. No second instance of the shape to fix.Test-only change; no src/ or agent-create path touched.
Ticket changed by: lodar