Skip to content

feat: align with gts-spec v0.17.0 (pattern engine, regex profile, reference keywords) - #6

Merged
Artifizer merged 4 commits into
ci/add-github-actionsfrom
feat/spec-v0.17-pattern-regex-refs
Oct 24, 2026
Merged

Artifizer merged 4 commits into
ci/add-github-actionsfrom
feat/spec-v0.17-pattern-regex-refs

Conversation

@Artifizer

Copy link
Copy Markdown
Contributor

Summary

Brings gts-dotnet in line with gts-spec v0.17.0. The full spec suite passes: ./gts.sh gts-dotnet gives 2367 passed, 0 failed.

  • Pattern engine (§10): new GtsPattern handles identifier matching and coverage. It is used for ID validation (OP#1), parsing (OP#3), matching (OP#4) and query wildcards. Versions are unsigned 32-bit and a single-segment instance ID is rejected.
  • Regex profile (§11.0.1, ADR-0006): expressions are checked against the profile everywhere they appear, including targets reached only through $ref. They are translated to reference semantics (code-point atoms, ASCII \d \w \s, $ matching end of input) and run on the linear-time non-backtracking engine, replacing the 250 ms timeout. additionalProperties no longer recompiles patternProperties with the ECMAScript engine, which rejected astral ranges.
  • Reference keywords (§9.6): x-gts-type-ref, x-gts-instance-ref and x-gts-pattern-ref replace x-gts-ref, which is now rejected as an unknown keyword (breaking). Derivation and evolution checks now cover references by testing semantic scope inclusion.
  • Hardening:
    • Inlining stops at 100,000 nodes, so shared refs cannot blow up exponentially.
    • Literal data (const, enum, default, examples) is left unchanged.
    • A local ref inside an inlined document resolves against that document.
    • A not containing a reference keyword also checks its structural part, so values of another type are no longer wrongly rejected.
    • Every level of a recursive schema is checked.
    • /$id accepts unsigned 32-bit versions.

Stacked on #4 (CI workflow); retarget to main once #4 merges.

Test plan

  • dotnet test (165 existing tests plus 5 new ones in ReferenceResolutionHardeningTests)
  • dotnet format whitespace|style --verify-no-changes
  • ./gts.sh gts-dotnet against gts-spec v0.17.0: 2367 passed

Port the reference pattern engine (README section 10) and use it for
OP#1 ID validation, OP#3 parsing, OP#4 matching and query wildcards.
It enforces unsigned 32-bit version bounds, the 1024-char limit and the
single-segment-instance rule, and decides coverage for pattern
candidates.

Signed-off-by: Artifizer <artifizer@gmail.com>
Check every pattern, patternProperties key and format: regex value
against the ECMA-262 u / RE2 profile (README section 11.0.1, ADR-0006),
including targets reached only through $ref. Supported expressions are
translated to reference semantics (code-point atoms, ASCII \d \w \s,
$ as end of input) and matched in linear time with the non-backtracking
engine, replacing the 250 ms match timeout.

additionalProperties no longer compiles sibling patternProperties with
the ECMAScript engine, which rejected in-profile astral ranges.

Signed-off-by: Artifizer <artifizer@gmail.com>
…ce keywords

Implement x-gts-type-ref, x-gts-instance-ref and x-gts-pattern-ref
(README section 9.6) and reject the removed x-gts-ref. Derivation and
evolution checks include the reference dimension via semantic scope
inclusion, and derived properties composed with allOf are flattened
before comparison. Bump the gts-spec pin to v0.17.0.

Harden reference resolution:
- resolve local refs of an inlined document against that document;
- cap inlining at 100,000 nodes so shared refs cannot grow exponentially;
- leave literal data (const, enum, default, examples) untouched;
- evaluate the structural part of a reference-bearing not;
- key the recursive-ref guard by instance path so every level is checked;
- accept unsigned 32-bit versions in /$id.

Signed-off-by: Artifizer <artifizer@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 259c86f8-287c-48fd-b79c-9cabeb859036

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@code-ranker-app

code-ranker-app Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

code-ranker: 1 finding View report ↗

csharp: 1 finding
🤖 Prompt for fix all with AI
Run `code-ranker check --top 1` and follow instructions to fix error. Loop until no errors left.

updated 2026-10-24 17:11 UTC

Signed-off-by: Artifizer <artifizer@gmail.com>
@Artifizer
Artifizer merged commit eebafeb into ci/add-github-actions Oct 24, 2026
3 checks passed
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.

1 participant