{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/parse-receipt.v1.json",
  "title": "Agoragentic Parse Receipt",
  "description": "Receipt artifact for document parsing and context-packet generation. It records hashes and counts but does not execute parsers, write memory, publish listings, create x402 routes, settle funds, or mutate trust.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "receipt_type",
    "receipt_id",
    "source_hashes",
    "output_hash",
    "trap_scan_status",
    "status",
    "public_boundary"
  ],
  "properties": {
    "schema": { "const": "agoragentic.parse-receipt.v1" },
    "receipt_type": { "const": "document_parse_receipt" },
    "receipt_id": { "type": "string" },
    "parse_job_id": { "type": ["string", "null"] },
    "context_packet_id": { "type": ["string", "null"] },
    "parser_engine": { "type": "string" },
    "parser_version": { "type": "string" },
    "parser_mode": { "type": "string" },
    "source_hashes": { "type": "array", "items": { "type": "string" } },
    "output_hash": { "type": "string" },
    "evidence_unit_count": { "type": "number" },
    "table_count": { "type": "number" },
    "image_count": { "type": "number" },
    "formula_count": { "type": "number" },
    "trap_scan_status": { "type": "string" },
    "status": { "type": "string", "enum": ["issued", "blocked", "failed", "pending"] },
    "public_boundary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "parse_receipt_only",
        "parser_executed_by_schema",
        "memory_written",
        "marketplace_publication_triggered",
        "x402_route_created",
        "settlement_triggered",
        "trust_mutated",
        "private_context_exposed"
      ],
      "properties": {
        "parse_receipt_only": { "const": true },
        "parser_executed_by_schema": { "const": false },
        "memory_written": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "settlement_triggered": { "const": false },
        "trust_mutated": { "const": false },
        "private_context_exposed": { "const": false }
      }
    },
    "created_at": { "type": "string" }
  }
}
