Skip to content

Pane policy: policy.json matches the macOS host's params, with a Swift parity test (cx-ctddg) - #20947

Merged
teamleaderleo merged 11 commits into
feat-cmux-nextfrom
op-next-replay/pane-policy-swift-parity
Oct 15, 2026
Merged

teamleaderleo merged 11 commits into
feat-cmux-nextfrom
op-next-replay/pane-policy-swift-parity

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

cx-ctddg. The Rust pane policy (cmux-agent-pane-policy/policy.json) had drifted from the macOS host's tables (AcpmuxPaneMethods.requests and knownParams). Those Swift tables are what enforce the pane's frames today. The Swift side of the parity tests was deleted, so nothing caught the drift. #20644 broke local chats when the two sides disagreed (cx-ibngi).

Change

  • New test, tests/swift.rs: reads both Swift tables and asserts that policy.json's requests and known_params equal them.
  • policy.json: gains the four params Swift already allows (scoping below).
  • src/params.rs: a _acpmux/permission_respond _meta must hold the pick's gesture ticket and nothing else. This is the same rule as Swift's breaksParamsRule. Without it, adding _meta to the list would have let an acpmux key through.
  • tests/cases/params.json:
    • the "every known param" cases now include the new params;
    • two new cases must break: _meta with more than the ticket, and _meta without it.
  • tests/typescript.rs: base has since fixed the same allowlist scan of typedRequest calls (6bf943f, cx-js8uc). After the base merge this file is identical to base.

Review fixes

  • Gesture pick, src/check.rs: GesturePick::new gains Swift's AgentPaneGesturePick branch for _acpmux/permission_respond. Its pick is {sessionId, permissionId, optionId}, and there is no pick when it carries answers. Before, Rust dropped sessionId from the pick, and this PR's _meta param made that path reachable.
  • src/lib.rs: says hosts strip a session/new's _meta.acpmux.noProject in their folder step, as AcpmuxPathPolicy does.
  • Stale references: the deleted AgentPanePolicyParityTests is no longer cited in policy.json's description, lib.rs, or the Swift checkOne doc comment. That comment is the only Swift change.
  • More params cases: _meta: {} on permission_respond breaks; a non-string ticket passes the params rule, as in Swift.

Scoping of each added param

Swift already allows each of these with the same reason, and no new method is added.

Method Param What it does Scope
session/new _meta.acpmux.noProject The pane's "Do not work in a project". The host's path policy reads and strips it. Before any session exists, so no session scope. Grants no folder.
session/prompt _meta.acpmux.context A chat's workspace context on its first prompt (cx-ihyx2). acpmux sends it to the agent and keeps it out of the transcript text. The prompt's sessionId must be the pane's (session_scoped).
_acpmux/models refresh The picker's Refresh models: acpmux runs again the model probes it already runs in the background. Grants nothing, so no gesture rule.
_acpmux/permission_respond _meta Only the gesture ticket of the person's pick (cx-0q7o). Any other key, or no ticket, breaks the params rule. The ticket is checked against the pick.

Verification

All runs were on the Linux builder, with the same focused command:

cargo test -q -p cmux-agent-pane-policy --test swift
Commit Result
Red, 3eda6d1 The requests check passes. the_known_params_are_the_macos_hosts fails on exactly the four params above.
Green, the fix 2 passed.

Gesture pick, with the focused command cargo test -q -p cmux-agent-pane-policy --test parity full_check_order:

Commit Result
Red, c12cf36 Fails on "a ticketed permission answer binds its pick…". The got pick is {optionId, permissionId}; the expected pick also names sessionId: s1.
Green, 9035b2b 1 passed.

On the fix:

  • the crate's full tests pass: parity 16, swift 2, typescript 4;
  • rustfmt is clean;
  • the crash ratchet is ok.

The only Swift change is one doc comment. sbx build on the merged head (base dbb1123) completes. On the merged head, the crate passes 16 + 2 + 4 and rustfmt is clean. No host runs the Rust policy's frame check at runtime today, so nothing changes for users.

Defaults snapshot

This PR does not change schemas/defaults/cmux-next.json. The autofix bot added a line recording Lawrence's existing key.home.switchView default, and I dropped it. A red defaults-snapshot check here is the base red for that missing record, not a new default from this PR.

Changelog

none

🤖 Generated with Claude Code


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


Summary by cubic

Restores parity between the Rust pane policy (policy.json) and the macOS host's Swift tables, which enforce the pane's frames today. The Swift parity tests were deleted, so nothing caught the drift — #20644 broke local chats when the two sides disagreed (cx-ibngi).

  • Adds tests/swift.rs, which asserts policy.json's requests and known params equal the Swift tables.
  • Adds the four params Swift already allowed: session/new noProject, session/prompt context, _acpmux/models refresh, and _acpmux/permission_respond _meta.
  • Enforces that _acpmux/permission_respond _meta holds the gesture ticket and nothing else, matching Swift's breaksParamsRule.
  • Makes a permission answer's gesture pick name its session, permission, and option — and pick nothing when it carries answers — matching Swift's AgentPaneGesturePick.
  • The allowlist test now also reads the method each typedRequest call in direct.ts names, fixing a pre-existing red test after acpmux: one typed protocol registry; generated web types and drift checks (hq#2025, no bead) #20576 moved _acpmux/permission_respond to that helper.
  • Documents in lib.rs that hosts strip a session/new's _meta.acpmux.noProject in their folder step, and drops stale references to the deleted AgentPanePolicyParityTests (including the Swift checkOne comment).

No Swift behavior changes, and no host runs the Rust policy's frame check at runtime, so nothing changes for users.

Written for commit 6688ec1. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 14, 2026 23:39
policy.json lags AcpmuxPaneMethods.knownParams: session/new noProject,
session/prompt context, _acpmux/models refresh and
_acpmux/permission_respond _meta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
policy.json gains what AcpmuxPaneMethods.knownParams already allows:
session/new acpmux noProject, session/prompt acpmux context,
_acpmux/models refresh, and _acpmux/permission_respond _meta, which
holds the pick's gesture ticket and nothing else (the same rule as
Swift's breaksParamsRule). The allowlist test also reads the method of
direct.ts's typedRequest calls (#20576 moved permission_respond there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 15, 2026 07:36 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d7428667-cd47-405f-b5f7-c1da343789ec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@blacksmith-sh

blacksmith-sh Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs

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

teamleaderleo and others added 5 commits October 15, 2026 00:46
…pick nothing (red)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GesturePick::new gains Swift's AgentPaneGesturePick branch: a
_acpmux/permission_respond picks {sessionId, permissionId, optionId}, and
nothing when it carries answers. lib.rs says hosts strip a session/new's
_meta.acpmux.noProject in their folder step. The deleted
AgentPanePolicyParityTests are no longer cited (policy.json, lib.rs, the
Swift checkOne comment). The typedRequest scan reads the call's own
literal second argument or fails. Two more permission_respond _meta cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-swift-parity

# Conflicts:
#	cmux-tui/crates/cmux-agent-pane-policy/tests/parity.rs
…-parity' into op-next-replay/pane-policy-swift-parity
…oes not touch)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 15, 2026 07:54 — with GitHub Actions Inactive
…defaults snapshot

Brings back the autofix hunk: it is not a new default, it fixes the base
defaults-snapshot red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot 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.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 15, 2026 07:56 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Not verified: macOS jobs did not run: compile and app tests were skipped on 6688ec1858; ci-status is green without them.

CI passes on 6688ec1858 (run 38709401923 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

…is base's to land)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot 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.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 15, 2026 08:18 — with GitHub Actions Inactive
…-swift-parity

# Conflicts:
#	cmux-tui/crates/cmux-agent-pane-policy/tests/typescript.rs
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Gate on head 6688ec1: the only red, cmux-next checks, is the base Package conventions lint red (BuiltInAdBlockerSetting.swift:5 namespace-type, fixed by #20927), waived per the coordinator. Size cap, crash ratchet and defaults-snapshot pass; react-apps-check doesn't run (no web change); the CI Release compile was skipped, so I ran the fleet Release compile on this exact head: xcodebuild exit 0. Still pending: the external compile check (queued since 08:57 UTC) and the cmux-next fast tier (queued since 08:58 UTC). Not merging until compile is green.

@teamleaderleo
teamleaderleo merged commit 752d254 into feat-cmux-next Oct 15, 2026
171 of 178 checks passed
@teamleaderleo
teamleaderleo deleted the op-next-replay/pane-policy-swift-parity branch October 15, 2026 10:15
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Merged 752d254 at exact head 6688ec1 on the coordinator's ruling. Waived: the external cmuxterm-hq compile check (stuck queue, not required; the exact-head fleet Release compile above is the compile gate, xcodebuild exit 0) and the base Package conventions lint red inside cmux-next checks (BuiltInAdBlockerSetting, fix #20927). Size cap, crash ratchet, fast tier green; react-apps-check not run (no web change); freeze-check clean.

This branch was previously deployed

2 inactive deployments
artifacts — 6688ec18 Deployed Oct 15, 2026 by teamleaderleo via publish tree-addressed cmux-tui #17155
cmux-tui-merge-tree — 6688ec18 Deployed Oct 15, 2026 by teamleaderleo via publish the merge tree #1428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant