import { type ChildProcess } from "node:child_process"; import type { ContainedValidationRequest, ContainedValidationResult, WorktreeCommitArtifact, WorktreeCommitProduceRequest, WorktreeCommitProductionControl, WorktreeCommitVerifyRequest } from "./types.js"; import type { ValidationBudgetRequest, ValidationOutcome } from "./validation-budget.js"; export type WorktreeCommitArtifactErrorCode = "invalid-request" | "invalid-state" | "validation-failed" | "git-failed" | "verification-failed"; export declare class WorktreeCommitArtifactError extends Error { readonly code: WorktreeCommitArtifactErrorCode; constructor(code: WorktreeCommitArtifactErrorCode, message: string); } export declare function resolveValidationExecutable(executable: string): Promise; export declare function terminateTree(child: ChildProcess, closed: Promise): Promise; /** Runs one bounded command without exposing output or performing Git mutations. */ export declare function runContainedValidation(request: ContainedValidationRequest, signal?: AbortSignal): Promise; /** Runtime-owned validation entry point. The bare helper above remains a library primitive. */ export declare function runBudgetedContainedValidation(request: ContainedValidationRequest, budget: { readonly request: ValidationBudgetRequest; readonly reserve: () => Promise<{ readonly decision: "ALLOW" | "SKIP" | "DENY"; readonly reservation_id: string | null; readonly reason: string; readonly reused?: ContainedValidationResult; }>; readonly settle: (outcome: ValidationOutcome, exitCode: number | null, duration_ms?: number) => Promise; }, signal?: AbortSignal): Promise; export declare function produceWorktreeCommitArtifact(request: WorktreeCommitProduceRequest, control?: WorktreeCommitProductionControl): Promise; /** * Managed workers cannot perform arbitrary Git mutations. Under that project threat model, the exact * generated commit proves that its producer crossed the validation-and-commit boundary. */ export declare function recoverWorktreeCommitArtifact(request: WorktreeCommitProduceRequest): Promise; export declare function verifyWorktreeCommitArtifact(request: WorktreeCommitVerifyRequest): Promise;