import type { Gate, GateProvenance } from '@manehorizons/cadence-types'; import type { GateImpl, SettleAccumulator, SettleContext } from './types.js'; /** * The settle-dispatched gate subset (Phase 44.1). The four 39.7 gates * (`coherence-check`, `approve`, `plan-review`, `per-task-verify`) fire in * DRAFT/BUILD with their own `DraftGateImpl`/`BuildGateImpl` shapes, and * `anomaly-notify` is a post-gates notify predicate, not a dispatched gate — so * none of them belong in this `GateImpl` registry. Excluding them at the type * level is what makes `GATE_REGISTRY` total over exactly what settle runs. */ export type SettleGate = Exclude; export interface GateEntry { readonly impl: GateImpl; /** * Invoked unconditionally — the impl self-guards on `opts.* OR membership` * and no-ops when not requested. `deep-verify` (`--deep`) and * `interactive-verdict` (`--interactive`) can fire WITHOUT the gate being in * the set; `boundary-scan` (Phase 156) instead self-guards on * `effectiveBoundaryEnforcement === 'block'`, orthogonal to gate-set * membership entirely. A pure membership intersection would drop all three. */ readonly selfGuarded?: boolean; } /** * Total over `SettleGate` — a missing entry is a COMPILE error. The single * source of truth for which settle gates exist; `GATE_ORDER` owns the order. */ export declare const GATE_REGISTRY: Record; /** * Canonical settle EXECUTION order — cheap→expensive, so the first refusal is * the cheapest. This is NOT the gate-matrix order (`[...ALWAYS_FIRE, ...DELTAS]` * in engine.ts): settle runs deep-verify before code-review, draft-read before * coverage, etc. The driver walks THIS, never `gateSet.gates` array order. * `boundary-scan` sits right after `structural-verifier` — early, no external * services, cheap to no-op when not in `block` mode. */ export declare const GATE_ORDER: SettleGate[]; export interface RunGatesResult { readonly acc: SettleAccumulator; readonly refused: boolean; /** Phase 140: per-gate ran/skipped provenance, in GATE_ORDER. Partial on * refusal — only entries computed before the halting gate. */ readonly gates: GateProvenance[]; } /** * Drive the settle gate sequence (Phase 44.1). Walks `GATE_ORDER`, invoking a * gate iff it is `selfGuarded` or present in `ctx.gateSet.gates`, merging each * `GateResult` into the accumulator. The first refusing gate halts the loop — * it has already written its own stderr; the caller sets `process.exitCode`. * Bit-identical to the former hand-wired settle.ts dispatch block. * * Phase 176: a gate impl that throws (rather than returning `{outcome: * 'refuse'}`) is caught here and normalized into the same refuse path, so * settle.ts's refusal branch always gets a chance to persist a SUMMARY — * previously only `security-audit` self-normalized its own throws this way; * every other gate's throw escaped uncaught to settle.ts's outer catch, which * writes no SUMMARY at all. * * `deps` is a test seam (production callers pass only `ctx`): it lets a test * drive the real loop over recording stubs. The defaults ARE the real registry * and order — the object identity wired here is what settle runs. */ export declare function runSettleGates(ctx: SettleContext, deps?: { registry?: Record; order?: SettleGate[]; }): Promise; //# sourceMappingURL=registry.d.ts.map