test(mcp): pin RFC #110 cache-prefix claims with 6 unit tests#112
Merged
test(mcp): pin RFC #110 cache-prefix claims with 6 unit tests#112
Conversation
The reconnect RFC's central claim — "re-bridging tools mid-session breaks the prompt prefix when the new tool surface differs from the old" — was so far an architecture-derived assertion, not an empirical result. Cheap to lock down at the prefix-fingerprint layer. `tests/mcp-reconnect-prefix-invariant.test.ts` covers six cases the RFC directly references: - identical tool list → fingerprint unchanged (the safe-reconnect case) - one tool added → fingerprint changes - one tool removed → fingerprint changes - description-only edit on an existing tool → fingerprint changes - parameter-schema edit → fingerprint changes - same tools reordered → fingerprint changes (array order is part of the prefix bytes via JSON.stringify) This gives RFC #110 a concrete reference to point at when weighing the strict / permissive / `--force` approaches: any drift past the "identical bytes" line is a guaranteed cache miss, full stop. Refs #110.
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.
Refs #110.
What
The reconnect RFC's central claim — "re-bridging tools mid-session breaks the prompt prefix when the new tool surface differs from the old" — was an architecture-derived assertion, not an empirical result. Cheap to lock down at the
ImmutablePrefix.fingerprintlayer.tests/mcp-reconnect-prefix-invariant.test.tscovers six cases the RFC directly references:Why
This gives RFC #110 a concrete reference to point at when weighing strict / permissive /
--forceapproaches: any drift past the "identical bytes" line is a guaranteed cache miss, full stop. So the design conversation can focus on UX policy ("refuse vs warn vs flag-gated"), not on whether the underlying claim is actually true.This is a tests-only change, no source files touched. Doesn't unblock C2b implementation by itself — that still needs the design call in #110 first.
Test plan
npm run verifypasses locally (1760 tests, +6)ImmutablePrefix(no behavior change in src/)