assertReadContractPreserved
assertReadContractPreserved(
authoritative,projection,options?):void
Defined in: packages/contracts/src/projection.ts:132
Assert that a per-client projection registry preserves the read contract (ADR-0025) of the
authoritative registry it projects from. For every table the projection declares, its
fingerprintReadContract must equal the authoritative entry’s: a projection may differ only in
write capability and lifecycle orchestration, never in the data it syncs (columns, primary key,
row-filter shape). A table present in the authoritative registry but absent from the projection is a
permitted subset; a table in the projection with no authoritative source is an error (no contract to
project from).
Throws, naming the divergent tables, on any mismatch. Call it where the client registries are assembled
(module-eval or a test) so a drifted projection fails closed instead of silently serving different rows
to different clients. The customWhere body is invisible to the fingerprint — bump
RowFilterSpec.revision so a logic-only divergence is caught.
Parameters
Section titled “Parameters”authoritative
Section titled “authoritative”projection
Section titled “projection”options?
Section titled “options?”label?
Section titled “label?”string
Returns
Section titled “Returns”void