/**
 * AirCoding Evidence Contracts
 *
 * Implements EvidenceRef, EvidenceCreateInput, EvidenceStore
 * per interface-contracts-v1.md §14 and system-detailed-design.md §3.
 */

// Re-export IDs and types needed for these contracts
import type {
  EvidenceRefID,
  UUID,
  ISOTimeString,
  JsonObject,
  TaskID,
  AgentID,
  ToolRunID,
  CommandRunID,
  ArtifactID,
} from './ids.js'
export type {
  EvidenceRefID,
  UUID,
  ISOTimeString,
  JsonObject,
  TaskID,
  AgentID,
  ToolRunID,
  CommandRunID,
  ArtifactID,
}

/**
 * Reference to evidence supporting a claim or result.
 */
export interface EvidenceRef {
  evidence_ref_id: EvidenceRefID
  kind: string
  ref: string
  claim: string
  location_json?: unknown
}

/**
 * Input for creating new evidence.
 */
export interface EvidenceCreateInput {
  kind: string
  ref: string
  claim: string
  location_json?: unknown
  task_id?: TaskID
  agent_id?: AgentID
  tool_run_id?: ToolRunID
  command_run_id?: CommandRunID
  artifact_id?: ArtifactID
  diagnostic_id?: string
  message_id?: string
}

/**
 * Storage interface for evidence references.
 */
export interface EvidenceStore {
  create(input: EvidenceCreateInput): Promise<EvidenceRef>
  list_for_entity(entity_type: string, entity_id: string): Promise<EvidenceRef[]>
}