Repository navigation
refactor(sources): row-less sources and host-less surfaces name their host - #27290
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Several issue surfaces can repeat provider requests without a task-source context, creating a material reliability and performance risk. The accompanying ratchet documentation is also incomplete. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Update the ratchet policy comment for scope defaults. · focus-setting-read-baseline.txt:3-4
config/focus-setting-read-baseline.txt:3-4
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the ratchet policy comment for scope defaults.
The new
defaultScopeHostseed inconfig/scripts/check-owner-routing-ratchet.mjs(Line 25) also sanctions default-host reads for row-less source and scope selection. This comment says only creation flows may read the default host throughdefaultCreationHost. Update it to describe both permitted cases.This follows the PR objective that
defaultScopeHosthandles source and scope picker defaults.Proposed wording
-# Only creation flows with no source row may read -# the default host, through defaultCreationHost. +# Creation flows use defaultCreationHost; row-less source and scope selection uses defaultScopeHost.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9583ec94-b8c1-4bd0-9630-cdf586e671ce
📥 Commits
Reviewing files that changed from the base of the PR and between 2eb6a92 and 1c080a506a06f8e33fa25e1d49772361ee527044.
📒 Files selected for processing (51)
config/focus-setting-read-baseline.txtconfig/owner-routing-baseline.txtconfig/scripts/check-owner-routing-ratchet.mjssrc/renderer/src/components/JiraIssueWorkspace.tsxsrc/renderer/src/components/LinearIssueTextEditor.tsxsrc/renderer/src/components/LinearIssueWorkspace.tsxsrc/renderer/src/components/LinearItemDrawer.tsxsrc/renderer/src/components/jira-user-picker.tsxsrc/renderer/src/components/linear-issue-project-selector.tsxsrc/renderer/src/components/linear-issue-sub-issues.tsxsrc/renderer/src/components/linear-item-drawer-comment-footer.tsxsrc/renderer/src/components/linear-item-drawer-edit-controller.tsxsrc/renderer/src/components/settings/use-settings-store-model.tssrc/renderer/src/components/sidebar/use-workspace-board-task-status-sync.tssrc/renderer/src/components/sidebar/workspace-board-task-status-sync.test.tssrc/renderer/src/components/sidebar/workspace-board-task-status-sync.tssrc/renderer/src/components/status-bar/ClaudeSwitcherMenu.tsxsrc/renderer/src/components/status-bar/use-codex-switcher-controller.tssrc/renderer/src/components/task-page-jira-grouping.test.tssrc/renderer/src/components/task-page-linear-issue-model.tsxsrc/renderer/src/components/task-page/jira/IssueAssigneeField.test.tsxsrc/renderer/src/components/task-page/jira/IssueAssigneeField.tsxsrc/renderer/src/components/task-page/linear/Filters.tsxsrc/renderer/src/components/use-new-linear-issue-projects.tssrc/renderer/src/components/use-task-page-jira-creation-metadata.tssrc/renderer/src/components/use-task-page-jira-issue-creation.tssrc/renderer/src/components/use-task-page-jira-list-effects.tssrc/renderer/src/components/use-task-page-jira-list-state.tssrc/renderer/src/components/use-task-page-linear-board.tssrc/renderer/src/components/use-task-page-linear-creation-state.tssrc/renderer/src/components/use-task-page-linear-issue-creation.tssrc/renderer/src/components/use-task-page-linear-project-creation.tssrc/renderer/src/components/use-task-page-provider-metadata.tssrc/renderer/src/hooks/use-active-skill-discovery-runtime-target.tssrc/renderer/src/hooks/useIssueMetadata.test.tsxsrc/renderer/src/hooks/useIssueMetadata.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.tssrc/renderer/src/lib/default-creation-host.test.tssrc/renderer/src/lib/default-creation-host.tssrc/renderer/src/lib/linear-issue-url-lookup.tssrc/renderer/src/runtime/runtime-jira-client.test.tssrc/renderer/src/runtime/runtime-jira-target.tssrc/renderer/src/runtime/runtime-linear-client.test.tssrc/renderer/src/runtime/runtime-linear-client.tssrc/renderer/src/store/slices/jira-connection-actions.tssrc/renderer/src/store/slices/jira-read-coordination.tssrc/renderer/src/store/slices/linear-invalidation.test.tssrc/renderer/src/store/slices/linear-scoped-collection-cache.test.tssrc/renderer/src/store/slices/linear/linear-slice-connection-actions.tssrc/renderer/src/store/slices/linear/linear-slice-scope.tssrc/renderer/src/store/slices/linear/linear-slice-status-actions.ts
💤 Files with no reviewable changes (1)
- config/owner-routing-baseline.txt
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| @@ -46,7 +47,7 @@ export default function JiraIssueWorkspace({ | |||
| sourceContext | |||
| }: JiraIssueWorkspaceProps): React.JSX.Element { | |||
| const settings = useAppStore((s) => s.settings) | |||
| const providerSettings = sourceContext ?? settings | |||
| const providerSettings = sourceContext ?? defaultScopeSource(settings) | |||
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Stabilize default-scope sources used by effects. When sourceContext is absent, each render creates a new providerSettings object. Each affected effect depends on that object and updates state. The updates restart requests instead of allowing the current request lifecycle to finish.
src/renderer/src/components/JiraIssueWorkspace.tsx#L50-L50: memoize the fallback bysettingsbefore the issue-loading effect uses it.src/renderer/src/components/LinearItemDrawer.tsx#L41-L41: memoize the fallback bysettingsbefore the drawer fetch effect uses it.src/renderer/src/components/linear-issue-project-selector.tsx#L27-L27: memoize the fallback bysettingsbefore the project-search effect uses it.
📍 Affects 3 files
src/renderer/src/components/JiraIssueWorkspace.tsx#L50-L50(this comment)src/renderer/src/components/LinearItemDrawer.tsx#L41-L41src/renderer/src/components/linear-issue-project-selector.tsx#L27-L27
c6eed4c to
4a8a5ab
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5a913d71-5619-4376-8028-ba36dbaf3419
📥 Commits
Reviewing files that changed from the base of the PR and between 3e9ab7ff66ee230b8205dcca97e161c95788def7 and 4a8a5ab19fa58ddb295b2ecb30d8863947176b28.
📒 Files selected for processing (2)
config/focus-setting-read-baseline.txtconfig/owner-routing-baseline.txt
💤 Files with no reviewable changes (1)
- config/owner-routing-baseline.txt
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| @@ -4,10 +4,13 @@ | |||
| # the default host, through defaultCreationHost. Everything else routes by the owner. | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the header to include scope-picker reads.
Line 4 says only creation flows may read the default host through defaultCreationHost. This PR adds defaultScopeHost for initial source and scope picker selection, so the documented rule excludes an intended read. Update it to name both allowed paths. The PR objective describes this new scope-picker behavior.
… host Linear and Jira clients take a RowLessSource: a task-source context, an explicit host, or defaultScopeSource(settings) when no Tasks source is chosen, so raw settings no longer compile. defaultScopeHost joins defaultCreationHost as the second sanctioned reader of the default-host setting (both behind one private read, both ratchet seeds), and the status-bar account switchers, settings navigation and the settings host picker's initial default use it. Skill discovery routes by the owner id its install terminal resolves, and the workspace-board Linear sync by the workspace owner.
defaultScopeSource is a sanctioned read of the default host, so its call sites count. A function that assigns a reader's result to a local and returns that local is a reader too, which keeps the skill-discovery hook counted.
4a8a5ab to
6597a18
Compare
ELI5
Linear and Jira on the Tasks page, the Claude/Codex account switchers in the status bar, and the settings navigation don't belong to any one project, so they have no owner to follow. Until now they quietly asked the old focus-routing helper which host to use. This PR names that choice explicitly: a row-less source uses its Tasks source when it has one, and otherwise the default host, through one clearly named function. Nothing changes for users.
What Changed
lib/default-creation-host.tsnow holds both approved readers of the "default host" setting, behind one private read:defaultCreationHostfor creation flows;defaultScopeHost, new, for row-less sources and settings scopes that start on the default host until a picker overrides them.RowLessSource(a Tasks source context, an explicit host, ordefaultScopeSource(settings)) androwLessSourceTarget. The ratchet countsdefaultScopeHostandrowLessSourceTargetas readers (seeds), so their uses stay visible in the focus-read baseline.getLinearRuntimeTarget,getJiraRuntimeTargetand every client that takesRuntimeLinearSettings/RuntimeJiraSettings) take aRowLessSourceinstead of settings, so raw settings no longer compile. Callers passsourceContext ?? defaultScopeSource(settings): the Tasks page, the issue drawers, the Linear/Jira store slices and the read scopes.{ kind: 'local' }. This covers metadata hooks called without a source, the Linear URL lookup with no context, and the workspace-board sync with no resolver.useSettingsNavigationMetadata(shared with the palette) have no host picker, so they usedefaultScopeHost. The settings host picker's initial default reads throughdefaultScopeHosttoo, so there is one reader.runtimeTargetForOwnerEnvironmentinstead ofgetActiveRuntimeTarget. The owner id still comes from the same single-focused-server rule the skill-install terminal uses, so scan and install keep naming the same host. That rule still reads the setting, and it stays counted.runtimeTargetForWorkspaceOwner; no row means this computer), instead ofgetSettingsForWorktreeRuntimeOwner.use-new-linear-issue-projects.ts, which keeps the creation-state hook under the line limit.defaultScopeHost/defaultScopeSourceuses (row-less or host-less only): Linear/Jira store slices (connection, status, read scopes), Tasks-page Linear/Jira hooks and dialogs, Linear/Jira issue drawers and editors,ClaudeSwitcherMenu,use-codex-switcher-controller,useSettingsNavigationMetadata, and the settings host scope's initial default.Why
The design allows exactly two reads of the setting: the creation default, and the initial host of a source or scope picker. These surfaces are the second kind, but they used the generic routing helper, which hid that choice and kept the owner-routing ratchet above zero.
We considered building a Tasks-page host picker now. It needs per-host Linear and Jira connection status, which the store tracks only for the default host today, so it stays a follow-up. The default host is now named at every call site, so that picker only has to replace
defaultScopeSource(settings).Linked Issue
None. This is part of the host-ownership routing stack (D4 G1, leftovers from the forge and terminal areas).
Visual Proof
N/A. There is no UI or behavior change: the same hosts are read through explicit names.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
default-creation-host.test.tschecks that row-less sources start on the default host and that a task source or explicit host wins.The Linear/Jira client, store-slice, drawer and board-sync tests are updated for explicit sources, with the same expectations for which host is read.
Ran:
pnpm tc:web, focusedpnpm test(369 files; the only failure was the timing-boundpalette-match-performance, which is unrelated and fails under machine load), oxlint, oxfmt,check:code-quality:changed,audit:anti-slop, andcheck:owner-routing-ratchet.Review
Agent skill upstream boundary
Notes
No wire change; renderer only. SSH: direct-SSH owners still go through this app. Folder workspaces: board sync resolves folder owners through
resolveOwner.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Review fix (ratchet accounting)
defaultScopeSourceis now a counted reader, so its ~48 call sites show in the focus-read baseline. This is the visible list of row-less surfaces that still use the default host.const id = reader(…); return id …). That keeps the skill-discovery hook and similar wrappers counted. The focus-read baseline grows (1492 on current main) because the definition is wider, not because anything new reads the setting.