Commit Graph
34 Commits
Author SHA1 Message Date
OrcaWinandOrcaWin 3eb2765e66 test: remove low-value script, queue and docs coverage (#41551)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-12 05:44:15 -08:00
OrcaWinandOrcaWin 831f655b1d test: remove low-value smoke and fixture assertions (#41493)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-12 02:25:47 -08:00
Neil e902c9a65b refactor(workspace-layout): organize concrete domain owners (#41350)
* refactor(workspace-layout): organize concrete domain owners

* test(layout): retire obsolete legacy-leaf publication setup
2026-11-11 20:54:34 -08:00
OrcaWinandOrcaWin 252cfa3efd test: remove 34 low-value tests, including five whole suites (#41321)
* test: remove low-value startup and usage suites

* test: drop redundant form driver and lease recipes

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-11 17:40:04 -08:00
Neil 04158606b5 refactor(git): group command execution by concrete owners (#41316) 2026-11-11 17:05:03 -08:00
Brennan Benson 175f10e32b Run local usage services in a supervised backend process (#40792)
* Move local usage services into a supervised backend process

* Own usage recovery and worker retirement lifetimes

* Preserve answered usage data during background refresh

* Run independent usage scans concurrently in the backend

* Limit backend startup paths to the delegated usage service

* Show usage failures through backend recovery

* Include usage failure strings in the English catalog

* Keep usage update details beside refresh failures

* Resolve usage freshness failure from the final producer snapshot

* Retain the forced refresh completion requirement

* Keep managed backend failures out of application crash reports

* Preserve usage recovery boundaries across backend reconnects

* Match the backend RPC cancellation signal in the usage seam proof

* Avoid serializing backend requests before port delivery

* Keep receiving request validation in the boundary schemas

* test: align usage transport coverage with renderer project

* fix: preserve unknown usage state and renderer retirement

* fix(usage): revalidate tracking before scan admission

* fix(usage): retry failed backend startup on demand

* test(usage): isolate stale backend ownership checks
2026-11-11 16:39:52 -08:00
Brennan Benson 890ad4d8aa Prevent new blocking work on Electron main in CI (#41263)
* WIP: guard blocking main-process APIs with file ratchets

* Cover declared SQLite receivers and preserve daemon guards

* Cover SQL iteration and shared synchronous IPC in ratchets
2026-11-11 16:24:55 -08:00
OrcaWinandOrcaWin 0184d8187d test: remove 98 low-value cases and 17 suites (#41124)
* test: remove 60 low-value cases and orphaned conversion fixtures

* docs(ci): list supported Windows SSH host cells

* test: recognize direct Windows orcad server entry

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-11 06:08:53 -08:00
Neil 1af64194a4 refactor: group renderer agent sessions and runtime modules by owner (#40911)
* refactor: group renderer agent sessions and runtime modules by owner

* fix: carry moved owner paths into refactor ratchets

* test: remove retired empty sleep guard registration
2026-11-10 16:04:03 -08:00
Neil d1466f6017 refactor: finish terminal runtime and typography owner imports (#40761)
* refactor: finish terminal and Mobile defining-owner imports

* fix: retain completion coordinator type binding

* refactor: consolidate direct terminal tree imports

* refactor(renderer): import typography from defining owners
2026-11-10 04:51:57 -08:00
Brennan BensonandClaude Opus 5.5 15cabe65ac fix(terminal): scope parking and output coverage to each workspace (#40331)
* perf(native-chat): project structured chat tabs per workspace bucket

The shared chat-tab list was keyed on the whole unifiedTabsByWorktree
identity, so every tab write anywhere (terminal title batches included)
rescanned all tabs and handed every consumer a new list. Rebuild only the
buckets whose identity changed and return the previous list while no chat
tab changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): reconcile chat status membership per changed tab

The status bridge rebuilt every member and host group and captured every
chat on any tab-map or owner-input change, and recaptured every chat on any
launch notification. Membership now updates only the tabs whose identity
changed; owner-input changes re-resolve only unstamped tabs, the only ones
whose host depends on them; launch notifications name their session so only
its tabs are recaptured (unaddressed ones still recapture all). The sleep
and launch-directory companions of one projection land in one store write.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): guard whole tab-map triggers and hot-map listeners

Add a count ratchet for identity comparisons of the whole
unifiedTabsByWorktree/tabsByWorktree map in renderer code (counts may only
fall), wired into pnpm lint, run-ratchets discovery and changed-check
selection. Extend the advisory no-whole-hot-map-selector rule to inline
store listeners that compare a whole hot map and to effect bodies that use
one whole from getState().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* revert(lint): drop the hot-map listener/effect extension

The guard stays scoped to the repaired seams; no repository-wide rule change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): capture chat status on semantic tab changes; address tombstone retirement

Focus, preview and order-only tab writes no longer recapture a chat's
status: membership and the projection fences compare the fields the
projection reads. Absent-tombstone retirement now names the sessions it
retired, so no launch producer sends an unaddressed notification.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): keyed-record transition seam for tab maps and companion records

Writers build next tab buckets and keyed companion records through
replaceTabBuckets / replaceRecordEntries (or name the keys of a record they
already built), which record exactly which keys and tab IDs changed against
the produced record. Readers ask readTabMapChanges / readRecordChanges for
an addressed delta; any unannotated link reads as a full resync. Adds
subscribeTabTransitions and a store-observer installer registry. The
chat-tab list and the status bridge now consume addressed deltas and keep
the whole-list walk only as the cold path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): annotate every shared tab-map writer through the seam

Shared tabsByWorktree/unifiedTabsByWorktree writers (tab, editor, browser,
worktree, ssh, terminal create/close/navigation/title-batch/reconnect/
hydration, web-session mirroring and layout frames) now build or annotate
their next tab buckets and companion records with the exact workspace and
tab IDs they changed; full hydration, full frame builds and reconnect
inventories are named full resyncs. Writers that copied every bucket for
one tab (preview promotion, dirty-file preview clear, worktree removal
filters, sleeping-record identity rename) now keep unchanged buckets.

Replace the renderer-wide tab-map comparison ratchet with a narrow seam
guard: the repaired consumers may walk a whole tab map only in named cold
paths, and the pinned writer modules may not build raw seam records.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(store): name seam fields once; type seam records; record moved respawn writes

Writers stop repeating tracked field names (centralized in
seam-record-fields.ts), the seam takes a named KeyedSnapshot record type
instead of casts, and the layout-writer baseline records the respawn
helpers moved unchanged out of worktree-layout-lifecycle.ts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(store): drop seam field cast; record the seam field list in the layout-writer baseline

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): keep chat-tab list in source workspace order (C3/F1)

Every source workspace keeps a projection slot, even without chats, and the
seam reports when a write added or deleted a workspace key or moved a
surviving bucket, so the incremental list never reorders first-match
consumers; those transitions take the cold rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): keep projection and retirement debt awake (C2, F3)

A member is owed from attach or semantic change, members without a host
feed keep their own debt, and every reconciliation drains existing owed or
retired work even when no new member changed, including a closed last chat
whose feed is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): stop inferring host-mirror companion IDs from visible tabs (C1)

A host retraction can delete PTY or layout records for tabs neither
inventory lists, so the mirror funnel marks its tab-keyed records full
resync instead of advertising an incomplete addressed set.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): close indirect paths in the tab-map seam guard (C4)

The guard now rejects ordinary callers of the bridge cold path, value
imports the repaired consumers have not reviewed, and raw seam records built
into a local binding without a seam helper annotating it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): drive real tab actions through the status bridge (F2)

Close, session rebind with a late old-session tick, and a legacy owner
change, through createUnifiedTab/setTabLabel/closeUnifiedTab, so the
addressed reconciliation path is exercised.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: exempt seam field-name constants from the layout-writer ratchet; drop dead setters (F4)

The seam's SEAM_*_FIELDS lists name fields without writing them, so the
ratchet skips them and the raised baseline row is gone (renderer total 569,
main 571). setStructuredChatSleptAt and the two launch-directory setters
lost their last callers to the batched companion write.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): Map provenance and source-ordered change keys in the seam (PR A addenda)

replaceMapEntries gives Map-typed fields (runtimeStatusByEnvironmentId) the
same weak provenance and readRecordChanges protocol. Change keys compose
forward through a chain, oldest write first, so added keys come out in
source order (index keys first for records, as Object.keys orders them). A
surviving key deleted and re-added, in one write or across a chain, and a
record builder that moves a surviving key, read as a 'reordered' full
resync.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): writers declare key order; seam reports ordered additions (N1c, N1a)

The seam no longer scans both records to rediscover order on every
annotation. replace* helpers know insertion order by construction; annotate*
takes a declared order ('appended' by default, 'reordered' for a builder
that moves keys, read as a full resync), verified only under test.
Addressed changes now report keys, source-ordered added keys and deleted
keys, so a reader holding its own key ranks places changes in O(changed).
Worktree removal declares its editor-transfer records reordered.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): scope the chat-tab projection to chat-bearing workspaces (N2c)

The projection keeps chat subsets only for workspaces that have chats, plus
per-workspace source ranks that change only when a workspace is added or
deleted. A focus, label or title write costs O(that workspace); the
ordered list is materialized lazily, only for full-list readers, and keeps
its identity while no chat changed. Workspace adds and deletes are
addressed through the ranks instead of a cold rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): resolve aliases and require annotation before publication (C4)

Any reference to a cold helper or Object enumerator outside its named
callers counts, including aliases and callbacks; writer values are followed
through local aliases and must be annotated before the write that
publishes them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): scoped hydration keeps the warm chat list equal to a cold read (D1)

Drives the real scoped hydrateTabsSession on early/later chats of one
session: source order, list order and first-match precedence match a cold
rebuild, including when the selection order differs from hydrated order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): cache the chat-workspace order across chat edits (D1 item 5)

The lineage keeps chat-bearing workspaces in rank order and only inserts or
removes one when it gains its first or loses its last chat; a chat object
change re-flattens the list without re-sorting. Full resyncs rebuild it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): the seam guard recognizes only construction helpers and cold marks (D1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(store): addressed provenance only from constructing helpers (D1)

Remove annotateRecordReplacement/annotateTabBucketReplacement and their
caller-declared order: only replace*/recordDraft/tabBucketDraft, which
perform the construction, derive changed keys, additions and deletions from
their operations (delete-then-reinsert reads as reordered); opaque
reconstructions use markFullResync. Every former annotate caller is
migrated: ordinary local writes build their records once through helpers
or drafts with today's operations and order; scoped tab and terminal
hydration, the reconnect inventory, host-mirror application and layout
flush are full resyncs. Change readers move to keyed-record-change-reads.ts.
Renderer layout-writer total 567 (main 571).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): type the hydration fixture without a cast

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): seam record writes define own entries, even __proto__ (N5c)

replaceRecordEntries and drafts assigned through the inherited __proto__
setter, so a tab id '__proto__' lost its own PTY, layout and startup
entries. Both now define an own data property, as the computed-key literals
they replaced did; contract test included.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(terminal): build each createTab record once (N4c)

createTab took ensureGroup's and insertSplitGroup's whole records and the
orphan cleanup's seam records, then rebuilt them through the seam. It now
takes the per-worktree group and split results and gives the orphan
cleanup only the bucket it reads, so every seam record is constructed once
with its ordered operations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): record createTab's orphan-cleanup input view (renderer total 570, main 571)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(terminal): split orphan cleanup so createTab cleans only companion caches (N6c)

buildOrphanTerminalCompanionCleanupPatch holds the per-tab cache, tab-bar
order and selection cleanup; buildOrphanTerminalCleanupPatch adds the seam
record deletes on top, unchanged for reconciliation. createTab calls only
the companion part with real state and deletes the seam entries through its
single construction, so the stub input view and its layout-writer baseline
rise are gone (terminal-tab-creation.ts back to 10).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(terminal): filter the orphan cleanup's kept bucket once (N7c)

The full cleanup filters the workspace's tabs once and hands the kept
bucket to the companion part, which takes its replacement active tab from
it; createTab's companion-only call still makes its single find pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Scope terminal parking inputs and registries to workspace ownership

* Guard parking ownership and cover background split output

* Connect parking ownership to accepted tab transitions

* Use accepted Map provenance and preserve parking owner order

* Read paired parking capability deltas from the shared seam

* Consume ordered additions from accepted record transitions

* Expose first-tab and outside-owner views of terminal membership

* Construct terminal binding and startup transitions at their writers

* Construct shutdown and orphan cleanup transitions from ordered operations

* Construct presentation and sleeping record transitions at their writers

* Express semantic parking inputs and close annotation guard escapes

* Keep replacement values typed from their source records

* Construct sleeping session moves without changing nullable status records

* Follow the constructing seam integer-key module

* Adopt the separated transition reader module

* Ratchet the cold parking compiler bailout improvement

* Exercise parking fixtures through addressed inputs and live ownership

* fix(tabs): keep removed worktrees' group entries deleted on removal

The second emptied-group collapse in removeWorktreeLayout also visited
removed worktrees and wrote their deleted groupsByWorktree entry back as
an empty list, a delete-then-set the seam read as a reordered full resync.
It now visits only surviving workspaces, so removal stays addressed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(tabs): closeEmptyGroup collapses through the shared builder again

collapseGroupLayout takes the record builder, and the renderer passes the
seam's replaceRecordEntries, so the per-worktree collapse publishes with
provenance without new counted layout writes (tabs-group-actions back to 12).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(tabs): reconciliation names its draft fields once (2 + 4 <= 9)

The written-field sets come from SEAM_ field-name constants instead of
string literals, so the reconciliation split no longer raises the combined
layout-writer count (tabs-reconciliation 2, tabs-reconciliation-batch 4,
against the original 9).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(terminal): bound parking updates to changed ownership facts

* fix(terminal): type parking ratchet entry descriptors

* chore(tabs): publish reconciliation drafts with explicit field writes (N9c)

Revert the SEAM_ field-name constants: the drafts are held under their own
names and finishReconciliationDrafts publishes each written draft as an
explicit unifiedTabsByWorktree/groupsByWorktree/activeGroupIdByWorktree/
layoutByWorktree property, so the counter sees every real write and the
split totals 2 + 4 against the original 9, with no exemption.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(parking): follow merged module paths

* Move parking assignment invalidation into the store observer

* Limit parking assignment checks to changed tab rows

* Separate tab row recording from provenance reads

* Preserve uncertainty across skipped tab reinsertion

* Keep root terminal watchers within workspace surfaces

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-09 23:36:10 -08:00
OrcaWinandOrcaWin 6231ca5695 test: remove low-value fixtures and duplicate cases (#40667)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-09 22:41:27 -08:00
OrcaWinandOrcaWin 3d28b6fbf8 test: remove low-value Codex lifecycle and compiler examples (#40588)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-09 18:25:15 -08:00
Brennan Benson 7777f352d8 build: fail the React Compiler ratchet on stale uncompiled-list paths (#40198)
* build: fail the React Compiler ratchet on stale uncompiled-list paths

- A listed path that no longer names a renderer source (a rename or split) fails the ratchet, so the file can't silently start compiling.
- The build and the ratchet read the lists through one parser that drops trailing notes, resolved from the repo root rather than the current directory.

* build: resolve uncompiled lists from import.meta.url and check listed paths on disk

- electron-vite's config bundle rewrites import.meta.url per file but not import.meta.dirname, so the repo root came out wrong and desktop builds failed with ENOENT.
- A listed path is stale only if no renderer file exists there; the scan's test-name filter no longer flags shipped files like notification-test-delivery.ts.

* build: require uncompiled-list entries to name the exact file the build matches

A ../ segment, a directory or a different letter case passed the existence check, but the build's exclusion matches only the exact path, so the file still compiled.

* build: reject backslashes in uncompiled-list entries

On Windows path.join turns a backslash into a separator, so the entry passed the check while the build's forward-slash match missed it.
2026-11-09 17:53:19 -08:00
Brennan BensonandClaude Opus 5.5 376cf18634 perf(native-chat): addressed tab-map transitions for chat membership (#40098)
* perf(native-chat): project structured chat tabs per workspace bucket

The shared chat-tab list was keyed on the whole unifiedTabsByWorktree
identity, so every tab write anywhere (terminal title batches included)
rescanned all tabs and handed every consumer a new list. Rebuild only the
buckets whose identity changed and return the previous list while no chat
tab changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): reconcile chat status membership per changed tab

The status bridge rebuilt every member and host group and captured every
chat on any tab-map or owner-input change, and recaptured every chat on any
launch notification. Membership now updates only the tabs whose identity
changed; owner-input changes re-resolve only unstamped tabs, the only ones
whose host depends on them; launch notifications name their session so only
its tabs are recaptured (unaddressed ones still recapture all). The sleep
and launch-directory companions of one projection land in one store write.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): guard whole tab-map triggers and hot-map listeners

Add a count ratchet for identity comparisons of the whole
unifiedTabsByWorktree/tabsByWorktree map in renderer code (counts may only
fall), wired into pnpm lint, run-ratchets discovery and changed-check
selection. Extend the advisory no-whole-hot-map-selector rule to inline
store listeners that compare a whole hot map and to effect bodies that use
one whole from getState().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* revert(lint): drop the hot-map listener/effect extension

The guard stays scoped to the repaired seams; no repository-wide rule change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): capture chat status on semantic tab changes; address tombstone retirement

Focus, preview and order-only tab writes no longer recapture a chat's
status: membership and the projection fences compare the fields the
projection reads. Absent-tombstone retirement now names the sessions it
retired, so no launch producer sends an unaddressed notification.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): keyed-record transition seam for tab maps and companion records

Writers build next tab buckets and keyed companion records through
replaceTabBuckets / replaceRecordEntries (or name the keys of a record they
already built), which record exactly which keys and tab IDs changed against
the produced record. Readers ask readTabMapChanges / readRecordChanges for
an addressed delta; any unannotated link reads as a full resync. Adds
subscribeTabTransitions and a store-observer installer registry. The
chat-tab list and the status bridge now consume addressed deltas and keep
the whole-list walk only as the cold path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): annotate every shared tab-map writer through the seam

Shared tabsByWorktree/unifiedTabsByWorktree writers (tab, editor, browser,
worktree, ssh, terminal create/close/navigation/title-batch/reconnect/
hydration, web-session mirroring and layout frames) now build or annotate
their next tab buckets and companion records with the exact workspace and
tab IDs they changed; full hydration, full frame builds and reconnect
inventories are named full resyncs. Writers that copied every bucket for
one tab (preview promotion, dirty-file preview clear, worktree removal
filters, sleeping-record identity rename) now keep unchanged buckets.

Replace the renderer-wide tab-map comparison ratchet with a narrow seam
guard: the repaired consumers may walk a whole tab map only in named cold
paths, and the pinned writer modules may not build raw seam records.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(store): name seam fields once; type seam records; record moved respawn writes

Writers stop repeating tracked field names (centralized in
seam-record-fields.ts), the seam takes a named KeyedSnapshot record type
instead of casts, and the layout-writer baseline records the respawn
helpers moved unchanged out of worktree-layout-lifecycle.ts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(store): drop seam field cast; record the seam field list in the layout-writer baseline

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): keep chat-tab list in source workspace order (C3/F1)

Every source workspace keeps a projection slot, even without chats, and the
seam reports when a write added or deleted a workspace key or moved a
surviving bucket, so the incremental list never reorders first-match
consumers; those transitions take the cold rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(native-chat): keep projection and retirement debt awake (C2, F3)

A member is owed from attach or semantic change, members without a host
feed keep their own debt, and every reconciliation drains existing owed or
retired work even when no new member changed, including a closed last chat
whose feed is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): stop inferring host-mirror companion IDs from visible tabs (C1)

A host retraction can delete PTY or layout records for tabs neither
inventory lists, so the mirror funnel marks its tab-keyed records full
resync instead of advertising an incomplete addressed set.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): close indirect paths in the tab-map seam guard (C4)

The guard now rejects ordinary callers of the bridge cold path, value
imports the repaired consumers have not reviewed, and raw seam records built
into a local binding without a seam helper annotating it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): drive real tab actions through the status bridge (F2)

Close, session rebind with a late old-session tick, and a legacy owner
change, through createUnifiedTab/setTabLabel/closeUnifiedTab, so the
addressed reconciliation path is exercised.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: exempt seam field-name constants from the layout-writer ratchet; drop dead setters (F4)

The seam's SEAM_*_FIELDS lists name fields without writing them, so the
ratchet skips them and the raised baseline row is gone (renderer total 569,
main 571). setStructuredChatSleptAt and the two launch-directory setters
lost their last callers to the batched companion write.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(store): Map provenance and source-ordered change keys in the seam (PR A addenda)

replaceMapEntries gives Map-typed fields (runtimeStatusByEnvironmentId) the
same weak provenance and readRecordChanges protocol. Change keys compose
forward through a chain, oldest write first, so added keys come out in
source order (index keys first for records, as Object.keys orders them). A
surviving key deleted and re-added, in one write or across a chain, and a
record builder that moves a surviving key, read as a 'reordered' full
resync.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): writers declare key order; seam reports ordered additions (N1c, N1a)

The seam no longer scans both records to rediscover order on every
annotation. replace* helpers know insertion order by construction; annotate*
takes a declared order ('appended' by default, 'reordered' for a builder
that moves keys, read as a full resync), verified only under test.
Addressed changes now report keys, source-ordered added keys and deleted
keys, so a reader holding its own key ranks places changes in O(changed).
Worktree removal declares its editor-transfer records reordered.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): scope the chat-tab projection to chat-bearing workspaces (N2c)

The projection keeps chat subsets only for workspaces that have chats, plus
per-workspace source ranks that change only when a workspace is added or
deleted. A focus, label or title write costs O(that workspace); the
ordered list is materialized lazily, only for full-list readers, and keeps
its identity while no chat changed. Workspace adds and deletes are
addressed through the ranks instead of a cold rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): resolve aliases and require annotation before publication (C4)

Any reference to a cold helper or Object enumerator outside its named
callers counts, including aliases and callbacks; writer values are followed
through local aliases and must be annotated before the write that
publishes them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): scoped hydration keeps the warm chat list equal to a cold read (D1)

Drives the real scoped hydrateTabsSession on early/later chats of one
session: source order, list order and first-match precedence match a cold
rebuild, including when the selection order differs from hydrated order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(native-chat): cache the chat-workspace order across chat edits (D1 item 5)

The lineage keeps chat-bearing workspaces in rank order and only inserts or
removes one when it gains its first or loses its last chat; a chat object
change re-flattens the list without re-sorting. Full resyncs rebuild it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): the seam guard recognizes only construction helpers and cold marks (D1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(store): addressed provenance only from constructing helpers (D1)

Remove annotateRecordReplacement/annotateTabBucketReplacement and their
caller-declared order: only replace*/recordDraft/tabBucketDraft, which
perform the construction, derive changed keys, additions and deletions from
their operations (delete-then-reinsert reads as reordered); opaque
reconstructions use markFullResync. Every former annotate caller is
migrated: ordinary local writes build their records once through helpers
or drafts with today's operations and order; scoped tab and terminal
hydration, the reconnect inventory, host-mirror application and layout
flush are full resyncs. Change readers move to keyed-record-change-reads.ts.
Renderer layout-writer total 567 (main 571).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(native-chat): type the hydration fixture without a cast

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(store): seam record writes define own entries, even __proto__ (N5c)

replaceRecordEntries and drafts assigned through the inherited __proto__
setter, so a tab id '__proto__' lost its own PTY, layout and startup
entries. Both now define an own data property, as the computed-key literals
they replaced did; contract test included.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(terminal): build each createTab record once (N4c)

createTab took ensureGroup's and insertSplitGroup's whole records and the
orphan cleanup's seam records, then rebuilt them through the seam. It now
takes the per-worktree group and split results and gives the orphan
cleanup only the bucket it reads, so every seam record is constructed once
with its ordered operations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ratchets): record createTab's orphan-cleanup input view (renderer total 570, main 571)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(terminal): split orphan cleanup so createTab cleans only companion caches (N6c)

buildOrphanTerminalCompanionCleanupPatch holds the per-tab cache, tab-bar
order and selection cleanup; buildOrphanTerminalCleanupPatch adds the seam
record deletes on top, unchanged for reconciliation. createTab calls only
the companion part with real state and deletes the seam entries through its
single construction, so the stub input view and its layout-writer baseline
rise are gone (terminal-tab-creation.ts back to 10).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf(terminal): filter the orphan cleanup's kept bucket once (N7c)

The full cleanup filters the workspace's tabs once and hands the kept
bucket to the companion part, which takes its replacement active tab from
it; createTab's companion-only call still makes its single find pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(tabs): keep removed worktrees' group entries deleted on removal

The second emptied-group collapse in removeWorktreeLayout also visited
removed worktrees and wrote their deleted groupsByWorktree entry back as
an empty list, a delete-then-set the seam read as a reordered full resync.
It now visits only surviving workspaces, so removal stays addressed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(tabs): closeEmptyGroup collapses through the shared builder again

collapseGroupLayout takes the record builder, and the renderer passes the
seam's replaceRecordEntries, so the per-worktree collapse publishes with
provenance without new counted layout writes (tabs-group-actions back to 12).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(tabs): reconciliation names its draft fields once (2 + 4 <= 9)

The written-field sets come from SEAM_ field-name constants instead of
string literals, so the reconciliation split no longer raises the combined
layout-writer count (tabs-reconciliation 2, tabs-reconciliation-batch 4,
against the original 9).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(tabs): publish reconciliation drafts with explicit field writes (N9c)

Revert the SEAM_ field-name constants: the drafts are held under their own
names and finishReconciliationDrafts publishes each written draft as an
explicit unifiedTabsByWorktree/groupsByWorktree/activeGroupIdByWorktree/
layoutByWorktree property, so the counter sees every real write and the
split totals 2 + 4 against the original 9, with no exemption.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-09 12:19:13 -08:00
Neil 815854777b refactor: give browser, RPC and process contracts concrete owners (#40167)
* refactor: separate execution route and child exit owners

* refactor: move browser data into defining feature owners

* refactor: give runtime RPC entry its shutdown implementation

* refactor: use defining process types and colocate host telemetry test

* docs(process-host): point piped child contract to Node owner

* docs(process-host): clarify both piped contract owners
2026-11-08 23:32:21 -08:00
OrcaWinandOrcaWin 6c3ca0ab6d test: remove 34 low-value suites and redundant cases (#40115)
* test: remove low-value ACP, CLI and simulated scroll suites

* test: remove redundant runtime, session composition and timing suites

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-08 20:10:32 -08:00
OrcaWin a2d490700b build: enable React Compiler for the renderer and web build (#39811) 2026-11-08 19:41:47 -08:00
Brennan Benson 1d28b8882c chore(ratchets): fail PRs that add sync fs calls on Electron main or new setInterval polls (#39930)
* chore(ratchets): count sync fs calls on Electron main and setInterval calls

Sync fs on main and fixed-cadence intervals that never settle were two of the
most common perf fix classes since September, and no gate counted them. Both
ratchets grandfather today's uses per file and fail when a file's count grows.

* chore(ratchets): count every sync fs export, src/shared and node:timers intervals

Review: the allow-list missed descriptor/copy APIs, src/shared helpers run on
main too, and setInterval imported from node:timers escaped the timer count.

* chore(ratchets): keep hosted setInterval calls beside a named timer import

Review: a named node:timers import zeroed window/globalThis calls too, a
destructured require was counted twice, and collector edits didn't select
the timer ratchet in check:changed.

* chore(ratchets): charge calls through an alias, not the alias binding

Decider ruling B on review finding C6: binding a plain alias of a gated call
counted as a use, so an alias refactor failed every collector-based ratchet.
Conditional/fallback aliases and exported bindings stay charged.

* chore(ratchets): count bare setInterval only when nothing local shadows it

Review: the timer ratchet kept its own narrower binding resolver, so alias
and namespace-destructure forms of an imported setInterval counted twice.
Module bindings are the shared collector's; a bare call is the global only
when the file declares no setInterval binding.

* chore(ratchets): resolve bare setInterval calls per scope

Decider ruling A: the file-wide shadow rule let an unrelated parameter or type
declaration named setInterval hide every global poll in the file. Each bare
call now resolves through a single-file TypeScript checker (noLib, noResolve)
and counts when it binds to nothing declared in the file.

* chore(ratchets): write the timer baseline exactly as --prune does

* chore(ratchets): charge global timer aliases and bracket access

CodeRabbit: `const schedule = setInterval; schedule(poll)` and
`window['setInterval'](poll)` counted zero. Count value references to the
global timer (per scope) instead of only direct calls.

* chore(ratchets): charge shorthand timer escapes; skip writes, typeof and JSX tags

Review: `{ setInterval }` of the global counted 0, while assignments to it,
parenthesized typeof probes and a <setInterval/> tag counted 1.

* chore(ratchets): charge compound assignments to the global timer

Review: `||=` and `??=` read setInterval before writing it, so only a
plain `=` target is write-only.

* chore(ratchets): regenerate baselines for files main moved

main's SSH reorganisation moved counted files under src/main/ssh and
src/main/managed-server; counts are unchanged except one sync fs call main
removed.
2026-11-08 13:34:07 -08:00
Neil a964c9e0b5 refactor(acp): group transport, session, launch, and timeline owners (#39897) 2026-11-08 08:42:10 -08:00
Neil 83f8e6340d refactor(shared): organize file operations and storage owners (#39746) 2026-11-07 22:58:35 -08:00
OrcaWinandOrcaWin bb368c3ae6 chore(ratchet): flag discarded subscriptions and store snapshots React Compiler would cache (#39630)
Two new React Compiler compat hazards:
- discarded-subscription: a useSyncExternalStore call whose result is thrown
  away, so the reads after it get cached on unrelated inputs.
- store-read-in-memo-block: a render-level getState() that the compiler places
  in a cache-guarded block. Reads inside the source's own useMemo or callbacks
  keep their written deps and are skipped.

The compiled output is parsed once for hook and store reads. Current sites are
grandfathered in the hazard baseline.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 16:45:10 -08:00
OrcaWinandOrcaWin 60003df154 feat(i18n): make render-path translation reactive to the UI language (#39353)
Add useTranslate()/useIntlLocale() backed by a TranslationScopeProvider whose key
changes only with the active language or its own resources, an AST codemod that
rewrites render-path translate()/getIntlLocale() calls and threads the hook values
into render-called helpers, a helper analysis report, and a ratchet that keeps
render-path module translate() calls from growing. Apply the codemod to
components/native-chat.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 13:44:33 -08:00
Neil c231b5d7da refactor: place renderer store state with defining feature owners (#39508) 2026-11-07 08:19:02 -08:00
OrcaWinandOrcaWin f6874cc512 refactor(renderer): make memo invalidators and layout flushes compiler-safe (#39414)
React Compiler drops bare `void x;` reads, narrows callback deps to the fields
read, and oxc 0.152 emits `a[q.head++]` as a prefix update. Rewrite those
sites so they behave the same with the compiler on, and identically to today
with it off:

- `void tick` memo invalidators -> `recomputeOn([tick], () => ...)`
- `void el.offsetWidth` transition resets -> `forceLayoutReflow(el)`
- pty termination queue reads, then advances, the head index
- host agent preference subscription takes the whole subscription object

Prunes the compiler-compat hazard baseline from 40 to 2 entries.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 02:37:53 -08:00
OrcaWinandOrcaWin a89cdae5dc build(renderer): fail compiler-compat baseline shrinks only in touched files (#39440)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 01:59:33 -08:00
OrcaWinandOrcaWin 75910ba631 build(renderer): gate React Compiler compatibility with a ratchet (#39324)
Adds oxc-transform-react as a devDependency and a ratchet that runs React
Compiler in analysis mode over the shipped renderer sources. Files can't gain
bailouts (new files must compile fully), and new code the compiler would run
differently is banned: hooks it memoizes into a cached block, bare `void x;`
reads, member postfix updates used as values, and "use no memo" opt-outs.
Both baselines are generated by --update / --prune.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 00:42:01 -08:00
OrcaWinandOrcaWin 90433cd212 test: remove 235 low-value main, scripts and shared tests (#39376)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-07 00:21:18 -08:00
Neil 3228095e97 refactor(renderer): organize launch, workspace, browser and search owners (#38845)
* refactor(renderer): group launch, workspace, and browser owners

* fix(renderer): restore workspace name Enter focus to agent picker
2026-11-06 10:37:45 -08:00
OrcaWinandOrcaWin 4001dc9edf test: remove 112 low-value static-gate and runtime tests (#38723)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-05 15:42:24 -08:00
OrcaWinandOrcaWin cde6bd02f3 test: remove 181 low-value skill and source-policy tests (#38619)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-05 10:52:11 -08:00
Neil 18bab90efa refactor(main): group client RPC pairing and host runtime owners (#38584)
* refactor(main): group client RPC pairing and host runtime owners

* test: target concrete mobile notification owner in headless fixture

* test: retarget dynamic quit mocks to runtime metadata owner
2026-11-05 09:16:47 -08:00
Neil 6bb2e13c35 refactor(tooling): organize remaining scripts by domain owners (#38407)
* refactor(tooling): group remaining scripts by concrete domain owners

* fix(tooling): preserve relocated launcher resource roots
2026-11-05 00:29:16 -08:00
Neil 9bd6272fdf refactor(tooling): organize build, CI, and test owners (#38130)
* refactor(tooling): organize test runtime and maintenance owners

* test(tooling): preserve relocated runtime fixture dependency edges

* refactor(tooling): preserve xterm routing owner checks

* ci(tooling): include routing owner in sparse checkout

* test(tooling): preserve copied workflow dependency closures

* fix(tooling): normalize hashed JSON assets in release parity

* fix(tooling): distinguish asset aliases from literal references

* fix(tooling): frame normalized asset reference payloads

* fix(tooling): normalize decoded JSON asset references

* refactor(tooling): organize build, CI and release owners

* fix(tooling): align moved generator and workflow path contracts

* fix(tooling): update generated plugin bundle owner banners

* test(tooling): create relocated mobile verifier fixture directories

* test(tooling): copy headless detector dependency closure

* test(tooling): align native batch policy fixtures with owner path

* fix(tooling): link moved reliability command to historical evidence

* fix(tooling): preserve nested sandbox owners and canonical guide source

* fix(tooling): target release version owners in checkout fixture
2026-11-04 21:08:19 -08:00