Repository navigation
base red: panic ratchet, #30921's and #30923's index reads use checked forms (cmux-tui 855 > 831) - #31097
Conversation
…d forms #30921 (af670df, cmux mcp video_frames/video_info) and #30923 (b91b9c7, cmux link seed pull) added clippy::indexing_slicing hits in cmux-tui production code, a deny lint of the panic ratchet: cmux-tui went from 831 to 855. Each read now uses a checked form; valid input behaves the same, and a missing or non-object field reads as it did through serde_json's Index (null): - video_tools: the app's answer and error fields through Value::get; the params writes through cmux_json::JsonSet::set (the params are always an object, as before). - seed_pull export: the job and status fields through Value::get; the bundle copy's chunk through buffer.get(..read), an error if a read ever claims more than its buffer. - seed_cli pull keep: summary.base.{head,index,work} through Value::get. No allow attributes, no baseline change.
|
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:
|
|
Review (subagent, correctness first): SHIP at c7de86d Every rewritten read matches serde_json's Index semantics: a missing or non-object field reads as Null or None, and the comparisons go through as_str and as_bool as Value's PartialEq does. The JsonSet::set targets are always objects from identity(). buffer.get(..read) cannot fail under the Read contract. The video_tools.rs hits that remain are all in #[cfg(test)]. The PR adds no allow and no baseline change. |
|
Found 4 test failures on Blacksmith runners: Failures
|
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. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Fixes #30921
Fixes #30923
The panic ratchet on
feat-cmux-nextis red since about 14:47Z:cmux-tui: clippy::indexing_slicing 855 > baseline 831(tip watcher jobaf1347a18047071fb78a1b9bat db2332c, hq run 41321021625). The new hits come from two direct merges after #30966's base (41d5197, 831):cmux mcpvideo_frames/video_info, newcli/mcp/video_tools.rs.cmux link seed pull, newlink/sync_cli/seed_pull.rsandlink/seed_cli/pull.rs(keep).git blamenames b91b9c7 on eachseed_pull.rsandpull.rshit.Each read now uses a checked form. Valid input behaves the same. A missing or non-object field reads as null, the same as serde_json's
Indexreturned:video_tools.rs: the app's answer and error fields go throughValue::get(the error code through oneerror_codehelper). The params writes go throughcmux_json::JsonSet::set; the params are always an object, so nothing changes.seed_pull.rsexport: the job and status fields go throughValue::get.Staging::copytakes its chunk throughbuffer.get(..read), which returns an error if a read reports more bytes than its buffer holds.seed_cli/pull.rskeep:summary.base.{head,index,work}throughValue::get.There are no
allowattributes and no baseline change.Hit table
This table compares the full clippy JSON at this PR's base 1f80a9f (a measurement-only commit lifts the cmux-tui baseline so that the step returns its JSON; that ref was deleted after the run) with the JSON at this head. Exactly 24 hits are gone and none are added.
git blameat 1f80a9f names the culprit on every line.cli/mcp/video_tools.rs(404, 407, 412, 413, 435, 459, 467, 468, 481, 517, 530)link/sync_cli/seed_pull.rs(375, 379, 387, 389, 390, 395, 401, 412, 413, 414, 753, 754)link/seed_cli/pull.rs(205)Clippy did not count the other reads in these files (
describe,info_value, the per-frame closures). They were changed to the same checked form so that each function uses one form.Evidence (fleet, Linux route,
scripts/ci/cmux-tui-rust-check.sh)af1347a18047071fb78a1b9b445bcd7a45940c8b93c8e601e74d9073071178e6cbfd1a0b8b943a06e67c8ac1092dcae7a285f14f8ea5e7d0d49f1d64video_tools01c813e2c05fb95374817930pull(seed_pull_journey, seed_cli::pull, link_sync)09e24ade054d746c76430314bring_back(bring_back_journey, seed_pull_journey)0736b1af55ea0d332f909749a599ea4075e85735b64efd54Observed / Not run
Observed: the tip watcher's panic step is red at db2332c (855 > 831).
scripts/cmux-next/prepush-gate.pypassed on the head.rustfmt --edition 2024is clean on the three files. Every fleet job in the table above ran on the Linux route, and I read each job's log. An independent review subagent passed the head:Review (subagent, correctness first): SHIP at c7de86da361040eedd91b7842ad453ef727a05a4.Not run: no local cargo build (the fleet runs it). No macOS run: the panic baseline holds Linux counts, and the changed code has no macOS-only path.
Changelog
none