Skip to content

docs(mcp): document saved queries, test sequences and the ERD surface - #321

Merged
ardelperal merged 1 commit into
mainfrom
docs/issue-320-mcp-instructions
Sep 12, 2026
Merged

ardelperal merged 1 commit into
mainfrom
docs/issue-320-mcp-instructions

Conversation

@ardelperal

Copy link
Copy Markdown
Owner

Closes #320

What was missing

src/mcp/server-instructions.ts is the single source of truth for agent-facing guidance (#529) — the first and only thing an agent is told about what this index holds. It documented .bas / .cls modules, .form.txt / .report.txt layouts, event wiring, call-edge shape and test manifests, and said nothing about three extractors the fork already ships:

Surface Emits Documented before
queries/<Name>.sql + sibling queries.json query node (language sql) + references to tables (sql-query-table, vba-external-backend) no
sequences/*.json file node + references to each Test_* (vba-test-sequence, with runnerPolicy / sequenceFile / procedureIndex) no (manifests were)
ERD/*.md table class nodes (access-erd-table), field type_member + contains, linked-table references (vba-linked-table) no

This is the read-fallback this project's retrieval work exists to prevent: an agent that has never been told query nodes exist will grep the .sql. The ERD surface is the cheapest answer to "what columns does this table have" and was reachable only by accident.

To be clear about the claim: this is not an argument that new prose changes tool choice — the instructions are a low-salience channel and this repo has measured that. It is the narrower case of telling the agent which node kinds and provenance tags are in the index, so it can use what a call already returns.

How it is kept honest

The new suite asserts nothing about wording. For each surface it runs the real extractor, collects every node kind and metadata.synthesizedBy tag actually emitted, and requires the instructions to name each one. Rename a tag in an extractor and the build fails until the guidance follows.

The ERD case runs against the checked-in fixture, which carries both a plain and a LINKED table, so both tags are exercised rather than assumed. Each test also sanity-checks that the extractor really produced the shape (e.g. a query node exists), so an extractor that silently stopped emitting cannot make the test pass by emitting nothing.

Verification

  • Reverting only src/mcp/server-instructions.ts fails 3 of the 4 new tests, naming the exact undocumented tag each time (sql-query-table, vba-test-sequence, access-erd-table).
  • pnpm exec vitest run vba extraction-sql-query sql-query-discovery — 73 files, 1217 passed, 1 skipped (the Windows CI leg, run locally on Windows). The new file's name contains vba, so that leg picks it up.
  • npx tsc --noEmit — clean.

No behavior change, no new tool: instructions text plus its coverage test.

server-instructions.ts is the single source of truth for agent-facing
guidance (#529), and it described .bas/.cls modules, form and report
layouts, event wiring and test manifests — but none of the saved-query,
test-sequence or Access ERD extractors the fork already ships. An agent
that is never told `query` nodes exist greps the .sql instead, which is
the read-fallback this project's retrieval work exists to prevent.

Add the three surfaces in the shape the existing entries use: the file
shape that produces them, the node kinds and edges emitted, and the
provenance tag to filter on.

The new suite asserts nothing about wording. It runs the real
extractors, collects the node kinds and synthesizedBy tags they emit,
and requires the instructions to name each one, so renaming a tag in an
extractor fails the build until the guidance follows. The ERD case uses
the checked-in fixture, which carries both a plain and a LINKED table,
so both tags are exercised rather than assumed.

Refs #320
@ardelperal
ardelperal merged commit 6906a13 into main Sep 12, 2026
5 checks passed
@ardelperal
ardelperal deleted the docs/issue-320-mcp-instructions branch September 12, 2026 20:09
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.

docs(mcp): server instructions omit saved queries, test sequences and the ERD surface

1 participant