Skip to content

feat(Conformance): segment-aware rule-id prefixes for only and skip - #407

Merged
thomasfosterau merged 1 commit into
trunkfrom
issue-367-segment-prefixes
Oct 22, 2026
Merged

thomasfosterau merged 1 commit into
trunkfrom
issue-367-segment-prefixes

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Conformance.Options.only and skip now 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 in selected handles both options.

  • "spec/status/create-location" now matches only that rule. Before, it also matched spec/status/create-location-matches-self.
  • "spec/content-negotiation" and "spec/content-negotiation/" both match the whole section.
  • A partial segment such as "spec/content-neg" matches nothing.

The JSDoc on both options, the README skip bullet and docs/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):

  • New: "matches only and skip prefixes by path segment, never past one". It checks the create-location case for both only and skip, a section with and without its trailing /, and that a partial segment matches nothing.
  • "leaves out the skipped rule ids…" now skips spec/content-negotiation instead of spec/content-neg, and works out what it expects using the segment rule.
  • "leaves out the skipped rules from what only and tiers select" now skips the two accept-weight rule ids by name.
  • "holds the middleware to the Accept-weight rule Content negotiation treats an Accept q-weight as a media type parameter, so Accept: application/vnd.api+json;q=0.9 gets a spurious 406 #101 fixed" also used the partial prefix spec/content-negotiation/accept-weight (the issue doesn't list it). It now names the two rules.

Closes #367

Verification

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass (0 errors; this diff adds no warnings)
  • vp run check: pass
  • vp run -r test:unit: 3566/3568 passed. The two failures were 5s timeouts in test/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: pass
  • fallow 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

  • This is a behaviour change for any caller that relies on a partial segment. The changeset says so.
  • An empty-string entry ("") 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

Copy link
Copy Markdown
Owner Author

The failing check is the Audit step (pnpm audit --audit-level high). Every other step is green. It is not this PR's failure: the new advisory GHSA-587h-7wmj-h5pm (launch-editor via vite-plus and @changesets/cli) fails trunk the same way. A fix is in progress in #406, and I'll port it into this branch once it exists.


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
thomasfosterau force-pushed the issue-367-segment-prefixes branch from 3d40dd2 to 6579bd3 Compare October 22, 2026 00:01
@thomasfosterau
thomasfosterau merged commit 72a42dd into trunk Oct 22, 2026
1 check passed
@thomasfosterau
thomasfosterau deleted the issue-367-segment-prefixes branch October 22, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Conformance): segment-aware rule-id prefixes for only and skip

2 participants