Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tenet

Check code against requirements written in Markdown.

Install

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.

Check code

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 base

For 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 includes confidence. Unresolved contracts need follow-up but do not fail the command.

Read every applicable contract during a review. Tenet helps choose where to investigate first; the outer reviewer owns the final judgment. See Reviews.

Test contracts

tenet eval --contract database-failures
tenet eval fixtures/cache --case broken-cache-hit --strict

Evaluations compare judgments with expected answers. Use inline examples for a small code fragment, or repository fixtures for a full directory and optional patch. Expected answers are never sent to the model.

Review changes

tenet check --base origin/main --json > review.jsonl

A reviewer investigates failures and unresolved contracts with ordinary repository tools. 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.

Read commands, output, and reviewing with an agent. The same docs are at tenet-contracts.com/docs.

Build

cargo build --release --locked -p tenet
cargo install --path crates/tenet --locked

MIT.

About

Check code against Markdown contracts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages