/** * Compliance gate criterion, computed at the command layer after `evaluateGate`. * * Follows the convention `knowledge/`, `traceability/` and `tasks/` established: a * `gate-criterion.ts` per concern, exporting an evaluator plus message helpers, and * registered at both wiring sites. `core/gate.ts` and `core/lifecycle.ts` are not * modified at all. * * Two properties matter more than the coverage arithmetic: * * **A project with no pack installed sees nothing.** The evaluator returns `null`, * the command layer assigns no field, and behaviour is what it was before this * feature existed. That is the constraint the whole design is organised around, and * `null` is the mechanism. * * **Advisory is the default.** Findings are computed and reported whether or not * enforcement is on; only `compliance.enforce: true` turns them into gate failures. * Because control findings live in their own stream, the pre-existing review gate * never sees them, so advisory costs no change to gate logic. * * Coverage is measured over the **effective** required artifacts, not the template's * raw list. The repo is already inconsistent here — `checkRequiredArtifacts` applies * the legacy `tasks.md` filter and `checkReviewGate` does not — and using the raw * list would block a pre-existing design-phase instance from transitioning under * enforcement until someone wrote a compliance file for an artifact the * required-artifacts gate agrees is optional. * * Requirements: compliance-packs/AC-25, AC-26, AC-55, AC-56, AC-62, AC-82 */ import type { Blocker, WorkflowTemplate } from '../core/types.js'; import type { Control } from './types.js'; /** One control that applies to the phase under evaluation. */ export interface ApplicableControl { packId: string; control: Control; } /** A control that no artifact accounted for. */ export interface UncoveredControl { controlId: string; artifact: string; } /** A critical control finding left open. */ export interface OpenCriticalControl { controlId: string; findingId: string; artifact: string; } /** Outcome of the compliance criterion for one phase. */ export interface ComplianceResult { /** Packs consulted, by id. */ packs: string[]; /** Whether `compliance.enforce` is on. Drives failure, never computation. */ enforce: boolean; /** Controls applying to this phase. */ applicable: string[]; /** Artifacts whose coverage was measured. */ artifacts: string[]; /** Control/artifact pairs with neither a finding nor a cleared line. */ uncovered: UncoveredControl[]; /** Critical control findings still open. */ openCritical: OpenCriticalControl[]; /** Non-fatal problems: unparseable lines, packs that no longer resolve. */ warnings: string[]; } /** Message for a control no artifact accounted for. */ export declare function uncoveredControlMessage(controlId: string, artifact: string): string; /** Message for an open critical control finding. */ export declare function criticalControlMessage(controlId: string, findingId: string): string; /** Message for an installed pack that will not load. */ export declare function packLoadErrorMessage(packId: string, detail: string): string; /** * Evaluate the compliance criterion for one phase. * * @returns `null` when the criterion does not apply — no pack installed, or no * control applies to this phase. Never an empty result standing in for "off": * the command layer distinguishes the two by the null. */ export declare function evaluateComplianceCriterion(projectRoot: string, instanceName: string, phaseName: string, template: WorkflowTemplate | null): ComplianceResult | null; /** * The gate failures a result implies. * * Empty unless `enforce` is on. Advisory mode still produces the result — the * findings are recorded and reported — it simply produces no failures, which is the * whole meaning of advisory. */ export declare function complianceFailures(result: ComplianceResult): string[]; /** * The same failures, each with what it is about — the shape the `Next steps:` * block is built from (say-what-to-do-next/AC-7). One list, so the reasons and * the remedies cannot disagree about which failures exist. */ export declare function complianceViolations(result: ComplianceResult): { reason: string; blocker: Blocker; }[]; //# sourceMappingURL=gate-criterion.d.ts.map