Skip to content

feat(mcp): in-process run_tests and get_context's commands use the local review (#964) - #983

Merged
jimhoyd merged 2 commits into
mainfrom
claude/mcp-run-tests-964
Sep 29, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
claude/mcp-run-tests-964

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #964

What changed

  • In-process run_tests follows the CLI runners' local-review rule (Local edit loop needs a new revision pin on every edit; plan-feature false positive on 'team' and no scheduling/credits recipes #932, feat(mcp): authoring runners review an edited extension site locally (#940) #962). If the server has no --policy and PROJECT_SHA256 is unset, each call:

    • pins the operator host to the project's current revision for that run only;
    • reads no policy, so no grant applies;
    • defaults the origin to http://localhost;
    • stays hermetic, as it has been since feat(core,auth,store,audit)!: hermetic test runs with declared seeds; expectJson; resolved captures in failures (#930) #947;
    • returns a localReview: {revision, origin} field and a local_review event. The event uses the same note as the CLI, which is now shared as localReviewNote in cli-command-metadata.ts.

    An operator pin always wins. A stale --policy or PROJECT_SHA256 still refuses with Extension revision pin mismatch, and the refusal carries no local-review event.

  • get_context: the validate, test, audit and routes commands now end with --local-review, the same as the generated npm scripts. This covers the whole-project context, --task redirects and bootstrap: true (validate and test). A single localReviewFlag in context.ts feeds all of them and projectScripts(). The serving commands (start, dev) never carry the flag.

  • Tool descriptions: updated for run_tests and get_context. Tool schemas and counts are unchanged, so the agent-facts counts don't change.

  • Docs: TOOLING (context commands, inspection without a pin, the MCP runner section), EXTENSIONS local review loop, AI-AUTHORING, llms.txt, and the regenerated llms-full.txt.

  • Package budget: 1049077 packed / 4136907 unpacked bytes on Node 26. The packed budget goes to 1029 KiB and unpacked to 4043 KiB, which leaves room for Node 24's roughly 800 extra bytes plus about 3 KiB.

Tests

  • test/extensions.test.ts: the MCP run_validate/run_test/run_audit cannot review an edited extension site without a pin (follow-up to #932) #940 MCP subtest now also calls run_tests after an edit. With no pin it passes and reports localReview and a local_review event at the new revision. With a stale PROJECT_SHA256 it refuses, and with a stale --policy given to the server it also refuses.
  • Command-string tests (context, context-task, context-commands, bootstrap, mcp-authoring, validation-context) now expect --local-review. The bootstrap test also asserts that start does not carry it.

npm run verify and npm run test:package pass locally (macOS, Node 26).

Left as is

prerequisites still lists --origin when a project declares extensions and no origin was given. That advice is still true for serving, but a local-review check no longer needs the origin.

🤖 Generated with Claude Code

…cal review (#964)

- run_tests: with neither the server's --policy nor PROJECT_SHA256, pin that
  one run to the project's current revision, read no policy, default the
  origin to http://localhost, and return localReview plus a local_review
  event. An operator pin always wins; a stale one still refuses.
- get_context (whole-project, --task redirects and bootstrap): the validate,
  test, audit and routes commands end with --local-review, matching the
  generated npm scripts. Serving commands never carry it.
- The local_review note is shared (localReviewNote) between the CLI and MCP.
- Docs: TOOLING, EXTENSIONS local review loop, AI-AUTHORING, llms.
- Package budget raised for the added prose and code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 29, 2026 22:05
@jimhoyd
jimhoyd merged commit 44dd463 into main Sep 29, 2026
22 checks passed
@jimhoyd
jimhoyd deleted the claude/mcp-run-tests-964 branch September 29, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP in-process run_tests and get_context's suggested commands lack the local review (follow-up to #940)

1 participant