Repository navigation
base red: panic ratchet: cmux-rd-link's 7, acpmux's and cmux-tui's new index/slice hits - #29024
Conversation
The Rust panic ratchet is red on feat-cmux-next since the cmux-rd-link crate landed by direct push (3b9cf69, 6d04ce1, ae8cd21): a new crate has a baseline of 0, and it had 7 clippy::indexing_slicing hits. - lib.rs write_handshake: truncate the buffer to the length Noise wrote instead of slicing it. - lib.rs seal: build the packet with push/extend/resize and hand Noise the body through get_mut, not three index writes. - replay.rs: the window word is read and written through get/get_mut; slot() always gives a word < WORDS, so the miss branch never runs. No behavior change. The baseline is not raised and no allow is added. These are the same hunks as #28958 (cmux-rd-link part), so that PR merges over this one with no conflict. Co-authored-by: Leo Li <cheerleaderleo@outlook.com>
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
…aled datagrams, reliable control) A pure crate (no I/O, injected clock) for Mac Screen on cmux.rd/1 (plans/cmux-next/remote-desktop-mac-host.md section 7): - Noise_XX_25519_ChaChaPoly_BLAKE2s with the hub session id as prologue. The link accepts only the remote session key the caller expects (the device hub vouches for it: each side signs its session key with its device key, checked before the link is built). The initiator checks the responder's key on message 2, before it reveals its own. - Sealed packets carry an explicit 64-bit nonce (stateless transport), so loss, reorder and duplicates on any path are fine; a 2048-nonce sliding window drops replays. - Inside the seal: rd datagrams (best effort), an ordered reliable control channel (window 128, RTO with backoff; hello, start and stats leave the TCP socket so the session works through routers and relays), path probes and replies, and close. - Handshake retries every 250 ms and gives up after 10 s. - Packet tags 0xD0..0xD7 sit outside every RFC 7983 range, so one UDP socket also carries STUN and TURN. Tests (behavior at the crate boundary, two links over an in-memory network): handshake, control and datagrams across 20 % loss with duplication and reordering; a peer the hub did not vouch for is refused; another session's handshake does not complete; tampered and replayed packets open nothing; an unanswered handshake times out. rbx (lane mac-screen-rd): cargo fmt, clippy --locked -D warnings, 5 tests passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Found 3 test failures on Blacksmith runners: Failures
|
|
Review (claude-opus-subagent): SHIP at 19b8aaa Findings: none blocking. I read the code only; I did not build or run tests.
|
The panic ratchet is also red on two more rows on feat-cmux-next: acpmux indexing_slicing 692 > baseline 686 (from #28170) and cmux-tui 836 > baseline 831. Each hit is rewritten with checked access (pointer/get, JsonSet::set, get(n..).unwrap_or_default()); no behavior change: an empty slice or a null stands where the old code would have panicked. The baseline is not raised. These are Leo's hunks from #28958 (e9303c1, 5033a36, 96299c6), including his compile fix for the Value name inside tracing::warn!. Co-authored-by: Leo Li <cheerleaderleo@outlook.com>
…s with an iterator (cmux-tui 836 > 831) 7b3b9f7 (cmux automation --target cloud) added args[i] in take_target, the sixth new cmux-tui indexing_slicing hit. The loop now takes the words from an iterator and the value after --target from the same iterator; the words, the target and the missing-value usage error are the same. A unit test pins both flag forms, the default, a missing value and a bad target.
|
Fleet results at head 467388d:
|
…::* (unused-imports) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d9e7e9f7fb2b87a57d5f
|
Review (claude-opus-subagent): SHIP at 2d634ba Findings: none. I checked each hunk against the base. I did not build or run tests (cargo is not run locally). The clippy counts are not checked here.
|
|
Fleet results at head 2d634ba (Leo's unused-import fix dc34d45, cherry-picked):
Base findings, not caused by this PR:
|
|
Owner note for PL-acpmux: #29024 changes three acpmux files with checked access and no behavior change: |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What
A base red, priority zero. The Rust panic ratchet (
scripts/ci/cmux-tui-rust-check.sh panic, the "Rust panic ratchet" step of cmux-tui.yml) is red onfeat-cmux-nexton three rows. Every PR that touches cmux-tui inherits it.cmux-rd-link: clippy::indexing_slicing 7 > new crate (must be 0): the new crate landed by direct push (3b9cf69, 6d04ce1, ae8cd21).acpmux: clippy::indexing_slicing 692 > baseline 686: from acpmux: a waiting peer_add, peer_reconnect or peer_lease says whether it settled and why #28170.cmux-tui: clippy::indexing_slicing 836 > baseline 831: from 49394d0 (group create), cf3d7a3 (chief acp/pipe), d13d17a (apps info) and 7b3b9f7 (cmux automation --target cloud).Fix
Each hit is rewritten with checked access, as #28808 and #28847 did. The baseline is not raised and no allow is added. No behavior change: where the old code would have panicked, the new code gives an empty slice, a null or no match.
lib.rs:write_handshaketruncates the buffer to the length Noise wrote;sealbuilds the packet withpush/extend_from_slice/resizeand gives Noise the body throughget_mut(9..).replay.rs: the window word goes throughget/get_mut.slot()always gives a word <WORDS.host_peering.rs,hub/peers.rs,server/requests.rs:Valueindexing becomespointer/getandJsonSet::set.group_create.rs,chief/mod.rs,chief/pipe.rs:get(n..).unwrap_or_default().apps_list.rs:get(..).and_then(..).cli/automation.rstake_target: it walks the words with an iterator. A new unit test pins both flag forms, the default, a missing value and a bad target.The rd-link, acpmux and four cmux-tui hunks are Leo's from #28958 (credited with
Co-authored-by; his unused-import fix dc34d45 is cherry-picked with his authorship). Thetake_targethit came after his count.Verification
cmux-ci run --class isolated --script scripts/ci/cmux-tui-rust-check.sh --arg panic --ref <sha>, and--arg clippy(the-D warningsstep).cmux-rd-link 7 > new crate,cmux-tui 835 > 831. At 19b8aaa over a newer base, alsoacpmux 692 > 686,cmux-tui 836 > 831(job 4c51f42f48fd71e5cc9cb947).Observed / Not run
prepush-gate.py: no new violations. Tests at 467388d (job c285412e8b48acf834fcdfd0): 13508 of 13519 passed. The cmux-rd-link tests and the newtake_targettest passed. 11 tests failed in acpmuxpeer_restart/startup_load, cmux-tuicli_audit/setup/apps_storeand cmux-tui-corelocal_resize_order. None of them is in the changed code.Changelog
none