export type ActorType = 'human' | 'ai' | 'system'; export type ProvenanceAction = 'create' | 'edit' | 'review' | 'approve' | 'reject' | 'link' | 'apply' | 'derive'; export type ReasonCode = 'initial_creation' | 'refinement' | 'correction' | 'clarification' | 'implementation' | 'graduation' | 'rejection' | 'linkage'; export interface ProvenanceEvent { event_id: string; timestamp: string; actor_id: string; actor_type: ActorType; action: ProvenanceAction; artifact_refs: string[]; reason_code: ReasonCode; summary?: string; fingerprint_before?: string | null; fingerprint_after?: string; } export interface EmitProvenanceInput { actor_id: string; action: ProvenanceAction; artifact_refs: string[]; reason_code: ReasonCode; summary?: string; fingerprint_before?: string | null; fingerprint_after?: string; } export interface ListProvenanceInput { projectId?: string; artifact_ref?: string; actor_id?: string; limit?: number; } export interface ListProvenanceOutput { events: ProvenanceEvent[]; total_count: number; /** * Records that could not be read or parsed and are therefore absent from * `events`. Zero on a healthy store. Present so that a short list is * detectable — an empty result with unreadable_count > 0 means "could not * read", which is a different fact from "no activity". */ unreadable_count: number; } export interface ProjectResolutionError { error: 'project_resolution_failed'; message: string; hint: string; } /** * Generate a unique event ID in format PROV-{timestamp}-{ms} */ export declare function generateEventId(): string; /** * Hash content using SHA-256 and return first 16 characters. * Format: sha256:{first16chars} */ export declare function hashContent(content: string): string; /** * Get the default actor ID. * Priority: the acting identity for this dispatch > DECIBEL_ACTOR_ID > git > $USER * * The first step is the one added by EPIC-0040, and it is what makes a * provenance event agree with the record it describes. A call arriving over * the daemon with an X-User-Key resolves to `user:`; re-deriving from * git here would have attributed that event to whoever owns the box the * daemon runs on, which is a different person entirely and silently so. * * Outside a dispatch — a direct in-process caller, a test, a script — there is * no scope open and the original env/git/$USER order stands unchanged. */ export declare function getDefaultActorId(): string; /** * Emit a provenance event for an artifact action. * Stores in .decibel/provenance/events/PROV-*.yml * * @param input - Event data (actor_id, action, artifact_refs, reason_code, summary, fingerprints) * @param projectRoot - Root path of the project (or projectId to resolve) * @returns The event_id of the created provenance event */ export declare function emitProvenance(input: EmitProvenanceInput, projectId?: string): Promise; /** * List provenance events, optionally filtered by artifact_ref or actor_id. * * @param input - Filter criteria (projectId, artifact_ref, actor_id, limit) * @returns List of matching provenance events */ export declare function listProvenance(input: ListProvenanceInput): Promise; /** * Helper to emit provenance for artifact creation. * Convenience wrapper for emitProvenance with 'create' action. */ export declare function emitCreateProvenance(artifactRef: string, content: string, summary: string, projectId?: string): Promise; //# sourceMappingURL=provenance.d.ts.map