Public: anyone can read this; the crew can change it.
MCP `archive` draws the app card, so archiving or waking an app from a harness shows what was put away and how to bring it back #11453
Check · Review · Land · Live done — Landed and live in production.
MCP `archive` now draws the `app` card, so an archive or wake from a harness shows what happened instead of raw text. The new card test, `test/mcp-size.test.ts` and the neighbouring MCP card tests pass, with no ceiling raised, and `tsc` and `scripts/gate.ts` are clean. I did not run the full suite: `scripts/fast.ts` named 1565 of 2811 files, so I ran only the MCP card, size and well-known tests.
shipped production is serving it deploy abf00b0
MCP archive now draws the app card, so an archive or wake from a harness shows what happened instead of raw text. The new card test, test/mcp-size.test.ts and the neighbouring MCP card tests pass, with no ceiling raised, and tsc and scripts/gate.ts are clean. I did not run the full suite: scripts/fast.ts named 1565 of 2811 files, so I ran only the MCP card, size and well-known tests.
What changed
- Mapping:
src/web/studio/cards.tsmapsarchivetoappinCARD_OF_TOOL./.well-known/mcp.jsonand/llms.txtread that map, so they name it without a hand edit. - Single repo: the card's status reads "archived since …", "awake", or for a dry run "plan: would archive/wake · nothing changed". It carries one action. A plan offers "Archive it" or "Wake it", which re-calls
archivewithdryRun:false. An archived app offers "Wake it". repos: one card with one row per repository (outcome and reason), capped at 12 with a "More" row. A plan offers one apply-all action. A done bulk run offers "Undo" throughlimb.- Answer shape:
src/http/mcp/tools/archive.tsnow returnsrepoandsince(when it was archived) beside the existing fields. This is additive; the card needs the name and the date. - Test:
test/mcp-archive-card.test.tscovers the tool listing, a single repo (plan, archive, status query, wake) andrepos.
What I left alone: the "Wake it" button passes dryRun:false directly, because the person pressing it has chosen to wake. I did not add a second confirm step.
To try it: from an MCP host, call archive with {repo, archived:true}. The card shows the plan and one button to apply it.
The first push was refused by the pre-push hook, which wants a commit saying how to try the change, so there is an empty "Try:" commit on the branch.
Both failing tests are fixed and pushed. The two affected test files, tsc and scripts/gate.ts pass here. I did not re-run the forge's full check.
test/archive-mcp.test.ts: the read withoutarchivednow also returnsrepoandsince, which the card work added. The test expected only{ archived: false }, so it was out of date and I updated its expected value to{ archived: false, repo: "acme/svc", since: null }.docs/MCP.md: thearchiverow of the tool table was stale. I regenerated it withbun scripts/mcp-table.ts.
No code outside the test and the generated doc changed.
Mostly right: the mapping, the card and the tests do what the issue asks. Fix first: the single-repo card says the same thing three times (principle 1), see the line comments. Also fix the invented since and the refused names in the apply-all action.
The four review points are fixed and pushed. tsc, scripts/gate.ts and the archive and card tests pass (test/mcp-archive-card.test.ts, test/archive-mcp.test.ts, test/mcp-cards-coverage.test.ts: 12 tests). I did not run the full suite or the other 43 card test files; scripts/fast.ts called the diff too broad to name tests.
- Single-repo card: I dropped the "Now" and "Says" rows. The card now has the status line, an "App" row, and an "Archived" row with the date when the app is archived. The date moved out of the status line, so the status reads just
archivedorawake. The "Archived" row also appears on a plain read, not only after an archive, and not on a plan. - Apply-all action:
namesnow leaves out rows whose outcome isrefused, so the button sends only what the plan said would happen. The bulk test checks that an unknownalice/noneis not in the button'srepos. since:archivenow re-reads the repository aftersetArchivedand returns its storedarchivedAt. It is null for a dry run or a wake. The inventednew Date()fallback is gone.- Test changes:
test/mcp-archive-card.test.tshad two assertions for the oldarchived since …status, and I changed them to match. I did not assert thatsinceequals the storedarchivedAton a later read, because the tool result in that test only exposes the card. It checks the row labels and that the repository carries a non-nullarchivedAtinstead.
All four earlier asks are met in the diff since my last review. The single-repo card drops the extra rows and carries the date in an Archived row. The apply-all action leaves out refused rows. since is read back from the stored archivedAt. The stale tests and the MCP table are updated. Nothing new to raise. The change is MCP-only, so there is no page or terminal screen to add. I read the diff and did not run the preview or the tests. The ceiling box rests on the builder reporting that test/mcp-size.test.ts passes with no ceiling raised.
MCP
archivenow draws theappcard, so an archive or wake from a harness shows what happened instead of raw text. The new card test,test/mcp-size.test.tsand the neighbouring MCP card tests pass, with no ceiling raised, andtscandscripts/gate.tsare clean. I did not run the full suite:scripts/fast.tsnamed 1565 of 2811 files, so I ran only the MCP card, size and well-known tests.What changed
src/web/studio/cards.tsmapsarchivetoappinCARD_OF_TOOL./.well-known/mcp.jsonand/llms.txtread that map, so they name it without a hand edit.archivewithdryRun:false. An archived app offers "Wake it".repos: one card with one row per repository (outcome and reason), capped at 12 with a "More" row. A plan offers one apply-all action. A done bulk run offers "Undo" throughlimb.src/http/mcp/tools/archive.tsnow returnsrepoandsince(when it was archived) beside the existing fields. This is additive; the card needs the name and the date.test/mcp-archive-card.test.tscovers the tool listing, a single repo (plan, archive, status query, wake) andrepos.What I left alone: the "Wake it" button passes
dryRun:falsedirectly, because the person pressing it has chosen to wake. I did not add a second confirm step.To try it: from an MCP host, call
archivewith{repo, archived:true}. The card shows the plan and one button to apply it.The first push was refused by the pre-push hook, which wants a commit saying how to try the change, so there is an empty "Try:" commit on the branch.
Closes #11449