import type { AgentNarrativeEvidence, DeterministicGateResult, DeterministicGateAudit, EvidenceArtifactPath, EvidenceCommandReference, EvidenceOutputSnippet, EvidenceOutcome, EvidenceStatusBreakdown, EvidenceSummary, FixLoopAttemptEvidence, NarrativeAuditRecord, RoutingAuditRecord, RunStatus, StepEvent, StepStatus, VerificationCaptureParams, VerificationResult, WorkflowArtifactReference, WorkflowLogReference, WorkflowRoutingEvidence, WorkflowRunEvidence, WorkflowStepEvidence } from './types.js';
export interface CreateRunParams {
    runId: string;
    workflowId: string;
    workflowName: string;
    routing?: Omit<WorkflowRoutingEvidence, 'recordedAt'>;
}
export interface CreateStepParams {
    stepId: string;
    stepName: string;
    agentRole?: string;
    routing?: Omit<WorkflowRoutingEvidence, 'recordedAt'>;
}
export interface GateParams {
    gateName: string;
    verifications: VerificationResult[];
    command?: string;
    exitCode?: number;
    stdoutExcerpt?: string;
    stderrExcerpt?: string;
    outputExcerpt?: string;
    artifacts?: WorkflowArtifactReference[];
}
export interface RetryParams {
    attempt: number;
    status: StepStatus;
    startedAt?: string;
    completedAt?: string;
    error?: string;
    command?: string;
    exitCode?: number;
    stdoutExcerpt?: string;
    stderrExcerpt?: string;
    outputExcerpt?: string;
    verifications?: VerificationResult[];
    artifacts?: WorkflowArtifactReference[];
}
export interface CompleteRunParams {
    status?: RunStatus;
    finalSignoffPath?: string;
}
/** Create a fresh run evidence record in pending state. */
export declare function createRunEvidence(params: CreateRunParams): WorkflowRunEvidence;
/** Create a fresh step evidence record in pending state. */
export declare function createStepEvidence(params: CreateStepParams): WorkflowStepEvidence;
/** Create a verification record with command evidence and a timestamp. */
export declare function createVerificationResult(params: VerificationCaptureParams): VerificationResult;
/** Append an event to a step, returning updated step evidence. */
export declare function appendStepEvent(step: WorkflowStepEvidence, event: StepEvent): WorkflowStepEvidence;
/** Record a deterministic verification gate against the run, optionally against a step.
 *  When stepId is provided, the gate is stored only on the matching step to
 *  avoid duplicate evidence in downstream collectors that traverse both
 *  run.deterministicGates and step.deterministicGates. */
export declare function recordDeterministicGate(run: WorkflowRunEvidence, gateOrName: GateParams | string, verifications?: VerificationResult[], stepId?: string): {
    gate: DeterministicGateResult;
    run: WorkflowRunEvidence;
};
/** Build a deterministic gate record from command and verification evidence. */
export declare function createDeterministicGate(params: GateParams): DeterministicGateResult;
/** Attach an artifact reference to a step. */
export declare function attachArtifact(step: WorkflowStepEvidence, artifact: WorkflowArtifactReference): WorkflowStepEvidence;
/** Attach an artifact reference produced at run scope. */
export declare function attachRunArtifact(run: WorkflowRunEvidence, artifact: WorkflowArtifactReference): WorkflowRunEvidence;
/** Attach a log reference to the run. */
export declare function attachRunLog(run: WorkflowRunEvidence, log: WorkflowLogReference): WorkflowRunEvidence;
/** Record a workflow abstraction or execution routing decision on the run. */
export declare function recordRoutingDecision(run: WorkflowRunEvidence, route: Omit<WorkflowRoutingEvidence, 'recordedAt'>): WorkflowRunEvidence;
/** Append agent narrative output without mixing it into deterministic gates. */
export declare function appendRunNarrative(run: WorkflowRunEvidence, narrative: Omit<AgentNarrativeEvidence, 'recordedAt'>): WorkflowRunEvidence;
/** Mark a step as complete with a terminal status. Rejects non-terminal statuses. */
export declare function completeStep(step: WorkflowStepEvidence, status: StepStatus): WorkflowStepEvidence;
/** Derive run status from step statuses and deterministic gates, then mark the run as complete.
 *
 *  When `params.status` is provided it overrides step-derived status. The
 *  caller assumes authority — a failed step can be masked by `status: 'passed'`
 *  if all deterministic gates also pass. This is intentional: the coordinator
 *  may have external knowledge (e.g. manual override) that justifies the
 *  upgrade. Deterministic gate downgrade still applies after the override. */
export declare function completeRun(run: WorkflowRunEvidence, params?: CompleteRunParams): WorkflowRunEvidence;
/** Produce a condensed summary from run evidence. */
export declare function summarizeEvidence(run: WorkflowRunEvidence): EvidenceSummary;
/** Build the structured runtime view used for reports, fix loops, and audit trails. */
export declare function buildEvidenceOutcome(run: WorkflowRunEvidence): EvidenceOutcome;
/** Bucket explicit run and step statuses for reports and fix-loop routing. */
export declare function buildStatusBreakdown(run: WorkflowRunEvidence): EvidenceStatusBreakdown;
/** Collect verification, gate, and retry commands with exit codes and snippets. */
export declare function collectEvidenceCommands(run: WorkflowRunEvidence): EvidenceCommandReference[];
/** Collect produced artifact paths from run, step, and deterministic gate evidence. */
export declare function collectArtifactPaths(run: WorkflowRunEvidence): EvidenceArtifactPath[];
/** Collect retry attempts as fix-loop evidence with commands, outputs, and artifacts intact. */
export declare function collectFixLoopAttempts(run: WorkflowRunEvidence): FixLoopAttemptEvidence[];
/** Audit deterministic gates independently from narrative agent output. */
export declare function auditDeterministicGates(run: WorkflowRunEvidence): DeterministicGateAudit[];
/** Audit workflow abstraction and execution routing decisions. */
export declare function auditRoutingEvidence(run: WorkflowRunEvidence): RoutingAuditRecord[];
/** Audit narrative separately so reports can include it without trusting it as a gate. */
export declare function auditNarrativeEvidence(run: WorkflowRunEvidence): NarrativeAuditRecord[];
/** Collect relevant command, log, and step error snippets for reporting. */
export declare function collectOutputSnippets(run: WorkflowRunEvidence): EvidenceOutputSnippet[];
