Skip to content

fix(next): retain Dock policy source through KVO teardown - #27385

Merged
teamleaderleo merged 6 commits into
feat-cmux-nextfrom
fork-dock-observer-lifetime
Oct 29, 2026
Merged

teamleaderleo merged 6 commits into
feat-cmux-nextfrom
fork-dock-observer-lifetime

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Starting notification observation could release NSRunningApplication.current while its activationPolicy KVO observer was still registered. This crashed the fork action test process with signal 11. The policy stream now retains its source until cancellation invalidates the observer, then releases it. The callback continues reading the policy directly from the observed object.

The regression uses the production KVO bridge with a test-owned observable. It checks source retention after the caller releases it, policy delivery, and source release on consumer cancellation while the stream remains alive.

Validation:

  • Before: fleet step e99abab9f1686afd420c4ed5 reached ForkConversationTests and crashed with signal 11 and the activation-policy observer warning.
  • After: fleet step a516a911b4aadb7c4290b739 compiled the package/tests and passed DockBadgeTests (4), DockBadgeObservationTests (1), and ForkConversationTests (6), at c3df46547462cf072a46971ac9e8eceeca9133a3. Subsequent changes document the holder invariant and remove an unnecessary unsafe annotation from Foundation's Sendable KVO token; executable behavior is unchanged.
  • Final head f23076a23ee69a5be132ea147dadd476e175eac5: remote fast gates passed crash-ratchet comparison, prepush checks, and crash-class rules. Exact-head app compile and independent review are running.

Risk: KVO ownership and cancellation ordering. The holder is initialized before publication and modified only by AsyncStream's once-only termination callback. The KVO token is invalidated before the source is released. No new production task or timer; the existing notification task owns stream consumption.

No capture: this corrects observer ownership and preserves the existing Dock badge appearance.

Agent session: agent session

@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 f23076a: 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=pr27385 -f ref=fork-dock-observer-lifetime -f platform=macos -f backend_mode=local

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

@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 Oct 29, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@teamleaderleo
teamleaderleo force-pushed the fork-dock-observer-lifetime branch from 4205a4e to f33b509 Compare October 29, 2026 10:57
@cursor

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

@blacksmith-sh

blacksmith-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpc60g3ho6/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpt8dwhlpj/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

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

@teamleaderleo
teamleaderleo merged commit 17d64ea into feat-cmux-next Oct 29, 2026
156 of 159 checks passed
@teamleaderleo
teamleaderleo deleted the fork-dock-observer-lifetime branch October 29, 2026 11:57
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40872205512 at eef18f1 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 20f21d4. This pull request is one of 5 merged since: #27385, #27403, #26843, #27312, #27407.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40869443998 at 17d64ea failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 20f21d4. This pull request is one of 1 merged since: #27385.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

teamleaderleo added a commit that referenced this pull request Oct 29, 2026
…Dock policy KVO fix)

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

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40870120427 at 5f33ee4 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 20f21d4. This pull request is one of 3 merged since: #27385, #27403, #26843.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40870378984 at 90e1666 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 20f21d4. This pull request is one of 4 merged since: #27385, #27403, #26843, #27312.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40873692330 at 52fea2d failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 20f21d4. This pull request is one of 5 merged since: #27385, #27403, #26843, #27312, #27407.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

teamleaderleo added a commit that referenced this pull request Oct 29, 2026
…e daemon-tests signal 11 fix #27385)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo pushed a commit that referenced this pull request Oct 30, 2026
…reds (#28036)

* fix(cmux-next checks): clear the three base reds of the cmux-next checks job (package deps, crash ratchet)

Package dependency lists sorted: CmuxNextAccounts' TeamInviteConsentWindow
uses DemandTimer from CmuxNextWakeups (a0ee135); the target now declares it.

Crash safety: six crash-ratchet rows rose on the tip. Each new hit is fixed in
the code, not waived away:
- cmux-tui-core unwrap 1149 -> 1150 (915bab1): the roster's agent_records
  read recovers a poisoned lock (PoisonError::into_inner), as its 340 siblings do.
- CmuxNextSidebar dynamic_dispatch 3 -> 5 (f97775b): the disclosure chevron
  sets its turn as a typed CATransform3D, not by key-value coding.
- MessagesLabHome index_subscript (banned) 0 -> 1 (6ac0d64): the row
  bitmap write takes its slot from out.checkedIndex on the same line again.
- MessagesLabHome unchecked 14 -> 16 and unchecked.waived 1 -> 4 (6ac0d64):
  PaletteScope's main-thread slot, process palette and box table, and
  Fixture.baseGeneration, move from nonisolated(unsafe) statics into one
  OSAllocatedUnfairLock. Render workers read the process palette and the base
  generation while the main thread writes them, so this was a real data race.
  PaletteBox keeps @unchecked Sendable with a reviewed crash-allow (two lets set
  before publication): recorded with --record-waivers, waived 1 -> 2.
- CmuxNextDesign unchecked.waived 3 -> 4 (17d64ea, #27385): the Dock
  policy observation keeps its object in an OSAllocatedUnfairLock
  (uncheckedState) instead of a hand-rolled @unchecked Sendable holder.

Patches/ for Fixture, Transcript and WindowView regenerated with
sync-messageslab.sh --write-patches (WindowView's patch was already stale on
the tip); --check passes. The arch ratchet's global_mutable_statics falls by
three; the one lock is a reviewed exception.

Red on base b3587f5, green here: python3 scripts/cmux-next/crash_ratchet.py
(6 rows), python3 scripts/cmux-next/check-package-dependency-lists.py (CI run
on 49d2105).

Sidebar-Look: no visual change

* arch ratchet: the PaletteScope lock exception names its owner and expires 2026-11-13

* fix(home): PaletteBox's crash-allow names why it is not checked Sendable, its owner and its expiry (2026-11-13)

A checked Sendable PaletteBox needs a Sendable FixtureTheme, and
FixtureTheme.swift:28 holds a CGGradient, which the SDK does not mark
Sendable: the fleet probe e72b1f95374d27da0c9f8e94 (scratch 78d5dd9)
failed with "stored property 'gradient' ... contains non-Sendable type
'CGGradient'" (NSColor passed). The waiver stays, recorded as before.

This branch was previously deployed

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