provedone
API reference

provedone

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

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

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

Constants

checkedLine

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

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

checkIntent

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

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

criteria

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

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

decide

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

digest

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

doneLine

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

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

doneReport

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

ESCAPE_AFTER

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

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.

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

indexDrift

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

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

MODES

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.

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

program

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

recentBlocks

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

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.

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.

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

unevidenced

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

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

verdict

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

VERSION

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

const VERSION: string;

Interfaces

Check

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

CriterionReport

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

Decision

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

EvidenceRow

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

Finding

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

LogEntry

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

Receipt

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.

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

Verdict

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

Types

Mode

type Mode = (typeof MODES)[number];

On this page