/** * The machine-readable declaration of what an audit judged. * * `## Red-line scope` in the RD request is prose for a human and is read by no * machine here. The declaration is the only machine-read statement of a * slice's surface, and the producer that emits the artifact writes it, so a * caller cannot produce the artifact without one. * * Grammar — exactly one fenced json block under the heading `## Judged content`: * * ## Judged content * * ```json * {"schemaVersion":1,"judgedAt":"2026-10-13T00:00:00.000Z","handoffHash":"unknown", * "files":[{"path":"src/a.ts","sha256":"<64 hex>"}], * "roots":[{"path":"src/dir","why":""}]} * ``` * * Rules. No backslash anywhere in the block: JSON resolves an escaped spelling * to the same string, so a raw reader and a parsing reader could disagree about * what was declared. A `path` is a relative POSIX path with no `..` and no * leading slash; `files` is non-empty; a duplicate path is refused. A root * entry must carry a non-empty `why` — a bare directory root is refused. * * LIMIT, recorded rather than fixed: any rule keyed on a self-reported field is * closed against accidental shedding, and not against a producer that rewrites * its own field. */ export declare const JUDGED_HEADING = "## Judged content"; export declare const JUDGED_SCHEMA_VERSION = 1; export type JudgedFile = { readonly path: string; readonly sha256: string; }; export type JudgedRoot = { readonly path: string; readonly why: string; }; export type JudgedDeclaration = { readonly schemaVersion: number; readonly judgedAt: string; readonly handoffHash: string; readonly files: readonly JudgedFile[]; readonly roots: readonly JudgedRoot[]; }; export type JudgedParseFailure = { readonly ok: false; readonly code: string; readonly detail: string; }; export type JudgedParseResult = { readonly ok: true; readonly declaration: JudgedDeclaration; } | JudgedParseFailure; /** * The audit service's detect result when the declaration cannot be built. It * lives here so the producer can substitute it for the probe's verdict without * growing the service's own branch count. */ export declare function declarationMissingDetect(detect: { readonly handoffPresent: boolean; readonly templatePresent: boolean; }, failure: JudgedParseFailure): { readonly state: 'declaration-missing'; readonly handoffPresent: boolean; readonly templatePresent: boolean; readonly warnings: readonly string[]; readonly nextActions: readonly string[]; }; export type Sha256Result = { readonly ok: true; readonly sha256: string; } | { readonly ok: false; readonly code: 'missing' | 'unreadable'; readonly detail: string; }; /** Hash the bytes of one file. A missing file is reported, never guessed. */ export declare function sha256OfFile(absPath: string): Sha256Result; /** A declared path is a relative POSIX path pointing at one file. */ export declare function validateDeclaredPath(raw: unknown): { ok: true; path: string; } | { ok: false; detail: string; }; /** Render the declaration as the artifact section the check reads back. */ export declare function renderJudgedDeclaration(declaration: JudgedDeclaration): string; /** * Parse the declaration out of an artifact body. Strict on shape: a block that * parses to something other than the grammar is a refusal, never a default. */ export declare function parseJudgedDeclaration(body: string): JudgedParseResult;