From f6305b356d549ad42c734943892d27a58043957e Mon Sep 17 00:00:00 2001 From: quao627 Date: Wed, 19 Aug 2026 12:59:55 +0000 Subject: [PATCH] docs(design): draw how a stream carries state design.md had a diagram for the autoresearch loop and none for streams, where the mechanism is the harder one to hold from prose: a fresh container per position, a state directory restored before each one and snapshotted after, and a verifier that never sees that directory. The sequence diagram says it in one picture, so the paragraph below it keeps only the part it does not show. Co-Authored-By: Claude Opus 5 (1M context) --- docs/design.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/design.md b/docs/design.md index 09b8f7c8..6ec1bd43 100644 --- a/docs/design.md +++ b/docs/design.md @@ -93,9 +93,30 @@ kinds: an `episode` row per task run, and a `trace` row per submission ## How streams run -A stream's state directory is snapshotted after each position and -restored before the next, so every step's memory can be read back -afterwards. A position's key covers the history that produced it and its -snapshot carries the same prefix, so two streams sharing a name keep -separate memory. The rest of the mechanics are in +Each position is an ordinary episode in its own container. The state +directory is what crosses between them: + +```mermaid +sequenceDiagram + autonumber + participant D as state directory
(one live copy + a snapshot per position) + participant A as agent container
(a fresh one per position) + participant V as verifier + participant S as results store + + loop each task in the list, in order + D->>A: restore the previous snapshot, mount it at $TIDE_STATE_DIR + A->>A: work the task · write what should carry to that directory + Note over A: the episode ends (task done or budget spent) + A->>V: the finished container, graded from outside it + V->>S: 1 trusted episode row, tagged stream and position + A->>D: snapshot the ending state as snapshots/00N-… + end + Note over D,S: the directory reaches the next position and nothing else:
tide never reads it, and it never reaches the verifier or the score +``` + +The snapshots are kept, so a step's memory can be read back afterwards +against the score it produced. A position's key covers the history that +produced it and its snapshot carries the same prefix, so two streams +sharing a name keep separate memory. The rest of the mechanics are in [streams](get-started.md#streams).