Repository navigation
base red: arch-ratchet after #36133 - #36207
Conversation
…wo statics Fixes the arch-ratchet tip red after #36133: [stateful_singletons] +2 (CmuxNextAgentPane: AgentPageFlickerLog.shared and its static occlusion watch). The agent tab store's wiring (AgentTabStore.wired, built once per AppServices) makes the app run's log with AgentPageFlickerLog.forAppRun() (nil outside an app bundle, as `shared` was) and hands it to every pane through AgentPaneShared.flickerLog. A pane keeps it (AgentPaneView.flickerLog) and its bridge, navigation delegate and AgentPageTerminations record through it. The window occlusion watch is the log's own instance state: each pane asks for it, the first starts it. A pane with no log (tests) writes nothing. Threading is unchanged: a caller's turn only builds the JSON line; the file create, append and roll-over run on the log's utility queue, never the main thread. Test: AgentPageFlickerLogTests.everyPaneAsksForTheWindowWatchAndAFlipIsOneLine. Red on base b1b7a3f: arch-ratchet.py --base bacb88f --head b1b7a3f refuses stateful_singletons +2; --audit at b1b7a3f counts 201 over 199. Green on this commit.
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
web and size checks: green Shipped in:
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41992440601 at c293fc3 failed: cmux-next crash ends the app. |
…l holds it; review F1)
This comment has been minimized.
This comment has been minimized.
|
Review (claude-review-subagent): SHIP at c425e04 Independent correctness review of the exact head. The first pass at 9640563 found one HOLD issue: the new test's NSWindow was closed with
|
|
Classification of the non-green checks on this head:
|
Bugbot needs on-demand usage enabledBugbot 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. |
…wn occlusion observer) (#36502) * base red: arch-ratchet observer_sites +1 from #36133 (flicker log's own occlusion observer) The tip's arch ratchet (bacb88f..tip) refuses observer_sites +1 (CmuxNextAgentPane +1): AgentPageFlickerLog.watchWindows registered its own MainActorObservation of NSWindow.didChangeOcclusionStateNotification for every window (27fa467, #36133; #36207 moved it from a static to the log instance, and the site stayed). The app already observes every window's occlusion once: SurfaceInvariantMonitor .observeWindowOcclusion (AppServices wiring). That observer now hands each flip to the agent flicker log (services.madeAgentTabs?.paneShared.flickerLog?.recordOcclusion(of:)), the arch rule's right pattern (observe once per app, tell app subscribers directly). The log keeps no observer: watchWindows() only turns window lines on, as the first pane did before, and recordOcclusion(of:) writes the same window-occlusion line (window, visible, type). madeAgentTabs never makes the agent tab store, so a flip before agent tabs exist starts nothing. AgentTabStore.paneShared is no longer private, so the App can read it. Arch ratchet on this commit over origin/feat-cmux-next: observer_sites -1 (CmuxNextAgentPane -1); app_lines +1 (the forwarding line), carried by a dated exception in the next commit. Test: AgentPageFlickerLogTests.aFlipIsOneLineOnceAPaneAsks replaces everyPaneAsksForTheWindowWatchAndAFlipIsOneLine (watchWindows(center:) is gone): no line before a pane asks, one line per flip after two panes ask. * arch exception: app_lines +1 for the flicker log's occlusion forward (observer_sites -1) The one App line is the forward from SurfaceInvariantMonitor, the app's one window occlusion observer, to the agent flicker log. It replaces the log's own observer (observer_sites -1). Reviewed: Review (claude review subagent): SHIP at b113011. Expires 2026-11-19.
Takes back #36133: moves its flicker log from a static to one instance owned by AgentTabStore.wired (the composition root) to fix the arch-ratchet stateful_singletons +2 tip red; the log's behavior and its off-main writes do not change.
Fixes the
arch-ratchettip red onfeat-cmux-nextafter #36133 (culprit 27fa467):[stateful_singletons] +2 (CmuxNextAgentPane +2), fromAgentPageFlickerLog.sharedand itsstatic var occlusion.The log is now one instance that the composition root makes and passes in (plans/cmux-next/PATTERNS.md, composition root):
AgentTabStore.wired(to:)(built once perAppServices) makes it withAgentPageFlickerLog.forAppRun(). That is nil outside an app bundle, assharedwas. The store passes it to every pane throughAgentPaneShared.flickerLog.AgentPaneViewkeeps it (flickerLog). Its bridge, its navigation delegate andAgentPageTerminationsrecord through the pane's log. A pane with no log (tests) writes nothing.NotificationCenterso a test can post to its own.Threading does not change. The caller's turn only builds the JSON line. The file create, append and roll-over run on the log's utility
DispatchQueue, never on the main thread.flush()(queue.sync) is called only by tests.Red on base, green on head
Command:
python3 scripts/cmux-next/arch-ratchet.py --base bacb88f2349f --head b1b7a3ff9d02(the tip range), exit 1:arch-ratchet.py --audit --rev e3a11f5de68(current base):stateful_singletons 201 over the recorded 199.Head:
arch-ratchet.py --base origin/feat-cmux-next --head HEADgivesstateful_singletons -2 (CmuxNextAgentPane -2),no architecture count rises, exit 0.--audit --rev HEADreports no stateful_singletons rise (199).prepush-gate.py: no new violations.Regression test:
AgentPageFlickerLogTests.everyPaneAsksForTheWindowWatchAndAFlipIsOneLine. Two panes ask for the watch and one occlusion flip writes one line. The test does not compile on base, because the watch was a static onshared, andsharedis nil in tests.Fleet compile:
cmux-ci compile-check --app --package CmuxNext --ref c425e04a4f841067068c5e166a7d0b06f87924b8, job 1879bbb659bbbe4fd139e0c2: CmuxNext passed, app passed (also passed at 9640563, job 43da2f7b56759e66e5ca241d)Fleet test:
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg suite --arg Packages/macOS/CmuxNext --arg AgentPageFlickerLogTests, ref c425e04, step 9915cf9d004fc8ef48a8ea61 on aws-m4pro-7: 4 tests inAgentPageFlickerLogTestspassed, the new test includedChangelog
none
Observed / Not run
prepush-gate.py; the fleet compile and the fleet test run above.observer_sitessite (the occlusion watch). That row is part of older debt that no single commit raised (+15 at the tip), and the arch ratchet does not report it red. This PR keeps the count the same.