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

/forges says when each hosted forge was last kept, and a forge never kept is named #13997

Merged opened this

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

Merged

Each hosted forge's row on /forges now says "kept ago", or "never kept" when no backup holds it. The forges MCP listing and GET /api/v1/forges give the same words as kept on each finished forge. The words come from keptWords in src/snapshot/hosted.ts, which reads the snapshot/hosted.json record that #13839 writes.

Notes

shipped production is serving it deploy 4adf612

opened this

Each hosted forge's row on /forges now says "kept <age> ago", or "never kept" when no backup holds it. The forges MCP listing and GET /api/v1/forges give the same words as kept on each finished forge. The words come from keptWords in src/snapshot/hosted.ts, which reads the snapshot/hosted.json record that #13839 writes.

  • Wording: the age reads "under an hour", then whole hours below two days, then whole days (ageWords). A forge the newest backup left out still says why ("left out of the newest backup: …"). The earlier "backed up …", "not in the newest backup" and "not in a backup yet" are gone. The two missing-record cases are now both "never kept", because the record only holds the newest snapshot.
  • One listing for both: listedKept in src/spawn/clients.ts adds kept to each finished forge. The MCP tool and the API both use it, so test/client-list.test.ts (which checks that the two lists are the same rows) stays true. No new tool; the tool's doc gains one phrase.
  • /forges: still one <span data-backed-up> per row; only the words changed.
  • Tests: test/forges-kept.test.ts covers the age words, a kept forge showing its age, an unkept one showing "never kept", and the same words in the MCP listing. Four existing tests were changed only because the wording changed: test/snapshot-hosted.test.ts, test/hosted-surfaces.test.ts, test/client-list.test.ts and test/mcp-forges-card.test.ts. docs/features/hosted-backup.md describes the new words.

Left out: a forge left out last night that an older snapshot did keep still shows only the reason, not when it was last kept. The record holds only the newest snapshot.

To try it: open /forges as an admin, or call the forges MCP tool with no arguments.

Checks: bun x tsc --noEmit, bun scripts/gate.ts --fix, bun scripts/design-lint.ts and bun test test/mcp-size.test.ts all pass. So do the forges-kept, snapshot-hosted, hosted-surfaces, client-list, mcp-forges-card, mcp-forges-refused and plans test files. scripts/fast.ts named 2098 files for this change, over its 5-minute budget, so I ran those covering files myself instead. I did not use keep_plan or estimate: neither tool was available in this session.

🤖 Generated with Claude Code

Closes #13833

commented

Each hosted forge's row on /forges now says "kept <age> ago", or "never kept" when no backup holds it. The forges MCP listing and GET /api/v1/forges give the same words as kept on each finished forge. The words come from keptWords in src/snapshot/hosted.ts, which reads the snapshot/hosted.json record that #13839 writes.

  • Wording: the age reads "under an hour", then whole hours below two days, then whole days (ageWords). A forge the newest backup left out still says why ("left out of the newest backup: …"). The earlier "backed up …", "not in the newest backup" and "not in a backup yet" are gone. The two missing-record cases are now both "never kept", because the record only holds the newest snapshot.
  • One listing for both: listedKept in src/spawn/clients.ts adds kept to each finished forge. The MCP tool and the API both use it, so test/client-list.test.ts (which checks that the two lists are the same rows) stays true. No new tool; the tool's doc gains one phrase.
  • /forges: still one <span data-backed-up> per row; only the words changed.
  • Tests: test/forges-kept.test.ts covers the age words, a kept forge showing its age, an unkept one showing "never kept", and the same words in the MCP listing. Four existing tests were changed only because the wording changed: test/snapshot-hosted.test.ts, test/hosted-surfaces.test.ts, test/client-list.test.ts and test/mcp-forges-card.test.ts. docs/features/hosted-backup.md describes the new words.

Left out: a forge left out last night that an older snapshot did keep still shows only the reason, not when it was last kept. The record holds only the newest snapshot.

To try it: open /forges as an admin, or call the forges MCP tool with no arguments.

Checks: bun x tsc --noEmit, bun scripts/gate.ts --fix, bun scripts/design-lint.ts and bun test test/mcp-size.test.ts all pass. So do the forges-kept, snapshot-hosted, hosted-surfaces, client-list, mcp-forges-card, mcp-forges-refused and plans test files. scripts/fast.ts named 2098 files for this change, over its 5-minute budget, so I ran those covering files myself instead. I did not use keep_plan or estimate: neither tool was available in this session.

🤖 Generated with Claude Code

commented

The admin's /forges page now shows, for each hosted forge, when it was last kept: "kept <age> ago", or "never kept" when no backup has caught it yet. The forges MCP listing gives the same words in its kept field. The age comes from the hosted backup record in src/snapshot/hosted.ts, and src/spawn/clients.ts adds it to each forge's row. Both the page and the tool read that row, so they always say the same thing.

The four tests that failed on the last check are probably timing noise in the check machine, not caused by this change:

  • Unrelated code: they cover preview sleep in test/apps-idle.test.ts and fast-forwards in test/take-expect.test.ts. This pull doesn't touch either area, and neither file nor src/apps changed on main since the pull branched off.
  • They pass here: both files pass locally, before and after merging main.
  • A timeout started it: in shard 73 the first test ran out its 60 s limit and the two after it in that file then failed. In shard 88 a fast-forward test failed on its own in about 0.1 s; I couldn't make it fail here.

I merged current main in, re-ran the type check, the gate, and the tests for both failing areas plus this change (45 pass, 0 fail), and pushed. If the same tests fail again on this push, it isn't noise and needs a closer look.

Not included: there is no alert when a forge goes too long without a backup; the page only reports the age.

To try it: open /forges as an admin and check that each forge's row says "kept … ago" or "never kept". Then call the forges MCP tool and check that its kept field matches. test/forges-kept.test.ts covers both, including a forge that was never kept.

🤖 Generated with Claude Code

Approved

Clean and small. keptWords gives one set of words (kept <age> ago / never kept / why left out) to /forges, the Resilience screen and, via listedKept, the forges MCP tool and GET /api/v1/forges. No new input, write or dependency; the record is read from FORGE_APP_DATA only. The how-to is in docs/features/hosted-backup.md and README is untouched. The new test covers the age words, kept vs never kept on the page, and the MCP listing. Note for later: a missing record and an unkept forge both read never kept, which the pull states openly.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs