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

A healthy forge's home and board carry no alert banner: design-lint refuses a standing alert there, and a test counts zero #10705

Merged opened this

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

Merged

Home and `/board` now carry no standing alert, and a lint rule and a test keep it that way. `scripts/gate.ts`, `bun scripts/design-lint.ts` and `bun x tsc --noEmit` all pass. I ran 14 related test files, including `test/calm-banners.test.ts`, all green, and did not run the full suite. `scripts/fast.ts` exits 2 because the diff touches `scripts/design-lint.ts`, so I picked the covering files myself…

shipped production is serving it deploy 6b2678b

opened this

Home and /board now carry no standing alert, and a lint rule and a test keep it that way. scripts/gate.ts, bun scripts/design-lint.ts and bun x tsc --noEmit all pass. I ran 14 related test files, including test/calm-banners.test.ts, all green, and did not run the full suite. scripts/fast.ts exits 2 because the diff touches scripts/design-lint.ts, so I picked the covering files myself.

What changed

  • banner rule: scripts/design-lint.ts refuses role="alert", a .banner or a .notice-danger in the home and board builders. Those are pages/board.ts, pages/boards-view.ts, studio/home*.ts and studio/alarm_lines.ts.
  • Opt-out: a tag carrying data-flash is let through, for a transient flash. There is no baseline for this rule, so zero is the ceiling.
  • Alarm lines: src/web/studio/alarm_lines.ts was the one real offender, with role="alert" on fired flow alarms over both home and the boards page. The lines are unchanged and no longer carry that role.
  • System page: /system now shows one line (#egress-reported) when egress is on report. /settings/capacity already had it.
  • Test: test/calm-banners.test.ts renders / and /board for an admin on a healthy forge and finds no alert or banner class.
  • Test, egress fault: with egress set to report, the fault line appears on Capacity and System, and / and /board stay calm. A third test covers the rule itself.
  • Docs: two lines in docs/design/areas/quiet.md describe the rule and the test. They add no new component class.

What I chose not to do

  • /board and alarms: I did not touch the /boards list or /board for alarms beyond dropping the role. A fired alarm still draws as a line, not a banner.
  • "System card": the issue says "system card", but there is no such card on the home or board pages. I read it as the /system page.
  • Push hook: the pre-push hook asked for a commit with a Try: line, so the branch ends with an empty commit that has one.

Try it: as an admin, set cells.egress to report on /settings/capacity. Then /system shows the one line, and / and /board show nothing. Run bun test test/calm-banners.test.ts and bun scripts/design-lint.ts.

🤖 Generated with Claude Code

Closes #10699

commented

Home and /board now carry no standing alert, and a lint rule and a test keep it that way. scripts/gate.ts, bun scripts/design-lint.ts and bun x tsc --noEmit all pass. I ran 14 related test files, including test/calm-banners.test.ts, all green, and did not run the full suite. scripts/fast.ts exits 2 because the diff touches scripts/design-lint.ts, so I picked the covering files myself.

What changed

  • banner rule: scripts/design-lint.ts refuses role="alert", a .banner or a .notice-danger in the home and board builders. Those are pages/board.ts, pages/boards-view.ts, studio/home*.ts and studio/alarm_lines.ts.
  • Opt-out: a tag carrying data-flash is let through, for a transient flash. There is no baseline for this rule, so zero is the ceiling.
  • Alarm lines: src/web/studio/alarm_lines.ts was the one real offender, with role="alert" on fired flow alarms over both home and the boards page. The lines are unchanged and no longer carry that role.
  • System page: /system now shows one line (#egress-reported) when egress is on report. /settings/capacity already had it.
  • Test: test/calm-banners.test.ts renders / and /board for an admin on a healthy forge and finds no alert or banner class.
  • Test, egress fault: with egress set to report, the fault line appears on Capacity and System, and / and /board stay calm. A third test covers the rule itself.
  • Docs: two lines in docs/design/areas/quiet.md describe the rule and the test. They add no new component class.

What I chose not to do

  • /board and alarms: I did not touch the /boards list or /board for alarms beyond dropping the role. A fired alarm still draws as a line, not a banner.
  • "System card": the issue says "system card", but there is no such card on the home or board pages. I read it as the /system page.
  • Push hook: the pre-push hook asked for a commit with a Try: line, so the branch ends with an empty commit that has one.

Try it: as an admin, set cells.egress to report on /settings/capacity. Then /system shows the one line, and / and /board show nothing. Run bun test test/calm-banners.test.ts and bun scripts/design-lint.ts.

🤖 Generated with Claude Code

commented

A healthy forge's home (/) and board no longer carry a standing alert. I fixed the four failures from the check, but only two of them had a cause I could find. The fix is pushed, and the forge's check will re-run on it.

What the pull does

  • Banner rule: scripts/design-lint.ts gains a banner rule. It refuses role="alert", .banner and .notice-danger in the home and board builders, unless the tag carries data-flash for a transient flash. The rule is described in docs/design/areas/quiet.md.
  • Alarm lines: alarmLines drops role="alert". The lines still show when an alarm fires.
  • Egress: /system shows a single line when egress is set to report. A setting that is off is now one line on its own page, never a banner over the board.
  • Test: test/calm-banners.test.ts covers the above.

What I fixed for the failing check

  • Alarm lines: test/flow-alarm-lines.test.ts still asserted role="alert" on /boards and home. I removed that one assertion and kept the check that the line appears or is absent. The test was wrong, not the code.
  • Devices revoke prompt: test/tui-asks-first.test.ts flagged revoke in src/tui/screens/devices.ts:143. That call came in with #10690 and isn't from this pull. It is passed to askApp, a prompt that asks for the app's slug before anything runs. I put it on the test's allowed list, with that reason.

What I could not explain Two other shards failed: "a stranger's deep read…" (test/spawn-reach-door.test.ts) and "the pull list wears a dot…" (test/pull-quiet.test.ts). Both pass when I run them here, so I changed nothing for them. The check on this push will show whether they were load flakes or real.

What I chose not to do

  • No flash mechanism beyond the existing data-flash opt-out.
  • No change to alarm firing or to the capacity settings page.

To try it Open /system as an admin with egress set to report and you'll see one line. / and /board stay calm. Locally, bun scripts/design-lint.ts and bun x tsc --noEmit pass, and so do the tests I ran: test/tui-asks-first.test.ts, test/flow-alarm-lines.test.ts, test/traffic-truth.test.ts, test/pull-quiet.test.ts and test/spawn-reach-door.test.ts.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it, so the pull should merge cleanly again.

The only conflict was in test/tui-asks-first.test.ts. Both sides had added an allowed-list entry for the revoke call in src/tui/screens/devices.ts. I kept main's wording ("run only from the slug prompt's onSubmit") and dropped mine, so the list has one entry.

After the merge, bun scripts/design-lint.ts and bun x tsc --noEmit are clean. I ran only test/tui-asks-first.test.ts, test/flow-alarm-lines.test.ts and test/calm-banners.test.ts, and they pass. The forge's check will run the full suite on this push.

Nothing else changed in the pull. A healthy forge's home and board still carry no standing alert, and an egress setting left on "report" shows as one line on /system.

🤖 Generated with Claude Code

Changes requested — before the latest push

The rule and the alarm-line fix are right, and the calm test is a real check. Three things to fix in one round:

  1. Both doors: the fault line is added to /system on the page only. src/tui/screens/system.ts and capacity.ts say nothing about egress in report mode. Add the one line to both terminal screens, or show why the terminal already carries it.
  2. The egress line now exists twice with different wording. Capacity has a multi-sentence paragraph, which is not 'one line', and System has a second copy. Share one small helper that returns the same single sentence for both pages, and cut the Capacity paragraph to it (design principle 1: nothing explains itself twice).
  3. test/flow-alarm-lines.test.ts: deleting the role=alert assertion weakens the test. Replace it with expect(body.includes('role="alert"')).toBe(false) so a fired alarm is shown to draw as a line and not as an alert.

Box 3 is also only half met: nothing shows the healthy System page lacks the line, and nothing exercises the 'system card' on the terminal. Add a test that /system has no #egress-reported when egress is enforced.

commented

All three points are addressed and pushed. bun x tsc --noEmit and design-lint are clean, and the calm-banner, alarm-line, TUI and capacity tests pass. The forge's full check hasn't run on this push yet.

  • One sentence, one place. src/system/egress_line.ts holds EGRESS_REPORTED and egressReportedLine(db). The line reads "Egress is reported, not enforced: cells may reach any public host on ports 80 and 443." and the helper returns nothing when egress is enforced. The Capacity page's multi-sentence paragraph is now that sentence. /system shows it too, with a link to Capacity.
  • Both doors. The terminal's System screen shows the line under the forge line when egress is reported (egressLines in src/tui/screens/system.ts). The terminal's Capacity screen shows it as a row after the guards, so the cursor never lands on it.
  • Tests.

- Alarm line: test/flow-alarm-lines.test.ts now asserts role="alert" is absent for both the alarm and no-alarm cases, instead of the deleted check. - Enforced case: test/calm-banners.test.ts has a new test that /system and Capacity carry no egress-reported and the terminal says nothing when egress is enforced. The report-mode test also checks the terminal line.

I did not test the Capacity terminal row. The terminal tests call egressLines for System, and Capacity renders the same helper.

🤖 Generated with Claude Code

Changes requested — before the latest push

Earlier asks: one sentence in one place (met, egress_line.ts), the terminal door for System (met), the alarm assertion (met). One miss remains. The terminal Capacity screen now draws the egress row, and nothing tests it. The author says so. Every behaviour added needs a test that fails without it. Fix first: add a test that builds the Capacity screen with egress on report and checks the row is present. Check it is absent when egress is enforced. Also check the System screen entry, not only egressLines. Non-blocking: the System page line links to Capacity; fine as is.

commented

A healthy forge's / and /board no longer show an alert banner. When cells' egress is reported rather than enforced, that shows as one line in four places: the Capacity and System pages, and the terminal's Capacity and System screens. All four use the same sentence from src/system/egress_line.ts. Only the terminal tests are new in this push; nothing in src/ changed.

What changed

  • One sentence: egressReportedLine(db) returns the egress sentence when cells.egress is report, and null when egress is enforced.
  • Pages: /settings/capacity and /system show it as one #egress-reported line, and the System line links to Capacity. / and /board never carry it.
  • Terminal: the Capacity screen adds it as one row after the guards and the self-swap row, so the cursor never lands on it. The System entry adds it under the forge line, through egressLines.
  • Lint: scripts/design-lint.ts has a new banner rule. It refuses a standing role="alert", notice-danger or banner in page source, and lets a transient data-flash through. Alarm lines no longer carry role=alert.
  • Page tests: test/calm-banners.test.ts checks that / and /board show no alert, banner or danger notice. It checks the egress line is on Capacity and System only when egress is reported, and that the banner rule flags or passes each case.

Review feedback: tests for the terminal's egress row

  • test/tui-capacity.test.ts: renders the Capacity screen in a terminal tall enough to show every row. The row is absent by default, present with cells.egress=report, and absent again with enforce.
  • test/tui-system.test.ts: opens System through its palette entry, not through egressLines. The line appears exactly once on report and is absent when egress is enforced. The System dialog cuts the sentence off at its width, so the test matches its first 40 characters.
  • I took the screen code out and confirmed both tests fail, then put it back.

bun scripts/gate.ts and bun x tsc --noEmit pass, and so do test/tui-capacity.test.ts, test/tui-system.test.ts and test/calm-banners.test.ts (30 tests). The full suite was not run here; the forge's check runs it on the push.

Try it: as an admin, set cells.egress to report on /settings/capacity. One line appears there and on /system, and none on / or /board. Over ssh, the Capacity and System screens show the same sentence. Set it back to enforce and all of them go quiet.

🤖 Generated with Claude Code

Approved

Clean. The banner rule is scoped to the home and board builders with a data-flash opt-out and no debt list. The one real offender (role=alert on alarm lines) is fixed. The egress sentence lives in one helper and shows on Capacity, System and both terminal screens, each with a test that fails without it. Healthy / and /board are asserted calm, and the fault appears only on its own pages. No new dependency, no README change, no new component class. Non-blocking: the lint regex excludes > inside a tag, so a => inside a ${} in an opening tag would hide it from the rule; and the Capacity line no longer says how to restore enforcement, which a later pull could put back as a link.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs