base red: acpmux process pages and retry delays without an index (panic ratchet 697 > 686, #30726, #31709)

LA
4d ago
+15-7

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] in ProcessTable::page_snapshot (line 327).
  • Nine serde_json indexes row["..."] in the too-large row of process_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(). start is an ID's slot + 1 (at most len) or 0, and end = min(start + limit, len), so the range is always in bounds and the fallback never applies.
  • reads the row fields with row.get(..). An Option<&Value> serializes None as null, 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>.

Observed / Not run

  • Observed: the fleet logs above. prepush-gate.py: no new violations. rustfmt --check on the file: clean.
  • Not run: no local cargo build, clippy or test (fleet only). I did not drive _acpmux/process/list pages 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.