/** * `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. Advisory by default: a repository that declares no policy * never blocks. An `off`-classed finding is still 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. * * Every source is advisory-safe: a throw degrades to a caveat and NEVER blocks a * commit. Deterministic, no LLM (north star `c6d1ad07`). */ import { Command } from 'commander'; import { type GovernanceFinding } from '../../core/services/mcp-handlers/enforcement-policy.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 { 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[]; /** * 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→warn, critical→error). Pure; no I/O. */ export declare function impactCertificateFindings(cert: ImpactCertificate): GovernanceFinding[]; /** * Collect governance findings from every in-scope source, mapping each native * finding onto the unified {@link GovernanceFinding} shape. Each source is * advisory-safe — a throw is recorded as a caveat and contributes no finding, * NEVER a block. Returns the findings plus any non-fatal source caveats. */ export declare function collectGovernanceFindings(cwd: string, config: OpenLoreConfig | null, policy: Record, baseRef?: string): Promise<{ findings: GovernanceFinding[]; caveats: string[]; }>; export interface EnforceCliOptions { cwd?: string; base?: string; json?: boolean; hook?: boolean; installHook?: boolean; uninstallHook?: boolean; } export declare function runEnforceCli(opts: EnforceCliOptions): Promise; export declare const enforceCommand: Command; //# sourceMappingURL=enforce.d.ts.map