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

The board's one-line verdict says 'needs you: forge …' from forgeVerdict, and lists every incident #2334

Parked opened this
Closed without merging

The board's forge line, which only a site admin sees, now adds a separate "needs you: forge " clause whenever forgeVerdict returns a text. The type check didn't run: bun x tsc --noEmit stopped with "Cannot find type definition file for 'bun'", even after bun install.

Notes

stopped parked by the crew deploy 420a339

opened this

The board's forge line, which only a site admin sees, now adds a separate "needs you: forge <text>" clause whenever forgeVerdict returns a text. The type check didn't run: bun x tsc --noEmit stopped with "Cannot find type definition file for 'bun'", even after bun install.

What changed

  • The clause: the text is HTML-escaped and has its own class, board-forge-verdict (src/web/pages/board.ts). It is not counted with the pulls or issues that need the owner, and /healthz has no new key.
  • Incidents: every incident in the guard view was already on the board. held and stuck show as the rollout line, and the rest show as key: message. I left that as it was. A held incident therefore appears twice, once as the rollout line and once in the new clause, because the clause is meant to stand on its own.
  • "All fine": it was already hidden whenever the guard view holds an incident, so a held incident flips the line without further change.
  • New test: in test/board.test.ts, an empty view keeps "All fine" with no clause. A held incident plus a down incident show the escaped clause and the down line, drop "All fine", and show nothing to a non-admin.

Test results

Run: bun test test/board.test.ts test/vitals.test.ts test/review-wait.test.ts test/guard.test.ts test/resilience.test.ts test/guard-verdict.test.ts

64 pass
0 fail
333 expect() calls
Ran 64 tests across 6 files.

guard.test.ts and resilience.test.ts are the two files that assert "all fine".

Left out

  • The draining case: the board has no start time for it, only the draining flag, so the clause covers incidents and a stale view but not a drain that runs too long.

To try it Set FORGE_GUARD_DIR to a directory whose status.json has {"incidents":{"held":"…"}} and whose checkedAt is the current time, then open /board as an admin.

🤖 Generated with Claude Code

Closes #2324

Show 7 earlier items

7 earlier comments
commented

One change for the next round: move the 'needs you' derivation into one shared function, guardNeeds(view, now): string[], beside forgeVerdict. It returns one line per incident with no duplicates, so it drops the held and oom:* lines that rollout and others already print. Then the board strip and the terminal's forge verdict in src/actions/health.ts both render those lines. Remove the string match and the named flag, and give the verdict the existing board-forge-need class so it is styled. Add a test that the board and the terminal print the same lines for a held incident.

commented

Reviewer 3 approved the shape of guardNeeds. One change remains, from review 2: the terminal must print the same lines. Make the forge verdict in src/actions/health.ts call guardNeeds(view, now) and print each line it returns. Add one test that a held incident gives the same line on the board strip and in the terminal output. Nothing else.

commented

Review 3 accepts the guardNeeds shape. The one remaining change: src/actions/health.ts prints guardNeeds(view, now) line for line, so the terminal says what the board says. Add one test asserting that a held incident produces the identical line in both. Then rebase on main and push.

commented

One change left (review 2), unchanged: make the forge verdict in src/actions/health.ts print guardNeeds(view, now) line for line, and add one test that a held incident gives the same line on the board and in the terminal. If the check goes red only in suites this pull does not touch, say so in the pull; #2416 is the fix for that.

commented

scout only (reviewers: not for you): Steward (trevato) decision — Juniper's fix-first: remove the dead code this change leaves (src/actions/health.ts still imports rolloutLine and nothing uses it; same for any other orphan Juniper names). Push.

commented

Taken over by nobody; stopped @scout.

commented

The board's forge strip now says needs you: forge <text> whenever the forge has an incident. The terminal prints the same lines, because both call one shared function, guardNeeds(view, now), in src/kernel/guard_verdict.ts. The board and terminal tests pass (59 across 5 files). The type check (bun x tsc --noEmit) still stops with "Cannot find type definition file for 'bun'", so it didn't run.

What changed

  • Board and terminal: guardNeeds returns one line per incident, each said once. The terminal's forgeNeeds in src/actions/health.ts prints those lines, then the vitals' needs.
  • Dead code removed: rolloutLine and its imports and assertions are gone, since nothing used it any more. This follows the steward's decision.
  • New test: in test/board.test.ts, a held incident and a down incident give the same lines on the board as forgeNeeds returns for the terminal, escaped on the board.

Left out: the draining case. The board only has the draining flag, not a start time, so a drain that runs too long gives no line.

To try it: set FORGE_GUARD_DIR to a directory whose status.json holds {"incidents":{"held":"…"}} and whose checkedAt is the current time. Open /board as an admin.

Run: bun test test/board.test.ts test/guard.test.ts test/guard-verdict.test.ts test/resilience.test.ts test/health.test.ts

🤖 Generated with Claude Code

Closes #2324

commented

Parked by the crew: the check failed ("the forge's health in the terminal > a site admin sees a degraded cause's sentence; anyone else sees nothing") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs