import type { FabricDispatchReceipt } from "../types.js"; import type { StatusCacheDispatchEntry } from "../../status/types.js"; import type { FabricDigestInputs } from "./receipt.js"; import type { ChecklistReportInput, FabricResultFinding, FabricWorkerResult, NodeAddress, RefreshRequest } from "../../status/types.js"; import { type FabricRunDependencies, type FabricRunOptions, type FabricRunReceipt, type FabricRunResult } from "./run.js"; export declare const FABRIC_WORKER_RESULT_SCHEMA: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["changedPaths", "commit", "evidence", "checklist", "gaps"]; readonly properties: { readonly changedPaths: { readonly type: "array"; readonly uniqueItems: true; readonly items: { readonly type: "string"; readonly minLength: 1; }; }; readonly commit: { readonly type: "string"; readonly pattern: "^[0-9a-f]{40}$"; }; readonly evidence: { readonly type: "string"; readonly minLength: 1; }; readonly checklist: { readonly type: "array"; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["index", "done"]; readonly properties: { readonly index: { readonly type: "integer"; readonly minimum: 0; }; readonly done: { readonly type: "boolean"; }; }; }; }; readonly gaps: { readonly type: "string"; }; }; }; export type FabricWorkerResultValidation = { readonly ok: true; readonly value: FabricWorkerResult; } | { readonly ok: false; readonly finding: FabricResultFinding; }; /** Validate direct schema output, not generated text or an arbitrary JSON fragment. */ export declare function validateFabricWorkerResult(value: unknown): FabricWorkerResultValidation; export type StructuredFabricRunResult = { readonly status: "completed"; readonly receipt: FabricRunReceipt; readonly workerResult: FabricWorkerResult; } | { readonly status: "invalid"; readonly receipt: FabricRunReceipt; readonly finding: FabricResultFinding; } | { readonly status: "failed"; readonly runResult: Exclude; }; /** Always supplies the worker schema; callers cannot replace it with a looser one. */ export declare function dispatchStructuredFabricRun(options: Omit, dependencies: FabricRunDependencies): Promise; /** Only read artifacts within the owning cache; persisted accounting is untrusted. */ export declare function readFabricDispatchResult(entry: StatusCacheDispatchEntry, cachePath: string, dispatchRoot?: string): Promise<{ readonly receipt: FabricDispatchReceipt; readonly workerResult: FabricWorkerResult; readonly digestInputs: FabricDigestInputs; } | undefined>; /** Explicit inputs for independent verification/status; worker claims do not mark done. */ export declare function fabricResultInputs(result: FabricWorkerResult, worktreePath: string, nodeAddress: NodeAddress): { readonly verify: { readonly worktreePath: string; readonly expectedCommit: string; readonly checklistReports: readonly ChecklistReportInput[]; }; readonly status: { readonly worktreePath: string; readonly expectedCommit: string; readonly refresh: RefreshRequest; }; };