Repository navigation
Derive addressable-source coverage from the vocabulary - #186
Merged
patchstackdave merged 1 commit intoAug 27, 2026
Merged
Conversation
…stated list The round-trip suite's completeness assertion compared one hard-coded set against another hard-coded set, so it asserted that the file agreed with itself. A sixth addressable source would not have failed it — which is the gap it was written to close. The root cause was that the vocabulary could not be asked. `InputSource` was a bare type union, and a union cannot be enumerated at runtime, so a test wanting "every source the map can address" had no option but to restate the list. Every sibling vocabulary in `capabilities.ts` is a runtime array with its type derived from it; this one was the exception. `INPUT_SOURCES` is now that array and `InputSource` is derived from it, so the two cannot disagree. The assertion computes its own expectation: a source is addressable when `runtimeCoordinate` yields a parameter for it, and every addressable source must have a case driven through the real engine. The body-shaped sources are asserted to collapse to `post.<path>` rather than assumed to, so a divergence cannot hide behind the grouping, and the unaddressable ones are asserted to stay unaddressable with a stated reason — a coordinate appearing for a route parameter would compile a rule the resolver cannot resolve. Verified by adding a sixth addressable source: the new assertion fails, the old one passed. ## A second instance of the same defect, found on the way Adding `INPUT_SOURCES` to `CAPABILITY_MANIFEST` did not put it in `capabilities.json`, because `emit-capabilities.mjs` assembles the JSON from its OWN restated list of vocabulary names. And `emit-capabilities --check` reported "up to date" throughout: both sides omitted the field, so they agreed. A vocabulary could be declared, typed, used, and never ship, with the check built to catch exactly that saying nothing. The emitter now emits it, and a test asserts over the SOURCE that every exported `as const` vocabulary reaches the manifest with the same members — the only form of this assertion that cannot be satisfied by two files agreeing to be wrong together. It has a floor on the number of vocabularies found, so an empty match cannot pass either. Verified the same way: with the emitter's line removed, `--check` still says "up to date" and the new guard fails. Capability version 1.1.0 → 1.2.0; the version check reads it as additive, as it should. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Adds comprehensive input-source vocabulary integration with robust manifest and tests. 🎯 Quality: 100% Elite · 📦 Size: Medium 📈 This month: Your 145th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
mariojgt
approved these changes
Aug 27, 2026
patchstackdave
deleted the
fix/derive-coordinate-coverage-from-vocabulary
branch
August 27, 2026 08:56
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.
Fixes the P3 from #183's review, and a second instance of the same defect found while doing it.
The completeness assertion asserted nothing
One hard-coded set against another hard-coded set — the file agreeing with itself. A sixth addressable source would not have failed it, which is the gap it was written to close.
The root cause was that the vocabulary could not be asked.
InputSourcewas a bare type union, and a union cannot be enumerated at runtime, so a test wanting "every source the map can address" had no option but to restate the list. Every sibling vocabulary incapabilities.tsis a runtime array with its type derived from it; this one was the exception.Now
INPUT_SOURCESis that array andInputSourcederives from it. The assertion computes its expectation from production: a source is addressable whenruntimeCoordinateyields a parameter, and every addressable source must have a case driven through the real engine.Two supporting assertions so the grouping can't hide anything:
post.<path>, not assumed to;Verified by adding a sixth addressable source (
trailer→server.TRAILER_*): the new assertion fails, the old one passed.A second instance, found on the way
Adding
INPUT_SOURCEStoCAPABILITY_MANIFESTdid not put it incapabilities.json—emit-capabilities.mjsassembles the JSON from its own restated list of vocabulary names.And
emit-capabilities --checkreported "up to date" throughout, because both sides omitted the field, so they agreed. A vocabulary could be declared, typed, used, and never ship, with the check built to catch exactly that saying nothing.Demonstrated directly — with the emitter's line removed:
The new guard asserts over the source: every exported
as constvocabulary must reach the manifest with the same members. That is the only form of the assertion that cannot be satisfied by two files agreeing to be wrong together. It carries a floor on how many vocabularies it found, so an empty match cannot pass either.State
Capability version 1.1.0 → 1.2.0;
check-capability-versionreads it as "additive change with a minor bump — added: field inputSources".Full suite: 1670 passed, 6 skipped; typecheck, template typecheck and
emit-capabilities --checkclean.🤖 Generated with Claude Code