Skip to content

base red: panic ratchet, #30361's new JSON index reads use get (acpmux, cmux-host, cmux-tui, cmux-tui-core) - #30478

Merged
lawrencecchen merged 3 commits into
feat-cmux-nextfrom
fix/base-red-panic-acpmux-30361
Nov 1, 2026
Merged

lawrencecchen merged 3 commits into
feat-cmux-nextfrom
fix/base-red-panic-acpmux-30361

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Base-red fix (fix forward). The Rust panic ratchet is red on feat-cmux-next since 72dc85d (#30361, Cloud repository discovery). The tip watcher's --arg panic step failed at 4cd800a (job 63b147f0938fdb56741e7c83) and again at b9b4ac5 (job b2e7ab23614482433a9e00b5). It passed at 4b15acd (job 919042f7eb84849e08597ca8).

crate clippy::indexing_slicing at the tip baseline
acpmux 694 686
cmux-host 1 0
cmux-tui 836 831
cmux-tui-core 880 853

The watcher reported only the first crate (acpmux, +8). Four crates are red. All of the new hits come from #30361. The other first-parent commits in 4b15acdb7ae8..4cd800a309c2 (#30197, #30157, #28937, #30362, #29826 and others) add no index or slice in production code.

What changed

Each serde_json index read that #30361 added in production code is now a get / pointer read. The one IndexMut is now get_mut. The slice command[..2] is now command.get(..2). The baseline is not raised.

file hits now
acpmux/src/cloud_repo_mcp.rs 17 get(..).and_then(Value::as_str), pointer("/error/code"), and get_mut("error") in enrich_retry
cmux-host/src/cloud/github_repos.rs 3 pointer("/error/code"), get("provider"), get("_tag")
cmux-tui/src/cli/cloud_repo.rs 4 get("id"), get("ok"), get("error_code"), get("error")
cmux-tui/src/cli.rs 1 command.get(..2).is_some_and(..) (the old code checked len() >= 2 first)
cmux-tui-core/src/cloud_repos/{engine,local,runtime,store}.rs rest get / pointer reads; store.rs gets two small readers, chat_repos and recent_repos

There is no change in behavior. A missing key read through get gives the same result as the Null that indexing returned:

  • v["k"] == "x" becomes as_str() == Some("x").
  • v["ok"] != true becomes as_bool() != Some(true).
  • existing["ref"] != json!(reference) keeps Null for a missing key.
  • from_value(doc["local"].clone()) becomes from_value(get(..).cloned().unwrap_or_default()), which is still Null, so a missing list still fails the same way.
  • enrich_retry used to write through &mut result["error"] only when result["error"] was an object, so the get_mut form takes the same branch.

Update after the merge of feat-cmux-next (1dfc4dd)

The merge had conflicts in cloud_repo_mcp.rs, engine.rs and runtime.rs with #30528 (let-chains) and #30382 (seed.unknown_job). The resolution keeps their logic and the get reads. At the merge head 9d4a172 the ratchet was still red (job 1764d0cc925c9f12951dc4c3) on two rows that later base commits added. Both are fixed here too, because base reds go in one PR:

Testing

run ref result
panic ratchet (--arg panic) tip 4cd800a RED: the four rows above, job 63b147f0938fdb56741e7c83
panic ratchet (--arg panic) first head 8b701f4 pass (exit 0, no RED row, indexing_slicing at or under the baseline in all four crates), job 0b990c6938c0c3ba18439332. The warn-tier rows (arithmetic, casts) are the same as on the tip.
test cloud_repo (acpmux cloud_repo_mcp, cmux-tui-core cloud_repos, cmux-tui cli::cloud_repo and cloud_repo_tools) 8b701f4 37 of 37 pass, job 6083001dc37f62bd46fd723c
test github_repos (cmux-host) 8b701f4 9 of 9 pass, job cf655a5395608395acddeb21
panic ratchet (--arg panic) merge head 9d4a172 RED: acpmux 689 > 686 and cmux-tui string_slice 83 > 82, from #30439 and #30464, job 1764d0cc925c9f12951dc4c3
panic ratchet (--arg panic) head f9a0611 pass (no RED row), job 1f0e6bb20a1631d3f73a8b30
test subagents f9a0611 51 of 51 pass, job 2d550515957dbd10a47c1254
test seed f9a0611 79 of 79 pass, job 9fac88983e527560cdbb0f29
test cloud_repo f9a0611 37 of 37 pass, job 5d73878f27ac96fcd368f66b
  • Review (subagent, correctness first): SHIP at 8b701f4, at 9d4a172 (the merge) and at f9a0611 (the current head). It checked every rewrite against serde_json semantics and the enrich_retry borrow and found no blocking issue.

Observed / Not run

Observed: all the runs above (fleet Linux, Blacksmith overflow), prepush-gate.py (no new violations), and rustfmt 1.95 on the changed files.
Not run: macOS builds, because this PR has no Swift change. I did not run a macOS clippy, because the panic ratchet runs on Linux. #30555 (cloud_repo.rs validate is_none_or) overlaps 4 let-chain sites; whichever lands second merges the other.

Changelog

none

The Rust panic ratchet is red on feat-cmux-next since 72dc85d (#30361,
Cloud repository discovery), tip watcher job 63b147f0938fdb56741e7c83 at
4cd800a: clippy::indexing_slicing over the baseline in four crates
(acpmux 694 > 686, cmux-host 1 > 0, cmux-tui 836 > 831,
cmux-tui-core 880 > 853). The other commits in 4b15acd..4cd800a
add no index or slice in production code.

This rewrites every serde_json index read #30361 added in production code
(cloud_repo_mcp.rs, github_repos.rs, cli/cloud_repo.rs, cloud_repos/
engine.rs, local.rs, runtime.rs, store.rs) as get / pointer reads, the one
IndexMut as get_mut, and the `command[..2]` slice in cli.rs as
`command.get(..2)`. Behavior is the same: a missing key read through get
compares and converts the same as the Null that indexing returned
(`v["k"] == "x"` is `as_str() == Some("x")`, `v["ok"] != true` is
`as_bool() != Some(true)`, `v["ref"] != json!(r)` keeps Null for a missing
key). The baseline is not raised.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

View guided diff | Turn on auto-fix | Re-trigger cubic

…d-panic-acpmux-30361

# Conflicts:
#	cmux-tui/crates/acpmux/src/cloud_repo_mcp.rs
#	cmux-tui/crates/cmux-tui-core/src/cloud_repos/engine.rs
#	cmux-tui/crates/cmux-tui-core/src/cloud_repos/runtime.rs
…lice use checked forms

After the merge of feat-cmux-next 1dfc4dd, the panic ratchet at
9d4a172 (job 1764d0cc925c9f12951dc4c3) is still red on two rows
that later base commits added:
- acpmux indexing_slicing 689 > 686: #30439 (229803e) added
  `summary["turn"].is_object()` in hub/views.rs and two
  `self.running[at]` in subagents.rs.
- cmux-tui string_slice 83 > 82: #30464 (1b7b01c) added
  `&text[prefix.len()..]` in link/seed/github.rs.

Now `summary.get("turn").is_some_and(Value::is_object)`,
`self.running.get_mut(at)` (`at` is a position in the same Vec, found
just above with no change between, so the slot is always there), and
`text.split_at_checked(prefix.len())` (None exactly where the old
`text.get(..prefix.len())` was None). No behavior change.
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review f9a0611: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr30478 -f ref=fix/base-red-panic-acpmux-30361 -f platform=macos -f backend_mode=local

Shipped in:

@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Nov 1, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (subagent, correctness first): SHIP at f9a0611

The reviewer checked the 3 new changes by reading:

  • views.rs: summary is an owned Value, so get is serde_json's Value::get.
  • subagents.rs: at comes from position on the same Vec with no change between, so get_mut is always Some.
  • github_repos: split_at_checked gives None in the same cases as get(..n).

The merge resolutions keep #30528's let-chains and #30382's seed.unknown_job. Scope is 11 files over 1dfc4dd. It found no issue at any severity. Fleet at this head: ratchet green (1f0e6bb20a1631d3f73a8b30), and tests subagents 51/51, seed 79/79 and cloud_repo 37/37.

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 1, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (subagent, correctness first): SHIP at 8b701f4

The reviewer read every rewrite against serde_json semantics. A missing key read through get / pointer gives the same result as the Null from indexing. enrich_retry with get_mut takes the same branch as before and passes the borrow check. The record closure stays Fn. It found no blocking issue. Fleet: ratchet green (job 0b990c6938c0c3ba18439332), cloud_repo tests 37/37 (6083001dc37f62bd46fd723c), github_repos tests 9/9 (cf655a5395608395acddeb21).

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 1, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Found 13 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp4ahbwwwy/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpgzgfswln/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs

...and 3 more test failures. View all on Blacksmith

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@lawrencecchen
lawrencecchen merged commit 285bf78 into feat-cmux-next Nov 1, 2026
46 of 49 checks passed
@lawrencecchen
lawrencecchen deleted the fix/base-red-panic-acpmux-30361 branch November 1, 2026 09:20
@lawrencecchen lawrencecchen removed the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 1, 2026

This branch was successfully deployed

2 inactive deployments
artifacts — f9a0611a Deployed Nov 1, 2026 by lawrencecchen via publish to R2 #95193
sentry-dsyms — f9a0611a Deployed Nov 1, 2026 by lawrencecchen via upload cmux-tui dSYMs to Sentry #95193
ci-routing-agent — f9a0611a Deployed Nov 1, 2026 by lawrencecchen via cmux-tui tree preflight #95193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant