base red: acpmux process pages and retry delays without an index (panic ratchet 697 > 686, #30726, #31709)
Summary
Culprit: #30726 (fbaa7a5105e, Leo), "feat(acpmux): byte-bound background-process history with opt-in pages (SW-11)". It added ten clippy::indexing_slicing hits in cmux-tui/crates/acpmux/src/hub/processes.rs:
self.processes[start..end]inProcessTable::page_snapshot(line 327).- Nine serde_json indexes
row["..."]in the too-large row ofprocess_page_values(lines 384-388).
The Rust panic ratchet is red on feat-cmux-next: acpmux 697 > baseline 686 at 7da73fec7f6 (hq run 41384159581), and 696 after #31695 removed the #30712 hit. The broken Cargo.lock from #31462 hid this red until #31717.
This PR:
- reads the window with
self.processes.get(start..end).unwrap_or_default().startis an ID's slot + 1 (at mostlen) or 0, andend = min(start + limit, len), so the range is always in bounds and the fallback never applies. - reads the row fields with
row.get(..). AnOption<&Value>serializesNoneasnull, the same as an index on a missing key, so the reply does not change.
It also fixes one more hit that came on the tip after #31695: #31709 (030cb46514b, Leo, "Settings > Retry After Errors sets acpmux's retry loop") added DEFAULT_DELAYS_MS[n.min(DEFAULT_DELAYS_MS.len() - 1)] in hub/auto_resume/settings.rs. It now reads DEFAULT_DELAYS_MS.get(n).or(DEFAULT_DELAYS_MS.last()): past the defaults the last wait repeats, as before. The array is a non-empty const ([u64; 4]), so the MIN_DELAY_MS fallback never applies.
No baseline change and no allow.
Testing
Focused command (fleet, Linux route): cmux-ci run --class light --script scripts/ci/cmux-tui-rust-check.sh --arg panic --os linux --ref <sha>.
- Tip
8fad072aafc(with #31695): RED,acpmux: clippy::indexing_slicing 697 > baseline 686(job 4fbbc710c433f636164a8524, hq run 41388454113). - Earlier head
2f95be6b0cf(only the #30726 fix): still RED, 687 > 686; the extra hit is #31709's (job e04b07004910adff2b197d6e, hq run 41386195677). - Head
d561fd27997: green,rust-panic-ratchet: 80 crates checked, 30 at deny(job 2b80c682d0c03462ac781c8a, hq run 41388454076). - acpmux process tests (
--arg test --arg process_) at the head: 145 passed (job fe6209efcdec5c0b9e069f4b, hq run 41388453748). - acpmux retry tests (
--arg test --arg auto_resume) at the head: 101 passed (job 5cfaee5e3c404f45cda447d0, hq run 41388454078).
Observed / Not run
- Observed: the fleet logs above.
prepush-gate.py: no new violations.rustfmt --checkon the file: clean. - Not run: no local cargo build, clippy or test (fleet only). I did not drive
_acpmux/process/listpages or the retry settings by hand.
Changelog
none
Related: #31697 (Linux clippy fix for #31462's plugin_manager.rs). The two fixes are independent: each step fails on its own, and neither step needs the other fix to run.