Repository navigation
feat(server): a parent moving to its child's computer takes the child back - #998
Merged
Merged
Conversation
… back A thread's agent on computer A could start a child on computer B over a link. If that parent later moved to B, the child stayed stranded: fenced for good, pointing at A's read-only copy, its reports to A retried forever, and nobody could direct it. Now the moving parent takes such threads back as its own children on B. A sends the list it holds (PeerMoveManifest.startedThere, only to a computer that says moveAdoptsChildren). B adopts only threads its own records also name as started over that link by that thread, and only when the decider's checks pass (same link, origin thread, pinned computer, project, not archived or moving, no children, within the parent's access). Before the import, B's link releases each one: open requests end, queued messages are taken back, the request's own running turn stops, and the ledger owes the link nothing more. The adopted child clears remoteOrigin, carries adoptedFromLink, and stays fenced until the user writes in it. The committed answer names the adopted threads, and A's read-only copy drops their records. LinkRequests now checks the thread is still the link's before any cancel clean-up, ack, send, read, stop or wrap, so a late cancel can't stop the user's new turn.
…eps what stays apart Review fixes for taking a link's threads back on arrival: - The decider now guards what a link asks for: a stop, Wrap up or answer's record names the link (byLink) and is refused unless the thread is still that link's, and a link's queued request is taken back instead of run once it isn't. The LinkRequests read before it can be stale. - One shared check (adoptionRefusal) decides which threads qualify. LinkMoves asks it before releasing anything, with the modes the import will write, so a thread that stays apart keeps its requests. Archived ones the manifest names now say why they stay apart. - Release stops the turn the link's request started, found from the thread's turn starts (the ledger has no turn id while it runs), and never a turn the user started since. - After the import lands, the adopted threads are released again, so a send that arrived in between ends and its message is taken back.
…nk stop is kept - A stop can name the turn it means (`thread.session.stop.expectedTurnId`); the decider refuses it when another turn began before it landed. Release uses it, so it never ends the user's next turn. - Release decides and dispatches its stop before it marks the request ended, so a retry after a failed read decides it again. A failed release after the import leaves the move unsettled for the sweep to redo. - A link's stop answers "not yours" only for the ownership refusal; any other refusal fails as before, so the asking computer keeps the stop. - fleet.md names the window where a thread queues its own move between the check and the import.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
A thread can start a child on another computer. If that thread later moved to the child's computer, the two stayed apart. The child stayed fenced for good, it still answered to a read-only copy on the old computer, its reports retried forever, and nothing could direct it.
Now the computer the parent arrives on adopts the child as its own attached child again (docs/design/fleet.md, Part 3f (g)).
startedThere) and this computer's own records name: same link and origin thread, pinned computer, same project, not archived or moving, and within the new parent's mode ceiling. One shared check (adoptionRefusal) decides this before anything is released and again in the decider. A child that fails stays separate, and the Moved here line says why.adoptedFromLink) until a person's own message in it lifts it. While fenced, it can only move back to the computer that started it.byLink, and the decider refuses them once the thread isn't that link's, which closes the races between the two computers.remoteChildrenentries when the move completes, and stops retrying reports for a parent that moved away. A pending Wrap up or Reopen rides along and applies only if newer.moveAdoptsChildrencapability. Migration 120 adds one nullable column.The design was planned by the lead model, and the plan and the diff were each reviewed twice by an independent reviewer. All findings were fixed except one narrow window, which is documented in fleet.md. Not verified on two real computers; the integration tests run the real engine through release, import and late link commands.