Getting started

Install the CLI, choose how far to adopt it, give each crate a tier, and run the check.

Install

cargo-tauten is a Cargo subcommand and brings its own profile. The library API is on docs.rs.

cargo install --locked cargo-tauten

Then run cargo tauten check in your workspace. Needs Rust 1.98 or newer, with clippy.

Choose a route

Each route is complete on its own; none replaces a check the project already runs.

  • Advisory trial: run the structural checks once on a disposable checkout. Nothing in the repository changes.
  • Opt-in CI check: commit the tiers and a reviewed baseline, then require the full check in CI.
  • Lean module only: vendor one pinned Lean file into an existing proof project, without the CLI.

All three, with what each step changes: docs/ADOPTING.md.

Advisory trial

Install the exact release and the Rust toolchain it is built for. init without --write previews the tier plan; --assume-tier applies it for one run without editing a manifest.

docs/ADOPTING.md

$ rustup toolchain install 1.98.0 --profile minimal --component clippy$ cargo +1.98.0 install --locked --version 0.8.0 cargo-tauten$ git clone --quiet . ../tauten-trial && cd ../tauten-trial   # disposable checkout$ cargo +1.98.0 tauten init                                   # preview the tier plan; writes nothing$ cargo +1.98.0 tauten check --structure-only --no-baseline \    --assume-tier '*=core' --assume-tier app=edge --format json > ../tauten-trial.jsonl$ echo $?1$ git status --short                                          # prints nothing

$ cargo tauten check --structure-only --no-baseline --assume-tier '*=core' --assume-tier app=edge --format json

{"id": "TAU-H001", "severity": "error", "crate": "workspace", "file": "Cargo.toml", "line": null}{"id": "TAU-X002", "severity": "error", "crate": "parse", "file": "crates/parse/src/lib.rs", "line": 2}

Exit code 1. Each line is trimmed here to id, severity, crate, file and line; the full line also carries the message, the rule, why it exists and the fix.

  • Exit 1 means at least one error-level finding under the assumed tiers. The code still builds. Exit 0: none from the checks that ran; exit 2: tauten could not run.
  • Not run: --structure-only skips Clippy and rustc, so most rules they decide report nothing (the unwrap in this workspace is one, TAU-P001). --no-baseline ignores any baseline. No proof gate runs.
  • Nothing changes: no manifest, baseline, agent profile or proof record is written. In the capture above, every file of fixtures/adopt was compared before and after the run.
  • A finding is not a defect, and their number is not a defect count (benchmark).
  • TAU-H001 appears in most workspaces. Turning release overflow checks on makes an overflow panic instead of wrap: a decision about release behaviour, not a step of the trial.

Declare tiers

Each crate declares a tier. kernel is pure and can be proved, core takes its effects as parameters, edge is the only place that touches the world.

Cargo.toml

[package.metadata.tauten]tier = "core"   # "kernel" | "core" | "edge"
From the tauten README.
TierMeaningExamples of what is rejected
kernelPure, no_std, deterministic decisions; eligible for proofsany exception to a profile rule, floats, HashMap, Rc/RefCell, outward dependencies
coreLibrary code; effects arrive as parametersstd::fs::read, SystemTime::now, println!, detached threads, globals, unwrap, indexing, unchecked +
edgeStartup and IO; the only tier that may create authorityunwrap, ignored results, stubs (most other rules become warnings)

Dependencies point inward only: edge → core → kernel (TAU-T002). cargo tauten init proposes a tier for each crate that has none; --write applies it.

Check

Run cargo tauten check on every edit. Error-level findings exit with code 1. The CLI owns the profile, so loosening your own clippy.toml or [lints] does not weaken it. --format json prints one diagnostic per line, the form an agent should read.

README.md

$ cargo tauten check                 # human output$ cargo tauten check --format json   # one diagnostic per line, stable schema$ cargo tauten explain TAU-A001      # why the rule exists and how to fix it

$ cargo tauten check

error[TAU-P001]: used `unwrap()` on a `Result` value  --> rej-unwrap/src/lib.rs:6:5 (core crate `rej-unwrap`)  = rule: No unwrap/expect on fallible values (decided by Clippy)  = fix: Propagate with `?` and a typed error, or handle the None/Err case explicitly with match, if let, or a default chosen on purpose.

To excuse one item, put #[expect(lint, reason = "...")] on it. #[allow] is itself a finding (TAU-X001), and some rules admit no exception.

Opt-in CI check

Commit the tiers and a reviewed baseline. cargo tauten baseline records today's error-level findings; later checks report only new ones, and the baseline may only shrink. init --write also turns release overflow checks on: keep that line only as a decision; without it, TAU-H001 goes into the baseline like any other finding.

docs/ADOPTING.md

$ cargo +1.98.0 tauten init --write      # tiers, AGENTS.tauten.md, [profile.release] overflow-checks$ git diff                               # review every tier; keep overflow-checks only as a decision$ cargo +1.98.0 tauten baseline          # writes tauten-baseline.json; review it$ git add -u && git add AGENTS.tauten.md tauten-baseline.json$ git commit -m "tauten: tiers and reviewed baseline"$ cargo +1.98.0 tauten check             # in CI: structure and Clippy, against the committed baseline

$ cargo tauten check # exit 0: the reviewed baseline accepts today's findings

warnings (run with --warnings to list them):       1  TAU-D001  Documented public APItauten: 0 error(s), 1 warning(s), 2 accepted by the baseline

$ cargo tauten check # exit 1: one new unwrap

error[TAU-P001]: used `unwrap()` on a `Result` value  --> crates/parse/src/lib.rs:12:5 (core crate `parse`)  = rule: No unwrap/expect on fallible values (decided by Clippy)  = fix: Propagate with `?` and a typed error, or handle the None/Err case explicitly with match, if let, or a default chosen on purpose. warnings (run with --warnings to list them):       2  TAU-D001  Documented public APItauten: 1 error(s), 2 warning(s), 2 accepted by the baseline
  • In CI, install the same release and toolchain and run cargo tauten check. It also fails when a finding was fixed but the baseline still accepts it (TAU-R001); shrink the baseline in the same change.
  • Never run cargo tauten baseline in CI or regenerate the baseline to make a check pass. Recording more findings needs --allow-increase, a reviewed local change.
  • A lint check, not a proof gate. cargo tauten check runs no proof. A proof gate, tauten's or the project's own, stays a separate step.

Prove a kernel function

cargo tauten init --proofs <crate> --write sets up the gate. cargo tauten proofs runs it and records one outcome per claim. Without Docker or the image nothing is checked and nothing passes. What counts as proved: Proofs. To reuse one Lean module without the rest: Lean module only.

README.md

$ cargo tauten init --proofs my-kernel --write   # writes proofs/ (claims.toml, gate, Lean project)$ sh proofs/refresh.sh                           # translate the crate (Docker, pinned image)$ cargo tauten proofs                            # run the gate; one JSON outcome per claim

Tell the agent

cargo tauten init --write adds AGENTS.tauten.md. Point your AGENTS.md or CLAUDE.md at it.

AGENTS.tauten.md (first paragraph)

This workspace uses the tauten profile. `cargo tauten check` must pass beforeyou report a task as done. Run it with `--format json` to get one diagnosticper line; each has a rule `id`, the `file`/`line`, and a `fix`.`cargo tauten explain <ID>` prints the full rule.

The whole file

Commands

Parsed from crates/cargo-tauten/src/main.rs

cargo tauten check
    Run structural checks and clippy with the profile for each crate's tier
cargo tauten ship
    Before pushing: check, then the proof gate at ship level (only the mutants of claims whose inputs changed)
cargo tauten verify
    Run the cadence level: fast is check; ship adds the proof gate at ship level; full adds the whole proof gate (nightly, release)
cargo tauten baseline
    Record current error-level findings as the baseline (the ratchet)
cargo tauten init
    Propose a tier for every crate without one and write the agent profile; with --proofs <crate>, set up the proof tier for a kernel crate instead
cargo tauten new
    Write a fresh workspace laid out as the agent profile describes: a kernel crate with one proved claim, a core crate with a capability, #[effects] and one Evidence check, and a thin edge binary
cargo tauten proofs
    Run the project's proof gate (proofs/claims.toml) and print one JSON outcome per claim: proved, drift, build-failed, audit-failed, mutant-survived or tool-missing
cargo tauten obligations
    In kernel crates, list arithmetic and indexing findings (TAU-N001, TAU-N002, TAU-P003) as obligations: proved (subsumed by a recorded proof), open and baselined, or open
cargo tauten generated
    Regenerate every [[workspace.metadata.tauten.generated]] file and compare it byte for byte with the committed one: ok, drift or failed per entry (a missing output is never ok)
cargo tauten persisted
    The lock on the shape of persisted types (tauten-persisted.lock): status (exit 1 unless every declared shape is current), --record for new entries, --accept to record what happens to stored bytes when a shape changed
cargo tauten explain
    Explain a rule, e.g. cargo tauten explain TAU-P001; without an ID, list all rules
cargo tauten profile
    Print the generated clippy flags and clippy.toml for a tier

cargo tauten explain <ID> prints any rule; they are all on Rules.