3.8 KiB
Phase 0 GC2 Format Contract Completeness Evidence
Gate: GC2 / Format contract completeness
Result: Passed for shared format contracts, schema validation, semantic validation, and diagnostic error generation.
Date: 2026-09-05T18:33:45Z
Tooling: Zero-dependency Node.js validator (tools/validate-exhibit.mjs), JSON Schema Draft-07 (schema/xzbt-0.1.schema.json), and automated test suite (test/gc2-runner.test.mjs).
Specification & Implementation Summary
- Normative Specification: Updated XZBT_0-1_Format_Specification.md (Revision 0.2) defining document structure, metadata, primitive type system with strict coercion ban,
ValueSpec5-form grammar and operator arity table,ConditionSpeccomparisons and logical composition with edge-trigger re-arming,DurationSpecliterals, and standard error codes. - Structural JSON Schema: Authoritative schema authored at schema/xzbt-0.1.schema.json.
- Semantic Validator: Standalone CLI engine authored at tools/validate-exhibit.mjs.
Automated Conformance Test Matrix Results
The automated test runner executed 12 tests covering valid exhibits and deliberate fault injections:
| Fixture | Classification | Expected Outcome | Actual Result | Status |
|---|---|---|---|---|
test/fixtures/gc2/valid-minimal.xzbt |
Minimal Exhibit | Valid (0 errors) | Valid (0 errors) | PASS |
test/fixtures/gc2/valid-full-feature.xzbt |
Full Feature Exhibit | Valid (0 errors) | Valid (0 errors) | PASS |
prototypes/phase0/fixtures/amber-study.xzbt |
Prototype Baseline | Valid (0 errors) | Valid (0 errors) | PASS |
prototypes/phase0/fixtures/blue-study.xzbt |
Prototype Baseline | Valid (0 errors) | Valid (0 errors) | PASS |
test/fixtures/gc2/invalid-unknown-field.xzbt |
Fault Injection | ERR_UNKNOWN_FIELD |
ERR_UNKNOWN_FIELD |
PASS |
test/fixtures/gc2/invalid-unsupported-version.xzbt |
Fault Injection | ERR_UNSUPPORTED_VERSION |
ERR_UNSUPPORTED_VERSION |
PASS |
test/fixtures/gc2/invalid-id-syntax.xzbt |
Fault Injection | ERR_INVALID_ID |
ERR_INVALID_ID |
PASS |
test/fixtures/gc2/invalid-reference-missing.xzbt |
Fault Injection | ERR_INVALID_REFERENCE |
ERR_INVALID_REFERENCE |
PASS |
test/fixtures/gc2/invalid-type-mismatch.xzbt |
Fault Injection | ERR_TYPE_MISMATCH |
ERR_TYPE_MISMATCH |
PASS |
test/fixtures/gc2/invalid-cyclic-bindings.xzbt |
Fault Injection | ERR_CYCLIC_DEPENDENCY |
ERR_CYCLIC_DEPENDENCY |
PASS |
test/fixtures/gc2/invalid-out-of-bounds.xzbt |
Fault Injection | ERR_OUT_OF_BOUNDS |
ERR_OUT_OF_BOUNDS |
PASS |
test/fixtures/gc2/invalid-operator-arity.xzbt |
Fault Injection | ERR_INVALID_ARITY |
ERR_INVALID_ARITY |
PASS |
Gate Conclusion
The shared contracts portion of GC2: Format Contract Completeness is satisfied. The schema, validator, and test suite provide a deterministic foundation for Phase 1 runtime loading and validation. Subsystem-specific schemas and contracts (audio graphs, visual systems, scenarios) will be filled in dependency order alongside their respective phases.
Revision 0.3 reconciliation addendum
GC3 review found that the draft BindingSpec used from/to/transform, conflicting with the PRD's canonical source/target/scale/offset/clamp fields. Revision 0.3 corrected the schema, validator, and affected fixtures to the PRD vocabulary and added when plus exact smoothing semantics. The same 12-case GC2 matrix was rerun as part of the 27-test combined Phase 0 suite and still passed with zero failures. See the GC3–GC5 evidence for the reconciliation rationale and combined command.