Repository navigation
base red: panic ratchet rows from #34798 (link sync history slices) - #34941
Conversation
… get (panic ratchet, from #34798) c92b4ad (#34798, link sync undo/history/restore) added four `buffer[..read]` slices and one `sha256[..2]` str slice in link/sync_cli/history.rs: cmux-tui clippy::indexing_slicing 835 > 831 and clippy::string_slice 83 > 82 on feat-cmux-next. The copy loops now take `buffer.get(..read)` and return an error if a read ever says more than the buffer holds; the blob shard is `sha256.get(..2)` behind the same SHA-256 check. Behavior is unchanged: Read::read never returns more than the buffer length, and the 64-hex check already holds for the shard.
|
Base finding, not from this PR: the clippy step |
|
Found 6 test failures on Blacksmith runners: Failures
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: Shipped in:
|
|
Review (claude-review-subagent): SHIP at b9171a2 Checked (reading only, no local build):
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
The feat-cmux-next panic ratchet is red at the tip (tip watcher, fleet job
d902ffbfaf0fcbf76b13aeb2at baa2e73 and85dacc757ba1e7df1b5c27f5at 6fef0f8):cmux-tui: clippy::indexing_slicing 835 > baseline 831cmux-tui: clippy::string_slice 83 > baseline 82cmux-vault-egress: indexing_slicing 2, string_slice 5 > new crate (must be 0)This PR removes the cmux-tui rows. The cmux-vault-egress rows are already fixed on feat by 17f9f49 (#34921).
Culprits
link/sync_cli/history.rs: four&buffer[..read]in the copy loops ofkeep_blob_innerandkeep_file, one&sha256[..2]inblob_pathbuffer.get(..read)(error if a read says more than the buffer holds),sha256.get(..2)behind the same SHA-256 checksubstitute.rsHow the culprit was found (panic rows of the tip watcher per tip): cf86f55 had cmux-tui 836 / 82 (job
8430b3923f14690597d98d7c; 5 of these were the rows #34735 fixed). c92b4ad (#34798) had 840 / 83 (jobbe282ef707053535784f889f): +4 and +1. #34735 (9a1aa2f) then removed 5, so da8ca9d had 835 / 83 (job505d70d3d95173d207fdb61c). #34634, #34782 and 93703fe add no rows. The stale push 164d65f took back #34798 and #34735 for a time (tips bd14c57..f291b6c showed acpmux 689 > 686 again); 93703fe put both back, and the seven #34735 files on feat are identical to 9a1aa2f.Behavior is unchanged:
Read::readnever returns more than the buffer length, andblob_pathalready refuses anything but 64 hex digits, soget(..2)always has a value.Verification
cmux-tui-rust-check.sh panic) at b9171a2: job54bcb0bfee7258f1e6396abd: pass (89 crates checked; no row over baseline, cmux-vault-egress at 0)1d5ed720fe12d1fb1de84c84: red on a base finding, not this PR:clippy::redundant_cloneincrates/cmux-git/tests/sync_barrier.rs:108(from c30af19 fix(cloud): wait for repo sync before native agent tools #34782; the same on the feat tip). The build stopped there, so this run gives no clippy result for cmux-tui; the panic step's clippy --lib --bins covers the changed fileundo(the five tests oftests/link_sync_history.rs, owned Mac) at b9171a2: jobc443db895433e13e4e7982e8: pass (72 tests run, 72 passed, among them all 5cmux-tui::link_sync_historytests)python3 scripts/cmux-next/prepush-gate.py: no new violations.Observed / Not run
Observed: panic ratchet green and nextest undo green at the head (jobs above); the red rows and their per-tip counts in the tip watcher's fleet jobs named above; the diff of #34798 (the five sites); the #34735 files on feat compared with 9a1aa2f (no diff); the prepush gate.
Not run: no regression test is added. The change takes a panic path that cannot happen (a read past its buffer, a short SHA-256) and returns an error there instead; no input reaches it. The existing link sync history tests cover the copy loops.
Changelog
none