Check code against requirements written in Markdown.
curl -fsSL https://tenet-contracts.com/install.sh | bash
export OPENROUTER_API_KEY='your-key'Binaries support macOS and Linux on ARM64 and x86-64. Provider setup also covers TypeSafe.
Write numbered contracts under .contracts/, then run:
tenet validate # Check contract documents offline
tenet check # Assess the current repository
tenet check --base origin/main # Assess changes, assuming a valid baseFor example, a contract can require database failures to reach the caller rather than become empty results.
Tenet checks relevant files and their combined context, then reports one conclusion per contract.
Each model conclusion preserves raw confidence separately from routing. A model's failed or unresolved conclusion stays pending, with exit 4, until a reviewer records one.
Selected-path checks assess their combined evidence and can report clear without claiming full contract verification.
Install shared contracts from the public tenet-contracts library:
tenet contracts add tenet/data-and-apis --scope packages/api
tenet contracts update # Take later releases, keeping local editsSee Guidance for local adaptations and conflicts.
Read every applicable contract during a review. Tenet helps choose where to investigate first; the outer reviewer owns the final judgment. See Reviews.
tenet check --base origin/main # Assess the change and append a revision to .tenet/
tenet status # Settled and pending contracts, without a model
tenet show database-failures # The model's answer, history, and the record command
tenet record database-failures --conclusion failed --evidence src/query.ts:40-52 -m "returns [] on failure"A reviewer investigates pending contracts with ordinary repository tools and records a conclusion for each. A record is bound to the exact code it judged; editing a scoped file makes it outdated. Model judgments can be wrong; a successful exit does not mean every contract was verified. Selected code and contract rules go to the configured provider, using your API key.
Use tenet export to export selected contracts and source offline for a review or a focused question.
Read commands, output, and reviewing with an agent. The same docs are at tenet-contracts.com/docs.
cargo build --release --locked -p tenet
cargo install --path crates/tenet --lockedMIT.