/**
 * Provenance Tracker — Runtime Tracing System (ADR-039)
 *
 * Records every agent invocation during a pipeline execution as a
 * structured TraceRecord. Produces the Provenance Manifest (Artifact #15).
 *
 * Features:
 *   - Structured trace recording with code provenance
 *   - DecisionGraph namespace storage (provenance:{executionId}:{traceId})
 *   - Audit query helpers (who/what/when/how/reproducibility)
 *   - Rich manifest generation with all ADR-039 sections
 *   - Load/rehydrate from persisted records
 *   - Filtering by agent, pass, workstream, status
 *   - Privacy-safe: metadata only, no payload duplication
 *   - Version discrepancy detection
 */
import type { TraceRecord, PassNumber, AgentRef, AgentInvocationResult } from './types.js';
/** Generate the provenance namespace key for a trace record. */
export declare function provenanceKey(executionId: string, traceId: string): string;
/** Generate tags for a trace record's memory entry. */
export declare function provenanceTags(record: TraceRecord): readonly string[];
/** Who made a decision. */
export interface AuditWho {
    readonly agentDomain: string;
    readonly agentName: string;
    readonly agentId: string;
    readonly role: string;
}
/** What code was used. */
export interface AuditWhat {
    readonly package: string;
    readonly version: string;
    readonly entryPoint: string;
    readonly commitHash: string;
}
/** Reproducibility information for re-execution. */
export interface AuditReproducibility {
    readonly commitHash: string;
    readonly parameters: Record<string, unknown>;
    readonly inputNodeIds: readonly string[];
    readonly codePackage: string;
    readonly codeVersion: string;
}
export interface ProvenanceStatistics {
    readonly totalRecords: number;
    readonly uniqueAgents: number;
    readonly uniquePackages: number;
    readonly totalTokens: number;
    readonly totalCost: number;
    readonly totalDurationMs: number;
    readonly byPass: Readonly<Record<number, number>>;
    readonly byStatus: Readonly<Record<string, number>>;
    readonly byWorkstream: Readonly<Record<string, number>>;
    readonly longestAgent: {
        agentId: string;
        durationMs: number;
    } | undefined;
}
export declare class ProvenanceTracker {
    private readonly records;
    private readonly executionId;
    private sequenceCounter;
    constructor(executionId: string);
    /** Get the execution ID. */
    getExecutionId(): string;
    /** Record an agent invocation as a trace record with full code provenance. */
    recordInvocation(params: {
        agent: AgentRef;
        pass: PassNumber;
        passName: string;
        workstream: string;
        startedAt: string;
        completedAt: string;
        durationMs: number;
        inputNodeIds: readonly string[];
        outputNodeIds: readonly string[];
        artifactNumbers: readonly number[];
        status: 'success' | 'partial' | 'failed';
        confidence: number;
        tokensUsed?: number;
        modelUsed?: string;
        estimatedCost?: number;
    }): TraceRecord;
    /** Convenience: record from an AgentInvocationResult. */
    recordFromResult(result: AgentInvocationResult, passName: string, workstream: string, outputNodeIds?: readonly string[]): TraceRecord;
    /** Get all trace records. */
    getAllRecords(): readonly TraceRecord[];
    /** Get records for a specific pass. */
    getRecordsByPass(pass: PassNumber): readonly TraceRecord[];
    /** Get records for a specific agent (domain/agent). */
    getRecordsByAgent(domain: string, agent: string): readonly TraceRecord[];
    /** Get records for a specific workstream. */
    getRecordsByWorkstream(workstream: string): readonly TraceRecord[];
    /** Get records by status. */
    getRecordsByStatus(status: 'success' | 'partial' | 'failed'): readonly TraceRecord[];
    /** Get a specific record by trace ID. */
    getRecordByTraceId(traceId: string): TraceRecord | undefined;
    /** Get total number of unique agents invoked. */
    getUniqueAgentCount(): number;
    /** Get total tokens used. */
    getTotalTokens(): number;
    /** Get total estimated cost. */
    getTotalCost(): number;
    /** Get total pipeline duration (sum of all agent durations). */
    getTotalDuration(): number;
    /** Get the longest-running agent. */
    getLongestAgent(): {
        agentId: string;
        durationMs: number;
    } | undefined;
    /** Who made a decision (for a specific trace). */
    auditWho(traceId: string): AuditWho | undefined;
    /** What code was used (for a specific trace). */
    auditWhat(traceId: string): AuditWhat | undefined;
    /** Reproducibility info (for a specific trace). */
    auditReproducibility(traceId: string): AuditReproducibility | undefined;
    /** Compute aggregate provenance statistics. */
    getStatistics(): ProvenanceStatistics;
    /** Generate the Provenance Manifest as a markdown string. */
    generateManifest(params: {
        passesCompleted: number;
        passesDegraded: readonly PassNumber[];
        artifactOwnership: readonly {
            number: number;
            name: string;
            agent: string;
            pass: PassNumber;
        }[];
    }): string;
    /** Persist trace records to the output directory. */
    persist(outputDir: string): string;
    /** Load trace records from a previously persisted file. */
    static load(executionId: string, outputDir: string): ProvenanceTracker;
}
//# sourceMappingURL=provenance-tracker.d.ts.map