Skip to content

CI: the Swift app's acpmux methods and the agent pane's param keys are checked against acpmux-protocol.json - #36579

Merged
cmux-bot[bot] merged 3 commits into
feat-cmux-nextfrom
contract/acpmux-swift
Nov 5, 2026
Merged

cmux-bot[bot] merged 3 commits into
feat-cmux-nextfrom
contract/acpmux-swift

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-11-05, after a Cloud chat failed on a hand-spelled field name: "You guys keep running into these. These are weird issues that I feel like you should be able to just fix beforehand and check on beforehand."

acpmux's wire contract is cmux-tui/crates/acpmux/spec/acpmux-protocol.json. It is emitted from acpmux's Rust method registry, Rust's protocol_ir_is_current keeps it current, and the webviews generate their client from it. The app's Swift side names acpmux methods and the agent pane's allowed param keys by hand, and nothing checked those names against it. Now CI fails when Swift names a method or param the protocol does not define.

What changes

  • scripts/ci/check-swift-acpmux-protocol.py checks three things against the protocol:
    • Every method-shaped string literal in Packages/macOS/CmuxNext/Sources (_acpmux/, session/, acp., trigger/), skipping comments and joined prefixes. Today that is 144 names. Comments are skipped; multiline and raw strings are read as strings.
    • Every method of the agent pane's frame policy (AcpmuxPaneMethods requests, notifications, knownParams, and the first frame's initialize): 80 methods.
    • Every knownParams key of a method whose params the protocol types as a closed object: 14 methods, 42 keys. An open object (no additionalProperties: false) takes other keys too, so it is not limited.
  • Names that aren't methods go in scripts/ci/swift-acpmux-protocol-allowlist.txt with a reason. Today the only entry is acp.trust.peer-v1, an initialize extension name. A listed name that is no longer used, or that the protocol now defines, fails too, so the list only shrinks.
  • .github/workflows/swift-acpmux-protocol.yml runs the check and its tests on Linux with a sparse checkout, whenever either side changes.
  • tests/test_check_swift_acpmux_protocol.py covers four cases: a drifted method literal, a drifted pane method, a drifted param key, a drifted first-frame method, method names in multiline and raw strings, and a stale allowlist entry. It is also green on the repository.

No drift on today's tree beyond the one extension name. _meta.acpmux keys and the methods with untyped or open params are not checked yet, because the protocol does not close them.

Changelog

none

Verification

  • python3 -I tests/test_check_swift_acpmux_protocol.py: 8 tests OK.
  • python3 -I scripts/ci/check-swift-acpmux-protocol.py: green.
  • actionlint is clean on the new workflow.

Agent session: agent session

🤖 Generated with Claude Code

…e checked against acpmux-protocol.json

scripts/ci/check-swift-acpmux-protocol.py fails when a method-shaped literal in the app's Swift
sources (_acpmux/, session/, acp., trigger/), a method of the agent pane's frame policy, or a
knownParams key of a method with typed params is not in the protocol acpmux emits. Names that are
not methods are listed with a reason, and the list only shrinks. A Linux workflow runs it, with
its tests, whenever either side changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 0384f84: 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=pr36579 -f ref=contract/acpmux-swift -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 8b226da to compare; do not merge until green; see lane-rules

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 5, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Found 8 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpkgifb68z/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmppygzd1f1/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
test_a_base_given_on_the_command_line_wins_over_the_branch_s_integration_base (main
.PrePushGateTests.test_a_base_given_on_the_command_line_wins_over_the_branch_s_integrat
ion_base)/
test_a_base_given_on_the_command_line_wins_over_the_branch_s_integration_base (main
.PrePushGateTests.test_a_base_given_on_the_command_line_wins_over_the_branch_s_integrat
ion_base)
View Logs
test_a_base_given_on_the_command_line_wins_over_the_branch_s_integration_base (main
.PrePushGateTests.test_a_base_given_on_the_command_line_wins_over_the_branch_s_integrat
ion_base)/
test_a_base_given_on_the_command_line_wins_over_the_branch_s_integration_base (main
.PrePushGateTests.test_a_base_given_on_the_command_line_wins_over_the_branch_s_integrat
ion_base)
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at cd7e609

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 3. They land as checklist items in this PR's one follow-up tracking issue in this repo (Follow-ups: #N ..., label follow-up; add to an open one before filing, never one issue per finding), linking this receipt; the lane that opened the PR fixes them forward.

SHIP at cd7e609

Visual verdict: no images; Leo tries the build

  • [P2] [follow-up] [category:tooling] [finding:F1] [outcome:pending] Multiline Swift string literals are skipped by strip_comments/METHOD_SHAPE, so a drifted method embedded in """...""" is invisible to the checker (check-swift-acpmux-protocol.py:48).

  • [P2] [follow-up] [category:tooling] [finding:F2] [outcome:pending] The pane’s mandatory initialize method is never validated: only requests, notifications, and knownParams are collected (check-swift-acpmux-protocol.py:181). A typo in AcpmuxPaneMethods.swift:17 would pass CI and then reject every connection’s first frame.

  • [P2] [follow-up] [category:correctness] [finding:F3] [outcome:pending] properties() treats schemas without additionalProperties as closed because of the condition at check-swift-acpmux-protocol.py:89. For example, ForkParams has no additionalProperties: false in the protocol, so valid open-schema keys added to knownParams would be incorrectly rejected.

Follow-ups:

  • F1: support multiline/raw Swift literals.
  • F2: validate AcpmuxPaneMethods.initialize.
  • F3: distinguish open typed schemas from closed schemas.

…ake extra keys, multiline and raw strings

Review follow-ups: AcpmuxPaneMethods.initialize is checked; a typed params schema without
additionalProperties: false is open, so its keys are not limited to its properties; a multiline
string's // is not a comment, and a raw string's method is seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@cursor

cursor Bot commented Nov 5, 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

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 361e1ef

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 2. They land as checklist items in this PR's one follow-up tracking issue in this repo (Follow-ups: #N ..., label follow-up; add to an open one before filing, never one issue per finding), linking this receipt; the lane that opened the PR fixes them forward.

SHIP at 361e1ef

Visual verdict: no images; Leo tries the build

  • [P2] [follow-up] [category:correctness] [finding:F1] [outcome:pending] Protocol.properties() returns None for a closed object with no properties (return names or None at check-swift-acpmux-protocol.py). Such schemas are treated as untyped/open, so a future knownParams entry for _acpmux/protocol or InventoryRefreshParams could contain arbitrary keys without CI detecting the drift.

  • [P2] [follow-up] [category:correctness] [finding:F2] [outcome:pending] The method scanner only matches a method immediately after a quote (check-swift-acpmux-protocol.py). A valid Swift multiline literal whose value is written on the next line ("""\n_acpmux/foo\n""") is therefore missed, allowing a drifted method literal to bypass the check.

Follow-ups:

  • F1: preserve an empty closed-property set so its keys are rejected.
  • F2: parse multiline/raw literal values rather than relying on quote adjacency.

@cmux-bot cmux-bot 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.

cmux-bot approves 361e1ef: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

…ion registry (linux-guard)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 0384f84

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 2. They land as checklist items in this PR's one follow-up tracking issue in this repo (Follow-ups: #N ..., label follow-up; add to an open one before filing, never one issue per finding), linking this receipt; the lane that opened the PR fixes them forward.

SHIP at 0384f84

Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] [category:correctness] [finding:F1] [outcome:pending] [check-swift-acpmux-protocol.py:102-108] Closed object schemas with no properties are returned as None, so params are treated as open. The protocol currently has such schemas (_acpmux/protocol and _acpmux/harness/inventory/refresh); any future knownParams key for them would bypass validation.

  2. [P2] [follow-up] [category:correctness] [finding:F2] [outcome:pending] [check-swift-acpmux-protocol.py:133-152,197] Pane parsing only recognizes ordinary quoted literals. A raw or multiline initialize typo is missed entirely, and raw or multiline knownParams keys are omitted from checking.

Follow-ups:

  • [finding:F1] Preserve closed empty schemas as an empty property set.
  • [finding:F2] Parse raw and multiline literals in pane policy fields.

@cmux-bot cmux-bot 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.

cmux-bot approves 0384f84: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot merged commit e6de93b into feat-cmux-next Nov 5, 2026
157 of 158 checks passed
@cmux-bot
cmux-bot Bot deleted the contract/acpmux-swift branch November 5, 2026 14:47

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 0384f84a Deployed Nov 5, 2026 by teamleaderleo via cmux-tui tree preflight #116512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant