docs(spec): introduce 0.8beta1 spec version that clarifies schema -> schema validation for chained GTS IDs#55
Conversation
…schema validation for chained GTS IDs Signed-off-by: Artifizer <artifizer@gmail.com>
📝 WalkthroughWalkthroughDocumentation updates expanding the GTS operations reference implementation section to include OP#12 (Schema vs Schema Validation), along with new validation semantics content describing Instance → Schema and Schema → Schema validation rules, transitivity, compatibility, and additionalProperties handling in inheritance chains. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
1-1:⚠️ Potential issue | 🟡 MinorUpdate the top-level VERSION banner to 0.8beta1.
The banner still says “version 0.7” while the Document Version table introduces 0.8beta1, which will confuse readers.
✅ Suggested edit
-> **VERSION**: GTS specification draft, version 0.7 +> **VERSION**: GTS specification draft, version 0.8beta1Also applies to: 94-95
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 1, Update the top-level VERSION banner string "**VERSION**: GTS specification draft, version 0.7" to read "0.8beta1" and similarly replace any other occurrences labeled "version 0.7" (notably the instances around lines 94-95) so the README's header and the Document Version table consistently show "0.8beta1"; ensure the exact formatting of the banner (bold "**VERSION**: ...") is preserved while only changing the version token to "0.8beta1".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 263-275: The README's "Instance → schema validation" text claims
"validating against the rightmost type MUST also imply conformance to all base
types by transitivity" while "Schema → schema validation" allows compatibility
checks as MAY, creating a contradiction; update the wording to either require
schema→schema compatibility checks at registry/authoring time or qualify the
MUST as conditional (e.g., "MUST imply conformance ... provided schema→schema
compatibility is enforced"); specifically edit the "Instance → schema
validation" and "Schema → schema validation" paragraphs so they reference the
same enforcement model and use consistent modal language (replace the
unconditional "MUST imply conformance" or upgrade the "MAY" to a required check)
to eliminate the inconsistency.
---
Outside diff comments:
In `@README.md`:
- Line 1: Update the top-level VERSION banner string "**VERSION**: GTS
specification draft, version 0.7" to read "0.8beta1" and similarly replace any
other occurrences labeled "version 0.7" (notably the instances around lines
94-95) so the README's header and the Document Version table consistently show
"0.8beta1"; ensure the exact formatting of the banner (bold "**VERSION**: ...")
is preserved while only changing the version token to "0.8beta1".
| #### Validation semantics for GTS chained IDs (instance -> schema and schema -> schema) | ||
|
|
||
| GTS identifiers may be chained (e.g. `gts.A~B~C`). Validation MUST respect the left-to-right inheritance model and MUST preserve the compatibility guarantee (section 3.2). | ||
|
|
||
| - **Instance → schema validation** (validate an object instance): | ||
| - The system MUST resolve the **rightmost type** in the identifier chain and validate the instance payload against that JSON Schema. | ||
| - If the instance identifier includes a type chain (`A~B~<instance>`), validating against the rightmost type `B` MUST also imply conformance to all base types in the chain (by transitivity). | ||
| - Implementations MAY additionally validate that each adjacent type pair in the chain is compatible (schema→schema validation), but the primary runtime instance validation target is always the rightmost type. | ||
|
|
||
| - **Schema → schema validation** (validate a derived schema against its predecessor schema): | ||
| - Given a derived type identifier chain (e.g. `A~B~` or `A~B~C~`), the system MUST validate that each derived schema is compatible with its immediate predecessor in the chain. | ||
| - The compatibility rule is: every valid instance of the derived schema MUST also be a valid instance of the base schema. | ||
| - When JSON Schema inheritance is expressed via `allOf` (recommended), the derived schema MUST be written such that it does not invalidate the compatibility guarantee. |
There was a problem hiding this comment.
Align “MUST imply conformance” with optional compatibility checks.
You state that validating an instance against the rightmost type MUST imply conformance to all base types by transitivity, but then say schema→schema compatibility checks are MAY. Without mandatory compatibility enforcement (e.g., at registry time), that transitive guarantee doesn’t hold. Consider either requiring schema→schema validation or qualifying the “MUST imply” statement to be conditional on compatibility enforcement.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 263 - 275, The README's "Instance → schema
validation" text claims "validating against the rightmost type MUST also imply
conformance to all base types by transitivity" while "Schema → schema
validation" allows compatibility checks as MAY, creating a contradiction; update
the wording to either require schema→schema compatibility checks at
registry/authoring time or qualify the MUST as conditional (e.g., "MUST imply
conformance ... provided schema→schema compatibility is enforced"); specifically
edit the "Instance → schema validation" and "Schema → schema validation"
paragraphs so they reference the same enforcement model and use consistent modal
language (replace the unconditional "MUST imply conformance" or upgrade the
"MAY" to a required check) to eliminate the inconsistency.
This is the very first part of the:
#51
Summary by CodeRabbit