Skip to content

fix(cmux-next): validate replies from immutable question inputs - #26837

Merged
teamleaderleo merged 19 commits into
feat-cmux-nextfrom
lane/nx-question-validator-1028
Oct 30, 2026
Merged

teamleaderleo merged 19 commits into
feat-cmux-nextfrom
lane/nx-question-validator-1028

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Question-card Other answers need validation against the exact immutable native request before the trusted renderer proof can be spent. This prerequisite validates and canonicalizes a captured reply; it creates no person authority.

The standalone immutable Input contains sessionId, permissionId, requestJSON, and requestDigest. Validation checks the exact digest, current unique allow-once option, complete harness-specific answers, choice-only labels, duplicate JSON keys, original Claude AskUserQuestion previews, notes, and annotation absence/null semantics. Session and permission identity are never taken from the renderer reply. Omitted/null allowsOther defaults to true, matching AgentQuestion.Item and the web decoder; explicit false remains choice-only and malformed flags are refused. Both allowsOther and multiSelect require a JSON Boolean when present; numeric zero/one cannot coerce into flags. Omitted/null multiSelect defaults to false.

This pure helper has no ledger, connection, generation, nonce, person-proof, gesture-ticket, or renderer-binding APIs. The later integration must construct Input only from a captured native live Question and recheck that Question after renderer redemption and at ticket consumption. It does not repair Other Enter by itself.

Lawrence, via Leo:

leo i think this ui can be better / also needs to be keyboard navigable (i didnt check yet) / leo this needs to work with keyboard shortcuts like up arrow ctrl n/p etc / clicking enter doesnt work

Base: feat-cmux-next 8424d05bf9324f6f60a8f0c7c40b01f8a3e085b9.
Head: 0812231ec3dae1b370726bbd530fb4a5b0f73b8a.
Diff: 355 added lines in two files.

Validation:

  • git diff --check and python3 scripts/cmux-next/prepush-gate.py pass at this exact head.
  • Omission/null regressions were committed first as 028cb98a0cfead717bd2fb180cdc6a3581f286b8 and cover Claude/Chief/Codex with options present and exact answer preservation.
  • Numeric Other-flag and strict multiSelect regression sources were committed before their fixes as 54859174875 and 6669d37407b.
  • Original regression source was committed first as 0c7a29e9891; native compilation and tests are UNVERIFIED under the coordinator's Swift HOLD26809. No executed red/green result is claimed.
  • Intended fleet command after release: swift test --package-path Packages/macOS/CmuxNext --filter AgentPaneQuestionReplyTests.

The question_other_answer lane owns final verification with the root coordinator. This remains draft pending independent exact-head review and required native verification. No merge is requested.

Changelog

none

No capture: no UI change; this PR adds a pure Swift validator and its tests, with no rendered surface.

Agent session: agent session

Source regressions precede the helper; native compilation and execution remain unverified under Swift HOLD26809.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Pure validation and canonical intent only: no ledger, person proof, gesture ticket, or renderer binding authority.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-nvytmu created for this PR by the cmux coordinator.

@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Found 12 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpk4l8qu23/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpynqfidft/summary-missing.json (live):/summary-missing.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 2 more test failures. View all on Blacksmith

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

Source-only regression under native Swift HOLD; execution is pending fleet verification.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Match shared and web decoders for absent/null allowsOther while retaining explicit false restrictions and malformed flag refusal.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Source-only native regression under Swift HOLD; JSON numeric zero/one must not decode as Bool.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Validate the Foundation JSON type before reading boolValue to match strict shared/web decoding.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Source-only regression under native Swift HOLD; malformed numeric and object flags cannot change answer shape.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
Absent/null flags use the shared defaults; explicit flags require JSON booleans for both answer permissions and multi-select shape.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-eb13e936fc1b3752c7c7
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Review df7c8bf: 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=pr26837 -f ref=lane/nx-question-validator-1028 -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: No literal state roots (per-build isolation S7, cx-is1kf.8) is not red on the base 4eab936; do not merge until green; see lane-rules

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · took over from an earlier session · session

teamleaderleo and others added 2 commits October 30, 2026 04:08
…ption

Read the option as AcpmuxPermissionPrompt.onceOption does: a request that
offers two allow_once options is ambiguous and takes no reply. Note where the
validator deliberately matches acpmux check_answers/check_annotations (", "
multi-select split, any of the question's previews).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f8805b2d0f3b1303441e
…nd the question card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f8805b2d0f3b1303441e
teamleaderleo and others added 2 commits October 30, 2026 05:48
…acpmux does

acpmux check_annotations reads annotations only for Claude Code's
AskUserQuestion and drops them for any other question, so the pane check
passes them too instead of refusing a reply acpmux takes. Name what the
validator covers: question cards, not plain permission cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f8805b2d0f3b1303441e
…he relay take

Its byte caps are a parse bound above the relay's own per-field limits, it
reads only the allow-once option out of the request's options, and a Codex
choice may repeat a label two options share (acpmux checks no Codex labels).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f8805b2d0f3b1303441e
Skip non-object entries in the request's options and in rawInput's
questions and their options, as acpmux does, instead of refusing the reply
or skipping the preview check. Take the first allow_once option, the one
the question card answers with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f8805b2d0f3b1303441e
@teamleaderleo
teamleaderleo marked this pull request as ready for review October 30, 2026 10:28
…nds, and empty Claude prompts

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at df7c8bf

No blocking findings.

Review limited to the supplied diff and files; dependency reads were unavailable, and native compilation/tests were not run.

@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 df7c8bf: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (Codex gpt-6-astra high, fast; independent, via review-router): SHIP at df7c8bf

No blocking findings. Answer shapes, option resolution (the question card's answerOption and acpmux check_reply), multi-select splitting, size bounds, annotations and the immutable request checks match acpmux and the relay for well-formed question cards. Three nits only affect malformed requests. cmux-next/compile is green at this head. The reds fail the same way on base: cmux-next checks literal state roots (da4aa9b) and the Sidebar-Look trailer lint, which counts base commits (this PR adds two Swift files under CmuxNextAgentPane), plus release-notary test_digest.py (941b7a4).

@teamleaderleo
teamleaderleo merged commit ff7b8d3 into feat-cmux-next Oct 30, 2026
140 of 147 checks passed
@teamleaderleo
teamleaderleo deleted the lane/nx-question-validator-1028 branch October 30, 2026 16:03
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — df7c8bf1 Deployed Oct 30, 2026 by teamleaderleo via cmux-tui tree preflight #82784
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