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

MCP `mirror_now`: bring the off-box mirror level now, as the Backups page's button does, for a forge admin #5436

Parked opened this
Closed without merging

MCP now has a mirrornow tool that does what the Backups page's "bring level" button does, for a forge admin. The new test, test/mcp.test.ts, test/mcp-docs.test.ts, test/mcp-size.test.ts and test/mcp-repo-labels.test.ts all pass, and bun x tsc --noEmit is clean. I did not run the rest of the suite.

Notes

stopped parked by the crew deploy 36111d5

opened this

MCP now has a mirror_now tool that does what the Backups page's "bring level" button does, for a forge admin. The new test, test/mcp.test.ts, test/mcp-docs.test.ts, test/mcp-size.test.ts and test/mcp-repo-labels.test.ts all pass, and bun x tsc --noEmit is clean. I did not run the rest of the suite.

  • The tool: mirror_now takes no arguments and calls snapshotsOf(ctx.app)?.mirrorNow() in src/http/mcp.ts. It answers { level, newest?, error?, says }, and says uses the page's four sentences: no mirror, source unreadable, level, not level. It is marked as a write and listed only for admins. A non-admin gets the usual "no such tool" error, as with the other admin-only tools.
  • Docs and tests: docs/MCP.md has one new row, and test/mcp.test.ts's expected tool list includes the new name. test/mcp-mirror-now.test.ts covers the three cases: no mirror answers the page's sentence, a non-admin is refused, and a local destination with a mirror reports level.
  • Size cap: the new tool pushed tools/list 133 bytes over the 37,000-byte headroom in test/mcp-size.test.ts. I did not raise the cap. I shortened the description of mirror_now and trimmed the descriptions of flow, access, asks, asks_act, issue, quotas and propose_to_parent_forge. Only wording changed, and I kept the signup phrases the existing test checks.
  • Not done: it needs only an admin account, not an admin-scope token, since the page asks no more. Unlike the Backups page, it does not take a form or a same-origin check, because MCP calls are authenticated by bearer token.

Closes #5423

commented

MCP now has a mirror_now tool that does what the Backups page's "bring level" button does, for a forge admin. The new test, test/mcp.test.ts, test/mcp-docs.test.ts, test/mcp-size.test.ts and test/mcp-repo-labels.test.ts all pass, and bun x tsc --noEmit is clean. I did not run the rest of the suite.

  • The tool: mirror_now takes no arguments and calls snapshotsOf(ctx.app)?.mirrorNow() in src/http/mcp.ts. It answers { level, newest?, error?, says }, and says uses the page's four sentences: no mirror, source unreadable, level, not level. It is marked as a write and listed only for admins. A non-admin gets the usual "no such tool" error, as with the other admin-only tools.
  • Docs and tests: docs/MCP.md has one new row, and test/mcp.test.ts's expected tool list includes the new name. test/mcp-mirror-now.test.ts covers the three cases: no mirror answers the page's sentence, a non-admin is refused, and a local destination with a mirror reports level.
  • Size cap: the new tool pushed tools/list 133 bytes over the 37,000-byte headroom in test/mcp-size.test.ts. I did not raise the cap. I shortened the description of mirror_now and trimmed the descriptions of flow, access, asks, asks_act, issue, quotas and propose_to_parent_forge. Only wording changed, and I kept the signup phrases the existing test checks.
  • Not done: it needs only an admin account, not an admin-scope token, since the page asks no more. Unlike the Backups page, it does not take a form or a same-origin check, because MCP calls are authenticated by bearer token.
commented

Parked by the crew: the check failed ("previews of idle pulls sleep > a pull touched an hour ago keeps its preview; one idle past the age loses its process, and its page says so") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs