Skip to content

MCP runners that execute project code require --allow-authoring; bounded docs search reaches installed add-on guides (#590, #759) - #762

Merged
jimhoyd merged 3 commits into
mainfrom
claude/sleepy-shannon-xvazgl
Sep 25, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/sleepy-shannon-xvazgl

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

  • [Request]: tidy the local MCP surface for agents #590 (the run_tests execution contract): default urlcode mcp offered run_tests and labelled it read-only (readOnlyHint: true), but it runs the project's trusted Node functions, which can write files. That also contradicted SECURITY.md and TOOLING.md.
    • run_tests is now offered only with the operator's --allow-authoring flag. Calling it without the flag returns an error that names that flag.
    • run_tests, run_validate, run_test and run_audit all execute trusted project code. They are now annotated readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true, and their descriptions say the scratch data directory is not confinement.
    • The tools that only write files keep their previous annotations.
    • Default MCP goes back to inspection without executing project code: 35 read tools, 1 host-file tool, 7 authoring tools.
    • SECURITY.md, TOOLING.md, AI-AUTHORING.md, SPECIFICATION.md, README, llms.txt, the agent guide, the skill and the CLI help are updated to match.
    • sandbox: true is unchanged.
  • [Request]: provide a bounded documentation fallback when agent discovery lacks coverage #759 (bounded docs fallback): search_docs and urlcode docs search --project now also search, as data only, installed add-ons that are pinned and whose lock entry matches the pin. For each, they read urlcode.json, README.md and the agent references its descriptor declares: at most 6 files of 256 KiB each, never imported.
    • Each result names its section and config path.
    • Every answer reports what was searched and what was not.
    • An empty result says "No match in the searched sources", never "unsupported".
    • Release-catalog matches are listed separately from installed ones.
    • The generated agent guide, starter, skills and TOOLING.md now allow this bounded fallback. check-agent-facts rejects prose claiming search covers only the fixed core docs, or treating no match as meaning unsupported.
    • This PR makes no claim that authoring improved.
  • Package budget: core's limits go from 746 to 752 KiB packed and from 3000 to 3040 KiB unpacked. Together these changes measure 763472 packed and 3077097 unpacked bytes in 464 entries on Node 26.

Closes #759. Refs #590 (resolves the execution-contract gap reopened there).

Verification

All runs used Node 26.10.0.

  • Full verify: the combined branch, before its rebase onto main 58d0a2c, passed npm run check, npm run audit:packages and npm run verify except for one test. docs-search-package failed while npm install downloaded the packed tarball, with ECONNRESET (a network drop). It passed on its own re-run.
  • After the rebase: the tree is identical to the verified one (empty diff). Typecheck, check and audit:packages pass again.
  • Package test: npm run test:package passes (763417 packed / 3076371 unpacked bytes, 464 files).
  • New tests for [Request]: tidy the local MCP surface for agents #590:
    • A synthetic trusted function writes a marker file. In default mode run_tests is absent, calling it is refused, and 13 project-reading tools run without writing the marker.
    • With --allow-authoring, run_tests runs the fixture and the marker appears.
    • The annotations on all four runner tools are asserted.
  • New tests for [Request]: provide a bounded documentation fallback when agent discovery lacks coverage #759 (test/docs-search.test.ts):
    • requiredWhen finds the forms section and its config path.
    • form-records finds its composition contract.
    • An unknown term gets an honest no-match with the coverage limits.
    • An add-on outside the fixed core docs is covered.
    • An add-on whose import would write a marker is never imported.
    • An add-on whose lock entry does not match its pin is skipped.
    • The answer stays under 16 KiB.
    • The MCP tool works end to end.

Compatibility and security

  • Behavior change: an MCP client that called run_tests without --allow-authoring now gets an error naming the flag. The operator must opt in, just as for the other runners. urlcode test is unchanged.

  • Search without a project: installed guides are searched only when a project is given. searchDocs(text) with no options searches the core docs and the catalog, and says so in its coverage.

  • Pin check in tests: the tests pass the pin check through development-manifest local links. Release-manifest hashes go through the existing pin-check code and have no new test here.

  • Changes match the documented portable contract; docs/examples are updated where needed.

  • Relevant tests and package checks pass, or limitations are explained above.

  • No credentials, customer data or private project material are included.

  • Runtime/starter changes remain aligned where applicable.

🤖 Generated with Claude Code

https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP


Generated by Claude Code

…talled schemas with coverage reporting (#759)

searchDocs (MCP search_docs, urlcode docs search) now also reads, as data
only, the urlcode.json descriptor, README and declared agent references of
add-ons installed in the project's site whose lock entry matches core's pin.
Release-catalog matches are returned apart from installed results. Every
answer reports which sources were and were not searched and a focused next
step (a guide section, a descriptor config path, or get_schema); an empty
answer says "no match in the searched sources". Results stay bounded (three
excerpts of 1800 chars, five catalog matches, four next steps).

The generated AGENTS.md, skills, plugin copy, llms.txt, TOOLING.md and the
MCP tool description permit this bounded fallback; check-agent-facts rejects
prose that shrinks the search back to the core corpus or reads no-match as
unsupported. Core package budgets rise to 746 KiB packed / 3000 KiB unpacked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
@jimhoyd
jimhoyd merged commit 0c98f25 into main Sep 25, 2026
30 checks passed
@jimhoyd
jimhoyd deleted the claude/sleepy-shannon-xvazgl branch September 25, 2026 18:21
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.

[Request]: provide a bounded documentation fallback when agent discovery lacks coverage

2 participants