/** * src/gates/output-contracts.ts — output contract data + validation gates, * ported verbatim from the ZOB harness delegation output contracts. * * Contract data and validation logic are PURE. `readReferencedArtifacts` * performs fs reads (STATEFUL) but only when a `repoRoot` is supplied, keeping * the pure validation path fs-free and testable. `applyChildGates` mutates the * ChildResult in place, matching the harness exactly. Zero @earendil-works/*. */ import type { ChildResult, OutputGateIssue } from "../core/types.js"; export declare const OUTPUT_GATE_ISSUE_CODES: readonly ["empty_output", "unknown_contract", "invalid_requirement_pattern", "missing_final_marker", "missing_requirement", "deliverable_rejected", "mismatched_todo_id", "stale_child_goal_binding", "mismatched_delegation_attempt"]; interface OutputContractValidationOptions { repoRoot?: string; maxArtifactBytes?: number; /** Exact canonical TODO id bound by parent preflight for TODO-linked child output. */ expectedTodoId?: string; } export declare function listOutputContracts(): string[]; export declare function getOutputContractDefinitions(): Array<{ id: string; required: string[]; }>; export declare function getOutputContractFinalMarker(contractId: string): string | undefined; export declare function inferOutputContract(agentName: string): string; export declare function validateOutputContractId(contractId: string | undefined): string[]; export declare function validateOutputContractIssues(output: string, contractId: string, options?: OutputContractValidationOptions): OutputGateIssue[]; export declare function validateOutputContract(output: string, contractId: string, options?: OutputContractValidationOptions): string[]; export declare function validateChildOutputIssues(result: ChildResult, contractId?: string, options?: OutputContractValidationOptions): OutputGateIssue[]; export declare function validateChildOutput(result: ChildResult, contractId?: string, options?: OutputContractValidationOptions): string[]; export declare function applyChildGates(result: ChildResult, options?: OutputContractValidationOptions): ChildResult; export {};