v0.1.0A reference point for your next code change.Meet Invar

Change code.
Preserve behavior.

A local behavioral guardrail for coding agents and their maintainers. Capture what works. Review it. Keep the next change honest.

Open source. Runs locally. Approval stays with you.

Built for the way you change code.

Written in RustLocal by designApache-2.0

The change looks small.
The behavior isn’t.

A refactor can change what your commands return. Invar compares each run with the examples you explicitly accepted.

An ordering example, inspired by the repository demo. Select a result to explore the difference.

Explore the real example
ordering / verificationILLUSTRATIVE

$ invar verify

Behavior matches.

All configured examples match the accepted baseline.

ACCEPTED STDOUT

alice
bob
carol

CURRENT STDOUT

alice
bob
carol
stdout unchangedexit code 0

A passing result covers your configured examples, not every possible behavior. Invar complements your tests.

A baseline you choose.
A check you can repeat.

No account. No hosted service. Just reviewed commands, accepted observations, and an explicit point of comparison.

01 / SET UP

Initialize.

Start with a local configuration. Review the commands before running them.

$ invar init
02 / OBSERVE

Capture.

Record exit code, stdout, and stderr. The capture is a candidate, not approval.

$ invar capture
03 / APPROVE

Lock.

Inspect the candidate. Accept its exact hash when you approve the behavior.

$ invar lock --candidate <hash>
04 / COMPARE

Verify.

Change the code. Compare the next run with your accepted examples.

$ invar verify
Read the complete workflow

Less assumption.
More observation.

Give a changing codebase a stable reference. Keep the observations in your repository and the review in your hands.

Exact, by design.

Compare exit code, stdout, and stderr byte for byte. No normalization. No semantic guesswork.

Your machine. Your repo.

Run the CLI locally. Keep configuration and accepted observations under ordinary source review.

Approval is explicit.

Capturing never accepts changes. Verification never rewrites your baseline. You choose what becomes the reference.

Know the boundary.

Configured commands are not sandboxed. Hashes pin a candidate; they don’t authenticate its reviewer.

Read the security model

Make your next change
with a reference.

Install Invar. Capture the behavior worth keeping.

Read the documentation
Linux / WSL · x86_64v0.1.0
curl -fsSL https://github.com/zhugez/invar/raw/main/install.sh | sh

No sudo or Rust toolchain required. Review the installer first.

Using macOS or another architecture? Build from source