Convention-driven contract/invariant checker. YAML-configured, schema-validated, with pluggable reporters and AI-powered code review.
cargo install --path .Create .rs-contract-unit.yaml:
commands:
check:
invariants:
- hello/worksCreate contract-unit/primitives/hello/works.rs-cu.yaml:
name: hello
exec: echo "hello from rs-contract-unit"Run:
rs-contract-unit verify checkrs-contract-unit: check
[PASS] hello/works 0.0s
OK: 1 of 1 checks passed.
rs-contract-unit verify <command> # run checks
rs-contract-unit verify <command> --yaml # structured YAML output
rs-contract-unit verify <command> --reporter <cmd> # custom renderer
rs-contract-unit explain <command> # show execution tree
rs-contract-unit list # list available commands
rs-contract-unit export-schemas # generate JSON schemas- Three-layer YAML — config → invariants → primitives
- Named glob wildcards —
project/gates/*:gate/is-green - Fail-fast — configurable per invariant
- Repair — auto-fix and retry on failure
- Negation —
not: refinverts pass/fail - Memoization — each check runs at most once
- Schema validation — derived from code via schemars, zero drift
- Reporters — pluggable output pipeline (text, YAML, custom)
- AI review — commit drafts, code review, trajectory analysis via Claude
- Getting Started
- Configuration Reference
- Writing Checks
- Writing Helpers
- Troubleshooting
- Environment Contract
- Environment Proof Semantics
- How To Derive Signals
- Longreads
- Change Requests
- Engineering Direction
- Engineering Reviews
- Engineering Signals
- Engineering Reactions
- Design Principles
- Governance
MIT