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

Terminal: `live`, `releases` and a person's `rollback` in the forge's SSH terminal, gated as /releases is #2103

Merged opened this

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

Merged

The terminal now has a `Releases` command in the palette, and a person who writes `FORGE_REPO` can roll back from it. The new tests and `releases-page.test.ts` pass, and `tsc --noEmit` is clean.

shipped production is serving it deploy caaa084

opened this

The terminal now has a Releases command in the palette, and a person who writes FORGE_REPO can roll back from it. The new tests and releases-page.test.ts pass, and tsc --noEmit is clean.

I ran all of test/tui-*.test.ts. Two tests in tui-code.test.ts fail: "repo rows wear issue and pull counts…" and "an event on the bus refreshes the dashboard…". They fail the same way on main, so they aren't from this change. The forge's check will report on the whole suite.

  • Palette: Releases is offered only to a site admin or a reader of FORGE_REPO. Anyone else gets no command, and the screen's live line and list come back empty for them.
  • Screen (src/tui/screens/releases.ts): it shows live: <sha> since <time>, then each kept release with its short sha, landed pull, when it landed, and "healthy since" for the live one.
  • Rollback: Enter on a rollable release asks to confirm, then runs the same rollback as the page's button. Agents, non-writers, the live release and schema-incompatible releases are never rollable. With FORGE_SELF_SWAP off it toasts "This forge does not swap releases itself (FORGE_SELF_SWAP is off)".
  • Shared gate (src/release/gate.ts): I moved the page's gate and rollback flow into this module, and src/web/pages/releases.ts now uses it, so the page and the terminal can't drift apart.
  • Tests (test/tui-releases.test.ts):

- A non-reader sees nothing and isn't offered the command. The test caught the live sha leaking to a non-reader, which I fixed. - A reader sees the list but gets no rollback. - An agent is refused. - A writer is asked to confirm, and is told when swap is off.

  • README: the line saying the terminal lacks this is updated.

I didn't add a releases command-line argument, a separate terminal live-line on the dashboard, or any new dependency. The screen has no live refresh, so reopen it to re-read.

To try it, connect with FORGE_APP_SSH, open the palette with :, and pick Releases.

🤖 Generated with Claude Code

Closes #2079

Approved

Approved. The terminal now has Releases, gated by the same rules as /releases. The rules moved into src/release/gate.ts, and the page and the terminal both call it. Only a site admin or a reader of FORGE_REPO is offered the palette entry, and an agent or a non-writer gets no rollable rows. The writer is asked to confirm. mayRollBack is checked again when Enter is pressed, and the swap refusals are the page's own, including the FORGE_SELF_SWAP-off message. I read the diff only. I did not open the preview or the screenshots. The README is updated and no dependency was added.

Two things I would do next:

  1. Test rollBackTo directly in gate.ts. Today only the "FORGE_SELF_SWAP is off" refusal is covered, through the terminal. The beginSwap refusal and the success path (swap, then drain) have no test, and the page and the terminal now depend on them.
  2. Say what a screen-reader or narrow-terminal user gets. The live line is truncated to the head row, and a failed rollback shows only as a toast that disappears. Keep the refusal text on the screen until a key is pressed.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs