import { type NormalFormWitness } from "../entropy/normal-form.js"; import { type FabricExecutionFailureStageV1, type FabricExecutionOutcomeV1, type FabricExecutionTraceV1, type FabricTraceJsonValue } from "./trace-schema.js"; export * from "./trace-schema.js"; interface MutableCounts { droppedValues: number; truncatedValues: number; redactedValues: number; } interface TraceResultMeta { resultTruncated?: boolean; } interface Sanitized { value: T; counts: MutableCounts; } interface MutableOperation { type: "call"; sequence: number; ref: string; projectionRef: string; provider?: string; action?: string; causeSafe?: boolean; args: Sanitized<{ [key: string]: FabricTraceJsonValue; }>; outcome?: FabricExecutionOutcomeV1; normalization?: NormalFormWitness; failureStage?: FabricExecutionFailureStageV1; error?: Sanitized; result?: Sanitized; resultTruncated?: boolean; droppedResultValues: number; } /** * Optional, non-deterministic side channel (the assessment projection). It * observes issue and settle events and never alters the deterministic trace. */ export interface FabricExecutionTraceObserver { issued(sequence: number, ref: string): void; settled(sequence: number, outcome: FabricExecutionOutcomeV1, result: unknown): void; } export declare class FabricExecutionTraceOperationHandle { private readonly recorder; private readonly operation; /** Bridge issue order; shared with the trace operation when one is recorded. */ readonly sequence: number; constructor(recorder: FabricExecutionTraceRecorder, operation: MutableOperation | undefined, /** Bridge issue order; shared with the trace operation when one is recorded. */ sequence?: number); resolved(provider: string, action: string): void; prepared(args: Record): void; normalized(witness: NormalFormWitness): void; succeed(result: unknown, meta?: TraceResultMeta): void; fail(stage: FabricExecutionFailureStageV1, error: unknown, outcome?: FabricExecutionOutcomeV1, result?: unknown, meta?: TraceResultMeta): void; } export declare class FabricExecutionTraceRecorder { #private; sealed: boolean; constructor(observer?: FabricExecutionTraceObserver); /** @internal Forwards a settle to the observer; observer faults never reach the program. */ observeSettled(sequence: number, outcome: FabricExecutionOutcomeV1, result: unknown): void; snapshotIdentifier(value: string, maxBytes?: number): string; issueCall(ref: string, args: Record): FabricExecutionTraceOperationHandle; seal(outcome: FabricExecutionOutcomeV1, phases: readonly string[], safeError?: string): FabricExecutionTraceV1; } export declare const executionOutcomeFromError: (error: unknown, signal?: AbortSignal) => FabricExecutionOutcomeV1; //# sourceMappingURL=trace.d.ts.map