Skip to content

fix(spec): correct schema evolution compatibility - #90

Merged
Artifizer merged 1 commit into
GlobalTypeSystem:mainfrom
aviator5:v0.13-update
Jul 28, 2026
Merged

fix(spec): correct schema evolution compatibility#90
Artifizer merged 1 commit into
GlobalTypeSystem:mainfrom
aviator5:v0.13-update

Conversation

@aviator5

@aviator5 aviator5 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator
  • Define derivation and evolution through accepted-instance set inclusion.
  • Clarify content-model trade-offs and separate operational guarantees.
  • Align OP#8 API wording and conformance verdicts with the corrected rules.

BREAKING CHANGE: Compatibility verdicts change for open models, enums, and const identifier fields.

Summary by CodeRabbit

  • Documentation
    • Updated the GTS specification draft to 0.13, clarifying compatibility semantics for type derivation vs type schema evolution, effective JSON Schema behavior after resolution, and default vs materialization. Refreshed terminology, registry checking rules (including unchanged-identifier revisions), and wildcard matching guidance (including * greediness).
  • API
    • Updated the compatibility endpoint to reflect type schema evolution compatibility and expanded the 200 response with old, new, and tri-state verdicts: backward_compatibility, forward_compatibility, full_compatibility.
  • Tests
    • Updated OP#8 contract assertions and added extensive coverage for closed/open evolution, identity (const), renames, constraints/enums, numeric changes, referenced types, and expanded OP#4 wildcard pattern cases.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aviator5, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b00a84f8-e657-4dbb-a9de-5a754e67827b

📥 Commits

Reviewing files that changed from the base of the PR and between 94fe247 and 9523b8f.

📒 Files selected for processing (4)
  • README.md
  • tests/openapi.json
  • tests/test_op4_id_match_pattern.py
  • tests/test_op8_compatibility_checking.py
📝 Walkthrough

Walkthrough

The GTS specification advances to draft 0.13, separating derivation compatibility from schema evolution compatibility. Section 4, registry guidance, OP#8 terminology, the compatibility endpoint description, identifier matching, and compatibility test coverage are updated.

Changes

GTS compatibility model

Layer / File(s) Summary
Compatibility terminology and derivation contract
README.md
The draft version, section structure, compatibility terminology, and one-way derivation guarantee are updated.
Schema evolution compatibility semantics
README.md
Section 4 defines accepted-instance-set relations, compatibility modes, effective content models, evolution examples, and schema-versus-casting distinctions.
Operational compatibility and registry contracts
README.md, tests/openapi.json
Registry requirements, policy guidance, OP#8 naming, practical guidance, and the compatibility endpoint schema are aligned with schema evolution compatibility.
OP#8 compatibility test matrix
tests/test_op8_compatibility_checking.py
Existing verdicts are updated and new cases cover closed models, content-model changes, identity and property changes, numeric changes, arrays, enums, nested objects, and referenced types.
Identifier wildcard matching
README.md, tests/test_op4_id_match_pattern.py
Wildcard greediness and version-zero matching expectations are clarified and tested.

Estimated code review effort: 4 (Complex) | ~60 minutes

Suggested reviewers: artifizer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: correcting schema evolution compatibility semantics in the spec.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 153: Revise the “Built-in Compatibility Checking” statement to separate
schema compatibility from casting and runtime-processing guarantees. Describe
compatibility as comparing successive type definitions, without claiming that it
makes upcasting, downcasting, or consumer processing safe; align the wording
with the separate operational contracts defined in §4.3.
- Line 954: Qualify the Identity-field note’s const-compatibility statement:
explain that differing const values prevent instances carrying the optional
property from satisfying both schemas, but do not make the schema intersection
empty when the property is absent. Align the wording with the existing
qualification in the compatibility table while preserving the OP#9 casting and
operational-compatibility distinction.

In `@tests/openapi.json`:
- Line 602: Update the OpenAPI 200 response schema for the GET /compatibility
operation, near the “Check Type Schema evolution compatibility” summary, to
define is_backward_compatible, is_forward_compatible, and is_fully_compatible as
boolean response properties. Replace the unconstrained object definition while
preserving the existing response structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9dad8a98-de94-4bce-a063-d65f1d62dd31

📥 Commits

Reviewing files that changed from the base of the PR and between a723d63 and 0b6867d.

📒 Files selected for processing (3)
  • README.md
  • tests/openapi.json
  • tests/test_op8_compatibility_checking.py

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread tests/openapi.json
@aviator5
aviator5 force-pushed the v0.13-update branch 2 times, most recently from a1da7d5 to e79eea7 Compare July 28, 2026 05:29
@aviator5 aviator5 changed the title feat!: redefine schema evolution compatibility fix(spec): correct schema evolution compatibility Jul 28, 2026
@aviator5
aviator5 force-pushed the v0.13-update branch 2 times, most recently from cff47c6 to 94fe247 Compare July 28, 2026 11:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/test_op8_compatibility_checking.py (1)

844-844: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert all three verdicts for the constraint scenarios.

Every other scenario now pins backward_compatibility, forward_compatibility, and full_compatibility; these two only pin the backward verdict, so a wrong forward/full result would pass unnoticed. Relaxation should be forward-incompatible/full-incompatible, tightening forward-compatible/full-incompatible.

🧪 Proposed assertions
             .assert_equal("body.backward_compatibility", "compatible")
+            .assert_equal("body.forward_compatibility", "incompatible")
+            .assert_equal("body.full_compatibility", "incompatible")
             .assert_equal("body.backward_compatibility", "incompatible")
+            .assert_equal("body.forward_compatibility", "compatible")
+            .assert_equal("body.full_compatibility", "incompatible")

Also applies to: 913-913

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_op8_compatibility_checking.py` at line 844, Extend the assertions
in both constraint scenarios around the existing body.backward_compatibility
checks to also verify forward_compatibility and full_compatibility. For the
relaxation scenario, assert forward-incompatible and full-incompatible; for the
tightening scenario, assert forward-compatible and full-incompatible, matching
the verdict conventions used by the other scenarios.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/test_op8_compatibility_checking.py`:
- Line 844: Extend the assertions in both constraint scenarios around the
existing body.backward_compatibility checks to also verify forward_compatibility
and full_compatibility. For the relaxation scenario, assert forward-incompatible
and full-incompatible; for the tightening scenario, assert forward-compatible
and full-incompatible, matching the verdict conventions used by the other
scenarios.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b5df83af-6ce8-4f05-b2ca-5153e091f8fb

📥 Commits

Reviewing files that changed from the base of the PR and between cff47c6 and 94fe247.

📒 Files selected for processing (4)
  • README.md
  • tests/openapi.json
  • tests/test_op4_id_match_pattern.py
  • tests/test_op8_compatibility_checking.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/test_op4_id_match_pattern.py
  • README.md

- Separate type derivation from evolution and define both through accepted-instance-set inclusion.
- Correct open, closed, and partially open content-model rules while separating schema compatibility from operational guarantees.
- Expose tri-state OP#8 verdicts and align the OpenAPI contract with conformance assertions.
- Fix wildcard conformance expectations for chained suffixes and v0 minor-version patterns.

Signed-off-by: Aviator 5 <ai.agent.tor@gmail.com>
@Artifizer
Artifizer merged commit 5489fb7 into GlobalTypeSystem:main Jul 28, 2026
2 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.

2 participants