/** * The check that reads a declaration back and refuses when the tree moved. * * It hashes the bytes of every declared path. A commit does not change bytes, * so the check is commitment-invariant by construction rather than by way of a * git ref. A rename or a delete removes the path, and a rewrite changes its * hash; each is refused by name. A path that appears under a declared root and * was not declared is refused too, which is the one arm that needs a tree * listing rather than a hash. * * The listing is `git ls-files -c -o --exclude-standard`, which is invariant * under a commit: a commit redistributes tracked and untracked entries, it does * not change the set of files on disk. * * Absence rule, stated where the producer reads it: an artifact that is present * but carries no declaration is refused. There is no back-compat window, * because this check is reached only from a transition that a slice in flight * can re-run. */ import { type JudgedDeclaration } from './judged-declaration.js'; export type JudgedRefusal = { readonly code: string; readonly artifact: string; readonly path: string; }; export declare function describeJudgedRefusal(refusal: JudgedRefusal): string; export type JudgedCheckResult = { readonly refusals: readonly JudgedRefusal[]; readonly checked: number; }; /** Where the security audit artifact may live, newest tier first. */ export declare function securityArtifactTiers(rid: string): readonly string[]; export declare function resolveSecurityArtifact(projectRoot: string, sessionId: string, rid: string): { readonly relative: string; readonly absolute: string; } | null; type TreeListing = { readonly ok: true; readonly files: readonly string[]; } | { readonly ok: false; readonly detail: string; }; /** * List the files git knows about under a prefix. Fail-closed: a git read that * did not happen is reported, never returned as an empty list. */ export declare function listTreeFiles(projectRoot: string, prefix: string): TreeListing; /** Compare the declaration against the tree. Returns refusals, ordered by path. */ export declare function checkDeclarationAgainstTree(input: { readonly projectRoot: string; readonly artifact: string; readonly declaration: JudgedDeclaration; }): readonly JudgedRefusal[]; /** * Entry point for the transition gate. An artifact that is not there is not * this check's business — the artifact-existence prerequisite owns that. * * LIMIT, measured rather than assumed — the hole that survives is COMPLETENESS, * not tampering: the declaration is the producer's own statement, so ten files * touched and one declared passes. Nothing here can know what the producer did * not say. Rule: a declaration is a claim about the paths it names, never a * claim that those are all the paths. * * Absence rule, stated where the producer reads it, and the reason it is this * blunt: a security artifact that IS there must carry a declaration. No section * of the artifact turns the check off, because a requirement that any section * can switch off is not a requirement — an earlier draft of this file keyed the * requirement on a marker line in the coverage block, and deleting that block * (while keeping the declaration, and then rewriting a declared path) passed. * The cost is stated rather than hidden: an artifact written before this change * is refused until the audit is re-run, and the gate only fires on a * transition, so nothing already committed is affected. */ export declare function verifyJudgedDeclaration(input: { readonly projectRoot: string; readonly sessionId: string; readonly requestId: string; }): JudgedCheckResult; export {};