base red: cmux-tui panic ratchet and clippy from #28950 and #32065 (checked slices, JsonSet, one CloudAccess)
Merged
LA
4d ago+42+42+01234567890123456789-35-35-01234567890123456789
Fixes feat-cmux-next tip reds in cmux-tui. They block the clippy and panic steps of every cmux-tui PR (for example #31937, #31921).
1. Rust panic ratchet (from #28950, 7ea60b1b546b)
Tip watcher job eebb0e75406ab4c13e2ee200: cmux-tui: clippy::indexing_slicing 835 > baseline 831 and clippy::string_slice 84 > baseline 82.
The 4 + 2 new hits from #28950's production code, now checked forms with the same results:
link/cloud_broker.rsmint_token:services[0] == services[1]->matches!(services, [first, second] if first == second).link/native_broker.rsread_identity:bootstrap.team[5..]->strip_prefix("team_").is_some_and(|hex| hex.len() == 20 && ...).link/native_broker.rsnative_id:value[prefix.len()..]->strip_prefix(prefix).is_some_and(|id| id.len() == 26 && ...).link/mod.rs:ready_line["native"] = ...andready_line["wg_public_key"] = ...(serde_jsonIndexMut) ->cmux_json::JsonSet::set, the repo's form for string-key JSON writes.
Bad input still fails closed (Forbidden, refused()).
2. cmux-tui clippy (seen on #31921, hq run 41428596319)
clippy::too_many_arguments(8/7) onlink::serve, from #28950, which added the native broker as an eighth argument.
The broker and the credential relay socket are the two ways a serve resolves cloud hosts, andrun_servealready
refuses both at once (cloud.native.scope_conflict). They become oneCloudAccessenum
(Broker(Box<Bound>)|Relay(Option<PathBuf>); boxed forlarge_enum_variant). The branches are unchanged.unused_qualificationsatcli/app/tests.rs:352, from #32065:std::path::Path::new->Path::new(in scope throughsuper::*).
The force-unwrap red from #28950 is fixed separately in #32129.
Changelog
none
Observed / Not run
Observed:
- Panic step (
cmux-ci run --script scripts/ci/cmux-tui-rust-check.sh --arg panic --os linux):
at f8a56d7f299 still red (indexing_slicing 833 > 831: the 2 serde_json writes);
at 89343994531 pass; at a120c6b850d pass (step f11999b503f788836f662bfd). - Clippy step (
--arg clippy --os linux): at 9cae85cf223 red only on the new enum'slarge_enum_variant; at a120c6b850d pass (step f29404fd9222043a4ae6c39a). rustfmt +1.95.0 --edition 2024 --checkon the changed files andpython3 scripts/cmux-next/prepush-gate.py: clean.
Not run:
- The cmux-tui unit tests (
native_broker,cloud_broker_tests, link tests); CI runs them.