Summary
Environment setup arms the durable workspace mutation guard before execution, but calls guard.clear("setup") immediately after execute() returns and before checking result.timedOut or a non-zero exit code.
Impact
A timed-out setup may leave a partially mutated workspace. The CLI then clears the durable quarantine marker, throws a setup failure, and permits the next restart to run setup again without requiring operator inspection. This contradicts the documented guarantee that crashes or uncertain termination retain quarantine.
Relevant code
packages/code/src/cli.ts: setup calls guard.clear("setup") before testing result.exitCode !== 0 || result.timedOut
packages/code/README.md: setup crash or uncertain termination must retain the quarantine marker
Suggested direction
Clear the guard only after a definitely clean successful result. Retain quarantine for timeouts and other ambiguous outcomes, with a regression test that confirms the marker survives a timed-out setup.
Summary
Environment setup arms the durable workspace mutation guard before execution, but calls
guard.clear("setup")immediately afterexecute()returns and before checkingresult.timedOutor a non-zero exit code.Impact
A timed-out setup may leave a partially mutated workspace. The CLI then clears the durable quarantine marker, throws a setup failure, and permits the next restart to run setup again without requiring operator inspection. This contradicts the documented guarantee that crashes or uncertain termination retain quarantine.
Relevant code
packages/code/src/cli.ts: setup callsguard.clear("setup")before testingresult.exitCode !== 0 || result.timedOutpackages/code/README.md: setup crash or uncertain termination must retain the quarantine markerSuggested direction
Clear the guard only after a definitely clean successful result. Retain quarantine for timeouts and other ambiguous outcomes, with a regression test that confirms the marker survives a timed-out setup.