Replay
Memorywhat it remembers

Replay

One record of everything that happened, so any past moment can be rebuilt and run again.

Terminal · Replay
studio · replay Tue 8 Dec 07:42

# the record: every stream, one timeline, never rewritten

$bun LIFEOS/REPLAY/Replay.ts tail --n 8

tsstreamwritertitlewhat
07:05:00 vigil wf:vigil-tick heartbeat · 8 adapters live, 1 warn heartbeat
07:11:58 event wf:backup-laptop run failed · vault disk asleep, retry 3 of 3 workflow run
07:12:03 event wf:vigil-tick Laptop backup is 9 days stale · lane texted alert
07:12:04 conversations tool:Messages imessage · out · person sam · thread messages:9b2e41c7 text sent
07:39:51 receipt tool:Assay lumen onboarding suite · 47 pass, 0 fail (was 44 and 3) eval result
07:40:12 deploy app:lumen staging · onboarding step 3 fix · commit 4e7a2c1 deploy
07:41:30 turn hook:turn lumen-onboarding-fix · turn 6 · Opus high · tree 4e7a2c1 prompt
07:42:00 vigil wf:vigil-tick heartbeat · 8 adapters live, 1 warn heartbeat

$bun LIFEOS/REPLAY/Replay.ts verify && bun LIFEOS/REPLAY/Replay.ts counters

✓ Replay verify: ok {"refused":0,"spooled":3,"quarantined":0,"drained":3}

# 2,418 rows today from 31 writers · chains intact · cloud 41s behind · 0 gaps at the 07:00 reconcile

# rewind: Sunday 19:40, Sam asked if everything was backed up. Juno said yes. The laptop was 7 days stale.

$bun LIFEOS/REPLAY/Rewind.ts input 5e1c90ab --errata ERR-212

Fixture fixtures/5e1c90ab-t3.json
turn 3: Is everything backed up before I travel on Wednesday?
41 messages, 18 tools, 2 tool calls (Read, Grep)
conditions {"model":"Opus","effort":"high","channel":"voice","idle":"4s"}

# replay: run that turn again, as it ran and with the fix in place

$bun LIFEOS/ASSAY/Assay.ts replay --turn fixtures/5e1c90ab-t3.json --fix-append backup-check.md --expect "laptop.*stale" --k 5

flippedproven by paired turn replay · 5 runs per arm on Opus
controlSunday's prompt 0/5
then“Yes, everything is backed up as of last night.”
fix+ backup-check.md 5/5
now“Not the laptop: its last backup was 7 days ago. The vault disk is asleep.”
verdict better · p = 0.004 (one-sided Fisher, 0/5 vs 5/5)
→ wrote 1 turn-replay row · ids and counts only

$

Replay in the terminal: the last eight rows of Sam's record from six streams, the record's own health check showing 2,418 rows today, and Sunday's wrong answer about backups rewound and replayed, 0 of 5 as it ran and 5 of 5 with the fix.

Replay is the record of what happened. When a hook refuses a command, a job finishes or an app deploys, the fact is written once, in one shape, to one append-only record. Everything else the system keeps about its work is computed from it, so any past moment can be rebuilt and run again with a fix in place.

Why it exists

A system with dozens of parts ends up with dozens of private diaries, each in its own format. LifeOS kept them in one state folder it treated as disposable, so history quietly disappeared: the work-event log was wiped about every nine hours.

When something went wrong, the evidence was often gone, so no fix could be checked against its miss.

How it works

Every row carries the same envelope: who wrote it, when, which stream, how private it is, and the fact itself (large payloads by hash). On each machine, every writer appends to its own daily segment, so none waits on another, and each day’s segments are hash-chained and sealed against later edits. Secrets are masked (the local engine still refuses them for now), content leaves only by an audited erasure you approve, never by age, and the authoritative copy lives in the cloud on your own account.

The rest is meant to be views, like the work board. A registered view names what it reads and how it combines those rows, so it can be thrown away and rebuilt. Systems move in one at a time, writing to both stores until they match. A drill rebuilds every registered view against a copy and counts the history held only in deletable files. An hourly check reads the last two hours against transcripts and other independent logs and reports missing rows to Vigil.

Your apps report in too, each through a scoped credential or service binding with a ceiling on what it may send; customer data never reaches the cloud record.

One miss, replayedfrom the complaint to the proven fix
RecordedEvery prompt you type writes a turn row: its place in the transcript, the commits and uncommitted changes, the model, and how long the keyboard had sat idle.
→
RebuiltThe turn you complained about is rebuilt: the conversation since its last compaction, the system prompt it ran under, every tool call and its outcome.
→
ReplayedThe turn runs several times under the old prompt and several under the fixed one, on one model. The fix counts only if it passes more often than chance explains.
The point: the fix is tested against the real miss, with the original prompt as the control.

A prompt fix is judged over several runs because a model can answer differently each time. Code fixes are proven by a test of the miss that fails on the old commit and passes on the new one. Replayed turns can’t call their tools yet.

Where you see it

In the terminal up top, Replay.ts tail lists the last eight rows from six streams: a failed laptop backup, its alert, the text to Sam, an eval receipt, a staging deploy and a turn, between two Vigil heartbeats. verify and counters report 2,418 rows today from 31 writers, chains intact and 0 gaps at the 07:00 reconcile. Rewind.ts rebuilds the turn behind Errata entry ERR-212: on Sunday Juno told Sam everything was backed up when the laptop was 7 days stale. Assay replays it five times as it ran and five with the fix: 0 of 5 against 5 of 5, verdict better.

Where it fits

Replay keeps what happened, and Vigil decides whether any of it is worth interrupting you for. Cortex curates what’s worth remembering in its own ledger, which Replay reads in place. Census lists what exists and computes each thing’s state from the rows that name it. Code keeps its history in git, and Ledger versions every change to the system.