Repository navigation
feat(Conformance): segment-aware rule-id prefixes for only and skip - #407
Merged
Merged
Conversation
Owner
Author
|
The failing check is the Audit step ( Generated by Claude Code |
…367) A prefix now matches the rule whose id it is and every rule whose id continues it with `/`, so `spec/status/create-location` no longer reaches `spec/status/create-location-matches-self`, and a partial segment such as `spec/content-neg` matches nothing. One shared matcher in `selected` serves both options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ZgiUeCy5QxSz5oQt2gT1H
thomasfosterau
force-pushed
the
issue-367-segment-prefixes
branch
from
October 22, 2026 00:01
3d40dd2 to
6579bd3
Compare
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.
Summary
Conformance.Options.onlyandskipnow match rule-id prefixes by path segment rather than plain string prefix. An entry matches the rule whose id it is, plus every rule whose id continues it with/. One matcher inselectedhandles both options."spec/status/create-location"now matches only that rule. Before, it also matchedspec/status/create-location-matches-self."spec/content-negotiation"and"spec/content-negotiation/"both match the whole section."spec/content-neg"matches nothing.The JSDoc on both options, the README
skipbullet anddocs/conformance.md§1.5 are updated to match. The §1.5 sentence that pointed to #367 as future work is replaced with the new rule.Tests (
src/Conformance.test.ts):onlyandskipprefixes by path segment, never past one". It checks thecreate-locationcase for bothonlyandskip, a section with and without its trailing/, and that a partial segment matches nothing.spec/content-negotiationinstead ofspec/content-neg, and works out what it expects using the segment rule.onlyandtiersselect" now skips the two accept-weight rule ids by name.Acceptq-weight as a media type parameter, soAccept: application/vnd.api+json;q=0.9gets a spurious 406 #101 fixed" also used the partial prefixspec/content-negotiation/accept-weight(the issue doesn't list it). It now names the two rules.Closes #367
Verification
pnpm install --frozen-lockfile: passvp run build: passvp check: pass (0 errors; this diff adds no warnings)vp run check: passvp run -r test:unit: 3566/3568 passed. The two failures were 5s timeouts intest/entry-points.test.ts(module-subpath resolution) while the machine's load average was about 53. Rerun alone with--testTimeout=120000, all 25 tests in that file pass. This diff doesn't touch that file.vp run docgen: passfallow audit --base origin/trunk: pass (no issues in the 5 changed files)Changeset
.changeset/conformance-segment-prefixes.md, minor. It describes the narrower matching and says that partial-segment prefixes now match nothing.Notes
"") used to match every rule. It now matches none, which follows from the segment rule. No test or doc used it.Generated by Claude Code