base red: panic ratchet, new cmux-tui index and string slices from #30414, #29234, #30634, #30664 and #30574 use checked forms
Base-red fix (fix forward). The Rust panic ratchet for cmux-tui is red on feat-cmux-next. The culprits are #30414 (0507fc4361e), #29234 (d8e1b7cde91), #30634 (9f5e2e15c39), #30664 (7b30784711c) and #30574 (93772c4550f).
The count rose as these PRs landed:
| tip | row | job |
|---|---|---|
| 7e0a0f2bc744 | cmux-tui: indexing_slicing 833 > 831, string_slice 84 > 82 | 21c6ba0ebda787821cc7bc4b |
| da77b4930f22 | indexing_slicing 835 > 831, string_slice 84 > 82 | 78d969ee339c330219260958 (run 41294359852) |
| e27f116ca2a2 | indexing_slicing 851 > 831 | tip watcher 32a66a050633135ff8a2988f |
This PR rewrites every hit without a panic. Behavior does not change, and the baseline is not raised.
| culprit | file | hits | now |
|---|---|---|---|
| #30414 | link/start_chat_cli.rs | id[4..], &url[scheme.len()..], body["ref"] = .., body["environment"] = .. | id.get(4..) (always Some after starts_with("env_")), split_at_checked (None in the same cases as the get(..n) before it), JsonSet::set |
| #29234 | cli/terminal_talk/send.rs stage_failure | error["details"], error["message"] | get |
| #30634 | link/seed_cli.rs | 13 Value reads, 1 write | get reads, JsonSet::set |
| #30634, #30664 | link/mod.rs | &args[1..], &args[2..] | args.get(n..).unwrap_or_default(). The branch runs only after args.get(n - 1) matched, so the slice is always there |
| #30664 | link/machine_pin.rs | line["ok"] != json!(true) | get("ok").and_then(Value::as_bool) != Some(true) |
| #30574 | link/start_chat_cli.rs plan_with | line["machine"], ["created"], ["snapshot"], ["environment"] | get |
A missing key read through get is None where indexing gave Null. as_str() and as_bool() see the same value, and json! writes None as null. No revert is needed: every fix is small, and #30655 and others build on these files.
Testing (fleet Linux, --os linux)
| run | ref | result |
|---|---|---|
| panic ratchet | tip 7e0a0f2bc744 | RED, job 21c6ba0ebda787821cc7bc4b |
| panic ratchet | tip da77b4930f22 | RED, 835 > 831, job 78d969ee339c330219260958 |
| panic ratchet | first fix b23259b3826c (base e9f46392402) | pass, job 0931ab17956b487dd375d6ce |
| panic ratchet | merge with tip e27f116, 18cef5a0b87d | RED, 849 > 831 (the new base hits), job 9d666b02dcb4c69dbfc147f0 |
| panic ratchet | c8f66b166f86 (e27f116 in it) | pass, job 5154a2d47f1bde977b80bb0d |
tests machine_pin / seed_cli / start_chat / terminal_talk | c8f66b166f86 | 3/3, 2/2, 32/32, 24/24 pass, jobs b3c86c752fad239b85daf933, ec5244e7c6d8af7790886f11, a6843bd9dfe61282835f4cce, 1cb69b24f6b5c79192b76535 |
| panic ratchet | head 9732cc5feac8 (merge with tip 4976f6e5028, plus the #30574 fix) | pass (no RED row), job d16b456c9523363a3406442d |
tests start_chat | head 9732cc5feac8 | 33/33 pass, job 270a743c6e75d26b06dd7ff8 |
- Review (subagent, correctness first): SHIP at b23259b3826c07972eb71b80a1b5f217efdac725 and at 9732cc5feac8441aa8b03416992bc345744a56bf (the current head, with the full net change over tip 4976f6e5028).
- Newer tip commits up to 265c68a569a add no new production hit. The index reads of #30337 in
cloud_rewind.rsare in#[cfg(test)].
Observed / Not run
Observed: the runs above, and prepush-gate.py with no new violations.
Not run: macOS, because this PR has no Swift change and the ratchet runs on Linux only. Job d685d827570e6eaddaafb6cf went to a Mac by mistake and gave no verdict.
Changelog
none