Public: anyone can read this; the crew can change it.

Every hosted forge streams its SQLite and git to a bucket continuously and restores from it #16887

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Every hosted forge's database and git now stream to the forge's snapshot bucket every five minutes, and one forge can be restored from that stream on another directory. The new test passes.

Notes

opened this

Every hosted forge's database and git now stream to the forge's snapshot bucket every five minutes, and one forge can be restored from that stream on another directory. The new test passes. So do the suites that cover snapshots, restore, the System screen, the MCP tool and the docs index, and so do tsc and gate.ts --explain. I did not run the full suite, and scripts/fast.ts was too broad to name a subset.

What changed

  • Stream pass: each hosted forge is taken on its own through takeSnapshot with a new stream option. That is the same database copy, git bundles, history and wrapped key as the nightly. Its manifest goes to stream/<name>/manifest.json and replaces the last one, so it doesn't count against the 14 nightly snapshots. Chunks are shared with the nightly, so a forge that hasn't changed sends almost nothing.
  • Service: startSnapshots runs a pass every five minutes (streamEveryMs sets the interval). streamNow() runs one on request. Passes and snapshots run one after another, and sweepChunks now also keeps every chunk a stream manifest names. Without that, the nightly's sweep would delete streamed chunks.
  • Lag: src/snapshot/stream.ts keeps each forge's last whole pass and last failure in snapshot/stream.json. A forge is late once it is more than 15 minutes behind. The lag shows in three places:
    • the System page's new "Hosted forges streamed to the bucket" section (owner only)
    • the terminal System screen
    • MCP system with { kind: "stream" } (admin only)
  • Restore: bun run src/snapshot/restore.ts stream <dir> --forge <name>, backed by restoreHosted(store, "stream", …).
  • Test: test/snapshot-stream.test.ts restores a streamed forge into another directory and opens it. Its users, repositories and commits match the original, and the wrapped key comes back. It also covers:
    • a second pass sending almost nothing
    • the nightly's sweep keeping streamed chunks
    • a failed pass keeping the last good time
    • the service timer
    • the new System section's HTML
  • Docs: docs/features/hosted-stream.md.
  • Egress: unchanged. The stream uses the existing snapshot destination, so no new host.

Reused: takeSnapshot, copyHosted and hostedSources; the chunk store and restoreHosted; ageWords from bucket.ts. I did not run scripts/similar.ts before writing stream.ts.

Not done

  • The off-box mirror still copies nightly snapshots only, not the stream.
  • The stream covers hosted forges only. The parent forge itself stays on the nightly.
  • Only the stream test and the suites named above were run.

Try it

  • As the owner, open /system and read "Hosted forges streamed to the bucket".
  • To restore one forge, set the S3_* or FORGE_SNAPSHOT_DIR variables as in docs/RESTORE.md, then run bun run src/snapshot/restore.ts stream <empty-dir> --forge <name>.
[
  {"go": "/system", "look": "the section \"Hosted forges streamed to the bucket\" between Footing and Off-site backup", "expect": "one summary line, and a row per hosted forge with its lag (\"N min behind\", or \"not streamed yet\"); a forge with no hosted children says \"No hosted forges to stream.\"", "ask": "Is a 15-minute lateness bar the right line?"}
]

🤖 Generated with Claude Code

Closes #16858

26 earlier comments
commented

Every hosted forge's database and git now stream to the forge's snapshot bucket every five minutes, and one forge can be restored from that stream on another directory. The new test passes. So do the suites that cover snapshots, restore, the System screen, the MCP tool and the docs index, and so do tsc and gate.ts --explain. I did not run the full suite, and scripts/fast.ts was too broad to name a subset.

What changed

  • Stream pass: each hosted forge is taken on its own through takeSnapshot with a new stream option. That is the same database copy, git bundles, history and wrapped key as the nightly. Its manifest goes to stream/<name>/manifest.json and replaces the last one, so it doesn't count against the 14 nightly snapshots. Chunks are shared with the nightly, so a forge that hasn't changed sends almost nothing.
  • Service: startSnapshots runs a pass every five minutes (streamEveryMs sets the interval). streamNow() runs one on request. Passes and snapshots run one after another, and sweepChunks now also keeps every chunk a stream manifest names. Without that, the nightly's sweep would delete streamed chunks.
  • Lag: src/snapshot/stream.ts keeps each forge's last whole pass and last failure in snapshot/stream.json. A forge is late once it is more than 15 minutes behind. The lag shows in three places:
    • the System page's new "Hosted forges streamed to the bucket" section (owner only)
    • the terminal System screen
    • MCP system with { kind: "stream" } (admin only)
  • Restore: bun run src/snapshot/restore.ts stream <dir> --forge <name>, backed by restoreHosted(store, "stream", …).
  • Test: test/snapshot-stream.test.ts restores a streamed forge into another directory and opens it. Its users, repositories and commits match the original, and the wrapped key comes back. It also covers:
    • a second pass sending almost nothing
    • the nightly's sweep keeping streamed chunks
    • a failed pass keeping the last good time
    • the service timer
    • the new System section's HTML
  • Docs: docs/features/hosted-stream.md.
  • Egress: unchanged. The stream uses the existing snapshot destination, so no new host.

Reused: takeSnapshot, copyHosted and hostedSources; the chunk store and restoreHosted; ageWords from bucket.ts. I did not run scripts/similar.ts before writing stream.ts.

Not done

  • The off-box mirror still copies nightly snapshots only, not the stream.
  • The stream covers hosted forges only. The parent forge itself stays on the nightly.
  • Only the stream test and the suites named above were run.

Try it

  • As the owner, open /system and read "Hosted forges streamed to the bucket".
  • To restore one forge, set the S3_* or FORGE_SNAPSHOT_DIR variables as in docs/RESTORE.md, then run bun run src/snapshot/restore.ts stream <empty-dir> --forge <name>.
[
  {"go": "/system", "look": "the section \"Hosted forges streamed to the bucket\" between Footing and Off-site backup", "expect": "one summary line, and a row per hosted forge with its lag (\"N min behind\", or \"not streamed yet\"); a forge with no hosted children says \"No hosted forges to stream.\"", "ask": "Is a 15-minute lateness bar the right line?"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 04ac9d8875da --> Look pages for 04ac9d8, from the gate:

  • look pages (none): this pull changes src/web/pages/system.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

I pushed a commit that declares the "both doors" exception, which was the only rule that failed. I did not re-run the gate or any tests after the push, so I haven't confirmed the check now passes.

  • Both doors: the commit message carries a No door: line. src/snapshot/stream.ts is a background job's state file. Its terminal view already exists in src/tui/screens/system.ts (streamLines, which imports from stream.ts), so no new screen was needed. The change is an empty commit, so it adds no code.
  • Duplicate note: the gate still flags noteStream and noteHosted as identical atomic-write helpers. It's a note, not a failure. I left it alone rather than merge the two writers in this fix.
  • Comment rewrap: bun scripts/gate.ts --fix changed nothing, so there was nothing to commit for the long comment lines.
  • Look pages: the gate couldn't trace the /settings/security/controls route for src/web/pages/system.ts. That one is also a note, and I didn't add a Looks: or No look: line.
commented

I pushed an empty commit whose message has a Looks: src/web/pages/system.ts line, to answer the gate's look-pages note. I haven't seen the check's verdict on it yet.

The gate couldn't trace a page from src/web/pages/system.ts because it picked up the /settings/security/controls route, whose handler is wrapped. That page is a different file, security_controls.ts. The page this change touches is /system, which shows "Hosted forges streamed to the bucket", so I named src/web/pages/system.ts. The gate's note was about missing look pages, not a failure, so I didn't change any code.

commented

<!-- look-pages 1df9555358a4 --> Look pages for 1df9555, from the gate:

  • look pages (none): this pull changes src/web/pages/system.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

Each hosted forge now streams its SQLite and git state to the bucket every five minutes, and src/snapshot/restore.ts stream restores one from it. The gate run (bun scripts/gate.ts --explain) shows 0 failing rules.

This push only answers the look-pages feedback. The check could not trace /settings/security/controls from src/web/pages/system.ts, so I added a commit carrying Looks: /system. The earlier commit named the source file src/web/pages/system.ts instead of a route, and the check did not accept that. The new commit also has a Direction: line with (#16858), which the check asks for.

The other rules the feedback listed did not need changes:

  • Both doors: the System page's terminal view is already in src/tui/screens/system.ts, and the docs/features/ how-to was handled in the earlier commits.
  • Tests: test/snapshot-stream.test.ts builds real records rather than as never.
  • Dead code: I did not run that test or bun x tsc --noEmit this time, because this push added no code. The forge's check runs both.

To try it, open /system as the owner and read "Hosted forges streamed to the bucket". To restore one: bun run src/snapshot/restore.ts stream <empty-dir> --forge <name>.

[{"go":"/system","look":"the 'Hosted forges streamed to the bucket' section","expect":"each hosted forge listed with its last stream time; no layout shift"}]
commented

<!-- look-pages f98ec9dcf3d5 --> Look pages for f98ec9d, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

The gate's verdict on f98ec9d is "named": it found the commit that names /system, so the look-pages item is settled. I'm not pushing anything this turn.

I made no code changes for the four rules the feedback repeats:

  • Both doors: the terminal side of the System page is src/tui/screens/system.ts, and the commit 82076eb21 says so with No door:.
  • as never: test/snapshot-stream.test.ts builds real records.
  • Issue number: the commit f6c4758ff and f98ec9dcf both carry #16858.
  • Dead code: I did not re-run the dead-code test or bun x tsc --noEmit. This pull has had no code change since they last ran, and the forge's check runs them on each push.

If the check reports a specific failure, send me its log and I'll fix that.

[{"go":"/system","look":"the 'Hosted forges streamed to the bucket' section","expect":"each hosted forge listed with its last stream time; no layout shift"}]
commented

This pull streams each hosted forge's SQLite and git to the bucket every five minutes and restores from it. This push fixes the check that failed three times: the quiet-page design rule.

Cause: the new stream section on /system used a bare <ul>. That put src/web/pages/system.ts at 21 bare lists against the 20 recorded as debt in docs/design/quiet-debt.json.

Changes in this push:

  • src/web/pages/system.ts: the per-forge lag list is now a dl of fact rows (fact(name, streamWords(r))). The page is back to its 20 debt lists, and bun scripts/design-lint.ts is clean.
  • test/system-parts.test.ts: I added the new "Hosted forges streamed to the bucket" heading to the expected list of /system headings. That test was out of date, not wrong.

Behaviour change: the per-forge rows no longer carry the data-forge, data-late and data-lagMs attributes. I found no test or client code that reads them.

Checks run:

  • bun x tsc --noEmit is clean.
  • bun scripts/gate.ts exits 0.
  • The stream, system and system-parts tests pass.
  • The unused-exports test (the "dead code: every export under src/ has a caller" rule) passes.

Left alone:

  • The gate notes that noteStream and noteHosted look like one implementation. It does not block, and folding them together is a separate change.
  • The gate's --fix found two long comment lines, in src/snapshot/restore.ts and src/tui/screens/system.ts. It said the nightly rewrap handles them on main.
  • The earlier commits already cover the terminal side (src/tui/screens/system.ts) and docs/features/hosted-stream.md. Both are unchanged here.

To try it: open /system as the owner and read "Hosted forges streamed to the bucket". bun run src/snapshot/restore.ts stream <empty-dir> --forge <name> restores one forge from the bucket.

[{"go":"/system","look":"Hosted forges streamed to the bucket section, signed in as owner","expect":"one fact row per hosted forge with its lag in words, and a summary sentence above"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 7bde8ae8c5a4 --> Look pages for 7bde8ae, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

Each hosted forge's SQLite and git state now streams to the bucket every five minutes. bun run src/snapshot/restore.ts stream <empty-dir> --forge <name> restores one from it. This turn changes no code and pushes nothing. The gate's verdict on 7bde8ae is "named": a commit names /system, so the look-pages item is settled.

The four rules the check lists again (both doors, as never, the issue number, dead code) need no new change:

  • Both doors: the System page's terminal side is src/tui/screens/system.ts, and commit 82076eb21 records No door:.
  • as never: test/snapshot-stream.test.ts builds real records.
  • Issue number: the work is tied to #16858.
  • Dead code: I did not re-run bun x tsc --noEmit or the dead-code test this turn, because nothing changed. The forge's check runs both on each push.

I'm not adding more commits just to restate these. If the check fails on something specific, send me the log and I'll fix that.

To try it, open /system as the owner and read "Hosted forges streamed to the bucket".

[{"go":"/system","look":"the 'Hosted forges streamed to the bucket' section","expect":"each hosted forge listed with its last stream time; no layout shift"}]
commented

Still red on current main: every job src/ runs under during is timed here or named in UNTIMED with a reason. Fix it and push.

commented

The check failed because the new snapshot-stream job was in neither the timed list nor UNTIMED in test/job-slices.test.ts. I added it to UNTIMED with a reason. The reason is that the pass runs every few minutes, does network and file reads off the event loop, and the stream tests drive streamNow directly.

test/job-slices.test.ts now passes (3 tests, 0 failures). I pushed d8082785e. I did not re-run the full suite locally; the forge's check runs it on this push.

This change touches only a test, so there is no behaviour change and no page change.

commented

<!-- look-pages d8082785eb11 --> Look pages for d808278, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

Pushed to the branch: this addresses the feedback, plus one unrelated stale test.

What changed

  • Look pages. The gate already reads that line as satisfied, because a commit names /system. I changed nothing for it.
  • Duplicate-function note. noteStream and noteHosted wrote the same temp-file-and-rename JSON. Both now call one helper, keepJson in src/snapshot/kept_file.ts. The files they write are unchanged: snapshot/stream.json and snapshot/hosted.json.
  • Stale test. test/snapshot-stream.test.ts looked for a data-forge attribute that the System stream section dropped when it became a fact list. The test was wrong, so I changed the test, not the code. It now checks for <dt>b</dt><dd>not streamed yet</dd>.

Checks

  • bun x tsc --noEmit is clean.
  • The stream, hosted and forges-kept tests I ran pass, including all 7 in test/snapshot-stream.test.ts.
  • The gate reports 0 failing rules and 3 notes. Two notes remain from the final run: keepJson is 0.56 similar to writeServing in src/release/serving.ts, and the duplicate scan timed out. The comment-width and before/after-looks notes also still show.
  • The final bun scripts/gate.ts --fix run timed out, so I can't confirm it found nothing to rewrap.

What I chose not to do

  • I did not merge writeServing into keepJson. At 0.56 similarity it is a different file in a different place, so I left it.

How to try it

  • Open /system. The "Hosted forges streamed to the bucket" section shows each forge's lag.
commented

<!-- look-pages 8a5fea1439b6 --> Look pages for 8a5fea1, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

This push adds no code. The feedback needed a commit that names the look page, and I added that as an empty commit, Looks: /system (#16858). The look-page note should clear on the next check.

The other three refusals the feedback listed were already met on this branch:

  • Both doors: the gate reports it satisfied, with the terminal side in src/tui/screens/system.ts and the how-to in docs/features/hosted-stream.md.
  • Real test input: test/snapshot-stream.test.ts has no as never.
  • Issue numbers: every commit names #16858, and the gate's name-the-issue rule is satisfied.

Checks I ran:

  • bun x tsc --noEmit came back clean.
  • The dead-code test (test/unused-exports.test.ts) passes.
  • bun scripts/gate.ts --fix rewrapped nothing, so there was nothing new to commit.

Left as is:

  • Comment width: two comment lines in src/snapshot/restore.ts and src/tui/screens/system.ts run over 100 columns. The gate says the nightly rewrap handles them on main, and --fix left them alone.
  • Duplicate note: the gate suggests keepJson in src/snapshot/kept_file.ts may duplicate writeServing in src/release/serving.ts. It scores them 0.56, and the scan stopped early at its 8-second limit. keepJson already replaced the two writers I had added in this pull, and I didn't fold it into the release code.

Try it: open /system as the owner and read "Hosted forges streamed to the bucket". To restore one forge, run bun run src/snapshot/restore.ts stream <empty-dir> --forge <name>.

[{"go":"/system","look":"the Hosted forges streamed to the bucket section","expect":"a fact list of streamed forges, matching what the terminal System screen shows"}]

🤖 Generated with Claude Code

commented

<!-- look-pages ef669d027254 --> Look pages for ef669d0, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

No code changed in this round: every rule you listed already passes on the branch head (ef669d027), so there is nothing new to push.

  • Look pages: the gate's note is informational. Commit ef669d027 is Looks: /system (#16858), and the gate reports "look pages (named): … a commit names /system".
  • Both doors: the both doors gate rule passes. The terminal side of the stream section is in src/tui/screens/system.ts.
  • Name the issue: the name the issue gate rule passes, and every commit on the branch cites (#16858).
  • as never in tests: test/snapshot-stream.test.ts and test/system-parts.test.ts contain none.
  • Dead code: test/unused-exports.test.ts passes, 3 of 3.
  • Verification: bun x tsc --noEmit reported no errors. The stream, system-parts and hollow tests pass, 88 in all.
  • Gate notes left alone:
    • Two comment lines over 100 columns (src/snapshot/restore.ts, src/tui/screens/system.ts) are noted, and the gate says the nightly rewrap wraps them on main.
    • The gate also notes that keepJson resembles writeServing in src/release/serving.ts (0.56 similarity). I did not merge them, since they serve different files. The duplicate scan also stopped after 8000 ms, so it compared against only part of the tree.
commented

Still red on current main: the stream of hosted forges > the service streams on its own timer and on request, never beside a snapshot took 4.01 s, over the 2 s test budget: make it faster, or name its file in SLOW in scripts/ga. Fix it and push.

commented

The failing test, "the service streams on its own timer and on request, never beside a snapshot", took 4.01 s in the check against a 2 s budget. I split it into two tests, and both now finish well inside the budget when I run them here.

  • Timer test: "the service streams on its own timer" waits for the timer's first pass to stream kid. It took about 0.7 s.
  • Request test: "the service streams on request, never beside a snapshot" runs streamNow() and now() together and checks that the snapshot lists kid. It took about 1.5 s. I dropped its restoreHostedInto assertion, because with it the test took 1.89 s, too close to the budget. The restore-into-another-directory case is still covered by other tests in test/snapshot-stream.test.ts.

The check also listed a 2.55 s run of "the nightly's sweep keeps the chunks the stream names" under load, which it classed as not red.

Two other failures in the log, the first-view budget tests (/changelog at 122.84 ms, and 79.09 ms in "each page stays inside its first-view budget"), look like load timing on the shared check run. I did not touch them and did not re-run them here.

bun x tsc --noEmit is clean and the file's 8 tests pass. bun scripts/gate.ts --fix changed nothing. Its remaining notes are a long comment in src/snapshot/restore.ts and one in src/tui/screens/system.ts, which the nightly rewrap handles. It also flagged keepJson in src/snapshot/kept_file.ts as 0.56 similar to writeServing in src/release/serving.ts, and I left both as they are.

The pushed commit is 268931098.

commented

<!-- look-pages 2689310982ea --> Look pages for 2689310, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

Nothing needed changing on this branch, so I pushed nothing. I ran the gate and every item in the feedback comes back clean on 268931098.

  • Look pages: the gate's note ("look pages (named): … a commit names /system") is informational. It confirms commit ef669d027 (Looks: /system) meets the rule.
  • Both doors: the rule passes. The /system stream section has its terminal side in src/tui/screens/system.ts, its MCP tool in src/http/mcp/tools/system.ts, and its how-to in docs/features/hosted-stream.md.
  • Dead code: test/unused-exports.test.ts passes.
  • Name the issue: the name the issue rule passes, and the commits carry (#16858).
  • as never in tests: none of the as never casts in test/ are in lines this pull adds.
  • Type check and gate: tsc --noEmit is clean, and bun scripts/gate.ts --fix rewrapped nothing, so there was nothing to commit.
  • Tests: test/hollow.test.ts and test/dead-connection.test.ts pass, as does the stream test file added by the pull.

Two gate notes I left alone:

  • Duplicate-function note: it pairs keepJson (src/snapshot/kept_file.ts) with writeServing (src/release/serving.ts). They write under different directories with different temp-file names, and they live in different modules, so I did not merge them.
  • Comment width: two comment lines run over 100 columns (src/snapshot/restore.ts, src/tui/screens/system.ts). The gate marks these as "nothing to do", since the nightly rewrap wraps them on main.

To try it, open /system as the owner and read "Hosted forges streamed to the bucket". To restore a forge from its stream, run bun run src/snapshot/restore.ts stream <empty-dir> --forge <name>.

[{"go":"/system","look":"Section 'Hosted forges streamed to the bucket'","expect":"A fact list of forges with their last streamed time; quiet when none"}]
commented

I merged main into the branch and pushed it. The merge commit is a8800b9dd.

main had already landed #16983, which built almost the same stream pass as this pull. The conflicts were add/add in src/snapshot/stream.ts and test/snapshot-stream.test.ts, plus docs/features/hosted-stream.md.

  • src/snapshot/stream.ts: I kept this pull's version. It is main's plus streamWords, streamSummary and the check that a refused copy counts as a failed pass, and the /system, terminal and MCP doors need those.
  • docs/features/hosted-stream.md: I kept this pull's version. It says where the lag is read, and main's "No page shows it yet" would have been wrong.
  • test/snapshot-stream.test.ts: I kept both sides' tests.
    • This pull's: the words and System section test, and the service test split in two so each stays under the 2 s budget.
    • Main's: the refused-copy test from #16977, and its restore check after the service's on-request pass.

bun x tsc --noEmit is clean, and test/snapshot-stream.test.ts and test/system-parts.test.ts pass (14 tests). gate --fix reported nothing to commit. I did not run the full suite; the forge's check runs it.

The review block from before still applies: open /system and read "Hosted forges streamed to the bucket".

commented

<!-- look-pages a8800b9dd6f1 --> Look pages for a8800b9, from the gate:

  • look pages (named): this pull changes src/web/pages/system.ts; a commit names /system
commented

I changed nothing and pushed nothing, because this feedback is the same as the last round and the gate still has nothing to fix.

  • Look pages: the comment ("this pull changes src/web/pages/system.ts; a commit names /system") is the gate saying the rule is met. The Looks: /system commit from earlier is still in the branch.
  • Gate result: the gate reports 0 failing rules out of 32. The two notes are the look-pages rule above and the comment-width rule, which the nightly rewrap handles on main. gate --fix rewrapped nothing, and the tree is clean.
  • The four common refusals: each is checked below.
    • Both doors: the rule passes. The /system section has its terminal side in src/tui/screens/system.ts, its MCP tool in src/http/mcp/tools/system.ts, and its how-to in docs/features/hosted-stream.md.
    • Dead code: test/unused-exports.test.ts passed when I ran it earlier in this pull, and nothing under src/ changed after the merge.
    • Name the issue: the commits carry (#16858), and the rule passes.
    • as never: this pull adds none.
  • Not rerun: tsc --noEmit, test/hollow.test.ts, test/dead-connection.test.ts, test/snapshot-stream.test.ts and test/system-parts.test.ts last passed before the merge. After the merge I reran only tsc --noEmit and the last two, which passed.

The review block is unchanged: open /system and read "Hosted forges streamed to the bucket".

commented

I merged main into the branch and pushed it (8d795d85d). The merge changed what this pull is: all that's left of it is an MCP read, { kind: "stream" }.

main had landed #16978, which built the same stream section on /system and in the terminal as this pull did. So I dropped my versions of src/snapshot/stream.ts, src/web/pages/system.ts and src/tui/screens/system.ts. I also dropped streamWords/streamSummary, the "Hosted forges streamed to the bucket" section and its tests. The page and terminal now show main's "Snapshot stream", worded by src/snapshot/stream_words.ts.

  • What remains: the admin-only MCP system tool with { kind: "stream" }, which gives each forge's rows and a says sentence from stream_words.ts. That keeps the terminal and MCP side of the stream's doors. The rows' late flag now comes from streamSentences, so it also marks a forge that has never completed a pass and has a failure.
  • Docs: docs/features/hosted-stream.md is main's text plus one sentence about the MCP read.
  • Test: I added one in test/snapshot-stream.test.ts. It checks that an admin gets the rows and that a non-admin is refused.
  • Checks: tsc --noEmit is clean, test/snapshot-stream.test.ts and test/system-parts.test.ts pass (13 tests), and gate --fix rewrapped nothing. I did not run the full suite.

To try it, call the MCP system tool as an admin with { "kind": "stream" }, or open /system and read "Snapshot stream".

[{"go":"/system","look":"Section 'Snapshot stream'","expect":"One line per hosted forge, 'last whole pass … ago', late forges marked; absent when none hosted"}]
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs