/**
 * Action Receipts — tamper-evident per-edit audit trail.
 *
 * Each successful file mutation emits a receipt with pre/post content
 * hashes, operation type, model, and session linkage. Receipts are
 * append-only; the file's SHA-256 hash before and after the change
 * makes any post-hoc tampering with the edit detectable.
 *
 * v0 captures the minimum useful fields (file_path, hashes, bytes,
 * operation, model, session_id, timestamp). Richer fields from the
 * review — tests_passed, trust_delta, per-edit cost_usd — depend on
 * turn-level integration and are left for v1.
 */

export type ReceiptOperation = 'edit' | 'write' | 'delete'

export interface Receipt {
  version: 1
  id: string // short random id
  timestamp: number // ms since epoch
  session_id: string
  file_path: string // relative to cwd, forward-slash normalized
  operation: ReceiptOperation
  hash_before: string | null // SHA-256 hex; null if file did not exist
  hash_after: string | null // SHA-256 hex; null if file was deleted
  bytes_before: number
  bytes_after: number
  model?: string // active model name at time of edit, if known
}
