base red: panic ratchet and clippy, #30526's unreachable!, index reads and lints, #30574's redundant clone
Base-red fix (fix forward) for the panic ratchet and clippy reds that #30526 (68cab886b0d) and #30574 (93772c4550f) added. The baseline is not raised, and behavior does not change on any path that can run.
Panic ratchet (#30526)
At 98dbb856a872 the ratchet is red with acpmux: clippy::unreachable 4 > baseline 2 (job 770f13cbbcccb1d764e99793). After the first fix it was still red with acpmux: clippy::indexing_slicing 702 > baseline 686 (job 4c82b1115ebde52dc9e7a883). All hits come from #30526. The other acpmux commits since the last green tip (57be1e3b8176) add none in production code.
| file | hit | now |
|---|---|---|
cli/trigger_chat.rs run | _ => unreachable!() | the error that operation() returns for a bad value (the arm cannot run) |
server/trigger_chat.rs handle | _ => unreachable!() | RpcError::method_not_found(m), the same error as the first match (the arm cannot run) |
hub/prompt_ledger.rs | 4 Value reads, 5 out[..] = writes | get(..).and_then(as_str/as_bool) == Some(..), JsonSet::set |
server/trigger_chat.rs | 10 receipt/out/result[..] = writes | JsonSet::set (each target is a validated object) |
Clippy (-D warnings)
| file | lint | culprit | now |
|---|---|---|---|
acpmux prompt_provenance.rs:584 (test) | nonminimal_bool | #30526 | .is_none() |
acpmux server/trigger_chat.rs:154 (macOS) | needless_return | #30526 | the non-Linux cfg block is the tail expression |
cmux-tui link/start_chat_cli.rs:282 | redundant_clone | #30574 | keys.create moves (last use) |
These clippy reds are not from this PR and stay red at the head:
cmux-tui-cloud-conversations/src/environments.rs:89(nonminimal_bool) andcmux-tui-core/src/server/cloud_lease_gate_tests.rs:150(redundant_clone) come from #30357.- The open revert #30791 removes both.
Testing (fleet; head 49be3b6a3771 = merge with tip ffed4d8b34a)
| run | ref | result |
|---|---|---|
| panic ratchet (Linux) | tip 98dbb856a872 | RED, unreachable 4 > 2, job 770f13cbbcccb1d764e99793 |
| panic ratchet (Linux) | base e987ea5cc3c7 | RED, unreachable and indexing rows, job 4ec4a8d762595972cb2a7de6 |
| panic ratchet (Linux) | 138e7771d364 (unreachable fix only) | RED, indexing 702 > 686, job 4c82b1115ebde52dc9e7a883 |
| panic ratchet (Linux) | 14ed6b23e37c | pass, job 427989a23fae22609e72405b |
| panic ratchet (Linux) | head 49be3b6a3771 | pass, job 97b7188c592978bb55b67817 |
test trigger (Linux) | head | 34/34 pass, job 385ee5c95483cbfc4a4c2457 |
| clippy Linux / macOS | head | red only at environments.rs:89 (#30357), jobs 0b3bda573ad4f6adab4034ad and 5ce62e74d31135bb413a6b23. That crate stops clippy for cmux-tui-core and everything that depends on it |
| clippy Linux / macOS | scratch 19b408e625a7 (head plus a local environments.rs fix, not in this PR) | acpmux, cmux-tui and the cmux-tui-core lib pass. The only red is cloud_lease_gate_tests.rs:150 (#30357, cmux-tui-core lib test). Jobs c79765d7dcd701be19768677 and dd0e4c267f08625068a0910f |
- Review (subagent, correctness first): SHIP at 138e7771d36413113ecd1f4d7b2ed863477b5997, at 14ed6b23e37c8157e67f4b0611620e7c97fc9ad6 and at 49be3b6a3771cd47502647315bdaa5bf8c390d6a (the current head).
Observed / Not run
Observed: all the runs above, and prepush-gate.py with no new violations. Not run: Swift builds, because this PR has no Swift change.
Changelog
none