Skip to content

Keep runtime sessions tied to the selected checkout owner - #27030

Closed
nwparker wants to merge 7 commits into
nwparker/session-backend-module-extraction-10-09from
nwparker/session-workspace-owner-10-09
Closed

nwparker wants to merge 7 commits into
nwparker/session-backend-module-extraction-10-09from
nwparker/session-workspace-owner-10-09

Conversation

@nwparker

@nwparker nwparker commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​789 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​789
Prod 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​694 $\color{#cf222e}{\Huge{\mathbf{−}}}$​101 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​593

ELI5

A host could return another checkout’s saved terminals when two execution hosts used the same repository and checkout IDs. Session requests now keep the selected host and checkout instance through inventory, hydration and publication.

What Changed

The existing checked selector now supplies the session controller’s owner context. Snapshot reuse, saved-pane merging, retirement proofs, empty results and stream updates require that same current owner. Ambiguous or retired requests refuse before changing session state. Existing snapshots and results gain an optional canonical identity; IDs, persisted keys and stream opcodes stay compatible.

Old renderer frames cannot acquire a recreated checkout’s identity to bypass the removal fence. Saved panes and retirement notices retain the checked owner they already had.

Why

The wrong session came from discarding the resolved host and then reading a shared cache by checkout ID. Carrying that context through the existing controller and cache boundaries repairs the cause without replacing the persistence model or adding another ownership registry.

Linked Issue

Stacked on the runtime module prerequisite #27062, which inherits setup authority #27025. Internal reproducible audit; no new issue. Related issue/PR receipts and the contributor ledger are retained in the review packet. No donor implementation was copied.

Visual Proof

N/A — this change affects host-side session routing and wire content. It has no renderer layout change. Client activation and captured-owner transport are separate follow-ups.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

The final backend composition is 28 paths against prerequisite #27062. It normally inherits the reviewed repository lookup and wire compatibility test corrections from #27025. The prerequisite relocates six methods into existing inventory and terminal provisioning modules; all 35 production method signatures and bodies across those four modules retain the exact accepted backend text. The two mock factories move unchanged from the SQLite fixture into each of its three actual test entrypoints; every other test and fixture statement is unchanged.

On macOS, 204 existing tests pass in 14 suites: 28 registered SQLite ownership cases, 15 SQLite boundary cases, and 161 terminal close, browser, startup, captured readiness and inventory controls. The four moved modules were loaded cold and their served hashes recorded. Node and CLI type checks, regular lint and anti-slop on all 30 affected files, formatting, the suppression ratchet and the 28-file changed-quality gate pass. These controls ran before the subsequent normal merge of the parent’s two compatibility test corrections, which preserves all 30 controlled source files byte-for-byte; the final-parent quality and diff checks also pass. Two additional Node runtime boundary cases pass on the final parent, bringing the current controls to 206 cases in 15 suites.

Earlier broad controls belong to the accepted backend source, before this mechanical follow-on: Node and Bun each passed 33 suites with 1,628 passed cases and one existing Windows-only skip. All three TypeScript checks passed then, including web checking with a private copy of the pinned Shiki package closure and canonical compiler files/options/aliases. The earlier two-file SQLite registration follow-up passed five suites and 45 cases. Those historical results are retained separately from the current controls.

Actual registered RPC controls use SQLite persistence and the real runtime/controller. They cover both catalog orders, A/B/A saved layouts and proofs, held concurrent inventory, retirement during inventory, exact empty results, subscriber isolation, legacy requests, old renderer deletion fences and same-owner saved-pane retention/release. Test providers supply SSH Git listings and PTY inventory; Electron, unused registration imports and external history deletion are isolated. No native PTY was spawned, app was launched, or desktop focus was exercised.

Review

The full production change and corrective boundaries were reviewed. Full and independent reviews accepted the final corrections and current controls. Separate independent reviews found the original backend source and H2 merge clean, passed 13 focused controls, and verified the pure prerequisite’s complete diff, method bodies, imports and test evidence. The final stack preserves the original backend methods, parent corrections and SQLite registration. Historical failing controls, the four reproduced static errors and exact source witnesses are retained. No native end-to-end claim is made.

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

The optional identity is additive wire content. Older bare-ID clients retain unique-owner behavior and ambiguous requests refuse. The renderer follow-up validates missing-identity responses from older hosts. No new opcode, capability, ID migration, forced cache replacement or remote-process death assumption is introduced.

Checklist

  • I explained what changed and why
  • N/A visual proof with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, folder and backward compatibility considered
  • Final automated gates and independent source/13-control review complete

@nwparker
nwparker changed the base branch from nwparker/setup-authority-dispatcher-10-09 to nwparker/session-backend-module-extraction-10-09 October 10, 2026 01:06
@OrcaWin

OrcaWin commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded. Session and terminal calls on main now route by the workspace's owner (#27283, #27243, #27279), and session writes are partitioned per host (#27119, #27125). The remaining case (two hosts publishing the same repo and checkout IDs) is refused as ambiguous on main; this 1,500-line draft on an unmerged base is too much risk for that.

@OrcaWin OrcaWin closed this Oct 11, 2026
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.

2 participants