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

Boards, step 6a: the forge writes the Usage and Crew starting boards on boot, and never overwrites an edited one #2468

Merged opened this

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

Merged

On boot the forge now writes a **Usage** board and a **Crew** board into `forge/boards`, once each. A person's edit or deletion is never overwritten. The new test and the type check pass, but I did not run the full suite.

shipped production is serving it deploy f0961d3

opened this

On boot the forge now writes a Usage board and a Crew board into forge/boards, once each. A person's edit or deletion is never overwritten. The new test and the type check pass, but I did not run the full suite.

What changed

  • src/boards/starting.ts holds the two boards as plain data.

- Usage (24h, refreshes every minute) charts: - pod CPU and memory; - cells CPU and memory, one series per app: target; - node CPU and load; - requests per hour by status, from usage. - Crew (7d) charts: - runs by agent and outcome, from spend; - runs by state; - review verdicts; - spend per hour.

  • offerStartingBoards(app) in src/actions/boards.ts writes whichever starting boards are missing and records them in a .offered file in the same commit. A slug listed in .offered is never written again, so an edit stays and a deletion sticks. If a person already has a board under one of those slugs, it is recorded as offered and left alone.
  • src/main.ts calls it after the samplers start, without blocking boot. Failures are logged as warnings.
  • The README describes the starting boards.

Choices

  • Founding the forge org and boards repo needs a human admin. On a forge with none, nothing is written and the next boot tries again.
  • The forge boards repo is now created on first boot with an admin, not only on the first manual board.
  • The record is in the boards repo, not a DB table, because git is the source of truth. If someone deletes the whole repo, the starting boards come back.
  • Commits are authored as forge@<host>.

Left out

  • No "reset to default" action.
  • No new sources or chart types.

Tests test/boards-starting.test.ts boots a fresh forge and runs every panel's query of both boards without error. A second boot leaves an edited board unchanged, and a deleted board stays deleted. A forge with no admin writes nothing. Try it with bun test test/boards-starting.test.ts, or boot with an admin account and open /boards.

Closes #2458

commented

On boot the forge now writes a Usage board and a Crew board into forge/boards, once each. A person's edit or deletion is never overwritten. The new test and the type check pass, but I did not run the full suite.

What changed

  • src/boards/starting.ts holds the two boards as plain data.

- Usage (24h, refreshes every minute) charts: - pod CPU and memory; - cells CPU and memory, one series per app: target; - node CPU and load; - requests per hour by status, from usage. - Crew (7d) charts: - runs by agent and outcome, from spend; - runs by state; - review verdicts; - spend per hour.

  • offerStartingBoards(app) in src/actions/boards.ts writes whichever starting boards are missing and records them in a .offered file in the same commit. A slug listed in .offered is never written again, so an edit stays and a deletion sticks. If a person already has a board under one of those slugs, it is recorded as offered and left alone.
  • src/main.ts calls it after the samplers start, without blocking boot. Failures are logged as warnings.
  • The README describes the starting boards.

Choices

  • Founding the forge org and boards repo needs a human admin. On a forge with none, nothing is written and the next boot tries again.
  • The forge boards repo is now created on first boot with an admin, not only on the first manual board.
  • The record is in the boards repo, not a DB table, because git is the source of truth. If someone deletes the whole repo, the starting boards come back.
  • Commits are authored as forge@<host>.

Left out

  • No "reset to default" action.
  • No new sources or chart types.

Tests test/boards-starting.test.ts boots a fresh forge and runs every panel's query of both boards without error. A second boot leaves an edited board unchanged, and a deleted board stays deleted. A forge with no admin writes nothing. Try it with bun test test/boards-starting.test.ts, or boot with an admin account and open /boards.

Approved

Approved from the source and tests. I could not reach the preview from my sandbox (the network proxy refused it), so I did not check /boards by eye or in the phone and desktop pictures. The boot path never blocks, failures are logged and not shown, a forge with no admin writes nothing, and .offered is committed with the boards in one commit. That makes edits stay and deletions stick. No new page or input is added, so keyboard, phone and no-JS behaviour is unchanged from the existing /boards. Two things I would do next: (1) add a test for the case the code handles but nothing covers: a person-made board under usage is recorded as offered and not overwritten. (2) Add a way to see the starting boards on the preview, such as a seeded admin or a note in the README. The forge/boards repo now appears on first boot, not on the first board, so say in the README that this is where it comes from.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs