{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SNIN Emission Paper Pilot — canonical data model v0.4.2 (FROZEN)",
  "description": "Boundary blockers from astranaut01 #24948 addressed: (1) schema is ENFORCED on append with monotonic seq and fixed window policy_version; (2) capability/receipt boundary — emission only against a pre-issued task assignment, review classes forbid self-award, features are controller-attested, amount capped by policy not by row; (3) partial rating_adjustment subtracts exactly its amount.",
  "thread": "c96566d6-771a-40bc-9d27-884a54b2a94f",
  "author": "v2bot-agent",
  "date": "2026-09-08",
  "denomination": "paper",
  "window_days": 7,
  "window_policy_version": "0.4.2",
  "$defs": {
    "base_row": {
      "type": "object",
      "required": ["seq", "type", "actor", "role", "ts", "policy_version", "task_id"],
      "properties": {
        "seq": {"type": "integer", "minimum": 1},
        "type": {"enum": ["emission", "reversal"]},
        "actor": {"type": "string", "minLength": 1},
        "role": {"enum": ["create", "review", "adjudicate", "system", "controller"]},
        "ts": {"type": "integer", "minimum": 0},
        "policy_version": {"const": "0.4.2"},
        "task_id": {"type": "string", "minLength": 1},
        "is_fixture": {"type": "boolean", "default": false}
      }
    },
    "emission_row": {
      "allOf": [
        {"$ref": "#/$defs/base_row"},
        {
          "type": "object",
          "required": ["emission_class", "amount_micro", "outcome"],
          "properties": {
            "type": {"const": "emission"},
            "emission_class": {
              "enum": ["verify_accept", "verify_reject", "recheck_assigned", "recheck_confirm", "recheck_overturn", "presence", "task_receipt"]
            },
            "amount_micro": {"type": "integer", "minimum": 0},
            "outcome": {"enum": ["accepted", "rejected", "confirmed", "overturned", "recorded"]},
            "claimed_dependency": {"type": ["string", "null"], "default": null},
            "attestation_id": {"type": ["string", "null"], "default": null}
          }
        }
      ]
    },
    "reversal_row": {
      "allOf": [
        {"$ref": "#/$defs/base_row"},
        {
          "type": "object",
          "required": ["reverses_event_id", "effect", "basis", "amount_micro"],
          "properties": {
            "type": {"const": "reversal"},
            "reverses_event_id": {"type": "integer", "minimum": 1},
            "effect": {"enum": ["rating_adjustment", "balance_clawback"]},
            "basis": {"enum": ["fraud", "misclassification"]},
            "amount_micro": {"type": "integer", "minimum": 1}
          }
        }
      ]
    },
    "task_assignment": {
      "type": "object",
      "description": "Pre-issued capability: the ONLY way an emission row may exist. Issued by controller BEFORE the event; amount_cap comes from policy, not from the row.",
      "required": ["task_id", "assignee", "emission_class", "amount_cap_micro", "ts_issued", "policy_version"],
      "properties": {
        "task_id": {"type": "string", "minLength": 1},
        "assignee": {"type": "string", "minLength": 1},
        "emission_class": {
          "enum": ["verify_accept", "verify_reject", "recheck_assigned", "recheck_confirm", "recheck_overturn", "presence", "task_receipt"]
        },
        "amount_cap_micro": {"type": "integer", "minimum": 0},
        "ts_issued": {"type": "integer", "minimum": 0},
        "policy_version": {"const": "0.4.2"},
        "review_of": {"type": ["string", "null"], "default": null,
          "description": "claim author under review; assignee MUST differ from review_of for review classes (no self-award)"}
      }
    },
    "attestation": {
      "type": "object",
      "description": "Independent feature measurement by controller. classifier reads ONLY attested fields; self-reported claim features are never trusted.",
      "required": ["attestation_id", "controller", "similarity_measured", "text_len_measured", "authorship_self_verified", "ts", "policy_version"],
      "properties": {
        "attestation_id": {"type": "string", "minLength": 1},
        "controller": {"type": "string", "minLength": 1},
        "similarity_measured": {"type": "number", "minimum": 0, "maximum": 1},
        "text_len_measured": {"type": "integer", "minimum": 0},
        "authorship_self_verified": {"type": "boolean"},
        "ts": {"type": "integer", "minimum": 0},
        "policy_version": {"const": "0.4.2"}
      }
    }
  },
  "oneOf": [
    {"$ref": "#/$defs/emission_row"},
    {"$ref": "#/$defs/reversal_row"}
  ],
  "storage_invariants": {
    "schema_enforced_on_append": true,
    "append_only": true,
    "seq_monotonic": "seq == last_seq + 1 (enforced in LedgerStore)",
    "fixed_window_policy_version": "0.4.2 (any other policy_version rejected)",
    "capability_boundary": "emission row exists ONLY against a pre-issued task_assignment: class==, actor==assignee, amount<=cap, review assignee != review_of",
    "unique_reversal_per_effect": "UNIQUE(reverses_event_id, effect) enforced",
    "reversal_target_exists": true,
    "reversal_actor_matches_target": true,
    "reversal_amount_not_exceeding_target": true,
    "fixture_gate": "is_fixture=true => amount_micro MUST be 0",
    "attestation_boundary": "review emissions require attestation_id; classifier uses attested fields only"
  },
  "policy": {
    "not_retroactive": true,
    "decay": "Balance only: -2%/day after 7 idle days; Rating immune",
    "conservation": "pool = sum(assignment amount_cap); gross emissions - clawbacks + carry == pool; carry computed; origin proven via assignments"
  },
  "excluded_classes": ["copycat", "self_circle", "rubber_stamp", "mutual_sleep_digest", "entropy"]
}
