You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Require ADRs for normative specification changes and document the validation workflow.
- Add a project-adapted ADR template and align existing ADR headings with it.
Signed-off-by: Aviator 5 <ai.agent.tor@gmail.com>
# Optional: Install Python dependencies for reference implementations
22
-
pip install jsonschema
23
-
24
-
# Optional: Install JSON Schema validator
22
+
# Optional: install the JSON Schema validator used by CI
25
23
npm install -g ajv-cli
26
24
```
27
25
26
+
The conformance tests run against an external GTS implementation over HTTP; this repository does not contain a reference implementation. See [`tests/README.md`](tests/README.md) for Docker and local Python setup.
27
+
28
28
### Repository Layout
29
29
30
30
```
31
31
gts-spec/
32
-
├── README.md # Main specification document
32
+
├── README.md # Normative specification
33
33
├── CONTRIBUTING.md # This file
34
-
├── LICENSE # License information
35
-
└── examples/# Example GTS Types and instances
36
-
├── events/ # Event-related examples
37
-
│├── types/# GTS Type Schemas (JSON Schema documents)
38
-
│└── instances/# JSON instance examples
39
-
└── ... # Other domain examples
34
+
├── LICENSE # License
35
+
├── NOTICE # Attribution notices
36
+
├── adr/ # Architecture Decision Records (+ template.md)
37
+
├── examples/ # GTS Types and Instances in JSON, YAML, and TypeSpec
Follow the specification standards and patterns described below.
59
59
60
+
#### Specification changes require an ADR
61
+
62
+
Any proposal that adds normative behavior to the specification or intentionally changes existing normative behavior **MUST go through the Architecture Decision Record (ADR) process**. Start by copying the project-adapted MADR [`ADR template`](adr/template.md) to the next sequentially numbered file under [`adr/`](adr/) and fill in all applicable sections. The specification, tests, and examples must reference or implement the decision where applicable.
63
+
64
+
Open the pull request with the ADR already at **`Status: Accepted`** — the decision is what is under review, so accepting the ADR *is* merging the pull request. There is no separate approval step and no `Proposed` state in the repository: an ADR on `main` is accepted by definition. A decision that is later replaced keeps its file and moves to `Status: Superseded`, with `Superseded by` pointing at the ADR that replaces it (and that ADR's `Supersedes` pointing back). The ADR may be reviewed in its own pull request or together with the resulting specification change; either way it must not be merged before the reviewers agree on the decision itself.
65
+
66
+
A confirmed bug fix does not require a new ADR when it only restores behavior already established by the specification or an accepted ADR. If fixing the issue requires choosing new semantics, it is a specification change and therefore requires an ADR.
Run the checks relevant to the files you changed. JSONC, YAML, TypeSpec, nested example directories, and unresolved `gts://` references may require their own format-aware validation in addition to the CI command above. For test-suite setup and targeted test invocations, follow [`tests/README.md`](tests/README.md).
79
+
70
80
### 4. Commit Changes
71
81
72
82
Follow a structured commit message format:
@@ -113,8 +123,9 @@ Specification development guidelines:
113
123
114
124
- Follow GTS identifier format rules strictly
115
125
- Ensure all schemas use correct `$id` values
116
-
-Validate schemas against JSON Schema Draft 7 or later
126
+
-Declare the intended JSON Schema dialect with `$schema` and use keywords valid for that dialect; GTS is dialect-agnostic, while repository examples generally use Draft-07 for interoperability
117
127
- Include both GTS Type Schemas (the canonical JSON definitions of types) and GTS Instance examples
128
+
- Keep normative specification changes, conformance tests, and examples aligned
118
129
- Document any deviations or implementation-specific choices
119
130
120
131
## Releases
@@ -139,8 +150,8 @@ When the specification moves to the next minor version (e.g. `0.11` → `0.12`),
139
150
Releases are produced from `github.com/GlobalTypeSystem/gts-spec`. The workflow is restricted to that repository; pushing a tag from a fork has no effect.
140
151
141
152
```bash
142
-
git tag v0.11.3
143
-
git push origin v0.11.3
153
+
git tag vX.Y.Z
154
+
git push origin vX.Y.Z
144
155
```
145
156
146
157
The [`Release Tests Image`](.github/workflows/release-tests-image.yml) workflow:
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1622,6 +1622,7 @@ Given an inheritance chain `S₀ → S₁ → … → Sₙ`:
1622
1622
-**`null` at any depth deletes that key** from the effective object (per RFC 7396). The principal use case is to revert an ancestor-set value and let the trait-schema's `default` re-apply via the materialization step described in the Completeness check below — that is, a descendant writes `"<key>": null` to "fall back to the schema default" without picking a specific value. If the deleted key is `required` and has no `default`, the completeness check (OP#13) fails for non-abstract types (the descendant must then either mark itself abstract or accept that "delete + required + no default" is an unresolvable contract). Authors who want `null` as an *intended* trait value cannot express it via this merge and must use a sentinel value documented as part of the trait shape.
1623
1623
- Defaults declared in the effective trait-schema MUST be materialized into the effective traits object before the Completeness check runs (per ADR-0003): for every property declared in the effective trait-schema with a `default` and not present in the chain-merged object, the registry MUST substitute the default value. The Completeness check below (OP#13) operates on the resulting *materialized* effective traits object.
1624
1624
- A publisher who wants a trait value to be **locked** across all descendants of a base type SHOULD declare `"const": <value>` for that property in `x-gts-traits-schema`. A descendant attempting to override the value will fail the standard JSON Schema validation that runs against the effective trait-schema (per the Completeness check below). No GTS-specific "immutability" rule is required — `const` is the mechanism.
1625
+
-`const` constrains the **value** of a property, not its presence: per standard JSON Schema it asserts nothing when the property is absent. A publisher who additionally wants the trait to survive an RFC 7396 `null` deletion SHOULD either list the property in the containing object schema's `required` array (deletion then fails the Completeness check for non-abstract types) or declare a `default` equal to the `const` value (deletion then becomes a no-op, since materialization restores the value before validation). This is the general presence rule for traits — it is not specific to `const`: any optional inherited trait without a `default` can be removed by a descendant.
1625
1626
- A descendant MAY redeclare a trait value with the same value the ancestor already declared (idempotent restatement).
1626
1627
- See [`adr/0004-x-gts-traits-merge-strategy.md`](adr/0004-x-gts-traits-merge-strategy.md) for the rationale.
- Option 2B — Subschema + explicit composition by the author
48
+
49
+
Option 2's sub-variants share the keyword's value space and differ only in who composes the declarations along the chain; they are evaluated inside Option 2 below.
45
50
46
51
### Option 1 — Trait-type as a separately-registered GTS Type (URI value)
47
52
@@ -229,7 +234,7 @@ By construction, any value satisfying the effective trait-schema also satisfies
229
234
230
235
## Decision Outcome
231
236
232
-
Chosen: **Option 2A — `x-gts-traits-schema` is a JSON Schema subschema (object OR boolean); the registry composes declarations along the `$id` chain via `allOf`.**
237
+
Chosen option: **Option 2A — `x-gts-traits-schema` is a JSON Schema subschema (object OR boolean); the registry composes declarations along the `$id` chain via `allOf`.**
Copy file name to clipboardExpand all lines: adr/0003-x-gts-traits-completeness.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,10 @@ ADR-0001 commits GTS to being an extension of JSON Schema (dialect-agnostic); AD
92
92
93
93
## Considered Options
94
94
95
+
- Option 1 — No spec-level enforcement (author's responsibility)
96
+
- Option 2 — Validate at instance creation time
97
+
- Option 3 — Validate at type registration (fail fast) *(chosen)*
98
+
95
99
Three top-level options on **when (or whether) to enforce completeness**.
96
100
97
101
### Option 1 — No spec-level enforcement (author's responsibility)
@@ -223,7 +227,7 @@ Three ways to make the registration succeed:
223
227
224
228
## Decision Outcome
225
229
226
-
Chosen: **Option 3 — validate at type registration; non-abstract types MUST be complete.**
230
+
Chosen option: **Option 3 — validate at type registration; non-abstract types MUST be complete.**
227
231
228
232
### Definition of "complete"
229
233
@@ -254,7 +258,7 @@ At the registration of type T:
254
258
-**Non-abstract type with required-no-default and no explicit value.** Registration fails. Author resolves by (a) providing `x-gts-traits` value, (b) declaring a `default` in the schema, or (c) marking the type abstract.
255
259
-**Final non-abstract type.** Same rule as any non-abstract — must be complete. No special bullet needed.
256
260
257
-
## Implications
261
+
###Implications
258
262
259
263
-**OP#13 (Schema Traits Validation)** includes this rule; the operation explicitly conditions the completeness step on `x-gts-abstract != true`.
260
264
-**§9.7.5** carries the normative wording of the completeness check in the "Validation" bullet block, expressed in terms of "non-abstract types."
0 commit comments