Skip to main content

Module testing

Module testing 

Source
Expand description

Shared contract-test suite.

Every adapter imports and runs this suite against its own implementation as part of CI. It enforces the parts of the port contract that need no live database — determinism of canonical serialization, lossless roundtrips, volatile segregation, manifest honesty, and completeness of a constructed extraction.

Adapters also carry their own integration and determinism tests against a real fixture database (see ARCHITECTURE.md §7); this module covers what core can prove without one.

Functions§

assert_canonical_deterministic
Assert that canonical serialization is byte-stable: two serializations of identical input must produce identical bytes.
assert_manifest_valid
Assert a manifest passes its own self-consistency checks (unique expectations, sane backend identity, valid paths).
assert_serialization_roundtrip
Assert that canonical bytes deserialize back to a semantically identical value — the envelope, each entity, and the volatile section must all survive the roundtrip.
assert_verification_complete
Assert an extraction verifies against its manifest with zero Error-severity findings.
assert_volatile_segregation
Assert the volatile-segregation contract: every manifest-volatile field must appear in the volatile section for every existing row, and must not leak into the config body.
sample_manifest
A manifest that matches sample_realm and passes verification.
sample_realm
A small, representative extraction used to exercise this suite (and useful to adapters for bridging their own data into the canonical shape).