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

A builder whose issue names an MCP tool file is told to run test/mcp-size.test.ts before pushing, and to extend an existing tool rather than add one #6607

opened this

Merged 37d 14h ago, live in production

A builder whose issue names MCP now gets two extra sentences in its task text. Briefs for other issues are unchanged. The new test and the existing brief tests pass (8 tests).

Notes

opened this

A builder whose issue names MCP now gets two extra sentences in its task text. Briefs for other issues are unchanged. The new test and the existing brief tests pass (8 tests). I could not run the type check: tsc fails here with "Cannot find type definition file for 'bun'", before it reaches the code.

  • Trigger: the title or body names a path under src/http/mcp/, or contains the word "MCP" (case-sensitive, so "mcp" in lowercase prose doesn't trigger it). The check is namesMcp in src/crew/brief.ts.
  • What it adds: it appends one paragraph, MCP_SIZE_RULE, to the task text:
    • run bun test test/mcp-size.test.ts before pushing, because it names the five costliest tools when it fails;
    • prefer an action or kind on an existing tool (docs/MCP.md, "Room for a new tool"), and never raise the ceilings.
  • Scope: it appears only for an issue assignment, not when the run is about a pull, a review or a resumed session.
  • Test: test/brief-mcp-size.test.ts builds the task for an issue naming a path, an issue naming the word, and a plain issue. The rule's lines are present in the first two and absent from the third.
  • Byte-for-byte check: the test only shows the plain brief has none of the new lines. It doesn't compare against the old output, since the old code is gone from the tree.

To try it, run bun test test/brief-mcp-size.test.ts.

Closes #6440

commented

A builder whose issue names MCP now gets two extra sentences in its task text. Briefs for other issues are unchanged. The new test and the existing brief tests pass (8 tests). I could not run the type check: tsc fails here with "Cannot find type definition file for 'bun'", before it reaches the code.

  • Trigger: the title or body names a path under src/http/mcp/, or contains the word "MCP" (case-sensitive, so "mcp" in lowercase prose doesn't trigger it). The check is namesMcp in src/crew/brief.ts.
  • What it adds: it appends one paragraph, MCP_SIZE_RULE, to the task text:
    • run bun test test/mcp-size.test.ts before pushing, because it names the five costliest tools when it fails;
    • prefer an action or kind on an existing tool (docs/MCP.md, "Room for a new tool"), and never raise the ceilings.
  • Scope: it appears only for an issue assignment, not when the run is about a pull, a review or a resumed session.
  • Test: test/brief-mcp-size.test.ts builds the task for an issue naming a path, an issue naming the word, and a plain issue. The rule's lines are present in the first two and absent from the third.
  • Byte-for-byte check: the test only shows the plain brief has none of the new lines. It doesn't compare against the old output, since the old code is gone from the tree.

To try it, run bun test test/brief-mcp-size.test.ts.

commented

I've addressed all three points and pushed to the same branch. The brief and brief-gate tests pass (10 tests); I did not run the type check this round.

  • Repo gate: the MCP rule is now added only when the repository is named forge (src/crew/brief.ts, next to the existing issue-only check). I used the repo name, not a check for the file in the clone, because taskPrompt is pure and takes no filesystem. A different app that happens to be called forge would still get the rule, and a fork of the forge keeps the name, so it gets it too.
  • Self-comparison: I removed the expect(build(x)).toBe(build(x)) assertion. The plain-issue test now only checks that the rule's lines are absent.
  • Lowercase non-trigger: a new test shows that "mcp" in lowercase prose does not trigger the rule. The match stays on the uppercase word "MCP" or a path under src/http/mcp/, so any mention of "MCP" still triggers it, such as an issue about an unrelated MCP client. I kept that as the cheap trigger you accepted.
  • Other-repo test: a new test gives an MCP issue (title and path) in a repo named square and checks it gets no rule.
Sign in to join this conversation.

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

Keyboard shortcuts

Docs