Skip to content

feat: a thread moves with the threads it started - #984

Merged
badcuban merged 4 commits into
mainfrom
feat/move-step4b-families
Nov 18, 2026
Merged

badcuban merged 4 commits into
mainfrom
feat/move-step4b-families

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Part 2 of step 4b (docs/design/fleet.md, Part 3f). Builds on #981 (rooms) and merges after it.

A thread that had started other threads couldn't move. Now a parent moves with its family.

What it does

  • Choosing the family. The move dialog lists the threads it started with a tick each, and they all move together. An unticked one stays here as its own thread, with a line saying why. Older clients send no familySelection, which means the whole family.
  • How the family lands.
    • Each member is its own transfer. The receiving computer derives every new id from a family key built from its own link plus the member's source thread, so nothing a peer sends can collide or attach under a local thread.
    • Each checkout is made first. Then threads commit parent-first, and a child waits for its parent off the import slots (waiting_for_family).
    • Threads that shared a folder share one there, and the guest marker is derived on the receiving side.
  • Waiting on answers. "Move when it's done" waits for the children's answers. "Stop and move now" ends them as Stop does.
  • Children on another computer stay there, and the move names them.
  • One decision. A parent and the children moving with it are queued in a single decision.

Safety

  • The fence holds:
    • every import arrives fenced;
    • a manifest supplies no link identity;
    • there's no third-computer hop;
    • carried queued messages carry no sentFrom.
  • Locks: every import holds only its own lock, so two can't wait on each other.
  • Old peers: gated by moveFamilies, with optional fields only and a decode test with the old schemas.
  • Migration 118 adds two nullable columns and an index; no row is rewritten.

Checks

  • Outside review found four problems, all fixed, each with a test that fails without the fix:

    • a lock inversion after an abort and retry;
    • message-id collisions across members;
    • a shared-folder wait on held queues;
    • owner selection racing the queue.

    An earlier fresh-eyes review found five more, also fixed.

  • Live test on two local servers:

    • a parent with two children;
    • one child left behind;
    • a parent working in its child's folder.

    All three moved correctly. They ran before the last fixes and weren't rerun after them.

  • Gates: fmt, lint, typecheck; server 4,062 (replays included), web unit 3,266, web browser 1,100, contracts 114, shared 672, desktop 397.

Not checked: real Claude or Codex sessions, since only stand-in agents ran.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 18, 2026 3:39am UTC

Request Review

Base automatically changed from feat/move-step4b-rooms to main November 18, 2026 03:17
Step 4b, second part (docs/design/fleet.md, Part 3f). A parent moves with its family: ids derived on the receiving side from a family key and each member's source thread, checkouts first then threads parent-first, children waiting off the import slots, shared folders kept shared with guest markers derived on arrival, children left behind becoming their own threads, and children on another computer staying where they are. Rebuilt on main after #981; migration renumbered to 119.
@badcuban
badcuban force-pushed the feat/move-step4b-families branch from b069c64 to 3f9148d Compare November 18, 2026 03:25
A paired computer could reuse an approved family's id and folder owner while naming another project, so this computer approved a thread in one project and ran it in another's checkout. A member now takes its owner's folder only when both name the same project (canonical key and subdirectory), checked before it is ready and again at commit. Found by Vercel Security Review.
@badcuban
badcuban added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit c188094 Nov 18, 2026
24 checks passed
@badcuban
badcuban deleted the feat/move-step4b-families branch November 18, 2026 03:52
badcuban added a commit that referenced this pull request Nov 18, 2026
Step 4b, last part (docs/design/fleet.md, Part 3f). A child thread can move alone to another computer and stay its parent's child there, with the receiving computer writing its link origin from its own authenticated link; a thread another computer's agent started can move back home and nowhere else; and a thread still fenced from a move can only go back where it came from until a person here takes it over. A parent and a lone child never move against each other, and a shared folder waits for everything still running in it. Rebuilt on main after #984.

This branch was previously deployed

1 inactive deployment
Preview — 0ddf8399 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant