# provedone

> Every export of provedone, with its signature and doc comment: program, VERSION, decide, ESCAPE_AFTER, MODES, recentBlocks and 13 more, plus 10 types.

Source: https://provedone.interlace.tools/docs/api

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

provedone's library surface: the pure pieces its commands are built from, for a host that runs them itself.

```ts
import { program, VERSION, decide, … } from 'provedone';
```

## Constants

### checkedLine

The PR's `Checked:` line: each command and how it ended, then what was not checked.

```ts
const checkedLine: (receipt: Receipt) => string;
```

### checkIntent

Every finding for one intent: its `intent.md` text and, when it has one, its `spec.md` text.

```ts
const checkIntent: (slug: string, intent: string, spec: string | undefined) => Finding[];
```

### criteria

The success criteria of an intent, in order, numbered from 1.

```ts
const criteria: (intent: string) => string[];
```

### decide

```ts
const decide: (mode: Mode, verdict: Verdict, log: readonly LogEntry[], session: string) => Decision;
```

### digest

```ts
const digest: (output: string) => string;
```

### doneLine

The `Checked:` line of a done report: each criterion met and by what, then each one not.

```ts
const doneLine: (report: readonly CriterionReport[]) => string;
```

### doneReport

```ts
const doneReport: ({ slug, criteria, rows, stamps, branch }: DoneInput) => CriterionReport[];
```

### ESCAPE_AFTER

Blocks in one session after which the next run passes, logged.

```ts
const ESCAPE_AFTER = 2;
```

### evidenceRows

Each row of an evidence table (`| Criterion | Command… | Output |`). `command` is set only when
the cell is one code span and nothing else: a plain shell command (spec R3). Anything with prose
around it is a description of what ran, which cannot be re-run, and says so as `undefined`.

```ts
const evidenceRows: (intent: string) => EvidenceRow[];
```

### indexDrift

One finding per index row of `readme` whose status cell disagrees with the intent's own header.

```ts
const indexDrift: (readme: string, statuses: ReadonlyMap<string, string | undefined>) => Finding[];
```

### MODES

```ts
const MODES: readonly ["off", "observe", "enforce"];
```

### prBlock

The "How this was checked" block for a PR body: the `Checked:` line, then the trailers, which the gate reads.

```ts
const prBlock: (receipt: Receipt) => string;
```

### program

```ts
const program: import("burgee").Manifest;
```

### recentBlocks

The blocks in `session` since its last run that was not blocked.

```ts
const recentBlocks: (log: readonly LogEntry[], session: string) => number;
```

### sessionOf

The session a block counts against: the agent's session id when the environment names one, else the branch.

```ts
const sessionOf: (env: Readonly<Record<string, string | undefined>>, branch: string) => string;
```

### trailers

The commit trailers: one `Verified-by:` per check (or one `none`), one `Captured:` per path, one `Not-checked:` per gap, each folded to fit commitlint's footer width.

```ts
const trailers: (receipt: Receipt) => string[];
```

### unevidenced

True when a shipped intent records no evidence: no `## Shipped`, no `## Restated`, no evidence table.

```ts
const unevidenced: (intent: string) => boolean;
```

### verdict

```ts
const verdict: (message: string) => Verdict;
```

### VERSION

The installed package's version, read from the manifest beside dist/ so `--version` cannot drift.

```ts
const VERSION: string;
```

## Interfaces

### Check

```ts
interface Check {
    readonly command: string;
    readonly exit: number;
    readonly digest: string;
}
```

### CriterionReport

```ts
interface CriterionReport {
    readonly n: number;
    readonly criterion: string;
    readonly commands: readonly string[];
    readonly fix?: string;
}
```

### Decision

```ts
interface Decision {
    readonly blocked: boolean;
    readonly bypass: boolean;
}
```

### EvidenceRow

```ts
interface EvidenceRow {
    readonly criterion: string;
    readonly command: string | undefined;
    readonly output: string;
}
```

### Finding

```ts
interface Finding {
    readonly intent: string;
    readonly rule: string;
    readonly message: string;
    readonly fix: string;
}
```

### LogEntry

```ts
interface LogEntry {
    readonly at: string;
    readonly session: string;
    readonly mode: Mode;
    readonly ok: boolean;
    readonly blocked: boolean;
    readonly bypass: boolean;
    readonly reason: string;
}
```

### Receipt

```ts
interface Receipt {
    readonly checks: readonly Check[];
    readonly captures: readonly string[];
    readonly notChecked: readonly string[];
    /** Set only on `Verified-by: none (<reason>)`. */
    readonly none?: string;
}
```

### Stamp

One stamped command, as the store keeps it.

```ts
interface Stamp {
    readonly branch: string;
    readonly at: string;
    readonly command: string;
    readonly exit: number;
    readonly digest: string;
    readonly intent?: string;
    readonly criterion?: number;
}
```

### Verdict

```ts
interface Verdict {
    readonly ok: boolean;
    readonly reason: string;
    readonly fix?: string;
}
```

## Types

### Mode

```ts
type Mode = (typeof MODES)[number];
```
