truepass
Every export of truepass, with its signature and doc comment: parseUnifiedDiff, unexplainedSnapshots, weakenedAssertions, MATCHER_RANK, check, createProgram and 1 more, plus 4 types.
truepass: what makes a test suite report green without the code passing.
import { parseUnifiedDiff, unexplainedSnapshots, weakenedAssertions, … } from 'truepass';Functions
check
function check(base: string, git: Git): Promise<Finding[]>;| Parameter | Type |
|---|---|
base | string |
git | Git |
Returns Promise<Finding[]>
createProgram
The program, over a given git: the real one in the bin, a fake one in the tests.
function createProgram(git: Git): import("burgee").Manifest;| Parameter | Type |
|---|---|
git | Git |
Returns import("burgee").Manifest
parseUnifiedDiff
Parse git diff --unified=0 output into files and hunks.
function parseUnifiedDiff(diff: string): FileDiff[];| Parameter | Type |
|---|---|
diff | string |
Returns FileDiff[]
unexplainedSnapshots
A changed snapshot needs a Snapshot: <reason> line in one of the range's
commit messages — updating a snapshot is how a wrong output becomes the
expected one, so the change has to say what it accepts.
function unexplainedSnapshots(changedPaths: string[], commitMessages: string): Finding[];| Parameter | Type |
|---|---|
changedPaths | string[] |
commitMessages | string |
Returns Finding[]
weakenedAssertions
Assertions on the same subject that moved to a weaker matcher. An
Assertion: <why> line in one of the range's commit messages accepts them.
function weakenedAssertions(files: FileDiff[], commitMessages: string): Finding[];| Parameter | Type |
|---|---|
files | FileDiff[] |
commitMessages | string |
Returns Finding[]
Constants
MATCHER_RANK
Strictness, strongest first. A change that moves an assertion on the same subject to a lower rank accepts more wrong answers than it did.
const MATCHER_RANK: Readonly<Record<string, number>>;program
const program: import("burgee").Manifest;Interfaces
ChangedLine
The two truepass checks a lint rule cannot make, because they are about what a change did rather than what a file says: an assertion moved to a weaker matcher, and a snapshot rewritten with no reason given.
interface ChangedLine {
line: number;
text: string;
}FileDiff
interface FileDiff {
path: string;
hunks: Hunk[];
}Finding
interface Finding {
check: 'weakened-assertion' | 'unexplained-snapshot';
path: string;
line: number;
message: string;
}Hunk
interface Hunk {
removed: ChangedLine[];
added: ChangedLine[];
}For agents
Give a coding agent truepass's findings in the form it can act on: messages that end in fix:, the --json envelope, --schema for the whole command line as data, an MCP server with diff as a read-only tool, and exit codes as the contract.
truepass/eslint
Every export of truepass/eslint, with its signature and doc comment: rules, plugin, configs, noFixedSleep, noFocusedTest, noTestRetry and 1 more.