Skip to content

Tooling that reads the specification instead of remembering it - #86

Merged
blakebauman merged 2 commits into
mainfrom
feat/mcp-spec-toolkit
Aug 25, 2026
Merged

blakebauman merged 2 commits into
mainfrom
feat/mcp-spec-toolkit

Conversation

@blakebauman

Copy link
Copy Markdown
Member

The .claude/ toolkit encodes fold's own invariants well and the protocol it implements not at all. gateway-reviewer asks whether a change respects fold's architecture; nothing asked whether fold respects MCP.

That gap is load-bearing. The invisibility rule is a claim about a specification, and make conformance only checks what its 40 checks happen to cover — which is not the same as covering the spec.

Four skills and one agent, split along that seam. No behavior change; .claude/ only.

/mcp-spec Section map for revision 2026-07-28, pinned. Fetch and quote the normative sentence; never answer a protocol question from memory.
/mcp-inspector The official Inspector CLI against a local fold.
/spec-drift Revision-to-revision gap analysis.
/console-sync The vendored console — bump review, gate, manifest, triage.
mcp-spec-auditor Read-only spec audit over fold's three faces.

Two ideas do most of the work.

fold has three faces, and only the first gets audited. It is a server to its clients, a client to its upstreams, and — the one that matters — a shared intermediary that merges lists, caches them in possibly-Redis-backed storage across a fleet, rewrites names, and mints errors. Spec rules addressed to caches, proxies, and intermediaries bind fold, and no SDK will implement them for it. That is where real findings live, and the agent is organized around it.

The invisibility diff. /mcp-inspector's centrepiece: run the same method against fold and against the upstream directly, and diff the JSON. In passthrough that diff must be empty. It turns the invisibility rule into something executable against any fixture, not only the conformance suite's everything-server.

/console-sync fills a plainer gap — the vendored console had a make target, a CI gate, a weekly workflow, and a manifest allowlist, but no skill. Written as supply-chain review, since those assets execute same-origin with a page holding a live Bearer token in memory.

Findings, which is roughly the point

Writing these against the 2026-07-28 changelog turned up three things worth their own issues:

  1. Minted error codes sit in a reserved band. The revision partitions the JSON-RPC server-error range: -32000–-32019 implementation-defined, -32020–-32099 reserved for the specification. gateway/upstream.go:29-33 mints -32040–-32044. No collision today, but the spec renumbered three of its own codes into that band this revision. codeTaskNotFound = -32002 is correctly placed; the other five are not.

  2. CacheableResult binds fold twice over. New ttlMs and cacheScope fields, where cacheScope: "private" governs whether shared intermediaries may cache — and fold caches lists in shared Redis. Neither field is referenced anywhere in the tree, and cacheTtlMs can silently outlive an upstream's freshness hint. A correctness issue, not just conformance.

  3. MRTR may outdate the subscriptions/listen gap. README "Not implemented" says fold cannot use the SDK's stateless mode because session-keyed bridging needs stateful sessions. But this revision replaces server-initiated requests with Multi Round-Trip Requests — retry round-trips — which is the thing requiring bridging. Sampling, roots, and logging are also now deprecated on a twelve-month clock, and fold bridges all three. Worth re-reading that reasoning.

None of these are fixed here. They are what the tooling is for.

Depends on nothing; stacks cleanly with #85.

🤖 Generated with Claude Code

blakebauman and others added 2 commits August 25, 2026 14:44
The .claude/ toolkit encodes fold's own invariants well and the protocol
it implements not at all. gateway-reviewer asks whether a change respects
fold's architecture; nothing asked whether fold respects MCP. That gap is
load-bearing, because the invisibility rule is a claim about a
specification, and `make conformance` only checks what its 40 checks
happen to cover.

Four skills and one agent, split along that seam:

- /mcp-spec — the section map for revision 2026-07-28, pinned. Fetch and
  quote the normative sentence; never answer a protocol question from
  memory. Names the two traps: MUST vs SHOULD changes whether a gap is a
  bug or a documented decision, and fold is a shared intermediary and a
  client, not only a server.
- /mcp-inspector — the official Inspector CLI against a local fold. The
  centrepiece is the invisibility diff: the same method against fold and
  against the upstream directly, diffed. In passthrough that diff must be
  empty, which is the invisibility rule made executable for any fixture
  rather than only the conformance suite's.
- /spec-drift — revision-to-revision gap analysis, with a table that
  forces every gap into code, README "Not implemented", or the roadmap.
  A gap blocked on the SDK gets a drift canary, on the listen_test.go
  pattern, so the end of the wait is not something anyone has to notice.
- /console-sync — the vendored console had a make target, a CI gate, a
  weekly workflow and a manifest allowlist, and no skill. Written as
  supply-chain review, since these assets run same-origin with a page
  holding a live Bearer token.
- mcp-spec-auditor — read-only spec audit over fold's three faces
  (server, client, shared intermediary), grounding every finding in
  fetched spec text and separating conformance bugs from forward risk
  from undocumented gaps.

Writing them surfaced findings worth their own issues, which is roughly
the point. The 2026-07-28 revision partitions the JSON-RPC server-error
range and reserves -32020..-32099 for the specification; fold mints
-32040..-32044 there. CacheableResult (ttlMs, cacheScope) binds fold
twice over as a Redis-backed shared cache, and neither field is
referenced anywhere in the tree. And MRTR replaces server-initiated
requests with retry round-trips, which is the thing session-keyed
bridging exists to carry — so the SDK dependency behind the
subscriptions/listen gap may be shorter-lived than README says.

No behavior change; .claude/ only.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 41c5757 into main Aug 25, 2026
8 checks passed
@blakebauman
blakebauman deleted the feat/mcp-spec-toolkit branch August 25, 2026 22:26
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.

1 participant