Skip to content
language.blue
repo.blue ↗Run this example

04 · Historical catch-up

NBA Game: Host Catch-Up

Create a Game independently, progress it from Scheduled to Live to Final, and emit scoring and ending events. Then attach the completed Game to a waiting Host and watch the Host consume its retained revisions in order.

Executable Playground example2 participants2 documents7 guided actions

The story

The Host can arrive after the Game is over.

The NBA feed owns the Game’s lifecycle. The Host waits independently and does not need to be present while the Game is played. Attachment later admits the exact initial Game identity and reuses all committed child revisions.

Catch-up reuses history; it does not replay source actions.

The child is already complete. The Host consumes immutable child revisions through its new embedding edge.

Host: waiting independently

Game epoch 0: Scheduled
Game epoch 1: Live
Game epoch 2: MIN +2
Game epoch 3: LAL +3
Game epoch 4: Final
              │
              ▼ attach completed Game
Host consumes all five Game revisions

Run it

Build first. Attach later.

Each click advances exactly one real action and leaves its result visible before Guide offers the next step.

01
Create the NBA Game.A new autonomous managed Root appears while the Host continues waiting.
02
Start the Game.The NBA feed changes Scheduled to Live.
03
Record both scoring plays.Minnesota scores two; Los Angeles scores three. Each play creates one revision and event.
04
End the Game.The Game reaches its exact Final state and complete retained history.
05
Attach it to the Host.The Host reuses the child and catches up through all five committed revisions in order.
06
Touch the caught-up Host.A normal Host operation now runs against state that includes the completed embedded Game.

What this teaches

Independent Roots can converge later.

Creation order, immutable history, explicit attachment, and per-edge cursors let a new relationship catch up without changing the child’s past.

State machineOperations enforce Scheduled → Live → Final transitions.
EventsScoring and ending facts accompany exact child revisions.
ReuseThe completed child is attached, not reconstructed.
CursorThe Host records how far it has consumed child history.
Next: separate document identity from occurrence identity.

Five Embeddings, Three Games attaches repeated child references in one collection operation.