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

Merged opened this

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

Merged

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

opened this

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.ts maps archive to app in CARD_OF_TOOL. /.well-known/mcp.json and /llms.txt read 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 archive with dryRun: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" through limb.
  • Answer shape: src/http/mcp/tools/archive.ts now returns repo and since (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.ts covers the tool listing, a single repo (plan, archive, status query, wake) and repos.

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.

Closes #11449

commented

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.ts maps archive to app in CARD_OF_TOOL. /.well-known/mcp.json and /llms.txt read 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 archive with dryRun: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" through limb.
  • Answer shape: src/http/mcp/tools/archive.ts now returns repo and since (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.ts covers the tool listing, a single repo (plan, archive, status query, wake) and repos.

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.

commented

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 without archived now also returns repo and since, 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: the archive row of the tool table was stale. I regenerated it with bun scripts/mcp-table.ts.

No code outside the test and the generated doc changed.

Changes requested — before the latest push

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.

commented

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 archived or awake. The "Archived" row also appears on a plain read, not only after an archive, and not on a plan.
  • Apply-all action: names now leaves out rows whose outcome is refused, so the button sends only what the plan said would happen. The bulk test checks that an unknown alice/none is not in the button's repos.
  • since: archive now re-reads the repository after setArchived and returns its stored archivedAt. It is null for a dry run or a wake. The invented new Date() fallback is gone.
  • Test changes: test/mcp-archive-card.test.ts had two assertions for the old archived since … status, and I changed them to match. I did not assert that since equals the stored archivedAt on 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-null archivedAt instead.
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs