Repository navigation
Conversation
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7d-renderer-stores
branch
from
October 20, 2026 23:17
589c670 to
16fbe29
Compare
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7e-orchestration-history
branch
from
October 20, 2026 23:17
e07ff55 to
033b672
Compare
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7d-renderer-stores
branch
from
October 21, 2026 00:46
16fbe29 to
d82cf50
Compare
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7e-orchestration-history
branch
from
October 21, 2026 00:46
033b672 to
b8bf5c6
Compare
2 tasks done
…he desktop (D1b-7e) Settled local worker dispatches and their worker-terminal rows in a moved project take the WSL host's worktree id, in one ledgered, idempotent store. Chat workers, live rows, federated attachments and JSON receipts stay as written; automations keep their unchanged local copy (the scheduler only advances it). Per-table dispositions for orchestration.db. Co-Authored-By: Claude <[email protected]>
…is live; skip federated rows (D1b-7e review) Co-Authored-By: Claude <[email protected]>
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7d-renderer-stores
branch
from
October 21, 2026 05:17
d82cf50 to
df675bf
Compare
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-7e-orchestration-history
branch
from
October 21, 2026 05:17
b8bf5c6 to
05e3553
Compare
This was referenced Oct 21, 2026
Contributor
Author
|
Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept. |
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.
ELI5
When a user moves a project from "this Windows computer, reaching into WSL" to "the WSL host itself", the project's folders get new names (a Windows
\\wsl.localhost\Ubuntu\...path becomes/home/...). Orca's record of past agent work ("this worker ran in that worktree") still pointed at the old name. This PR updates those records once, after the move commits, so past work points at where the project lives now. Everything else in that history is left exactly as it was.What Changed
Before: after a move, the desktop's orchestration history (
orchestration.db) kept listing finished workers against the project's old Windows-side worktree id. That id belongs to a hidden, retained copy of the project, so the history pointed at something the user can no longer open.After: once the move reaches
destination-committed, a new desktop rewrite store,orchestration-history, gives every settled local worker dispatch in a moved project, and its worker-terminal row, the host's worktree id. Nothing else changes.Mechanism (it follows the 7b/7c store pattern exactly):
registerWslMoveOrchestrationHistoryStore(path)registers{id: 'orchestration-history', side: 'main', run, flush}. It is called at startup next to the 7c main stores.WSL_MOVE_DESKTOP_REWRITE_REGISTRY_COMPLETEstaysfalse(7f flips it).rundoes.orchestration.dbon its own connection. It never creates or migrates the file, so it can run at startup before the runtime exists.BEGIN IMMEDIATEtransaction, it rewritesworker_dispatches.worktree_idandworker_terminal_resources.worktree_id. A row is rewritten only if both hold:\\wsl.localhostor\\wsl$).synchronous = FULL, so it is on disk before the ledger entry.flushis therefore a no-op.updated_at, so history order does not change.starting,ready,start_unknown,stopping,stop_unknown), the store throws. It gets no ledger entry, and a later pass rewrites the row once it settles. That way it never records a half-rewritten project. The move's dispatch gate must refuse the same set, so the set is exported asWSL_MOVE_LIVE_WORKER_STATES. The gate'sactiveDispatchIdsproducer is not wired yet; it belongs to the gate/quiesce wiring, not this PR.SQLITE_TABLE_DISPOSITIONSfororchestrationwas split per table: two tables are rewrite-desktop and the rest are N/A, each with its reason. TheautomationsandautomationRunsnotes now say the desktop's copy is left as it is.orchestrationDbFile(userData)is now shared by the runtime and the store.Disposition table (desktop stores of orchestration, dispatch, automation-run and coordinator history)
orchestration.dbworker_dispatches.worktree_idorchestration.dbworker_terminal_resources.worktree_idCOALESCE(w.worktree_id, r.worktree_id)in the worker list; must agree with its dispatch.worker_terminal_resources.host_scope,dispatch_contexts.host_scoperuns.coordinator_pane_key,tasks.created_by_pane_key,dispatch_contexts.*_pane_key, resourcepane_key)remote_dispatch_attachmentsfederated_dispatches,federation_relay_itemsworker_dispatches.start_options/effects/residual_resources,mutation_receipts,legacy_*_receiptsruns,tasks,coordinator_runs,run_coordinator_handles,messages,deliveries,question_threads,decision_gates,attempt_observation_facts, archives@worktree:group addresses are resolved to handles at send time.automations(profile state)dormantState.automations) carries the host's copy, and the host runs it. The desktop scheduler treats the retained copy as owned by the host and only advancesnextRunAt(5c-3). Rewriting it could make the desktop resolve it to the host (a double run) and would break undo-if-unchanged, which compares the frozen source digest, automations included.automationRuns(profile state SQLite)dormantState.automationRuns). The desktop history sits beside its retained automation; an in-flight run in scope blocks the move.orchestration.db.orchestration-setup-state.tsis global, already in the localStorage census.Why
OrchestrationDb: the startup pass runs before the runtime is constructed. Opening throughOrchestrationDbwould also migrate and backfill the file as a side effect of a move.Linked Issue
Internal WSL mover track (D1b-7e); no public issue.
Visual Proof
N/A: no UI change, and the feature is dark-gated. The visible effect is the worktree id in
orca orchestrationworker lists after a move, which tests cover.Testing
New
wsl-move-orchestration-history-rewrite.test.ts(real SQLite, listed invitest-sqlite-runtime-files.mjs):\\wsl.localhostand\\wsl$ids are rewritten. Other repos, other distros, SSH-style paths, chat workers, federated dispatches, remote-attachment resources and null ids are not.worktree_idcolumn, the store is recorded and nothing changes.automation-wsl-move-refusal.test.tsgets one new case. It runs the real desktop rewrite pass atdestination-committed: the 7c main stores, plus 7e with an in-scope dispatch that does get rewritten. It then checks three things:nextRunAtadvances to the next occurrence, so nothing double-runs and nothing is dropped.Commands run:
pnpm tcpnpm testonsrc/main/persistence/moving-wsl-projects,src/shared/wsl-move,src/main/startup/main-process-ready*andsrc/main/automations(65 files, 588 tests)pnpm run check:code-quality:changedcheck-focus-read-ratchetandcheck-layout-writer-ratchets: both OK, no baseline changesAn adversarial review pass was run. It found one MEDIUM: a skipped live row would never be revisited. That is fixed by making the store throw instead. The LOWs fixed in the same pass:
NOT INagainst a nullable column becameNOT EXISTS;Review
Shared paths touched:
orchestration.dbrewrite, new store);src/main/runtime/workspaces/persisted-surfaces/automation-operations.ts(path helper only);src/main/startup/main-process-ready-foundation.ts(store registration);No automation runtime code changed.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code