import type { CompiledRule, Gate2Eligibility, LegitimacyProjectionSkip, PerRuleControlResult, ProvenanceRecord, RuleFiring, WindtunnelVerdict } from '@mmnto/totem'; export interface CertPersistInput { /** The scorer verdict for this run. */ verdict: WindtunnelVerdict; /** Firings the verdict was computed over (for the C1 control map + report). */ firings: RuleFiring[]; /** Minted (active) rule ids the scorer evaluated. */ mintedRuleIds: string[]; /** Positive-control targets (for the per-rule control map). */ positiveControlTargets: Array<{ pr: number; targetRuleId: string; }>; /** Candidate compiled rules eligible for stamping (the corpus rules). */ candidates: CompiledRule[]; /** Mining provenance per rule (lessonHash → provenance). */ provenanceByRule: Map; /** * Where PASS-survivors are written (the cert OUTPUT compiled-rules file under * the gate-1 dir — NOT the repo's live `.totem/compiled-rules.json`, which the * strategy#516 populator owns). Required: no default to the live corpus, so a * cert run can never clobber it. */ certifiedRulesOutPath: string; /** Directory for the transient cert-run report (§6 L3). */ reportDir: string; /** Injected ISO timestamp (report filename + body) — keeps the call testable. */ nowIso: string; /** Corpus identity for the report (the lock's asOfCommit). */ asOfCommit: string; /** * ADR-112 §5.3 Slice D4 (strategy Q2) — the downstream, VERDICT-INERT Gate-2-eligible * set for an authored run (`survivors ∩ {heldOut>0}`, §1(k)-guarded + illegitimate-window * disqualifier). Absent on mined runs. Persisted as a top-level report field (a sibling of * `verdict`, NOT folded into it): it is DERIVED from the verdict, never part of it, so the * durable artifact keeps the two altitudes legibly separate. */ gate2?: Gate2Eligibility; /** * Option-(i) ruling (#2291, operator 2026-07-04) — the AUTHORED C1 map, computed * at the §8 single home from the §4 differential HELD AT EMISSION. When present * it REPLACES the mined fire-on-target derivation below (which is structurally * unsatisfiable for pre-window anchors, §5.2). Absent on mined runs — the mined * derivation stays byte-unchanged. */ perRuleControls?: Map; } export interface CertPersistResult { /** True iff PASS-survivors were written to the cert output (PASS only). */ persisted: boolean; /** Number of survivor rules stamped + written. */ stampedCount: number; /** Absolute path of the transient cert-run report. */ reportPath: string; /** Path of the written cert rules file (only when persisted). */ certifiedRulesPath?: string; /** Projection skips (non-survivors / missing-provenance / verdict-not-pass). */ skips: LegitimacyProjectionSkip[]; } /** * The certifying-run persistence boundary (§6 L3 + bindings 1+4). * * 1. Computes the C1 per-rule control map from the firings (survivor-only). * 2. fold-B `projectLegitimacy`: stamps survivors PASS-only, from their OWN * control results (never the global nonVacuity); non-PASS stamps nothing. * 3. fold-C `buildCertifiedRulesFile`: parses the payload BEFORE any write, so a * half-stamp fails loud pre-disk. On PASS with ≥1 survivor, the validated * file is written to `certifiedRulesOutPath` (the cert OUTPUT, never the live * corpus — strategy#516 promotes from here). * 4. Always writes a transient cert-run report (verdict + skips + cull ledger + * needs-adjudication + exposure) under `reportDir` — including for non-PASS * runs, which write a report but NO rules (L3: non-terminals never reach the * corpus). * * The clock + paths are injected so the whole step is deterministically testable * with a tmpdir, no real lock required. */ export declare function persistCertifyingOutcome(input: CertPersistInput): Promise; //# sourceMappingURL=spine-cert-persist.d.ts.map