{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "service_version": {
      "const": "redacted-1099-readiness-1.0.0"
    },
    "tax_year": {
      "type": "integer",
      "enum": [
        2025,
        2026
      ]
    },
    "jurisdiction": {
      "const": "US-federal"
    },
    "evidence_mode": {
      "type": "string",
      "enum": [
        "current",
        "snapshot_replay",
        "fixed_synthetic_demo"
      ]
    },
    "assessed_at_utc": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T.*(?:Z|[+-]\\d{2}:\\d{2})$"
    },
    "synthetic_inputs": {
      "type": "boolean"
    },
    "accepted_rule_version": {
      "const": "pennybot-tax-intelligence-foundation-20261004"
    },
    "accepted_rules_sha256": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^[0-9a-f]{64}$"
    },
    "source_manifest_sha256": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^[0-9a-f]{64}$"
    },
    "hash_encoding": {
      "const": "UTF8-sorted-compact-JSON"
    },
    "reviewed_policy_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "covered_business_scope_reviewed_v1",
          "complete_original_annual_rows_reviewed_v1",
          "federal_backup_withholding_reviewed_v1",
          "tpso_settlement_rows_reviewed_v1"
        ]
      },
      "minItems": 0,
      "maxItems": 4,
      "uniqueItems": true
    },
    "vendors": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "vendor_id": {
            "type": "string",
            "maxLength": 18,
            "pattern": "^v_[0-9a-f]{16}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "CANDIDATE",
              "NOT_CANDIDATE",
              "REVIEW",
              "UNKNOWN"
            ]
          },
          "candidate_kind": {
            "type": "string",
            "enum": [
              "NEC",
              "MISC_RENTS",
              "MISC_ROYALTIES",
              "UNSUPPORTED",
              "TPSO_RECONCILIATION"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "minItems": 0,
            "maxItems": 40
          },
          "missing_facts": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "minItems": 0,
            "maxItems": 40
          },
          "ambiguity_flags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "minItems": 0,
            "maxItems": 40
          },
          "review_required": {
            "type": "boolean"
          },
          "filing_determination": {
            "const": false
          },
          "included_row_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 18,
              "pattern": "^r_[0-9a-f]{16}$"
            },
            "minItems": 0,
            "maxItems": 10000
          },
          "excluded_rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "row_id": {
                  "type": "string",
                  "maxLength": 18,
                  "pattern": "^r_[0-9a-f]{16}$"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "outside_tax_year",
                    "negative_requires_review",
                    "channel_requires_review",
                    "included_nec_misc",
                    "separate_tpso",
                    "payment_card_excluded"
                  ]
                }
              },
              "required": [
                "row_id",
                "reason"
              ]
            },
            "minItems": 0,
            "maxItems": 10000
          },
          "tpso_included_row_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 18,
              "pattern": "^r_[0-9a-f]{16}$"
            },
            "minItems": 0,
            "maxItems": 10000
          },
          "arithmetic_trace": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "row_id": {
                  "type": "string",
                  "maxLength": 18,
                  "pattern": "^r_[0-9a-f]{16}$"
                },
                "payment_date": {
                  "type": "string",
                  "maxLength": 10,
                  "pattern": "^20[0-9]{2}-[0-9]{2}-[0-9]{2}$",
                  "description": "Real Gregorian calendar date; runtime rejects impossible dates."
                },
                "amount_cents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "withholding_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "payment_channel": {
                  "type": "string",
                  "enum": [
                    "direct",
                    "payment_card",
                    "tpso",
                    "unknown",
                    "mixed",
                    "contradictory"
                  ]
                },
                "disposition": {
                  "type": "string",
                  "enum": [
                    "outside_tax_year",
                    "negative_requires_review",
                    "channel_requires_review",
                    "included_nec_misc",
                    "separate_tpso",
                    "payment_card_excluded"
                  ]
                },
                "nec_misc_running_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "nec_misc_running_withholding_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tpso_running_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "tpso_running_withholding_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "row_id",
                "payment_date",
                "amount_cents",
                "withholding_cents",
                "payment_channel",
                "disposition",
                "nec_misc_running_cents",
                "nec_misc_running_withholding_cents",
                "tpso_running_cents",
                "tpso_running_withholding_cents"
              ]
            },
            "minItems": 0,
            "maxItems": 10000
          },
          "nec_misc": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "withholding_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "threshold_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_predicate": {
                "type": "string",
                "enum": [
                  "MET",
                  "NOT_MET",
                  "NOT_EVALUATED",
                  "UNKNOWN"
                ]
              },
              "backup_withholding_predicate": {
                "type": "string",
                "enum": [
                  "MET",
                  "NOT_MET",
                  "NOT_EVALUATED",
                  "UNKNOWN"
                ]
              }
            },
            "required": [
              "amount_cents",
              "withholding_cents",
              "threshold_cents",
              "amount_predicate",
              "backup_withholding_predicate"
            ]
          },
          "tpso": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "gross_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "withholding_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "transactions": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "predicate": {
                "type": "string",
                "enum": [
                  "MET",
                  "NOT_MET",
                  "NOT_EVALUATED",
                  "UNKNOWN"
                ]
              },
              "comparison": {
                "const": "gross_cents > 2000000 AND transactions > 200"
              },
              "payer_filing_obligation_determined": {
                "const": false
              }
            },
            "required": [
              "gross_cents",
              "withholding_cents",
              "transactions",
              "predicate",
              "comparison",
              "payer_filing_obligation_determined"
            ]
          },
          "rule_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "minItems": 0,
            "maxItems": 10
          },
          "source_refs": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "minItems": 0,
            "maxItems": 50
          }
        },
        "required": [
          "vendor_id",
          "status",
          "candidate_kind",
          "reasons",
          "missing_facts",
          "ambiguity_flags",
          "review_required",
          "filing_determination",
          "included_row_ids",
          "excluded_rows",
          "tpso_included_row_ids",
          "arithmetic_trace",
          "nec_misc",
          "tpso",
          "rule_ids",
          "source_refs"
        ]
      },
      "minItems": 1,
      "maxItems": 1000
    },
    "counts": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "CANDIDATE": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "NOT_CANDIDATE": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "REVIEW": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "UNKNOWN": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        }
      },
      "required": [
        "CANDIDATE",
        "NOT_CANDIDATE",
        "REVIEW",
        "UNKNOWN"
      ]
    },
    "rule_checks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "topic": {
            "type": "string",
            "maxLength": 100
          },
          "status": {
            "type": "string",
            "enum": [
              "READY",
              "UNKNOWN"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 300
          },
          "rule_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "minItems": 0,
            "maxItems": 10
          },
          "source_refs": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "minItems": 0,
            "maxItems": 50
          }
        },
        "required": [
          "topic",
          "status",
          "reason",
          "rule_ids",
          "source_refs"
        ]
      },
      "minItems": 0,
      "maxItems": 10
    },
    "source_evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ref_id": {
            "type": "string",
            "maxLength": 120
          },
          "source_id": {
            "type": "string",
            "maxLength": 80
          },
          "url": {
            "type": "string",
            "maxLength": 1500,
            "pattern": "^https://www\\.irs\\.gov/"
          },
          "source_sha256": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9a-f]{64}$"
          },
          "text_sha256": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9a-f]{64}$"
          },
          "headers_sha256": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9a-f]{64}$"
          },
          "excerpt_sha256": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[0-9a-f]{64}$"
          },
          "line_start": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "line_end": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "retrieved_utc": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T.*(?:Z|[+-]\\d{2}:\\d{2})$"
          },
          "valid_until_utc": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T.*(?:Z|[+-]\\d{2}:\\d{2})$"
          }
        },
        "required": [
          "ref_id",
          "source_id",
          "url",
          "source_sha256",
          "text_sha256",
          "headers_sha256",
          "excerpt_sha256",
          "line_start",
          "line_end",
          "retrieved_utc",
          "valid_until_utc"
        ]
      },
      "minItems": 0,
      "maxItems": 50
    },
    "caveats": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 500
      },
      "minItems": 1,
      "maxItems": 10,
      "const": [
        "Reviewer queue only; no legal file/no-file, worker-status, entity-exception, foreign-status or tax-treatment determination.",
        "NOT_CANDIDATE means only the explicitly modeled predicate was not met on supplied reviewed facts; income below a reporting threshold may still be taxable.",
        "Declarations are unverified. No W-9, TIN, identity, account, annual completeness or payment processor was checked.",
        "Card/TPSO rows are excluded from NEC/MISC arithmetic. The TPSO predicate is separate and is not the business payer's filing obligation.",
        "No state rules, taxpayer documents, filings, corrections, refunds, or unsupported special-category determinations.",
        "Source freshness is a local evidence policy, not a guarantee of current law. Snapshot replay does not renew evidence."
      ]
    },
    "scope": {
      "const": "PUBLIC_PRODUCTION_SNAPSHOT"
    },
    "fee_eligibility": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "eligible",
        "price_atomic",
        "currency",
        "rule",
        "unknown_batch_no_charge",
        "settlement_claimed"
      ],
      "properties": {
        "eligible": {
          "type": "boolean"
        },
        "price_atomic": {
          "const": "50000"
        },
        "currency": {
          "const": "USDC"
        },
        "rule": {
          "const": "ALL_VENDORS_CANDIDATE_NOT_CANDIDATE_REVIEW_AND_RULE_EVIDENCE_READY"
        },
        "unknown_batch_no_charge": {
          "const": true
        },
        "settlement_claimed": {
          "const": false
        }
      }
    },
    "limitations": {
      "type": "array",
      "minItems": 8,
      "maxItems": 20,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 600
      }
    }
  },
  "required": [
    "service_version",
    "tax_year",
    "jurisdiction",
    "evidence_mode",
    "assessed_at_utc",
    "synthetic_inputs",
    "accepted_rule_version",
    "accepted_rules_sha256",
    "source_manifest_sha256",
    "hash_encoding",
    "reviewed_policy_ids",
    "vendors",
    "counts",
    "rule_checks",
    "source_evidence",
    "caveats",
    "scope",
    "fee_eligibility",
    "limitations"
  ]
}
