Repository navigation
fix(restart): refuse to clobber an armed reboot snapshot - #416
Conversation
Validation run: - cargo +stable fmt --all -- --check: exit 0, no diffs - python3 scripts/check_swallowed_error_budget.py: exit 0, total 3847 -> 3814 - NBUILD_REMOTE_ROOT=/home/kooshapari/builds/restart-save ~/bin/nbuild <wtree> test -p kcode --lib restart_: twice exit 2, nbuild cannot reach nixos, direct ssh timed out. ENV-BLOCKED. tx-agent: jcode tx-validated: lint tx-task: G1-restart-save-safety tx-scope: src/cli tx-intent: restart save must never silently clobber an armed snapshot tx-lane: jcode:session_koala_1795837517661_8c5572f0003a474a
…errors Two defects in the previous commit, both found by actually building it: - `restart_tests.rs:215` bound `let crashed = Session::create_with_id(...)` and then called `mark_active_with_pid(&mut self)`, so the test target failed to compile with E0596. The binding needs `mut`. - Two `writeln!(output, ...)` calls in `run_restart_save_command` discarded their `io::Result`, which trips `unused_must_use` under `-D warnings`. They now propagate with `?`, matching the four sibling calls in the same function. tx-agent: jcode tx-validated: test tx-task: PR-save-armed tx-scope: src/cli/commands/restart.rs,src/cli/commands/restart_tests.rs tx-intent: Make the branch build and pass its own restart tests. tx-lane: jcode:session_daisy_1795074744352_88932230960f4f43
…ages The two panic-prone usages in the provider doctor moved from lifecycle_driver.rs into lifecycle_contracts.rs; the baseline still keyed the old path, so the gate reported the new path as an addition and masked any genuine growth there. Count is unchanged at 2. tx-task: 409 tx-scope: scripts/panic_budget.json tx-intent: keep the panic ratchet honest after a file move tx-agent: jcode tx-validated: manual tx-lane: jcode:session_daisy_1795074744352_88932230960f4f43
args.rs had grown past its size ratchet. The cloud session view enum is a self-contained argument type, so it moves to src/cli/args/cloud_view.rs (1247 -> 1234 LOC) rather than being squeezed in place. Its re-export stays for the call sites that name it. The armed-snapshot guard in restart save no longer asserts the snapshot is present after checking it is present: the check now binds the filtered snapshot directly, so the refusal message reads its fields from the same value it tested. tx-task: 409 tx-scope: src/cli/args.rs, src/cli/args/cloud_view.rs, src/cli/args/tests.rs, src/cli/commands/restart.rs tx-intent: clear the size and panic ratchets for the restore-save path tx-agent: jcode tx-validated: build tx-lane: jcode:session_daisy_1795074744352_88932230960f4f43
Moves the four-arm restart match out of the top-level CLI dispatcher and into src/cli/commands/restart.rs, where the handlers already live. The dispatcher keeps one line per top-level command, so src/cli/dispatch.rs drops from 1528 to 1520 LOC while fmt and the size ratchet agree. tx-agent: jcode tx-validated: build tx-task: 409 tx-scope: src/cli/dispatch.rs, src/cli/commands.rs, src/cli/commands/restart.rs tx-intent: give the size ratchet a durable shape instead of a squeezed line tx-lane: jcode:session_daisy_1795074744352_88932230960f4f43
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
|



Rebased replacement for #409. Same change set, rebased onto current
master(a3c41a9ce); the original branch wasstill based on
1d42e7822, so the size ratchet diff no longer applied and a rebase could not be pushed withoutrewriting that branch.
What this does
jcode restart saveused to overwrite an already-armed reboot snapshot. This guards the write:restart save --replace-armedis required to clobber an existing armed snapshot; without it the command bails withthe snapshot's own fields quoted back (the previous code reached for
.expect("armed snapshot present")).CloudSessionViewFormatmoved out ofsrc/cli/args.rsintosrc/cli/args/cloud_view.rs, which is what bringsargs.rsfrom 1247 to 1233 LOC.src/cli/commands/restart.rs, where the fourhandlers already live.
src/cli/dispatch.rsdrops 1528 -> 1520 LOC, so the size ratchet andcargo fmtagree on adurable shape instead of fighting over a squeezed line.
scripts/panic_budget.jsonre-keyed fromlifecycle_driver.rstolifecycle_contracts.rs, which is the file thatactually holds the 2 recorded usages (renamed upstream). Count unchanged: this is a path fix, not a loosened budget.
Local evidence
[mac]No Linux node reachable (nixos, desk and cachyos are all Tailscale-offline), so this is a justified Macfallback run.
CI is the authority for the test suite.
Supersedes #409.
Closes #394.