/** * Invariant-registry walker for `cleo doctor --audit-invariants` (T10340). * * Iterates the central `INVARIANTS_REGISTRY` from `@cleocode/contracts` * (assembled by Saga T10326 R1-R5 — ADR-073 I1-I8 + ADR-070 ORC-001..014 + * ADR-056 D1-D6) and produces one {@link InvariantAuditEntry} per registered * invariant. Entries whose `runtimeGate` resolves to a "scan current DB" * audit adapter (today: ADR-073 sagas via `auditSagaHierarchy`) execute * the adapter and forward violations into the entry. Entries whose * runtime gates are spawn-bound, session-bound, or release-tag-bound (the * majority of ADR-070 ORC codes + ADR-056 D5) report `not-applicable` * with the gate location so operators can see the gap end-to-end. Entries * with `runtimeGate: null` report `documented` so the gap analysis (how * many invariants ARE registry-only) is visible in `--json` output. * * Design: * - **Read-only.** Performs zero writes against `.cleo/tasks.db`. * - **Adapter-pluggable.** New per-ADR adapters land via the * `ADAPTERS` map below; the walker code is invariant-shape-agnostic. * - **DRY.** The same `auditRegistryEntry` primitive feeds both the * `--audit-invariants` registry walk AND the focused `--audit-sagas` * alias (which filters to ADR-073 only). * * @task T10340 — R6: cleo doctor --audit-invariants * @epic T10327 — E-INVARIANT-REGISTRY-SSOT * @saga T10326 — SG-SUBSTRATE-RECONCILIATION * @see packages/contracts/src/invariants/index.ts — registry SSoT * @see packages/core/src/doctor/saga-audit.ts — ADR-073 adapter (consumed) */ import type { InvariantAuditResult } from '@cleocode/contracts'; /** * Walk the central invariants registry and audit every entry against the * project's current `.cleo/tasks.db` state. * * Read-only. Safe to invoke without any `--fix`-style flag. * * @param projectRoot - Absolute path to the project root. * @param options - Optional filters. Pass `{adrFilter: 'ADR-073'}` to * restrict the walk to one ADR (used by `--audit-sagas`). * @returns Aggregated {@link InvariantAuditResult}. * * @example * ```typescript * const audit = await auditInvariantRegistry(projectRoot); * if (audit.errorCount > 0) process.exitCode = 2; * for (const entry of audit.entries) { * if (entry.status === 'fail') { * for (const v of entry.violations) console.log(v.message); * } * } * ``` */ export declare function auditInvariantRegistry(projectRoot: string, options?: { adrFilter?: string; }): Promise; //# sourceMappingURL=invariant-audit.d.ts.map