chore(ratchet): drop the stale owner-adapter focus seed and prune the baseline (#31625)

resolveOwnerWithLegacyFallback stopped reading the Active Server focus in #31058, so seeding it
counted 92 phantom focus reads across 55 files.
This commit is contained in:
Neil
2026-10-21 12:42:43 -07:00
committed by GitHub
parent 78bc1e5005
commit 2e4af3f272
3 changed files with 24 additions and 81 deletions
+18 -73
View File
@@ -24,16 +24,10 @@
1 src/renderer/src/components/automations/use-automations-page-destination-form.ts
2 src/renderer/src/components/automations/use-automations-page-setup-state.ts
1 src/renderer/src/components/browser-pane/ReopenBrowserPageOnServerButton.tsx
1 src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.tsx
1 src/renderer/src/components/browser-pane/browser-reopen-on-server.ts
1 src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsx
1 src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-lifecycle.ts
1 src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-stream.ts
1 src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-stream-activation.ts
1 src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.ts
1 src/renderer/src/components/browser-pane/workspace-doc/workspace-doc-page-pane.tsx
2 src/renderer/src/components/cmd-j/quick-action-context.ts
1 src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts
2 src/renderer/src/components/editor/EditorContent.tsx
1 src/renderer/src/components/editor/EditorDiffFileSurface.tsx
1 src/renderer/src/components/editor/EditorEditFileSurface.tsx
@@ -69,12 +63,9 @@
1 src/renderer/src/components/linear-item-drawer-edit-section.tsx
2 src/renderer/src/components/native-chat-resume-modal.test-support.tsx
1 src/renderer/src/components/native-chat-resume-tree.test-support.ts
1 src/renderer/src/components/native-chat/NativeChatResolvedView.tsx
1 src/renderer/src/components/native-chat/NativeChatVisualFrame.tsx
1 src/renderer/src/components/native-chat/native-chat-file-link.ts
3 src/renderer/src/components/native-chat/native-chat-http-link-source-owner.ts
2 src/renderer/src/components/native-chat/native-chat-http-link-source-owner.ts
1 src/renderer/src/components/native-chat/native-chat-link-target-actions.ts
2 src/renderer/src/components/native-chat/native-chat-runtime-owner.ts
1 src/renderer/src/components/new-workspace/use-jira-source-connection.ts
4 src/renderer/src/components/new-workspace/use-linear-source-connection.ts
1 src/renderer/src/components/new-workspace/use-smart-workspace-name-field-controller.ts
@@ -82,24 +73,13 @@
2 src/renderer/src/components/new-workspace/use-work-item-source-foundation.ts
1 src/renderer/src/components/new-workspace/use-work-item-source-search.ts
1 src/renderer/src/components/quick-open-file-list-test-harness.ts
1 src/renderer/src/components/right-sidebar/ChecksPanel.tsx
2 src/renderer/src/components/right-sidebar/FileExplorer.tsx
1 src/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.tsx
1 src/renderer/src/components/right-sidebar/FolderWorkspacePrChecksRow.tsx
3 src/renderer/src/components/right-sidebar/checks-panel-hosted-review-click-routing.ts
1 src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-controller-state.tsx
1 src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-create-review.tsx
1 src/renderer/src/components/right-sidebar/file-explorer-row-context-menu.tsx
1 src/renderer/src/components/right-sidebar/git-status-file-watch-refresh.ts
1 src/renderer/src/components/right-sidebar/source-control/listing/entry-context-menu.tsx
1 src/renderer/src/components/right-sidebar/source-control/sync/git-history-commit-context-menu.tsx
1 src/renderer/src/components/right-sidebar/use-create-pull-request-base-ref-discovery.ts
2 src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts
1 src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts
1 src/renderer/src/components/right-sidebar/useCreatePullRequestDialogFields.ts
4 src/renderer/src/components/right-sidebar/useFileSearchPanel.ts
1 src/renderer/src/components/right-sidebar/useFileSearchRunner.ts
1 src/renderer/src/components/right-sidebar/useFileSearchScope.ts
1 src/renderer/src/components/right-sidebar/useGitStatusPolling.ts
1 src/renderer/src/components/settings/BaseRefPicker.tsx
2 src/renderer/src/components/settings/BrowserPane.tsx
1 src/renderer/src/components/settings/CliSkillRuntimeSetup.tsx
@@ -144,7 +124,6 @@
1 src/renderer/src/components/sidebar/WorkspaceAttachmentSearch.tsx
1 src/renderer/src/components/sidebar/WorkspaceKanbanDrawer.tsx
1 src/renderer/src/components/sidebar/WorktreeList.tsx
1 src/renderer/src/components/sidebar/WorktreeRowOpenInSubMenu.tsx # reads focus through resolveOwnerWithLegacyFallback, newly counted (round 3 F2); F8 nets it down
1 src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx
2 src/renderer/src/components/sidebar/delete-worktree-flow.ts
1 src/renderer/src/components/sidebar/linear-agent-skill-runtime.ts
@@ -188,11 +167,10 @@
1 src/renderer/src/components/status-bar/workspace-space-decision-details.ts
1 src/renderer/src/components/tab-bar/TabBar.tsx
3 src/renderer/src/components/tab-bar/tab-bar-windows-shell-launch-test-harness.ts
3 src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts
2 src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
2 src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts
1 src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
1 src/renderer/src/components/tab-bar/windows-shell-menu-visibility.ts
2 src/renderer/src/components/tab-group/useTabGroupActivationCommands.ts
5 src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts
3 src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts
1 src/renderer/src/components/task-page-jira-status-order.ts
2 src/renderer/src/components/task-page-linear-issue-model.tsx
9 src/renderer/src/components/task-page/TaskPage.tsx
@@ -202,22 +180,13 @@
1 src/renderer/src/components/terminal-pane/pty-connection/agent-idle-working-handlers.ts
1 src/renderer/src/components/terminal-pane/retire-unbound-runtime-terminal-pane.ts
1 src/renderer/src/components/terminal-pane/terminal-fit-restore.ts
1 src/renderer/src/components/terminal-pane/terminal-input-host-platform.ts
1 src/renderer/src/components/terminal-pane/terminal-keyboard-hook.ts
1 src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts
1 src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
2 src/renderer/src/components/terminal-pane/terminal-pane-close-admission.ts
2 src/renderer/src/components/terminal-pane/terminal-pane-menu-paste.ts
3 src/renderer/src/components/terminal-pane/terminal-pane-mount-preparation.ts
1 src/renderer/src/components/terminal-pane/terminal-pane-paste-execution.ts
1 src/renderer/src/components/terminal-pane/terminal-pane-paste-listeners.ts
1 src/renderer/src/components/terminal-pane/terminal-paste-runtime.ts # the paste owner's legacy-fallback read for raw PTY ids (round 3 F5); F8 nets it down
2 src/renderer/src/components/terminal-pane/use-terminal-pane-close-actions.ts
2 src/renderer/src/components/terminal-pane/use-terminal-pane-controller.ts
1 src/renderer/src/components/terminal-pane/use-terminal-pane-controller.ts
1 src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
1 src/renderer/src/components/terminal-pane/use-terminal-pane-mount-lifecycle.ts
1 src/renderer/src/components/terminal-pane/use-terminal-pane-paste-listeners.ts
1 src/renderer/src/components/terminal-workspace-model.ts
1 src/renderer/src/components/terminal/terminal-tab-actions.ts
4 src/renderer/src/components/terminal/terminal-tab-bulk-actions.ts
2 src/renderer/src/components/terminal/terminal-tab-create.ts
@@ -232,9 +201,7 @@
2 src/renderer/src/components/use-task-page-provider-metadata.ts
2 src/renderer/src/components/use-task-page-source-availability.ts
2 src/renderer/src/components/use-task-page-store-bindings.ts
2 src/renderer/src/components/use-terminal-activation-actions.ts
2 src/renderer/src/components/use-terminal-bulk-close-actions.ts
8 src/renderer/src/components/use-terminal-create-actions.ts
5 src/renderer/src/components/use-terminal-create-actions.ts
2 src/renderer/src/components/use-worktree-jump-palette-controller.ts
1 src/renderer/src/components/use-worktree-jump-palette-create-action.ts
2 src/renderer/src/components/use-worktree-jump-palette-filter.ts
@@ -246,12 +213,11 @@
1 src/renderer/src/hooks/composer-state/composer-source-state.ts
1 src/renderer/src/hooks/composer-state/runtime-target-selection.ts
1 src/renderer/src/hooks/editor-external-watch-target-rows.ts
3 src/renderer/src/hooks/editor-external-watch-targets.ts
2 src/renderer/src/hooks/editor-external-watch-targets.ts
1 src/renderer/src/hooks/ipc-events-close-routing-test-harness.ts
1 src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts
6 src/renderer/src/hooks/ipc-events-test-harness.ts
2 src/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.ts
1 src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts
1 src/renderer/src/hooks/ipc-events/runtime-environment-subscription-selection.ts
1 src/renderer/src/hooks/ipc-events/settings-sidebar-ipc-bridge.ts
1 src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.ts
@@ -266,25 +232,16 @@
7 src/renderer/src/hooks/useSettingsNavigationMetadata.ts
1 src/renderer/src/hooks/useUnreadDockBadge.ts
2 src/renderer/src/hooks/useWindowsTerminalCapabilityOwnerKey.ts
3 src/renderer/src/lib/activate-ai-vault-structured-session.ts
1 src/renderer/src/lib/active-agent-note-send.ts
1 src/renderer/src/lib/active-agent-note-target.ts
1 src/renderer/src/lib/agent-background-session-launch-host.ts
1 src/renderer/src/lib/agent-hibernation-coordinator-test-fixture.ts
1 src/renderer/src/lib/client-creation-action-error.ts
3 src/renderer/src/lib/client-creation-action-policy.ts
2 src/renderer/src/lib/client-creation-action-policy.ts
1 src/renderer/src/lib/default-creation-host.ts # the sanctioned reader of the default host
1 src/renderer/src/lib/doc-preview-grants.ts # reads focus through resolveOwnerWithLegacyFallback, newly counted (round 3 F2); F8 nets it down
1 src/renderer/src/lib/execute-open-editor-path-move.ts
1 src/renderer/src/lib/execution-host-facts.ts # reads focus through resolveOwnerWithLegacyFallback, newly counted (round 3 F2); F8 nets it down
5 src/renderer/src/lib/file-preview.ts
2 src/renderer/src/lib/file-preview.ts
6 src/renderer/src/lib/http-link-destinations.ts
3 src/renderer/src/lib/http-link-routing.ts
1 src/renderer/src/lib/launch-agent-background-session.ts
1 src/renderer/src/lib/launch-agent-execution-context.ts
2 src/renderer/src/lib/launch-agent-in-new-tab.ts
1 src/renderer/src/lib/launch-agent-in-new-tab.ts
2 src/renderer/src/lib/launch-agent-web-host-tab.ts
2 src/renderer/src/lib/launch-ai-vault-session.ts
1 src/renderer/src/lib/launch-ai-vault-session.ts
1 src/renderer/src/lib/linear-issue-url-lookup.ts
1 src/renderer/src/lib/local-preflight-context.ts
2 src/renderer/src/lib/provider-runtime-context.ts
@@ -293,24 +250,14 @@
1 src/renderer/src/lib/runtime-session-mirror-owners.ts
1 src/renderer/src/lib/runtime-session-mirror-targets.ts
1 src/renderer/src/lib/single-runtime-legacy-owner.ts
1 src/renderer/src/lib/structured-agent-session-tab-activation.ts
1 src/renderer/src/lib/tab-number-shortcuts.ts
1 src/renderer/src/lib/terminal-close-route.ts
1 src/renderer/src/lib/terminal-tab-owner-activation.ts
6 src/renderer/src/lib/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers
5 src/renderer/src/lib/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers
3 src/renderer/src/lib/unread-badge-count-selector.ts
2 src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts
1 src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts
4 src/renderer/src/lib/workspace-browser-tab-open.ts
1 src/renderer/src/lib/workspace-file-browser-open-target.ts # moved out of file-preview.ts (round 3 F7), same read
1 src/renderer/src/lib/workspace-tab-palette-activation.ts
1 src/renderer/src/lib/worktree-activation-pty-inventory.ts # reads focus through resolveOwnerWithLegacyFallback, newly counted (round 3 F2); F8 nets it down
2 src/renderer/src/lib/worktree-activation.ts
1 src/renderer/src/lib/worktree-creation-agent-seeds.ts
1 src/renderer/src/lib/worktree-activation.ts
1 src/renderer/src/lib/worktree-jump-navigation.ts
1 src/renderer/src/lib/worktree-row-open-in-owner.ts # reads focus through resolveOwnerWithLegacyFallback, newly counted (round 3 F2); F8 nets it down
3 src/renderer/src/lib/worktree-runtime-owner.ts # typed owner resolver and the legacy-fallback adapter the folds moved to (round 3 F0); F8 deleted the deprecated pair
1 src/renderer/src/lib/worktree-sort-order-host-split.ts
1 src/renderer/src/lib/worktree-sort-order-persistence.ts # its split helper calls resolveOwnerWithLegacyFallback directly (round 3 F4); F8 nets it down
1 src/renderer/src/lib/worktree-runtime-owner.ts # typed owner resolver and the legacy-fallback adapter the folds moved to (round 3 F0); F8 deleted the deprecated pair
17 src/renderer/src/runtime/runtime-jira-client.ts
2 src/renderer/src/runtime/runtime-jira-summary-client.ts
1 src/renderer/src/runtime/runtime-jira-target.ts
@@ -341,10 +288,9 @@
16 src/renderer/src/store/slices/browser/browser-cookie-import-actions.ts
1 src/renderer/src/store/slices/browser/browser-host-actions.ts
7 src/renderer/src/store/slices/browser/browser-host-state.ts
1 src/renderer/src/store/slices/browser/browser-page-conversion-actions.ts
14 src/renderer/src/store/slices/browser/browser-profile-import-actions.ts
13 src/renderer/src/store/slices/browser/browser-profile-list-actions.ts
6 src/renderer/src/store/slices/browser/browser-tab-actions.ts
4 src/renderer/src/store/slices/browser/browser-tab-actions.ts
1 src/renderer/src/store/slices/browser/create-browser-slice.ts
1 src/renderer/src/store/slices/browser/paired-browser-tab-creator.ts
2 src/renderer/src/store/slices/editor-slice-test-harness.ts
@@ -384,7 +330,6 @@
2 src/renderer/src/store/slices/settings-owner-hydration-publication.ts
5 src/renderer/src/store/slices/settings.ts
8 src/renderer/src/store/slices/store-test-helpers.ts
2 src/renderer/src/store/slices/tabs/tabs-host-mirroring.ts
1 src/renderer/src/store/slices/terminal-tab-retirement.ts
3 src/renderer/src/store/slices/workspace-attention/workspace-unread-characterization-fixture.ts
1 src/renderer/src/store/slices/worktree-visibility-owner-settings.ts
@@ -400,7 +345,7 @@
1 src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts
3 src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts
3 src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts
2 src/renderer/src/store/terminals/terminal-active-workspace-creation.ts
1 src/renderer/src/store/terminals/terminal-active-workspace-creation.ts
1 src/renderer/src/store/terminals/terminal-tab-appearance.ts
1 src/renderer/src/store/terminals/terminal-tab-close-providers.ts
1 src/renderer/src/web/preload-api/web-app-api.ts
+1 -3
View File
@@ -36,9 +36,7 @@ const SEED_FOCUS_READERS = [
'defaultCreationHost',
'defaultScopeHost',
'defaultScopeSource',
'rowLessSourceTarget',
// Its legacy branch returns the focused runtime inside an object literal, which discovery skips.
'resolveOwnerWithLegacyFallback'
'rowLessSourceTarget'
]
const FOCUS_SCAN_ROOTS = [SCAN_ROOT, 'src/shared']
@@ -227,21 +227,21 @@ describe('countFocusSettingReads', () => {
expect(countFocusSettingReads('linearConnect(defaultScopeSource(get().settings), key)')).toBe(1)
})
it('counts the legacy-fallback owner adapter and a wrapper that returns its result', () => {
it("counts a wrapper that returns a seed reader's result", () => {
const readers = discoverFocusReaders(
new Map([
[
'src/renderer/src/owner.ts',
[
'export function envUnlessTwin(state, id) {',
' const match = resolveOwnerWithLegacyFallback(state, { workspaceId: id })',
" return match.kind === 'resolved' ? match.owner : null",
'export function hostOrNull(state) {',
' const host = defaultScopeHost(state.settings)',
' return host ? host.id : null',
'}'
].join('\n')
]
])
)
expect(readers.has('envUnlessTwin')).toBe(true)
expect(readers.has('hostOrNull')).toBe(true)
})
it('counts destructuring reads', () => {