Repository navigation
fix(sidebar): a workspace rename reaches every host that publishes it - #160
Merged
Merged
Conversation
A worktree id is `repoId::path`, so a repo registered on two execution hosts publishes one id twice: two sidebar rows, each with its own persisted name. The rename path wrote only the host whose row was edited, so every other host kept the old name — and a paired HUB row, which is one row behind two host ids, could not rename its own server at all. A rename is now a workspace-level operation: it resolves every host that publishes the workspace (same-id twins, both routes of a HUB row, and hosts that publish it only as a detected row), starts all of their writes together so the edited host cannot strand the rest, and shows the new name on every row immediately. The other hosts receive the name alone; the rest of a mixed update (comment, links, push target) stays with the host the user edited. Best effort by design: a host that refuses keeps its own name and naming mode, its row goes back to it, and the error names the host by the label the sidebar shows. Refetching instead would have undone the hosts that did take the name. A row is only reverted while it still shows the name this attempt wrote, so a later rename or a refetch keeps the row it owns. The folder-workspace branch of updateWorktreeMeta and the hosted-review refetch move to their own modules verbatim, so the file stays inside its max-lines budget.
A linked worktree's `.git` is a file, so `mkdir <root>/.git/orca-gate` failed with ENOTDIR after the full suite had already run — the verdict was computed and then thrown away. Resolve the git directory instead, which is a directory even for a worktree, so the PR gate can be run where the work is.
nplez1
added a commit
that referenced
this pull request
Oct 24, 2026
#150) LOCAL-PATCHES keeps the evidence for the release-tooling patch series and the known-red sets, so the gate repairs need an entry there: which of the issue's five items had already landed (#160's linked-worktree cache directory, #177's dirty-verdict refusal and shared cache module, #178's judgement module and its tests), what the new fail-closed and cache rules are, why the verdict records its gate inputs, and the coupling rule's limits. BRANCHES gets the branch entry: why it exists, its shape, its target, and its verification state.
nplez1
added a commit
that referenced
this pull request
Oct 24, 2026
#150) (#179) * fix(gate): fail the unit gate closed, and cache only what it can prove (#150) Vitest's exit status was returned by runSuite and never read, so a non-zero exit that the report did not explain was green. The rule is now the CI twin's (check-unit-shard-verdict): a non-zero exit fails the gate only when neither the report nor the log explains it. The declared-vs-read unhandled count drops '>' for '!==' for the same reason, and a step that could not be spawned names the step instead of reading as failed. A cached verdict now records the gate inputs it was computed against — GATE_INPUT_PATHS plus the installed node and bun — and both readers compare them, because the machine-bound sqlite-binding and host-toolchain classes move with a bun upgrade that HEAD never sees. What may be reused or recorded is a decision with a reason: --no-cache forces a re-run and still records it, --allow-dirty neither reuses nor records, forwarded selectors record nothing, and HEAD and the tree are re-read before writing so a mid-run commit cannot become the previous revision's verdict. A forwarded selector's summary line now says it is not a gate-1 verdict, because it printed the same shape as one. The flake waiver asked only whether the test file was in the diff, so a branch that changed src/x.ts and broke x.test.ts one run in ten waived it as 'not ours'. local/gate-flake-coupling.mjs couples a test to itself, its sibling module, its one level of imports and the harness sharedHarnessPaths derives from the config and the runner; a per-test row that passes in isolation but is still refused says why. * docs(fork): record the unit-gate repairs in LOCAL-PATCHES and BRANCHES (#150) LOCAL-PATCHES keeps the evidence for the release-tooling patch series and the known-red sets, so the gate repairs need an entry there: which of the issue's five items had already landed (#160's linked-worktree cache directory, #177's dirty-verdict refusal and shared cache module, #178's judgement module and its tests), what the new fail-closed and cache rules are, why the verdict records its gate inputs, and the coupling rule's limits. BRANCHES gets the branch entry: why it exists, its shape, its target, and its verification state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A worktree id is
repoId::pathwith no host component, so a repo registered on two execution hostspublishes the same id twice — two sidebar rows, each with its own persisted
displayNamein thehost-qualified metadata store. The rename path wrote only the host whose row the user edited, so
every other host kept the old name, and a paired HUB row (one row behind two host ids) could not
rename its own server at all. Requested behaviour: renaming a workspace renames it on all hosts it
appears on, at the same time.
What
worktree-rename-across-hosts.ts(new) —planWorktreeRenameresolves every host thatpublishes the workspace: same-id twin rows, both routes of a HUB row (
hostId: ssh:x+runtimeOwnerEnvironmentId), and hosts that publish it only as a detected row.settleWorktreeRenamestarts every write together (the caller's full-payload write plus each other host's name-only
write) so a host that refuses cannot strand the rest, and per-host pending-name entries exist from
the first instant.
back to it and the error names the host by the label the sidebar shows (SSH target label / host
override / machine name). Refetching on a partial failure would undo the hosts that took the name.
A row is only reverted while it still shows the name this attempt wrote, so a later rename or a
refetch keeps the row it owns.
displayName+displayNameIsPinned; the rest of a mixed update (comment, links, push target) stays with the hostthe user edited, matching what is persisted.
use-worktree-card-activation-actions.ts—handleRenameTitlenow reads the result and throws,so the inline editor's existing toast reports a partial rename instead of it silently reverting.
folder-workspace-meta-update.ts,refresh-hosted-review-after-meta-update.ts)keep
update-worktree-meta.tsinside its 300-linemax-linesbudget (297 counted lines).(
updateFolderWorkspace) and main-side first-agent-message renames still write one host.Verification
PR gate 1 — full unit run on the final revision:
pnpm tcclean (17,755 / 3,177 / 34 / 15,781 files).oxlintclean.check:code-quality:changedpassed.
check:max-lines-ratchet, localization coverage/catalog/extraction, and the remainingpnpm lintsteps (check:readme-local-links,check:node-runtime-pin,check:mobile-shared-dependency-versions,verify:rpc-params-catalog,verify:acp-protocol,verify:bundled-skill-guides,verify:skill-bundle-manifest,check:process-host-imports,check:main-sync-spawn-ratchet,check:compat-boundary-imports) pass.pnpm lintstops at three ratchets that already fail onnplez1/main— verified by running themin a clean detached checkout of the base:
check:id-only-store-write-ratchet—RepoLifecycleOperations.relocateRepoPath(
src/main/persistence/tracking-repos/repo-update-operations.ts)check:repo-host-read-ratchet—register-worktree-catalog-handlers.ts,runtime-repository-relocation-controller.tscheck:host-list-render-ratchet—src/renderer/src/components/settings/SshTargetList.tsxChanged-file suites:
pnpm test src/renderer/src/store src/renderer/src/components/sidebar—890 files / 8,038 tests green, including 10 new tests (fan-out per host, optimistic name before any
write answers, partial failure keeps the hosts that took it and reverts only the refuser, a HUB row
written once, a host that publishes only as a detected row, an unreachable host reported, a row whose
host id lost the store dedupe, a mixed update keeping its comment local, and a non-rename update
staying host-scoped).
PR gate 2 — review: Opus 5.5 (
claude/opus), high reasoning, two rounds.Round 1 on the first commit: no BLOCKER; 5 SHOULD-FIX, 3 MINOR, 2 NIT — fan-out ordering, all
fields optimistically applied to twins, silently dropped unresolved hosts, detected-row hosts, and
the revert race. All were fixed. The delta re-check on round 2 confirmed each one RESOLVED and raised
4 new MINOR/NIT items, of which three are fixed here (a dedupe regression that hid one row's
optimistic name, pending-rename flags crossing hosts, and the preferred-host ordering); the fourth is
in the limitations list below. Final verdict: no open BLOCKER or SHOULD-FIX.
Second commit
d38307f35bfixes the fork's own gate script:local/gate-unit.mjscached itsverdict under
<root>/.git/orca-gate, which is not a directory in a linked worktree, so the firstgate run computed the verdict and then threw it away with
ENOTDIR. It now resolvesgit rev-parse --absolute-git-dir. Tooling only — no app code, so it does not change what the reviewcovered.
Known limitations (not fixed here):
holds the new name, so re-entering the same title is a no-op. Retry from the failed host's own row
or the edit-meta dialog.
other hosts' failures are logged, not merged into the message).
rename; the next refetch corrects it.