Expand description
§keystate-core
Canonical domain model, extraction ports, completeness verification, and idempotent output for Keystate — a read-only tool that pulls the complete, verified configuration state of an IAM system out of its database as a single backend-agnostic JSON document.
Core is deliberately backend-agnostic and carries no runtime or
database dependency. Adapters (own repos) implement the Extractor,
CompletenessVerifier and OutputSink ports against one backend’s
schema. The canonical structs are a thin set of common fields plus an
open native escape hatch, per the architecture document:
{
"id": "a1b2c3d4",
"name": "my-client",
"enabled": true,
"native": { /* backend-faithful representation, adapter-owned */ }
}The three guarantees this crate provides are:
- Completeness — a
FieldManifestdescribing every field a backend version must carry, checked by theManifestVerifierinto aVerificationReportthat is part of the output, not a side log. - Idempotency —
canonical_bytesproduces byte-stable output andcontent_hashfingerprints the config portion only, so a git diff on the output reflects real configuration change, never extraction noise or volatile churn. - Testability — the
testingmodule is a shared contract suite every adapter runs as part of CI.
See ARCHITECTURE.md in this repository for the full design.
§Module map
Re-exports§
pub use canonical::canonical_bytes;pub use canonical::config_bytes;pub use canonical::content_hash;pub use canonical::roundtrip;pub use error::Error;pub use error::Result;pub use port::CompletenessVerifier;pub use port::Extractor;pub use port::OutputSink;pub use verify::EntityExpectation;pub use verify::EntityPresence;pub use verify::FieldExpectation;pub use verify::FieldManifest;pub use verify::IssueKind;pub use verify::ManifestVerifier;pub use verify::Severity;pub use verify::VerificationIssue;pub use verify::VerificationReport;pub use verify::resolve_path;pub use version::Version;pub use model::*;
Modules§
- canonical
- Deterministic serialization and content hashing.
- error
- Error and result types shared across the crate and its ports.
- model
- The canonical (backend-agnostic) model.
- port
- The ports (traits) every backend adapter implements.
- testing
- Shared contract-test suite.
- verify
- Completeness verification: manifests, reports, the shared engine, and the path resolver.
- version
- Backend/schema version representation used to key manifests and reports.