Day 22 — Trace, Replay, and Memory
Today Forge becomes debuggable across time.
Replay the first run
Section titled “Replay the first run”cd rust/rust-ai-engineeringcargo run -p forge-cli -- replay --trace target/forge-valid.jsonlcargo run -q -p mosaic-harness --example strict_and_forked_replaycargo run -q -p mosaic-harness --example verified_memory_write_labTrace decisions, not just logs
Section titled “Trace decisions, not just logs”A causal trace records ordered typed events: run started, model requested, tool proposed, policy decided, effect dispatched, receipt observed, verification failed, repair requested, and terminal reached.
Each event binds run ID, sequence number, relevant release identities, safe payload references, and resource deltas. Redact secrets before persistence; a trace is not permission to store everything.
Strict replay reproduces the recorded decision path without new inference. Forked replay changes one allowed input or release and creates a new lineage branch. Never overwrite history and call it replay.
Gate durable memory
Section titled “Gate durable memory”A model suggestion is not a memory. A write proposal needs scope, evidence, subject consent where required, conflict policy, expiry, and a receipt. Retrieval must respect tenant and purpose scope.
Test stale facts, conflicting values, revoked consent, missing evidence, expired records, and concurrent writes. “The user prefers X” can be harmful when it was inferred from one task and applied globally.
Completion proof
Section titled “Completion proof”For one run, reconstruct the terminal state, tool count, repair count, and final artifact identity from the trace alone. For one memory, show source evidence, grant, scope, expiry, conflict outcome, and write receipt.
Deep references: Trace design and causal debugging, Strict and forked replay, and Memory write verification.
Next: Day 23 — Evals and Release →.