Skip to content

cmux NEXT: host real SwiftUI preview leaf - #24978

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
p1-native-preview
Oct 24, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
p1-native-preview

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

The native UI-layer host previously rendered a local copy of its chrome, so edits to real cmux NEXT SwiftUI modules could not appear in the host. This adds a Debug-only CmuxNextUiLayerPreview leaf product, reuses production CmuxNextDesign and CmuxNextIcons views, and maps the existing read-only projection into that surface. The checked-in vnode watcher follows the host and imported leaf-module roots, then terminates and restarts only the small host after a save; it never injects code into a running cmux app.

Before/after from the same fleet package harness:

  • Before: 0 real CmuxNext SwiftUI modules linked by UiLayerHost; host view was copied chrome.
  • After: 1 real preview leaf product linked (CmuxNextUiLayerPreview), with 3 production SwiftUI primitives (HairlineDivider, Icon, CmuxDialogActionButton) in the rendered path.
  • Fleet compile: cmux-ci compile-check job 407fe2a93c491f3282666f42 passed CmuxNext at exact head aa4d74934c4 in 86 s (controller-selected worker; no worker was pinned).
  • Warm capture slot on cmux-mac-mini-cua-5 at the host-seam predecessor: a one-line comment save in CmuxNextUiLayerPreview/UiLayerPreviewView.swift reached the first rendered frame in 1.653 s (ui-layer.reload to ui-layer.frame); a warm no-op swift build completed in 6.03 s. The host's read-only debug.window_record wrote 59 frames plus frames.json at 60 Hz without Screen Recording permission. The final socket-isolation/async-IO fix preserves this rendering path.

UiLayerHost real leaf preview recording

Full quality: p1-native-ui-layer.mp4

No capture: UiLayerHost is a standalone Debug SwiftPM executable; the packaged-app cmux-ci capture tour cannot launch this host, so the host-side recording above uses its own read-only debug.window_record socket.

Setup: docs/cmux-next/native-ui-host.md. Use CMUX_UI_LAYER_TRACE=1 to record ui-layer.reload and the first completed AppKit display pass (ui-layer.frame rendered_at_ns=...) in one stream. The preview product is off by default, excluded from CmuxNextApp and release app targets, and uses only read-only sample data or read-only attach methods.

agent-identity footer
Agent session: Air-Blue

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Review aa4d749: 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=pr24978 -f ref=p1-native-preview -f platform=macos -f backend_mode=local

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

Tour of aa4d74934c (run): no media. The tour job failed before the tour ran (build or setup); the run log has the output.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 24, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@blacksmith-sh

blacksmith-sh Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Found 12 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp7i5ufsyy/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpoldwo6av/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
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes (main.PreP
ushGateTests.test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes)/
test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes (main.PreP
ushGateTests.test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes)
View Logs
test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes (main.PreP
ushGateTests.test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes)/
test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes (main.PreP
ushGateTests.test_a_branch_that_merges_feat_cmux_next_in_is_judged_on_its_own_changes)
View Logs
test_a_merge_cannot_use_an_upstream_removal_to_pay_for_the_branch_s_own_debt (main.
PrePushGateTests.test_a_merge_cannot_use_an_upstream_removal_to_pay_for_the_branch_s_ow
n_debt)/
test_a_merge_cannot_use_an_upstream_removal_to_pay_for_the_branch_s_own_debt (main.
PrePushGateTests.test_a_merge_cannot_use_an_upstream_removal_to_pay_for_the_branch_s_ow
n_debt)
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.

@cursor

cursor Bot commented Oct 24, 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.

@cursor

cursor Bot commented Oct 24, 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 merged commit fe5fcb8 into feat-cmux-next Oct 24, 2026
130 of 134 checks passed
@teamleaderleo
teamleaderleo deleted the p1-native-preview branch October 24, 2026 23:08
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

teamleaderleo added a commit that referenced this pull request Oct 25, 2026
…r waivers, scrollbar List false positive (base reds) (#25032)

* fix(cmux-next checks): four base reds at the source (pre-push gate fixture, manifest reader, Browser waivers, scrollbar List)

- tests/test_cmux_next_prepush_gate.py: the fixture strips GITHUB_ACTIONS and
  CMUX_GUARDRAILS_SKIP_REASON (as test_cmux_next_guardrails.py does). prepush-gate.py
  runs the guardrails locally only, so the two [main-async] tests failed only on CI.
  With the guardrails on, NEW_CLEAN reads through Data(blockingContentsOf:) (the
  raw-blocking rule) and the skip-reason test pushes a try! with no blocking read.
- tests/test_cmux_next_route.py: a target's path: is read inside its own call.
  Since #24978 the .package(path:) dependencies follow the target list, and the
  last target (CmuxNextActionsTests) read ../../Shared/CmuxGhosttyKit as its path.
- crash-safety-baseline.json: --record-waivers for CmuxNextBrowser
  dynamic_dispatch.waived 9 -> 11. WebKitGestureFreeEvaluation's three selectors
  (8e23ffe, 2ae3fe8) are sent only after path()/functionPath() check
  responds(to:); they replace one in the deleted WebKitTab+GesturelessScript.
  The same run lowers cmux-tui-core unwrap 1151 -> 1150.
- check-scrollbars.sh: a ScrollView/List is judged only in a file that imports
  SwiftUI (any access level or scoped import), so AgentCLIIntentLedger's
  List(expectedMachineID:) request is no longer a hit; test cases added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1708f-432e-7f23-a9e8-11c5945da2f6&host=cosmic-gray

* review 1 of #25032: the manifest reader reads only a target's top-level path: (strings, raw and multi-line strings, nested comments, nested calls); @_spi(...) import SwiftUI counts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1708f-432e-7f23-a9e8-11c5945da2f6&host=cosmic-gray

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Oct 25, 2026
…oint moved entries, lint keeps moved files, Sleepy shims) (#25021)

* cmux NEXT: the No new SwiftUI and canary-coverage checks pass again on base

- AppIconView and AppSectionFrame moved from Store/Views to Section (84b3fc5);
  their old-path entries were deleted (91d4ac2) instead of re-pointed. Re-point them.
- The lint now names a moved file's new path in the stale-entry finding, and a
  move that also rewrote the file keeps its entry under --base, so this cannot recur.
- NightSky's NSViewRepresentable moves beside its only consumer, SleepySceneView
  (allowlisted): CmuxNextDesign's sky is AppKit only. SleepySceneView.hostView is the
  one place the scene meets AppKit, so SleepyOverlayWindows and both Sleepy tests no
  longer import SwiftUI (SleepyOverlayWindows' entry is deleted).
- CmuxNextUiLayerPreview (#24978) is the Debug-only preview leaf that exists to host
  production SwiftUI; it gets an entry and joins the swift-canary-fleet target list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1708f-432e-7f23-a9e8-11c5945da2f6&host=cosmic-gray

* cmux NEXT no-SwiftUI lint: a same-name move pairs one-for-one; an entry for a base red is a note (review 1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1708f-432e-7f23-a9e8-11c5945da2f6&host=cosmic-gray

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
lawrencecchen pushed a commit that referenced this pull request Oct 29, 2026
…d of the suites

CmuxNextUiLayerPreview defines its API only under CMUX_UI_LAYER_PREVIEW, set for Debug only
(#24978), but its test target compiled in every configuration, so
`CMUX_SWIFT_SUITE_CONFIGURATION=release package-test-lane.sh suite Packages/macOS/CmuxNext ...`
stopped at "cannot find 'UiLayerPreviewData' in scope" before any suite ran (fleet job
b7fa0279da88ac1bb65a9a8c). The test target now takes the same Debug-only define and its tests
compile where the type exists. The same file is on feat-cmux-next.
lawrencecchen added a commit that referenced this pull request Oct 31, 2026
…n the layer map (#27805)

* plans(cmux-next): place CmuxNextAppCore, CmuxNextSessionTransfer and CmuxNextUiLayerPreview in architecture-layers.json

The arch ratchet's layer_unplaced is 3 at feat-cmux-next (recorded 0): three Package.swift
targets have no layer entry.
- CmuxNextAppCore (66946e0): ui, mixes service and domain. Seam protocols whose public
  interface names AgentPane and Sidebar (ui) types; only CmuxNextApp imports it.
- CmuxNextSessionTransfer (ec1311e, #20945): ui, mixes domain. Transfer values and the Move
  Sessions picker as data; its public interface returns CmuxNextDesign's CmuxDialogSpec.
- CmuxNextUiLayerPreview (fe5fcb8, #24978): ui. A Debug-only SwiftUI leaf on Design and Icons.

Each takes its highest layer; every edge points to the same or a lower layer, so the hard, soft
and upward edge counts are unchanged (34, 12, 3). No exception.

* plans(cmux-next): CmuxNextSessionTransfer mixes core, not domain (review: Sendable values only, no state)
lawrencecchen added a commit that referenced this pull request Oct 31, 2026
…extUiLayerPreview (layer_unplaced 3 -> 0) (#28253)

arch-ratchet tip rise (reward-hacking audit, handoff/followups.md "arch-ratchet tip rises (no
exceptions)"): three targets came onto feat-cmux-next with no row in architecture-layers.json, so
layer_unplaced went 0 -> 3 and --update refused. Added by: CmuxNextAppCore 66946e0 (Leo, direct
push, in bb8e119), CmuxNextSessionTransfer ec1311e (Leo, #20945), CmuxNextUiLayerPreview
fe5fcb8 (Leo, #24978).

All three are ui by their dependencies: AppCore names CmuxNextAgentPane and CmuxNextSidebar (ui)
types in its public interface (the row perf/chrome-parity already has, e40abff, plus a plan to
lift those types); SessionTransfer depends on CmuxNextDesign (ui) and CmuxNextSettings (domain);
UiLayerPreview on CmuxNextDesign and CmuxNextIcons (ui). No edge is upward from ui, so no other
layer row moves. No exception, no ratchet number raised.
cmux-bot Bot added a commit that referenced this pull request Nov 1, 2026
)

`swift build --build-tests -c release` of Packages/macOS/CmuxNext failed with
"UiLayerPreviewTests.swift:6:20: cannot find 'UiLayerPreviewData' in scope"
since fe5fcb8 (#24978). The CmuxNextUiLayerPreview library defines
CMUX_UI_LAYER_PREVIEW only in Debug and its whole source is inside that
guard, so in Release the library is empty, while its test target had no
define and no guard. Every Release-config Swift suite step on the fleet
(package-test-lane.sh suite with CMUX_SWIFT_SUITE_CONFIGURATION=release)
stopped at this build error, e.g. jobs a836ea817d9250a196502b2b and
9d819957423526c18421578e.

Why the guard and not moving UiLayerPreviewData out of it: #24978 makes the
preview leaf Debug-only on purpose (docs/cmux-next/native-ui-host.md: "is
compiled only in the Debug configuration ... not included in release app
builds"; architecture-layers.json notes it as Debug-only). Its only consumer
is the Debug Prototypes/UiLayerHost. Shipping its data type in Release would
undo that for no user. So the test target now takes the same define with the
same condition (one shared uiLayerPreviewDefine, so the two cannot drift),
and the test file sits inside #if CMUX_UI_LAYER_PREVIEW: in Release the test
target builds with no tests; in Debug the test runs as before.

Red: the existing Release suite builds above fail at base 2a822f8.
Green: fleet Release-config suite build at this head (job IDs in the PR).

Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — aa4d7493 Deployed Oct 24, 2026 by teamleaderleo via namespace autofix #2498
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