base red: panic ratchet and clippy, #30526's unreachable!, index reads and lints, #30574's redundant clone

Merged
LA
5d ago
+28-23

Fixes #30526
Fixes #30574

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.

filehitnow
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.rs4 Value reads, 5 out[..] = writesget(..).and_then(as_str/as_bool) == Some(..), JsonSet::set
server/trigger_chat.rs10 receipt/out/result[..] = writesJsonSet::set (each target is a validated object)

Clippy (-D warnings)

filelintculpritnow
acpmux prompt_provenance.rs:584 (test)nonminimal_bool#30526.is_none()
acpmux server/trigger_chat.rs:154 (macOS)needless_return#30526the non-Linux cfg block is the tail expression
cmux-tui link/start_chat_cli.rs:282redundant_clone#30574keys.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) and cmux-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)

runrefresult
panic ratchet (Linux)tip 98dbb856a872RED, unreachable 4 > 2, job 770f13cbbcccb1d764e99793
panic ratchet (Linux)base e987ea5cc3c7RED, unreachable and indexing rows, job 4ec4a8d762595972cb2a7de6
panic ratchet (Linux)138e7771d364 (unreachable fix only)RED, indexing 702 > 686, job 4c82b1115ebde52dc9e7a883
panic ratchet (Linux)14ed6b23e37cpass, job 427989a23fae22609e72405b
panic ratchet (Linux)head 49be3b6a3771pass, job 97b7188c592978bb55b67817
test trigger (Linux)head34/34 pass, job 385ee5c95483cbfc4a4c2457
clippy Linux / macOSheadred 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 / macOSscratch 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

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