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
fix: close 2 review regressions + stale lockfile from the operability batch (#139)
Adversarial seam-review of the merged operability batch (v2.3.0..main)
surfaced two genuine incompletenesses plus a stale lockfile:
1. --memory-swap missed call-site (medium). The fail-closed `> i64::MAX`
guard was added to the run/create path (common.rs) but NOT to
`a3s-box update` (container_update.rs), so `update --memory-swap <huge>`
still wrapped negative -> resize.rs maps swap < 0 to memory.swap.max=max
-> silently UNLIMITED swap. Extract one shared `parse_memory_swap`
helper (handles the -1 sentinel + the i64::MAX bound) and call it from
both paths so they cannot diverge again.
2. OCI per-entry skip dropped data irrecoverably (low). On a per-entry
deserialize failure, read_index_from_disk skipped the bad entry but —
unlike the whole-file quarantine path — did NOT preserve it; the next
save rewrites index.json with only the survivors, erasing the
un-deserializable record (e.g. a schema mismatch after upgrade) with no
backup. Add a copy-only `quarantine_copy` (preserve original in place,
live catalog untouched) and back up index.json when entries are skipped.
3. Stale Cargo.lock. The monitor concurrent-probes fix added a `futures`
dep to a3s-box-cli but didn't regenerate the lock, so the committed
Cargo.lock omits the edge and `cargo build --locked` fails on main.
Regenerate.
Also drops a stale `a3s-box reap` reference (a non-existent command) from a
state-file doc comment, matching the accurate operator-facing message.
Tests: parse_memory_swap (sentinel/normal/overflow), quarantine_copy
(preserve+backup) and quarantine_corrupt (move-aside).
Co-authored-by: Roy Lin <roylin@a3s.box>
0 commit comments