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

`runs` answers with a ui://forge/runs card: each run's kind, state, issue or pull, and duration, newest first, linked to its log #11129

Parked opened this
Closed without merging

The MCP `runs` tool now draws its own `ui://forge/runs` card. `tsc`, `scripts/gate.ts` and the MCP tests (`test/mcp-size.test.ts` included, no ceiling raised) pass locally.

stopped parked by the crew deploy e65acd0

opened this

The MCP runs tool now draws its own ui://forge/runs card. tsc, scripts/gate.ts and the MCP tests (test/mcp-size.test.ts included, no ceiling raised) pass locally.

What changed

  • Card: runs used to draw the generic ui://forge/run card. That card was a thin row (agent <id> and #N — state) with no glyph, title or duration. It now has a card of its own.
  • Rows: one per run, newest first, up to 20. Each shows a glyph, the kind, #N and the issue or pull title, and the state as a word with its duration. A finished run shows the time it ran, and a running one shows running for 2m. Each row links to its run page, and only for a valid run id on an owner/name repo.
  • Failed first: the status line leads with failures, for example 1 failed · 1 running · 20 runs.
  • Answer shape: the runs JSON now also carries title for each run.
  • Escaping: the card is plain data that the shell draws with textContent. The new test/mcp-runs-card.test.ts renders a run with a hostile title and asserts it stays inert, and that the shell never uses innerHTML.
  • Docs and tests: docs/MCP.md lists the card. I changed the older runs card assertions in test/mcp.test.ts to expect runs, because that test was asserting the old kind.
  • Reader scope: listRepoRuns already limits a reader to repositories they can read, and I didn't touch that.

Not done

  • The card has no Stop action, since these are past runs.
  • I did not run the full suite or bun scripts/design-lint.ts; I left the design lint out because nothing under src/web/ pages changed (only the card module).

Try it Call the MCP runs tool with { repo: "owner/name" }. The result carries structuredContent.card, and the host reads ui://forge/runs.

The pre-push hook wanted a commit saying how to try the change, so I added an empty Try: commit.

Closes #11122

commented

The MCP runs tool now draws its own ui://forge/runs card. tsc, scripts/gate.ts and the MCP tests (test/mcp-size.test.ts included, no ceiling raised) pass locally.

What changed

  • Card: runs used to draw the generic ui://forge/run card. That card was a thin row (agent <id> and #N — state) with no glyph, title or duration. It now has a card of its own.
  • Rows: one per run, newest first, up to 20. Each shows a glyph, the kind, #N and the issue or pull title, and the state as a word with its duration. A finished run shows the time it ran, and a running one shows running for 2m. Each row links to its run page, and only for a valid run id on an owner/name repo.
  • Failed first: the status line leads with failures, for example 1 failed · 1 running · 20 runs.
  • Answer shape: the runs JSON now also carries title for each run.
  • Escaping: the card is plain data that the shell draws with textContent. The new test/mcp-runs-card.test.ts renders a run with a hostile title and asserts it stays inert, and that the shell never uses innerHTML.
  • Docs and tests: docs/MCP.md lists the card. I changed the older runs card assertions in test/mcp.test.ts to expect runs, because that test was asserting the old kind.
  • Reader scope: listRepoRuns already limits a reader to repositories they can read, and I didn't touch that.

Not done

  • The card has no Stop action, since these are past runs.
  • I did not run the full suite or bun scripts/design-lint.ts; I left the design lint out because nothing under src/web/ pages changed (only the card module).

Try it Call the MCP runs tool with { repo: "owner/name" }. The result carries structuredContent.card, and the host reads ui://forge/runs.

The pre-push hook wanted a commit saying how to try the change, so I added an empty Try: commit.

commented

The preview deploy didn't fail on anything in this change, so I made no new commit. The deploy log you sent shows no error from this branch. It also says only "no tests declared, none run".

  • Preview: it is up, and /healthz answers 200 at https://lab--11129--forge-trevato-apps.open-platform.sh.
  • Log noise: the one ERROR line in the log is [snapshots] restore drill failed to run: this forge has nowhere to drill from. That comes from the forge host, not from this app.
  • Tests: forge.json declares no app.test, so the deploy runs none. The tests run under the check block (fast, run and verify commands), not at deploy.
  • Checks: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. bun test test/mcp-runs-card.test.ts test/mcp.test.ts passes 51 tests with 0 failures.
  • Head commit: 7d60f981c ("Try: call the MCP runs tool…") is empty. I left it as is; I can't rewrite history, so it stays on the branch.

What the pull changes: the MCP runs tool now draws its own ui://forge/runs card (src/web/studio/cards.ts, src/http/mcp/tools/runs.ts). Each card row shows:

  • the run's kind;
  • a state word and glyph;
  • the issue or pull it belongs to, with its title;
  • the duration;
  • a link to its run page.

docs/MCP.md, test/mcp.test.ts and the new test/mcp-runs-card.test.ts cover it.

To try it: call the MCP runs tool with { repo } and read the returned card.

I did not change forge.json or add a deploy-time test command, since the check block already runs the suite.

commented

I merged main into the branch, fixed the two conflicts and pushed it as 342b85412. Before pushing, the gate, tsc, the design lint and test/mcp-runs-card.test.ts plus test/mcp.test.ts (51 tests) all passed.

The pull draws the runs tool's answer as its own ui://forge/runs card. Main had since added a scorecard card, and it had changed which card now and runs draw. The conflicts were all in the card kind lists and mappings.

  • src/web/studio/cards.ts: I kept both sets of changes.

- runs stays a card kind of its own and scorecard stays alongside it. - now now draws the crew card, as on main, and runs draws the new runs card. - The run card kind stays for the stop and now rows.

  • test/mcp.test.ts: the card list now has both ui://forge/runs and ui://forge/scorecard. The expectation that scorecard maps to ui://forge/scorecard is main's. The runs tool now expects the runs kind and resource.
commented

The runs tool now answers with a ui://forge/runs card. Each row links to its run page, and a failed run comes first in the card's status.

Both check failures were stale artefacts of the new title field on each run, not code bugs:

  • test/mcp-runs.test.ts: the test was wrong. It pinned the exact key set of a run row, so I added title to the expected keys.
  • docs/MCP.md: I regenerated the tool table with bun scripts/mcp-table.ts so the runs row matches the new doc string.

The runs and mcp-table tests and bun x tsc --noEmit pass locally. I did not re-run the full suite here, and the forge's check will run it on this push.

To try it, call the runs tool with { repo: "owner/name" }.

commented

Closed by the crew: main moved under it 2 times and the branch could not be brought up to date. Conflicting files: docs/MCP.md, src/web/studio/cards.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs