self: label idea-flower confidence as a likelihood (~N% likely) - #37
Merged
Conversation
…he rolling window
Operator: "remove the cap thing and rework it so that all transcripts are
saved by default and persistent between vibe code room runs."
Asking for today's transcript is what exposed it: the store held EXACTLY 400
lines — the cap — covering 17:52 to 21:07. Everything earlier was gone, evicted
one line per utterance, silently. Measuring the live file twice 35 minutes
apart caught it mid-act: the oldest line in the first read was absent from the
second.
THREE THINGS STOOD IN THE WAY, only one of them the cap.
• TRANSCRIPT_STORE_CAP = 400, evicting on every append.
• TRANSCRIPT_RESTORE_WINDOW_MS = 45 min, which discarded the file wholesale
when the newest line was older. This room's own archive contains a
155.9-minute gap starting 18:11 — dinner. Worse, restore() ASSIGNED
#lines, so a declined restore left the array empty and the next word
flushed a one-line file over the whole evening. Tonight's 363 pre-dinner
lines survived by luck: the room happened not to restart during dinner.
• The store needed BOTH self-mode AND an env marker, which is what made it
off by default. That gate exists for a reason (6a1d228: test runtimes were
writing the live store), so it is REPLACED, not deleted.
THE ARCHIVE is append-only JSONL, one segment per LOCAL day, unbounded and
permanent: builds/transcripts/YYYY-MM-DD.jsonl. Nothing is ever evicted; the
only thing that can shrink it is the operator with rm. Append costs the new
bytes — measured flat at 85-88 bytes per call over 2,000 appends, with zero
whole-file rewrites, where the old design re-serialized everything every
750ms. LOCAL day, not UTC, because this room's evening straddles UTC midnight:
a UTC "today" asked at 21:07 would have answered a 3-hour conversation with
its last 19 lines.
RESTORE IS A SEPARATE CONCERN, deliberately. Saved forever is not replayed
forever: the last ~60 lines within 6 hours come back, because the panel shows
40 and the research loop keeps 40 turns while the rig's two mics make each
utterance arrive roughly twice. So a 15-second self-reload resumes exactly as
before, a restart after dinner now resumes too (the case that used to fail),
and next morning starts clean and SAYS so, naming `bun run transcript
yesterday` rather than looking broken. Restore performs no writes at all,
which kills the destroy-on-decline bug structurally.
DEFAULT ON, at the boot entry rather than in the runtime — so `bun run start`,
run-room.sh and the supervisor all archive, while a runtime built the way
tests build one gets nothing. Acceptance test, verified rather than trusted:
the operator's real archive is byte-identical (sha256 1207a8bb…82d9f) after
1,414 tests, three scratch server boots and the CLI read-backs. room-harness
points its spawned server at its own tmp dir, closing the e2e path too.
READ IT BACK: `bun run transcript` (today), `... yesterday`, `... 2026-08-24`,
or GET /api/transcript/{today|yesterday|YYYY-MM-DD}[?format=text] and
/api/transcript/days. The CLI works when the room is DOWN, which is exactly
when last night's conversation is wanted.
MIGRATION recovered MORE than was live: 638 lines now, against the 400 the cap
had left, folded from the rolling file plus rescue copies — every source line
present, no duplicates, original atMs preserved, span 17:53:22 to 21:51:39.
ONE BUG FOUND IN REVIEW AND FIXED HERE: #separatorFor marked a segment healed
BEFORE the write it rode on had landed, so a first flush that failed (full
disk, permissions) left the day recorded as healed and the retry emitted no
leading newline — gluing the next utterance onto the stump and losing a second
line. The heal is now recorded only after the append succeeds, so "one corrupt
line costs exactly one line" is true on the retry path too.
KNOWN AND DELIBERATE: #pending is bounded at 5,000 lines. That is not a cap on
the archive — it is the safety valve for a wedged disk, it only engages when
writes are already failing, and it says so loudly ("dropping the N oldest
buffered line(s) — check the disk") rather than dropping anything quietly.
tsc clean, 1414 tests, build green. (repo-clone's real `git clone` times out
against a 5s budget under parallel load and passes 11/11 in isolation — the
known flake, and neither repo-clone file is in this diff.)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spoken in the room