Spike: registry-drift vocab from the projected MCP schema (#27) - #30
Merged
Conversation
Seeds the #27 hardening. vocabFromToolset(toMcpToolset(registry)) builds the drift vocab from verbspec's public JSON-schema projection (properties → flags, properties[x].enum → enum values, name → verb id) instead of reaching into Zod internals (verb.input._def.shape() / field._def.entries). Plus a vocabIsDegraded guard so an extraction failure no-ops rather than false-positiving valid --flags. Zero-dep, runnable; drives the real prose.mjs registryDrift to show parity. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GNDVjvsbTPsbWV9fEyjLt
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.
Spike seeding #27 (harden the registry-drift vocab).
Why
Production
vocabFromRegistryreads Zod internals (verb.input._def.shape(),field._def.entries) inside a swallowingtry/catch. A zod/verbspec bump that changes those internals silently degrades the vocab to{help, version}→ valid--flag/--storecopy then false-positives aserror-level drift and breaks the gate.What this shows
spikes/vocab-from-schema.mjs(zero-dep, runnable, drives the realprose.mjsregistryDrift):vocabFromToolset(toMcpToolset(registry))— builds the vocab from verbspec's public JSON-schema projection (properties→ flags,properties[x].enum→ enum values, toolname→ verb id). No_defaccess; this is the surfacetest.mjsalready pins.vocabIsDegraded(vocab)— the fail-saferegistryDriftshould adopt: an extraction failure → no findings, not false errors.Pure spike under
spikes/— not wired into the pipeline. Promotion path is in #27: swapvocabFromRegistry's internals for this, add the degraded-vocab no-op, and test real-registry extraction.Refs #27.
🤖 Generated with Claude Code
Generated by Claude Code