3.9 KiB
Conformance Harness Specification
Status: Draft Scope: Define the Phase 0 conformance harness goals, backend matrix, fixture format, and pass/fail gates for ASL and TGK store surfaces.
1. Purpose
The harness ensures that all backend adapters implement existing store semantics without drift.
It MUST:
- Run the same test vectors across multiple backends.
- Enforce deterministic ordering rules.
- Validate replay equivalence.
- Provide a single command entry point for CI.
2. Targets and Scope
2.1 Surfaces Under Test
- ASL/1-STORE
- TGK/STORE/1
Optional extensions:
- ASL/STORE-INDEX/1 (index/log store)
- TGK/PROV/1 (if provenance surface is exposed)
2.2 Conformance Mode
All tests are:
- Deterministic.
- Backend-agnostic.
- Semantics-first (no timing assumptions).
3. Backend Matrix
The harness MUST be able to run each test suite against:
3.1 ASL Backends
asl_store_fsasl_store_index_fs- Future:
asl_store_minio
3.2 TGK Backends
tgk_store_memtgk_store_fstgk_store_asl_index_fs- Future:
tgk_store_janus
4. Canonical Fixture Format
Fixtures are the source of truth for all conformance tests.
4.1 Requirements
- Versioned fixture schema.
- Stable ordering of artifacts and edges.
- Explicit references encoded as canonical
ReferenceByteshex. - Deterministic content generation (no randomness at runtime).
4.2 Minimal Fields
For ASL fixtures:
artifact_bytes(hex or base64, fixed encoding).type_tag(optional).expected_reference(canonical Reference hex).
For TGK fixtures:
edge_artifact_reference(canonical Reference hex).edge_body(decoded representation).edge_type_idfrom_refsandto_refs(ordered lists, canonical hex).
5. Test Suite Requirements
5.1 ASL/1-STORE Suite
- Put/get round-trip.
- Idempotent
put. geton missing ref yieldsERR_NOT_FOUND.- Collision on same ref yields
ERR_INTEGRITY. - Unsupported config yields
ERR_UNSUPPORTED. - Optional I/O fault path yields
ERR_IO.
5.2 TGK/STORE/1 Suite
resolve_edgefor valid edge returnsEdgeBody.resolve_edgefor non-edge returnsGS_ERR_NOT_EDGE.resolve_edgefor artifact integrity failure yieldsGS_ERR_ARTIFACT_ERROR.edges_from,edges_to,edges_incidentreturn identical lists across backends.- Deterministic ordering per
TGK/STORE/1canonical(hash_id, digest)rule. - Optional
neighborsreturns canonical node order. - Optional
scan_edgesenumerates all edges exactly once.
5.3 Replay Equivalence
- Build a fixture ASL log/index state.
- Replay into a fresh store.
- Assert identical references and TGK results.
6. Ordering and Equivalence Rules
6.1 Edge Ordering
Edge lists MUST be sorted in ascending lexicographic order of:
hash_id_bytes || digest_bytes, with hash_id encoded as big-endian u16.
6.2 Node Ordering
Neighbor lists MUST be sorted in ascending lexicographic order of:
hash_id_bytes || digest_bytes, with hash_id encoded as big-endian u16.
6.3 Cross-Backend Equivalence
For a fixed snapshot and GraphStoreConfig, all backends MUST return:
- Identical edge sets.
- Identical ordered lists for adjacency queries.
- Identical results for
resolve_edge.
7. Harness Structure
Suggested structure:
tests/conformance/asl_store/*.ctests/conformance/tgk_store/*.ctests/fixtures/*.jsontools/amduat_conformance_run
The harness runner MUST:
- Accept backend selector flags.
- Accept fixture set selection.
- Emit a machine-readable summary.
8. CI Gate
An adapter cannot be merged unless:
- It passes its conformance suite.
- Cross-backend equivalence is demonstrated.
- Replay equivalence passes on at least one backend pair.
9. Out of Scope
- Performance benchmarking.
- Load testing.
- Backend-specific tuning.
Those are separate gates after conformance is proven.