What it does
The schema crate contains a contract model and suites: a deterministic change classifier, a producer-side record validator, a consumer-side compatibility check and a combined gate. None of it is called from a route or a writer path yet, so a contract can be stored on a collection but is not enforced anywhere.
How it works
A contract names an owner and a separate privacy owner, a compatibility mode, a lifecycle, allowed purposes, field-level rules, quality rules and declared consumers. The classifier compares two contracts and returns a sorted report of changes, and it is a pure function with no clock or random input, so two calls with the same inputs return the same bytes. The validator checks a record or a batch against a contract, and the consumer check tests a declared consumer against a proposed change. A combined gate returns an allow or refuse decision with reasons.
The compatibility modes are a deliberately coarse, documented simplification of schema-registry semantics, not an implementation of Avro-style reader and writer resolution. The module documents the exact call sites that wiring would use: the schema and view update handlers, and the record-preparation paths of the writers.
Where you reach it
- Library
kynetra_schema::contract: check_change, validate_record, validate_batch, check_consumer, contract_ci_gate (engine library, not wired to the server)
Limits
- Not enforced. A collection can carry a contract field, but no route, writer path, export or query path evaluates it.
- No HTTP or command-line interface reads or writes contracts.
Evidence
- TestsCovered in the engine repository by more than 60 contract tests for the classifier, validators, consumer checks and the combined gate
Test coverage is listed as present in the engine repository at this edition. This page does not report test results.
KynetraDB is in private preview
This is not available in the preview. Request a preview to discuss the current scope.