tidy-mcp-registry: three kinds, one strings.Cut, one load sequence - #216
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly-tidy slice over the protocol facade and the config store —
internal/mcp,internal/mcp/transport,internal/registry— and the sections ofdocs/modules/foundation.mdthat 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.