Skip to content

About

Convention-driven contract/invariant checker. YAML-configured, schema-validated, with pluggable reporters and AI-powered code review.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

rs-contract-unit

Convention-driven contract/invariant checker. YAML-configured, schema-validated, with pluggable reporters and AI-powered code review.

Quick Start

cargo install --path .

Create .rs-contract-unit.yaml:

commands:
  check:
    invariants:
      - hello/works

Create contract-unit/primitives/hello/works.rs-cu.yaml:

name: hello
exec: echo "hello from rs-contract-unit"

Run:

rs-contract-unit verify check
rs-contract-unit: check

  [PASS] hello/works                                            0.0s

OK: 1 of 1 checks passed.

Commands

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

Features

  • 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: ref inverts 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

Documentation

License

MIT

About

Convention-driven contract/invariant checker. YAML-configured, schema-validated, with pluggable reporters and AI-powered code review.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages