- Record user evidence for directory fallback to complete GC1 (10/10 checks passed) - Expand Format Specification 0.1 to Revision 0.2 with normative shared contracts - Author JSON Schema Draft-07 at schema/xzbt-0.1.schema.json - Implement zero-dependency semantic validator at tools/validate-exhibit.mjs - Create 12-case conformance fixture suite and automated test runner (12/12 passing) - Update implementation status, verification gates, and gap closure decisions - Add devlog entry covering stall recovery and Phase 0 current state
3.2 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.