Skip to content

Record which machine runs each build - #653

Merged
MaggieAppleton merged 1 commit into
mainfrom
build-machine
Oct 16, 2026
Merged

MaggieAppleton merged 1 commit into
mainfrom
build-machine

Conversation

@MaggieAppleton

Copy link
Copy Markdown
Collaborator

What and why

The Build tab's new status card (next PR) shows which machine a build runs on, to everyone who can see the build. Today a build stores only its in-memory connectionId, which means nothing after a reconnect or restart and is deliberately hidden from other people.

  • Persist the machine. When a build or rebuild is queued, it stores the paired machine's durable machineId, plus machineService when that connection ran as a background service (the machine record itself does not keep this). Both are optional in buildSchema, so builds stored before this still restore. Builds live in the document sidecar JSON, so there is no migration. They are written by the existing persistExclusive before the build is acknowledged or announced.
  • Name it in the snapshot. ImplementationSnapshot.buildMachines maps build id to { label, service, connected? } for the builds the snapshot shows: build, live.rebuild, and the live build (live.buildId). The label is read from storage.machines, so a rename shows up. A build with no machineId or no machine record has no entry; there is no fallback.
  • Online status stays private. connected is sent only to the build's own starter, the same rule as live.builderConnected. Other people see the name and icon, never whether the laptop is online. withoutConnection and builderConnected are unchanged.
  • Live updates still go through plan:implementation → the client re-reads GET /implementation, so the one snapshot read covers broadcasts as well.
flowchart LR
  A["Build / rebuild queued<br/>on a live connection"] --> B["queueBuild / queueRebuild<br/>build.machineId = connection.machineId<br/>build.machineService = about.service"]
  B --> C[("Sidecar JSON<br/>persistExclusive")]
  C --> D["announceImplementation<br/>plan:implementation"]
  D --> E["GET /implementation"]
  E --> F["storage.machines.get(machineId)<br/>label"]
  F --> G["buildMachines[buildId]<br/>{ label, service }"]
  G --> H["Every viewer:<br/>label + icon"]
  G --> I["Build's starter only:<br/>+ connected"]
Loading

Tests

  • DEMO_PERSONAS=off bun test apps/server/src/tasks/ apps/server/src/experiments/spike-host.test.ts: 157 pass.
    • Everyone sees a started build's machine; only its starter gets connected.
    • A living document's first build and its rebuild name their machine to a non-builder, who still gets no builderConnected.
    • A legacy build without machineId restores and the snapshot has no buildMachines.
    • machineId survives closing and reopening the document.
  • bun run types: server and protocol are clean. bun run ci fails only on git-ignored apps/web/src/design-jig/ files.

🤖 Generated with Claude Code

A build now stores its paired machine's durable id (and whether that connection ran as a
background service) when it is queued or rebuilt. The implementation snapshot names the
machine of every build it shows, so everyone who can see a build sees where it runs.
Only the build's own starter learns whether that machine is connected now. Builds stored
before this have no machine and show none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaggieAppleton
MaggieAppleton enabled auto-merge (rebase) October 16, 2026 12:26
@MaggieAppleton
MaggieAppleton merged commit 8809b41 into main Oct 16, 2026
24 checks passed
@MaggieAppleton
MaggieAppleton deleted the build-machine branch October 16, 2026 12:30
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.

1 participant