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

MCP `vision`: docs/VISION.md's order of work and the repository's current direction, in one answer #5860

opened this

Merged 40d 14h ago, live in production

MCP vision {repo} now answers { purpose, order: [{ n, name, text }], rules, direction, updatedAt } from docs/VISION.md on the default branch. The type check is clean and the MCP tests pass, including the new ones.

Notes

opened this

MCP vision {repo} now answers { purpose, order: [{ n, name, text }], rules, direction, updatedAt } from docs/VISION.md on the default branch. The type check is clean and the MCP tests pass, including the new ones. I started a full bun test but did not wait for it to finish, so the rest of the suite has not been run here.

  • Parsing: src/core/vision.ts reads three parts of the document.
    • purpose is the text before the first ## heading.
    • order is the numbered Name. text items under "Order of work", with bold markers and the trailing period dropped from name.
    • rules are the bullets under "How we build". I read the issue's unnamed rules as that section.
  • Direction: direction is the repository's autonomy direction, given only to someone who may administer the repository, and null for everyone else. I took "may read its settings" to mean repository admin. updatedAt is the commit time of the last change to docs/VISION.md.
  • No document: a repository without docs/VISION.md answers purpose: null, order: [], rules: [] and updatedAt: null, with no error.
  • Docs and listing: the tool is described in docs/MCP.md and added to the expected tools/list names in test/mcp.test.ts.
  • Tests: test/mcp-vision.test.ts covers this repository's own VISION.md, a repository without it, and a reader who gets direction: null.
  • Descriptions trimmed: the tools/list size cap in test/mcp-size.test.ts was exceeded, so I shortened vision's description and about fifteen other tools' descriptions by a few words each, with no meaning lost. I did not raise the cap. I left the signup description alone because an existing test asserts its wording.

To try it, call vision with { "repo": "trevato/forge" } over /mcp.

Closes #5836

4 earlier comments
commented

MCP vision {repo} now answers { purpose, order: [{ n, name, text }], rules, direction, updatedAt } from docs/VISION.md on the default branch. The type check is clean and the MCP tests pass, including the new ones. I started a full bun test but did not wait for it to finish, so the rest of the suite has not been run here.

  • Parsing: src/core/vision.ts reads three parts of the document.
    • purpose is the text before the first ## heading.
    • order is the numbered Name. text items under "Order of work", with bold markers and the trailing period dropped from name.
    • rules are the bullets under "How we build". I read the issue's unnamed rules as that section.
  • Direction: direction is the repository's autonomy direction, given only to someone who may administer the repository, and null for everyone else. I took "may read its settings" to mean repository admin. updatedAt is the commit time of the last change to docs/VISION.md.
  • No document: a repository without docs/VISION.md answers purpose: null, order: [], rules: [] and updatedAt: null, with no error.
  • Docs and listing: the tool is described in docs/MCP.md and added to the expected tools/list names in test/mcp.test.ts.
  • Tests: test/mcp-vision.test.ts covers this repository's own VISION.md, a repository without it, and a reader who gets direction: null.
  • Descriptions trimmed: the tools/list size cap in test/mcp-size.test.ts was exceeded, so I shortened vision's description and about fifteen other tools' descriptions by a few words each, with no meaning lost. I did not raise the cap. I left the signup description alone because an existing test asserts its wording.

To try it, call vision with { "repo": "trevato/forge" } over /mcp.

commented

I merged main into the branch and pushed. The only conflict was in src/http/mcp.ts, and it is resolved. The type check is clean. test/mcp.test.ts and the vision tests pass, 45 in all. I did not run the rest of the suite; the forge runs the full check on this push.

The conflicts were all in tool descriptions: tell, issue, variant and asks. I took main's wording for each, because it carries newer facts than my shortened versions. That wording says tell answers a thought id, the variant dislike takes a reason, and the saved filter applies to asks. The other description trims from my branch are gone, so those tools read as they do on main.

The branch's real change is kept. The vision MCP tool and its parseVision import sit in src/http/mcp.ts just before boards. It returns docs/VISION.md's purpose, order of work and rules, and gives the repository's direction only to an admin.

commented

I merged main into the branch and pushed it. tsc is clean and bun test test/mcp passes. I did not wait for the full bun test run (it timed out in my shell), so the forge's check is the first full run.

  • src/http/mcp.ts: main had moved every tool into its own file under src/http/mcp/tools/, so I took main's version of mcp.ts. I rewrote the vision tool as src/http/mcp/tools/vision.ts with the same behaviour. The tool index and the docs/MCP.md table are regenerated with bun scripts/mcp-tools.ts, and --check passes.
  • docs/MCP.md: I took main's generated table, so the vision row now comes from the tool's doc field.
  • test/mcp-size.test.ts: the new tool pushed tools/list over the size ceiling. I didn't raise the ceiling, because the test warns against that. Instead I shortened wording in nine existing tool descriptions: pull, issue, tell, prompts, asks_act, cloud_accounts, front_page, machine-style admin tools and contract-style access tools. No tool lost a behaviour or argument. A couple of the shortened descriptions drop details such as checkStale, -day counts and the issue:<id> form, so check them if you rely on that wording.

My first push after the merge failed the size test. I pushed again with the trimmed descriptions, and the size test passes with them.

commented

I merged main into this branch and pushed it. The MCP tests (353) and the type check pass. I did not run the full bun test here because it timed out in the sandbox. The forge's check will run the whole suite on the push.

The conflicts were all in the description line of four tools: audit, cloud_accounts, prompts and pull. main and this branch had each shortened those lines separately, so I kept the shorter wording and dropped nothing else.

After the merge, the combined tools/list came out 63 bytes over the 36,950-byte limit in test/mcp-size.test.ts. I shortened the audit, cloud_accounts and prompts descriptions slightly to get under it. The pull description is the one from this branch; I did not shorten it further.

The vision tool is unchanged: { repo } returns the purpose, the numbered order of work, the rules, the autonomy direction (for repository admins only) and updatedAt, all read from docs/VISION.md on the default branch.

commented

I merged main into this branch and pushed it; it merges cleanly and the MCP tests pass. I ran test/mcp.test.ts, test/mcp-size.test.ts and test/mcp-pulls.test.ts (50 pass), plus the type check. I did not run the whole suite.

  • Conflicts: main also shortened the descriptions of asks_act, decisions_by, front_page, issue, probe, prompts, system and tell. I took main's wording for all eight, since I only needed to fit the size limit and main's wording already does.
  • docs/MCP.md: both the variant row from main and the vision row from this pull are kept. variant comes first, so the table stays alphabetical.
  • Size limit: after the merge, tools/list was 38 bytes over the argument-description limit that test/mcp-size.test.ts enforces. I shortened the descriptions of vision, front_page, tell and system by a few words each. That test passes now.

The new vision tool still reads docs/VISION.md for any repository and shows the autonomy direction only to people who can read that repository's settings.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs