Skip to content

tidy-mcp-registry: three kinds, one strings.Cut, one load sequence - #216

Merged
dinstein merged 3 commits into
mainfrom
tidy-mcp-registry
Aug 7, 2026
Merged

tidy-mcp-registry: three kinds, one strings.Cut, one load sequence#216
dinstein merged 3 commits into
mainfrom
tidy-mcp-registry

Conversation

@dinstein

@dinstein dinstein commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Nightly-tidy slice over the protocol facade and the config store — internal/mcp,
internal/mcp/transport, internal/registry — and the sections of
docs/modules/foundation.md that cover them. No behaviour changes.

Nothing here touches the frozen surface: the depguard rules and their proofs, the
$gostd-only budget, MaxFrameSize, the error classes, or the lock/generation protocol.

  • 1. transport: the Kind block said four kinds where there are three
  • 2. registry: cutTag is strings.Cut with two return values nobody reads
  • 3. registry: Open and Reload repeat one load-and-adopt sequence verbatim

dinstein and others added 3 commits August 7, 2026 12:18
…rsed

The comment over the Kind block read "All four are implemented" above three
constants. Counting four sends a reader looking for the docker kind, which is
the exact confusion docs/modules/foundation.md spells out that there is no
such kind: docker is a variant of stdio, and containerization is expressed by
the registry's runtime field. The comment now says the same thing the module
doc does, in the place someone reading the constants will find it.

The package comment's first sentence had lost a fragment — "beneath
internal/downstream (; path ruled canonical in canonical.md" — leaving a
parenthesis opening on a semicolon and a citation with no section. It names
§2, where the retired-names table actually lives.

canonical.md §2 carried the same "five packages need to say the word read"
count that foundation.md had; seven import internal/tier, which the previous
commit on main established. Fixing one copy and not the other is worse than
having found neither.

Docs and comments only. make ci green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The json struct tag is split in exactly one place, and the helper doing it
hand-rolled a byte loop returning (name, opts, hasOpts) — the same three
values strings.Cut returns, in the same order, with the same meaning. Its one
caller reads only the first. So the package carried an eight-line
reimplementation of a standard-library call, plus two return values nobody
consumes, in the reflection path a reader already has to hold several things
in their head for.

strings.Cut(tag, ",") is both shorter and the spelling a reader recognizes
without checking what it does with a tag that has no comma.

No behaviour change; envelope's round-trip tests cover the tag parsing.
make ci green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Open and Reload each spelled out the same five steps — take the lock, load
every document, release, build the snapshot, adopt it — and with them the same
two-tier error protocol, which is the part worth having once. That protocol is
subtle: a failure before adoption joins the quarantines collected so far onto
the error, while a quarantine WITH a usable snapshot is returned alongside it
and is not fatal. Two copies of a rule that fine differ silently, and the way
it goes wrong is a caller that treats a serviceable registry as a dead one.

loadSnapshot now holds it, returning the quarantine report and the fatal error
as separate values so neither call site has to re-derive which is which.

One incidental change: Open now sets s.snap under s.mu like Reload does. It
did not before, correctly — the Store is not published yet — but a lock nobody
can contend costs nothing, and the alternative is a second function whose only
difference is the one thing a reader would have to justify.

No behaviour change. make ci green, including the multi-process registry tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dinstein
dinstein marked this pull request as ready for review August 7, 2026 04:22
@dinstein
dinstein merged commit 45e4086 into main Aug 7, 2026
3 checks passed
@dinstein
dinstein deleted the tidy-mcp-registry branch August 7, 2026 04: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