Commit beed95c
committed
feat(spec)!: enforce strict allOf form for derivation and redesign traits as URN-referenced types
- Add §3.2.1 (Top-level composition rules): derived GTS Type Schemas
MUST use the canonical single-item allOf with a \$ref to the
immediate parent; overlay constraints live at the top level.
Top-level anyOf/oneOf/not are forbidden on all GTS Type Schemas
(nested usage is unaffected). Rationale captured in ADR-0002.
- Rewrite §9.7 traits model: x-gts-traits-schema becomes a single
GTS Type URN string referencing a registered trait-type; inline
schema, \$ref, and composition forms are removed. Trait-types are
first-class GTS Type Schemas with their own parallel-derivation
chain. Shallow merge with immutable-once-set semantics preserved.
- Make the trait-completeness rule explicit: a non-abstract host
with unresolved required trait fields is invalid by definition;
registry MUST reject it at registration and OP#6 MUST reject
instances of it as defense in depth.
- Extend OP#12 to enforce the structural rules from §3.2.1 in
addition to the existing constraint-compatibility checks.
- Migrate all examples in events/types/, mcp/types/, and
typespec/vms/types/ to strict Form A and the new trait-type
model. Add gts.x.core.traits.event_meta.v1~ as the canonical
trait-type referenced by the base event schema.
- Update the register_derived test helper to emit strict Form A
(single-item allOf + overlay spread at top level). Add
register_trait_type and register_host_with_trait_ref helpers.
- Add 15 structural test classes to test_op12_* covering canonical
form, rejections (Form B, 3+ items, no-\$ref, multi-\$ref,
skip-level, wrong parent, hybrid, top-level union/negation,
base-with-allOf), and accepted nested-union shapes.
- Rewrite test_op13_* (38 classes) around URN-referenced
trait-types: value validation cases, trait-type derivation
(narrowing, loosening rejection, field extension, default
inheritance), parallel-derivation rules, abstract vs concrete
completeness, MAJOR-version pinning, cycle detection, and
instance-validation defense-in-depth.
- Migrate the three trait-aware tests in
test_refimpl_x_gts_final_abstract.py to the URN model.
- Add ADR-0002 (MADR) with worked Option-1..4 comparison, running
example, and explicit payload behavior under each option.
- Log change as version 0.12 (BREAKING).
Signed-off-by: Aviator 5 <ai.agent.tor@gmail.com>1 parent c01f956 commit beed95c
18 files changed
Lines changed: 2550 additions & 1874 deletions
File tree
- adr
- examples
- events/types
- mcp/types
- typespec/vms/types
- tests
- helpers
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Lines changed: 1 addition & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 14 | + | |
31 | 15 | | |
32 | 16 | | |
33 | 17 | | |
| |||
Lines changed: 23 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
9 | 20 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 21 | + | |
15 | 22 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
34 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
Lines changed: 24 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
9 | 20 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 21 | + | |
15 | 22 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
35 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
36 | 33 | | |
37 | | - | |
| 34 | + | |
38 | 35 | | |
Lines changed: 24 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
36 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
37 | 34 | | |
38 | | - | |
| 35 | + | |
39 | 36 | | |
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 12 | + | |
23 | 13 | | |
24 | 14 | | |
25 | 15 | | |
| |||
Lines changed: 22 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | | - | |
| 20 | + | |
11 | 21 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
30 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
| 12 | + | |
10 | 13 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
22 | 19 | | |
23 | | - | |
| 20 | + | |
24 | 21 | | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments