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

The MCP fork_tree tool answers with a `ui://forge/forks` card: each fork as a row with its depth and how it follows #11045

Merged opened this

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

Merged

The MCP `fork_tree` tool now answers with a `ui://forge/forks` card, and the JSON answer is unchanged. The gate, `tsc`, `mcp-size`, `mcp-cards-coverage`, `mcp.test.ts` and the new test pass, with no ceiling raised. I did not call the `keep_plan` tool, so the plan on the issue was never updated.

shipped production is serving it deploy 6b2678b

opened this

The MCP fork_tree tool now answers with a ui://forge/forks card, and the JSON answer is unchanged. The gate, tsc, mcp-size, mcp-cards-coverage, mcp.test.ts and the new test pass, with no ceiling raised. I did not call the keep_plan tool, so the plan on the issue was never updated.

  • Card: src/web/studio/cards.ts has a forks kind, and CARD_OF_TOOL maps fork_tree to it.
  • Rows: each node is a row with the repo name indented by depth and a link to the repository's page.
  • Follow words: autonomous reads "follows on its own", take-updates "takes updates", and dont-follow "off". offers (the stored "tell me") reads "offers updates", a wording of mine for a mode the issue's three phrases don't cover.
  • Doc: the tool's doc now names the card, and the size table in docs/MCP.md is regenerated.
  • Tests:

- test/mcp-forks-card.test.ts asserts the card for a three-level tree (alice/app, then bob/app, then dan/app). - A repository the caller cannot read is absent from both the card and the JSON. The admin's card names the private fork fay/secret; bob's card does not. - I updated the resource list in test/mcp.test.ts to include forks.

Left out:

  • Truncated count: truncated is only a boolean, so the card can't give the exact number left out. It adds a "Truncated" row saying more forks exist and to ask with a larger limit or smaller depth. The card shows at most 30 rows and counts the rest as "N more not shown".
  • Wait for #10996: I did not wait for #10996. The board card is already on main, so the CardKind line applied cleanly.

To try it, call fork_tree on a repo with forks from an MCP Apps host, or read ui://forge/forks.

Closes #11031

commented

The MCP fork_tree tool now answers with a ui://forge/forks card, and the JSON answer is unchanged. The gate, tsc, mcp-size, mcp-cards-coverage, mcp.test.ts and the new test pass, with no ceiling raised. I did not call the keep_plan tool, so the plan on the issue was never updated.

  • Card: src/web/studio/cards.ts has a forks kind, and CARD_OF_TOOL maps fork_tree to it.
  • Rows: each node is a row with the repo name indented by depth and a link to the repository's page.
  • Follow words: autonomous reads "follows on its own", take-updates "takes updates", and dont-follow "off". offers (the stored "tell me") reads "offers updates", a wording of mine for a mode the issue's three phrases don't cover.
  • Doc: the tool's doc now names the card, and the size table in docs/MCP.md is regenerated.
  • Tests:

- test/mcp-forks-card.test.ts asserts the card for a three-level tree (alice/app, then bob/app, then dan/app). - A repository the caller cannot read is absent from both the card and the JSON. The admin's card names the private fork fay/secret; bob's card does not. - I updated the resource list in test/mcp.test.ts to include forks.

Left out:

  • Truncated count: truncated is only a boolean, so the card can't give the exact number left out. It adds a "Truncated" row saying more forks exist and to ask with a larger limit or smaller depth. The card shows at most 30 rows and counts the rest as "N more not shown".
  • Wait for #10996: I did not wait for #10996. The board card is already on main, so the CardKind line applied cleanly.

To try it, call fork_tree on a repo with forks from an MCP Apps host, or read ui://forge/forks.

Changes requested — before the latest push

One fix first: the depth indent does not survive rendering. The label is leading spaces, and the card draws it as a dt via textContent with no white-space rule, so the browser collapses them and every fork shows flat. The tree structure, the point of the card, is invisible. The test only checks the raw string, so it passes anyway. Fix: carry depth as data and render it (padding-inline-start per depth step, or a white-space:pre rule on the label), and assert that in a test. Also note the three follow words: offers reads "offers updates", which is outside the issue wording; acceptable, but say so in docs/MCP.md if kept.

commented

The forks card now carries depth as data, and the shell pads each label by it, so the tree shows nested instead of flat.

  • What changed: CardRow has an optional depth field. The forks card sets depth and leaves the label as the plain repo name. The card's script pads the dt with padding-inline-start of 1.25em per level, capped at 8 levels, in src/web/studio/cards.ts.
  • Test: test/mcp-forks-card.test.ts checks the labels are unindented, that depth comes out as [0, 1, 2] for the three-level tree, and that the card script applies the padding. It would fail on the old leading-space labels, but it checks the script for the padding rule rather than rendering the card in a browser.
  • "offers updates": I kept the wording and documented it in docs/MCP.md as the card's own word for the offers mode.
  • Checks: tsc, the fork-card and MCP tests, and design-lint pass.
Approved

My earlier ask (principle 2: indentation by leading spaces collapses in HTML) is met. Depth is now a depth field on the row, the shell pads the dt by it, and a test asserts [0,1,2] for the three-level tree. The card is read-only, rows link to the repo page, and unreadable forks are absent from both the card and the JSON. The new depth is clamped to 0-8 server-side. Non-blocking: the padding test checks that SHELL_JS contains paddingInlineStart rather than rendering the card.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs