/** * `openlore enforce` — the unified finding-enforcement gate (change: * add-finding-enforcement-policy). * * Collects governance findings from the installed sources, resolves each finding's * enforcement class through the single declared `.openlore/config.json` * `enforcement.policy` (with the legacy `blastRadius.block` / `impactCertificate.block` * sugar lowered onto it), and — in `--hook` mode — fails the commit ONLY when at * least one finding resolves to `blocking`. Findings are sorted by a stable key so * output is reproducible. Each source declares its default class; an `off`-classed * finding remains listed (silenced, not invisible). * * Sources: * - stale-decision-reference — always (cheap: a pure walk of the decision graph * + anchored references). * - blast-radius orphan patterns — collected only when the repo configured the * blast-radius guard (`blastRadius.block`) or named an orphan code in the policy, * because the briefing is diff-heavy. * - impact-certificate surfaces — collected only when the repo declared covering * surfaces, for the same reason. * * Blocking and frozen sources fail closed when their assessment cannot be completed. * Deterministic, no LLM (north star `c6d1ad07`). */ import { Command } from 'commander'; import { classifyFindings, type GovernanceFinding } from '../../core/services/mcp-handlers/enforcement-policy.js'; import { type CorpusIntentFinding } from '../../core/drift/corpus-intent-review.js'; import { type BlastRadiusBriefing } from '../../core/services/mcp-handlers/blast-radius.js'; import { type ImpactCertificate } from '../../core/services/mcp-handlers/impact-certificate.js'; import { type DecisionConstraintState } from '../../core/decisions/constraint-ledger.js'; import type { OpenLoreConfig } from '../../types/index.js'; export declare function installEnforcementHook(rootPath: string): Promise; export declare function uninstallEnforcementHook(rootPath: string): Promise; /** * Map a blast-radius briefing onto unified governance findings — one per orphan * pattern the briefing triggers. Reads the SAME uncapped `*.orphaned` counts the * legacy `blast-radius --hook` blocks on (`triggeredBlockPatterns`), so the gate * and the legacy hook block on exactly the same diffs. Pure; no I/O. */ export declare function blastRadiusFindings(b: BlastRadiusBriefing): GovernanceFinding[]; /** A partial drift pass may report findings, but it must never initialize or shrink orphan debt. */ export declare function blastRadiusAssessmentComplete(b: BlastRadiusBriefing): boolean; /** * Map an impact certificate onto unified governance findings — one per declared * surface severity the change opens a new path into. Reads the SAME * `newlyOpenedPaths[].surfaceSeverity` the legacy `impact-certificate --hook` * blocks on (`triggeredBlockSeverities`), grouped into the per-severity * `surface-` codes a policy can name, so the two block on identical diffs. * Deterministic: surfaces are sorted; the intrinsic severity reflects the actual * surface severity (info→info, warn→warning, critical→error). Pure; no I/O. */ export declare function impactCertificateFindings(cert: ImpactCertificate): GovernanceFinding[]; /** * Map an impact certificate's QUALIFIED negative claim onto a governance finding (change: * disclose-dynamic-boundary-regions). * * The spec's emission condition is narrow on purpose: a finding fires only where a conclusion * QUALIFIES or CAPS a verdict because of a site, never for a purely informational disclosure. That * is exactly what `newPathClaimQualified` marks — the certificate claimed "this change opens no new * path into any declared surface", and a reflective, computed, or container-resolved dispatch in * the diff is the construct that can open one without leaving an edge, so the claim is withheld. * A certificate that already reports an opened path, or one over a repository with no declared * surface, made no negative claim and emits nothing. * * ONE finding per capped conclusion, not one per site: the sites and the truncation receipt are * carried in the message, so a bounded disclosure never reads as the whole set. Advisory by * default, like every non-corpus code; the `info` severity rides the emitted finding, never the * registry. Pure; no I/O. */ export declare function dynamicBoundaryFindings(cert: ImpactCertificate): GovernanceFinding[]; /** Adapt source-rich corpus intent findings to the unified enforcement shape. */ export declare function corpusIntentGovernanceFindings(findings: readonly CorpusIntentFinding[]): GovernanceFinding[]; /** * Collect governance findings from every in-scope source, mapping each native * finding onto the unified {@link GovernanceFinding} shape. Source failures are * recorded per code: advisory policies keep their historical fail-soft behavior, * while affected frozen codes preserve baseline bytes and fail closed. */ export declare function collectGovernanceFindings(cwd: string, config: OpenLoreConfig | null, policy: Record, baseRef?: string): Promise<{ findings: GovernanceFinding[]; caveats: string[]; assessedCodes: Set; failedCodes: Set; decisionConstraints?: Pick; }>; export interface EnforceCliOptions { cwd?: string; gitRoot?: boolean; base?: string; json?: boolean; hook?: boolean; agentHook?: boolean; installHook?: boolean; uninstallHook?: boolean; /** Also write the classified findings as a SARIF 2.1.0 log to this path (transport only). */ sarif?: string; } export declare function runEnforceCli(opts: EnforceCliOptions): Promise; /** Concise Claude Code Stop-hook rendering: action first, one finding per line. */ export declare function renderAgentHook(result: ReturnType, caveats: readonly string[], infrastructureUnavailable?: boolean, configuredBlockingCodes?: ReadonlySet): string; export declare const enforceCommand: Command; //# sourceMappingURL=enforce.d.ts.map