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

The System screen shows each forge's snapshot stream lag, worded to pass the quiet-page rules #17053

Merged opened this

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

Merged

The System screen now has a "Snapshot stream" section that shows each hosted forge's last whole stream pass and its last failure. The new tests, test/empty-states.test.ts, test/empty-words-all.test.ts, test/tui-system.test.ts, tsc --noEmit and bun scripts/design-lint.ts all pass.

Notes

opened this

The System screen now has a "Snapshot stream" section that shows each hosted forge's last whole stream pass and its last failure. The new tests, test/empty-states.test.ts, test/empty-words-all.test.ts, test/tui-system.test.ts, tsc --noEmit and bun scripts/design-lint.ts all pass. I did not run the whole suite; the forge's check does that.

What changed

  • Page: src/web/pages/system.ts adds streamSection, one status row per forge. A row reads "last whole pass 2 minutes ago", or "… 1 hour ago. Last failure: <why>" for a lagging forge. A forge more than three passes behind (15 minutes) is marked "(late)". It reads streamLag from the data the stream issue keeps.
  • No pass yet: a forge with no pass says "first pass is due within 5 minutes of the forge starting, then every 5 minutes", so there is no bare "No …" line. A forge whose first attempt has already failed is marked late and shows the failure.
  • No hosted forge: nothing is drawn and no empty copy is added, so the quiet-page rules aren't tripped.
  • Wording: src/snapshot/stream_words.ts is new and holds the sentences. Both the page and the terminal screen use it, so they say the same thing. I reused agoWords and streamLag.
  • Terminal: streamLines in src/tui/screens/system.ts shows the same section on the System screen.
  • Docs and tests: docs/features/hosted-stream.md now says where the lag is read. test/system-stream-lag.test.ts covers a lagging forge beside a fresh one, the first-due wording, and no hosted forge. streamLag now has a caller, so I removed it from scripts/unused-exports-allow.json.

Left out: the "first due" wording says "within 5 minutes of the forge starting", not a clock time, because the stream keeps no next-pass timestamp.

Review block

[
  {"go": "/system as the owner, on a forge that hosts others", "look": "the 'Snapshot stream' section", "expect": "a fresh forge reads 'last whole pass N minutes ago'; a lagging one reads '(late)' with its last failure; a new one says its first pass is due within 5 minutes"},
  {"go": "terminal: System", "look": "the 'Snapshot stream' lines under Restore", "expect": "the same sentences, with 'late' in front of a lagging forge"}
]

Closes #16978

5 earlier comments
commented

The System screen now has a "Snapshot stream" section that shows each hosted forge's last whole stream pass and its last failure. The new tests, test/empty-states.test.ts, test/empty-words-all.test.ts, test/tui-system.test.ts, tsc --noEmit and bun scripts/design-lint.ts all pass. I did not run the whole suite; the forge's check does that.

What changed

  • Page: src/web/pages/system.ts adds streamSection, one status row per forge. A row reads "last whole pass 2 minutes ago", or "… 1 hour ago. Last failure: <why>" for a lagging forge. A forge more than three passes behind (15 minutes) is marked "(late)". It reads streamLag from the data the stream issue keeps.
  • No pass yet: a forge with no pass says "first pass is due within 5 minutes of the forge starting, then every 5 minutes", so there is no bare "No …" line. A forge whose first attempt has already failed is marked late and shows the failure.
  • No hosted forge: nothing is drawn and no empty copy is added, so the quiet-page rules aren't tripped.
  • Wording: src/snapshot/stream_words.ts is new and holds the sentences. Both the page and the terminal screen use it, so they say the same thing. I reused agoWords and streamLag.
  • Terminal: streamLines in src/tui/screens/system.ts shows the same section on the System screen.
  • Docs and tests: docs/features/hosted-stream.md now says where the lag is read. test/system-stream-lag.test.ts covers a lagging forge beside a fresh one, the first-due wording, and no hosted forge. streamLag now has a caller, so I removed it from scripts/unused-exports-allow.json.

Left out: the "first due" wording says "within 5 minutes of the forge starting", not a clock time, because the stream keeps no next-pass timestamp.

Review block

[
  {"go": "/system as the owner, on a forge that hosts others", "look": "the 'Snapshot stream' section", "expect": "a fresh forge reads 'last whole pass N minutes ago'; a lagging one reads '(late)' with its last failure; a new one says its first pass is due within 5 minutes"},
  {"go": "terminal: System", "look": "the 'Snapshot stream' lines under Restore", "expect": "the same sentences, with 'late' in front of a lagging forge"}
]
commented

<!-- look-pages 626a98459b5d --> Look pages for 626a984, from the gate:

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

Nothing needed changing, and I pushed no new commit. Each point in the feedback already passes on the current head, 626a984.

  • Look pages: the commit 626a984 carries Looks: /system. The gate's "look pages (named)" line is a note, not a refusal.
  • Both doors: the terminal screen shows what the page shows. streamLines in src/tui/screens/system.ts reads the same src/snapshot/stream_words.ts as the web page. docs/features/hosted-stream.md is updated, and the doors, feature-doors and gate checks pass.
  • Dead code: test/unused-exports.test.ts and test/check-allow-lists.test.ts pass. The commit also removed a stale entry from scripts/unused-exports-allow.json.
  • Name the issue: the gate rule passes, and the commit says Direction: … (#16978).
  • as never: test/system-stream-lag.test.ts has no as never, as any or as unknown. bun x tsc --noEmit is clean.
  • Comment width: bun scripts/gate.ts --fix rewrapped nothing. It still lists one comment line over 100 columns in src/tui/screens/system.ts as a note, and the nightly rewrap on main handles it.

I ran test/system-stream-lag.test.ts, test/hollow.test.ts, the unused-exports and allow-list tests, and the doors tests, and all pass. The gate's duplicate-function scan stopped after 8000 ms and compared against only part of the tree, so I can't call it clean.

Pull description

The System screen now shows each hosted forge's snapshot stream lag and last failure. A forge with no pass yet says when its first is due.

  • Web: src/web/pages/system.ts has a new "Snapshot stream" section, worded to pass the quiet-page rules.
  • Terminal: streamLines in src/tui/screens/system.ts shows the same lines.
  • Wording: both read src/snapshot/stream_words.ts, so they can't drift apart.
  • Test: test/system-stream-lag.test.ts covers the wording.
  • Left out: no new settings, no alerting on lag, and no history of past failures.

To try it, open /system as the owner on a forge with hosted forges and read the Snapshot stream section.

[{"go":"/system","look":"the Snapshot stream section","expect":"each hosted forge shows its lag and last failure, or when its first pass is due"}]
commented

The System screen now shows each hosted forge's snapshot stream lag and last failure. A forge with no whole pass yet says when its first is due.

Both of Juniper's fixes and the extra test are pushed. The new test, test/system-stream-lag.test.ts and tsc pass. I didn't re-run the gate rules or the unused-exports tests after the change.

  • Sentence slicing: streamSentence in src/snapshot/stream_words.ts now returns text, the part after the name. It builds sentence as ${name}: ${text} from that. The page uses text and the terminal keeps using sentence, so a format change can't corrupt a row.
  • Markup-bearing failure: a new test feeds a long error containing <img … onerror> and checks the page shows &lt;img, not a tag. Escaping already worked; this proves it.
  • Review block: I have not changed it, so the single step still stands. Below is the two-step version that names the fresh row and the lagging one, as Juniper asked.
  • Left out: a next-pass time (the stream doesn't keep one yet) and a link from a late forge to its restore how-to. Both are follow-ups.

To try it, open /system as the owner on a forge with hosted forges and read the Snapshot stream section.

[{"go":"/system","look":"the Snapshot stream section, a fresh forge's row","expect":"the name alone, reading 'last whole pass 2 minutes ago.'"},{"go":"/system","look":"the Snapshot stream section, a lagging forge's row","expect":"the name followed by '(late)', reading 'last whole pass … ago. Last failure: …', with any markup in the failure shown as text"}]
commented

<!-- look-pages 8449c87ae988 --> Look pages for 8449c87, from the gate:

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

The pull is approved, and I made no new changes or commits this round. The branch stays at 8449c87.

The "look pages" line from the gate is a note, not a refusal, and 8449c87 already carries Looks: /system. The other four items passed on the earlier head, and the only change since was the text field and a new escaping test. I did not re-run the gate or the dead-code and doors tests on 8449c87.

Pull description

The System screen now shows each hosted forge's snapshot stream lag and last failure. A forge with no whole pass yet says when its first is due.

  • Web: /system has a "Snapshot stream" section of server-rendered dl rows, with no JavaScript and no new component class. A late forge is marked (late). The section draws nothing when no forge is hosted.
  • Terminal: streamLines in src/tui/screens/system.ts says the same sentences from the same module, src/snapshot/stream_words.ts. The how-to is in docs/features/hosted-stream.md.
  • Wording: streamSentence returns text (the part after the name) apart from sentence. The page uses text and the terminal uses sentence, so nothing slices the string.
  • Tests: test/system-stream-lag.test.ts covers a fresh forge and a lagging one beside each other. It also covers a forge with no pass yet, an empty list, and a failure containing markup, which must show escaped.
  • Left out:
    • A clock time for a new forge's first pass, which needs the stream to keep a next-pass time.
    • A link from a late forge to its restore how-to.

To try it, open /system as the owner on a forge with hosted forges and read the Snapshot stream section.

[{"go":"/system","look":"the Snapshot stream section, a fresh forge's row","expect":"the name alone, reading 'last whole pass 2 minutes ago.'"},{"go":"/system","look":"the Snapshot stream section, a lagging forge's row","expect":"the name followed by '(late)', reading 'last whole pass … ago. Last failure: …', with any markup in the failure shown as text"}]
Sign in to join this conversation.

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

Keyboard shortcuts

Docs