> ## Documentation Index
> Fetch the complete documentation index at: https://docs.10et.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# tenet build

> Generate and run build agents from specs

Generate decomposed eval scripts and agent TOMLs from a spec, then run the Karpathy loop until the agent hits 100%.

## Usage

```bash theme={null}
# Generate from a spec file
tenet build --spec knowledge/MY_SPEC.md --name my-feature

# Generate from inline description
tenet build --name auth --files src/lib/auth.ts --desc "Create auth module with login/logout"

# List all build agents and scores
tenet build --list

# Run an existing build agent
tenet build --run my-feature

# Generate without running
tenet build --spec knowledge/SPEC.md --name my-feature --dry-run
```

## Options

| Flag                 | Description                                        |
| -------------------- | -------------------------------------------------- |
| `--spec <file>`      | Markdown spec file to generate eval from           |
| `--name <name>`      | Agent name (kebab-case)                            |
| `--files <files...>` | Target files the agent should create               |
| `--desc <text>`      | Inline description of what to build                |
| `--list`             | Show all build agents with their latest scores     |
| `--run <name>`       | Run an existing build agent (PP autoresearch loop) |
| `-r, --rounds <n>`   | Max rounds when running (default: 5)               |
| `--dry-run`          | Create eval + TOML files but don't start the agent |

## What It Generates

### Eval Script (`eval/build/<name>.ts`)

A TypeScript file with decomposed binary checks:

```typescript theme={null}
const checks = [
  { name: "file-exists", pass: existsSync(resolve("src/lib/auth.ts")) },
  { name: "exports-login", pass: fileContains("src/lib/auth.ts", "login") },
  { name: "type-Session", pass: fileContains("src/lib/auth.ts", "interface Session") },
  { name: "purpose-header", pass: fileContains("src/lib/auth.ts", "@purpose") },
  { name: "compiles", pass: tscPasses() },
]
// Score = passed / total (0.0 → 1.0)
```

### Agent TOML (`.tenet/agents/build-<name>.toml`)

```toml theme={null}
[agent]
name = "build-auth"
scope = "build"
metric = "spec_compliance"
direction = "maximize"
time_budget_seconds = 600

[eval]
script = "eval/build/auth.ts"

[task]
description = "Create src/lib/auth.ts with login(), logout()..."
```

## How It Works

1. **Parse** — extracts file paths, exports, interfaces from spec markdown
2. **Generate eval** — each spec requirement becomes a binary check
3. **Generate TOML** — agent config with scope, constraints, task
4. **Run** — PP autoresearch loop: try → eval → keep/revert → repeat
5. **Converge** — agent iterates until score = 1.0, then creates PR

<Info>
  The build supervisor monitors progress and injects hints when agents stall, hit filename mismatches, or repeatedly fail the same checks.
</Info>

## See Also

* [Build Evals Pattern](/learning/build-evals) — the full pattern with examples
* [Peter Parker](/agents/peter-parker) — the orchestrator that runs the loop
* [Eval System](/learning/evals) — how evals work in general
