Skip to content

refactor(renderer): name target converters by meaning; drop re-export shims - #27992

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-6
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-6

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 112 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​150 $\color{#cf222e}{\Huge{\mathbf{−}}}$​257 $\color{#cf222e}{\Huge{\mathbf{−}}}$​107
Prod 298 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​460 $\color{#cf222e}{\Huge{\mathbf{−}}}$​530 $\color{#cf222e}{\Huge{\mathbf{−}}}$​70

ELI5

Two renderer helpers turn a host id into "where to send this request", and they differ only in how they treat an SSH host. One sends SSH rows to this app's IPC, which refuses them. The other returns no target for SSH. Their names didn't say that. This PR renames them for what they do, moves a third converter next to them, and removes the remaining re-export shims in the renderer's routing code.

What Changed

Users see no difference. Function bodies are unchanged.

  • runtimeTargetForOwnerHostId is renamed ipcOrRuntimeTargetForHostId: a server's runtime, or this app for local and ssh: rows.
  • runtimeTargetForExecutionHostId is renamed runtimeRpcTargetForAuthorityKey: a runtime RPC target for an authority key, with no target for direct SSH.
  • getRuntimeTargetHostId moves from store/runtime-target-host.ts (deleted) into runtime/runtime-client-target.ts, beside the other converters.
  • Re-export shims removed:
    • RuntimeClientTarget is imported from shared/runtime-client-target. runtime-client-target.ts and runtime-rpc-client.ts no longer re-export it.
    • hasRuntimeRpcErrorCode, RuntimeRpcCallError and unwrapRuntimeRpcResult are imported from runtime-rpc-result.
    • WorktreeRuntimeOwnerState and getRuntimeSessionMirrorEnvironmentIds are imported from their own modules, not via worktree-runtime-owner.
    • resolveExplicitWorktreeOperationRouteResult is imported from worktree-operation-catalog-route.
  • Tests: four mocks of runtime-rpc-client no longer provide a fake RuntimeRpcCallError or hasRuntimeRpcErrorCode. The code under test now imports those from runtime-rpc-result, so the real class and matcher run.

Net: production −67 (+459/−526), tests −110.

Why

Phase 3.99 / AGENTS.md rule: no barrels and no re-export shims. With direct imports, each import line names the module a file really depends on, and each test mocks the module the code under test actually calls. One barrel per PR keeps every review mechanical.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.6).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • rg finds no old converter names and no import of a removed re-export through its old path in src tests mobile config docs (@ts-nocheck files included).

  • All 111 changed test files pass (1224 tests). The full src/renderer suite passes too, apart from two load-related timeouts that pass when run alone.

  • pnpm tc, pnpm lint and pnpm run check:code-quality:changed (0 findings) pass on the whole barrel stack.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

P0/P1 review: my own review plus an independent reviewer.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only import changes. SSH, wire, mobile and platforms are not affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@OrcaWin
OrcaWin merged commit cef4d29 into main Oct 12, 2026
45 checks passed
brennanb2025 added a commit that referenced this pull request Oct 12, 2026
Resolve conflicts with #27732 (resume dialog links to the resume row, now on the Chat page) and #27992 (queue setting import, folded into ChatBehaviorSetting).
LINDECKER-Charles added a commit to LINDECKER-Charles/orca that referenced this pull request Oct 15, 2026
Upstream renamed runtimeTargetForOwnerHostId to
ipcOrRuntimeTargetForHostId and dropped the RuntimeClientTarget re-export
(stablyai#27992), so createProjectGroup and the shared createOnTarget helper use
the new name and import the type from shared. ProjectGroupingModel moved
to shared/project-section-grouping (stablyai#28850). Locale conflicts were
sibling additions; both sides are kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant