{
  "process_id": "CM-15",
  "policy_version": "synthetic-v1",
  "event_id": "cm-15-example-v1",
  "input": {
    "report_as_of": "2026-11-10T00:00:00+00:00",
    "allocation_policy_version": "SYNTHETIC-A1",
    "trade": {
      "id": "T1",
      "side": "short",
      "notional_cents": 40000000,
      "open_price_bps": 10100,
      "close_price_bps": 10075,
      "fees_cents": 10000,
      "closed_at": "2026-11-09T15:00:00+00:00",
      "close_observed_at": "2026-11-09T15:00:01+00:00",
      "opened_at": "2026-11-01T12:00:00+00:00",
      "open_observed_at": "2026-11-01T12:00:01+00:00"
    },
    "position_events": [
      {
        "id": "P1",
        "trade_id": "T1",
        "state": "open",
        "effective_at": "2026-11-01T12:00:00+00:00",
        "observed_at": "2026-11-01T12:00:01+00:00"
      },
      {
        "id": "P2",
        "trade_id": "T1",
        "state": "closed",
        "effective_at": "2026-11-09T15:00:00+00:00",
        "observed_at": "2026-11-09T15:00:01+00:00"
      }
    ],
    "loans": [
      {
        "id": "L1",
        "trade_id": "T1",
        "commitment_at": "2026-11-06T15:00:00+00:00",
        "weight_bps": 6000,
        "upb_cents": 25000000,
        "net_sale_proceeds_cents": 25137500,
        "operating_cost_cents": 50000,
        "carry_cents": 15000,
        "allocation_observed_at": "2026-11-06T15:00:01+00:00"
      },
      {
        "id": "L2",
        "trade_id": "T1",
        "commitment_at": "2026-11-07T15:00:00+00:00",
        "weight_bps": 4000,
        "upb_cents": 15000000,
        "net_sale_proceeds_cents": 15075000,
        "operating_cost_cents": 30000,
        "carry_cents": 10000,
        "allocation_observed_at": "2026-11-07T15:00:01+00:00"
      }
    ],
    "plan_contribution_cents": 160000
  },
  "expected": {
    "status": "realized_economics",
    "gross_hedge_cents": 100000,
    "net_hedge_cents": 90000,
    "allocated_hedge_cents": 90000,
    "unallocated_cents": 0,
    "loans": [
      {
        "loan_id": "L1",
        "loan_sale_gain_cents": 137500,
        "allocated_hedge_cents": 54000,
        "contribution_cents": 126500
      },
      {
        "loan_id": "L2",
        "loan_sale_gain_cents": 75000,
        "allocated_hedge_cents": 36000,
        "contribution_cents": 71000
      }
    ],
    "cohort_principal_cents": 40000000,
    "contribution_cents": 197500,
    "contribution_bps": "49.38",
    "plan_variance_cents": 37500,
    "cash_status": "not_evaluated",
    "external_actions": 0
  },
  "changes": [
    {
      "name": "Weights cannot silently rescale",
      "path": [
        "loans",
        0,
        "weight_bps"
      ],
      "value": 7000,
      "expected": {
        "status": "hold",
        "reason": "allocation_weights_not_conserved",
        "external_actions": 0
      }
    },
    {
      "name": "A late-observed opening cannot prove contemporaneous attribution",
      "replace_input": {
        "report_as_of": "2026-11-10T00:00:00+00:00",
        "allocation_policy_version": "SYNTHETIC-A1",
        "trade": {
          "id": "T1",
          "side": "short",
          "notional_cents": 40000000,
          "open_price_bps": 10100,
          "close_price_bps": 10075,
          "fees_cents": 10000,
          "closed_at": "2026-11-09T15:00:00+00:00",
          "close_observed_at": "2026-11-09T15:00:01+00:00",
          "opened_at": "2026-11-01T12:00:00+00:00",
          "open_observed_at": "2026-11-08T12:00:01+00:00"
        },
        "position_events": [
          {
            "id": "P1",
            "trade_id": "T1",
            "state": "open",
            "effective_at": "2026-11-01T12:00:00+00:00",
            "observed_at": "2026-11-08T12:00:01+00:00"
          },
          {
            "id": "P2",
            "trade_id": "T1",
            "state": "closed",
            "effective_at": "2026-11-09T15:00:00+00:00",
            "observed_at": "2026-11-09T15:00:01+00:00"
          }
        ],
        "loans": [
          {
            "id": "L1",
            "trade_id": "T1",
            "commitment_at": "2026-11-06T15:00:00+00:00",
            "weight_bps": 6000,
            "upb_cents": 25000000,
            "net_sale_proceeds_cents": 25137500,
            "operating_cost_cents": 50000,
            "carry_cents": 15000,
            "allocation_observed_at": "2026-11-06T15:00:01+00:00"
          },
          {
            "id": "L2",
            "trade_id": "T1",
            "commitment_at": "2026-11-07T15:00:00+00:00",
            "weight_bps": 4000,
            "upb_cents": 15000000,
            "net_sale_proceeds_cents": 15075000,
            "operating_cost_cents": 30000,
            "carry_cents": 10000,
            "allocation_observed_at": "2026-11-07T15:00:01+00:00"
          }
        ],
        "plan_contribution_cents": 160000
      },
      "expected": {
        "status": "hold",
        "reason": "no_contemporaneous_open_hedge",
        "loan_ids": [
          "L1",
          "L2"
        ],
        "external_actions": 0
      }
    },
    {
      "name": "Blank identifiers cannot produce an accepted result",
      "path": [
        "loans",
        0,
        "id"
      ],
      "value": "   ",
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "A boolean is not a financial amount or revision",
      "path": [
        "trade",
        "notional_cents"
      ],
      "value": true,
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "Trade close time must reconcile to history and precede no assigned commitment",
      "replace_input": {
        "report_as_of": "2026-11-10T00:00:00+00:00",
        "allocation_policy_version": "SYNTHETIC-A1",
        "trade": {
          "id": "T1",
          "side": "short",
          "notional_cents": 40000000,
          "open_price_bps": 10100,
          "close_price_bps": 10075,
          "fees_cents": 10000,
          "closed_at": "2026-11-05T15:00:00+00:00",
          "close_observed_at": "2026-11-09T15:00:01+00:00",
          "opened_at": "2026-11-01T12:00:00+00:00",
          "open_observed_at": "2026-11-01T12:00:01+00:00"
        },
        "position_events": [
          {
            "id": "P1",
            "trade_id": "T1",
            "state": "open",
            "effective_at": "2026-11-01T12:00:00+00:00",
            "observed_at": "2026-11-01T12:00:01+00:00"
          },
          {
            "id": "P2",
            "trade_id": "T1",
            "state": "closed",
            "effective_at": "2026-11-09T15:00:00+00:00",
            "observed_at": "2026-11-09T15:00:01+00:00"
          }
        ],
        "loans": [
          {
            "id": "L1",
            "trade_id": "T1",
            "commitment_at": "2026-11-06T15:00:00+00:00",
            "weight_bps": 6000,
            "upb_cents": 25000000,
            "net_sale_proceeds_cents": 25137500,
            "operating_cost_cents": 50000,
            "carry_cents": 15000,
            "allocation_observed_at": "2026-11-06T15:00:01+00:00"
          },
          {
            "id": "L2",
            "trade_id": "T1",
            "commitment_at": "2026-11-07T15:00:00+00:00",
            "weight_bps": 4000,
            "upb_cents": 15000000,
            "net_sale_proceeds_cents": 15075000,
            "operating_cost_cents": 30000,
            "carry_cents": 10000,
            "allocation_observed_at": "2026-11-07T15:00:01+00:00"
          }
        ],
        "plan_contribution_cents": 160000
      },
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "Frozen allocation cannot be created after the demonstrated close",
      "replace_input": {
        "report_as_of": "2026-11-10T00:00:00+00:00",
        "allocation_policy_version": "SYNTHETIC-A1",
        "trade": {
          "id": "T1",
          "side": "short",
          "notional_cents": 40000000,
          "open_price_bps": 10100,
          "close_price_bps": 10075,
          "fees_cents": 10000,
          "closed_at": "2026-11-09T15:00:00+00:00",
          "close_observed_at": "2026-11-09T15:00:01+00:00",
          "opened_at": "2026-11-01T12:00:00+00:00",
          "open_observed_at": "2026-11-01T12:00:01+00:00"
        },
        "position_events": [
          {
            "id": "P1",
            "trade_id": "T1",
            "state": "open",
            "effective_at": "2026-11-01T12:00:00+00:00",
            "observed_at": "2026-11-01T12:00:01+00:00"
          },
          {
            "id": "P2",
            "trade_id": "T1",
            "state": "closed",
            "effective_at": "2026-11-09T15:00:00+00:00",
            "observed_at": "2026-11-09T15:00:01+00:00"
          }
        ],
        "loans": [
          {
            "id": "L1",
            "trade_id": "T1",
            "commitment_at": "2026-11-06T15:00:00+00:00",
            "weight_bps": 6000,
            "upb_cents": 25000000,
            "net_sale_proceeds_cents": 25137500,
            "operating_cost_cents": 50000,
            "carry_cents": 15000,
            "allocation_observed_at": "2026-11-10T00:00:00+00:00"
          },
          {
            "id": "L2",
            "trade_id": "T1",
            "commitment_at": "2026-11-07T15:00:00+00:00",
            "weight_bps": 4000,
            "upb_cents": 15000000,
            "net_sale_proceeds_cents": 15075000,
            "operating_cost_cents": 30000,
            "carry_cents": 10000,
            "allocation_observed_at": "2026-11-07T15:00:01+00:00"
          }
        ],
        "plan_contribution_cents": 160000
      },
      "expected": {
        "status": "hold",
        "reason": "invalid_input",
        "external_actions": 0
      }
    },
    {
      "name": "Positive three-cent rounding conserves sign and keeps zero-weight loan at zero",
      "replace_input": {
        "report_as_of": "2026-11-10T00:00:00+00:00",
        "allocation_policy_version": "SYNTHETIC-A1",
        "trade": {
          "id": "T1",
          "side": "short",
          "notional_cents": 40000000,
          "open_price_bps": 10100,
          "close_price_bps": 10099,
          "fees_cents": 3997,
          "closed_at": "2026-11-09T15:00:00+00:00",
          "close_observed_at": "2026-11-09T15:00:01+00:00",
          "opened_at": "2026-11-01T12:00:00+00:00",
          "open_observed_at": "2026-11-01T12:00:01+00:00"
        },
        "position_events": [
          {
            "id": "P1",
            "trade_id": "T1",
            "state": "open",
            "effective_at": "2026-11-01T12:00:00+00:00",
            "observed_at": "2026-11-01T12:00:01+00:00"
          },
          {
            "id": "P2",
            "trade_id": "T1",
            "state": "closed",
            "effective_at": "2026-11-09T15:00:00+00:00",
            "observed_at": "2026-11-09T15:00:01+00:00"
          }
        ],
        "loans": [
          {
            "id": "L1",
            "trade_id": "T1",
            "commitment_at": "2026-11-06T15:00:00+00:00",
            "weight_bps": 5000,
            "upb_cents": 25000000,
            "net_sale_proceeds_cents": 25137500,
            "operating_cost_cents": 50000,
            "carry_cents": 15000,
            "allocation_observed_at": "2026-11-06T15:00:01+00:00"
          },
          {
            "id": "L2",
            "trade_id": "T1",
            "commitment_at": "2026-11-07T15:00:00+00:00",
            "weight_bps": 5000,
            "upb_cents": 15000000,
            "net_sale_proceeds_cents": 15075000,
            "operating_cost_cents": 30000,
            "carry_cents": 10000,
            "allocation_observed_at": "2026-11-07T15:00:01+00:00"
          },
          {
            "id": "L3",
            "trade_id": "T1",
            "commitment_at": "2026-11-08T15:00:00+00:00",
            "allocation_observed_at": "2026-11-08T15:00:01+00:00",
            "weight_bps": 0,
            "upb_cents": 1000000,
            "net_sale_proceeds_cents": 1000000,
            "operating_cost_cents": 0,
            "carry_cents": 0
          }
        ],
        "plan_contribution_cents": 160000
      },
      "expected": {
        "status": "realized_economics",
        "gross_hedge_cents": 4000,
        "net_hedge_cents": 3,
        "allocated_hedge_cents": 3,
        "unallocated_cents": 0,
        "loans": [
          {
            "loan_id": "L1",
            "loan_sale_gain_cents": 137500,
            "allocated_hedge_cents": 2,
            "contribution_cents": 72502
          },
          {
            "loan_id": "L2",
            "loan_sale_gain_cents": 75000,
            "allocated_hedge_cents": 1,
            "contribution_cents": 35001
          },
          {
            "loan_id": "L3",
            "loan_sale_gain_cents": 0,
            "allocated_hedge_cents": 0,
            "contribution_cents": 0
          }
        ],
        "cohort_principal_cents": 41000000,
        "contribution_cents": 107503,
        "contribution_bps": "26.22",
        "plan_variance_cents": -52497,
        "cash_status": "not_evaluated",
        "external_actions": 0
      }
    },
    {
      "name": "Negative three-cent rounding conserves sign and keeps zero-weight loan at zero",
      "replace_input": {
        "report_as_of": "2026-11-10T00:00:00+00:00",
        "allocation_policy_version": "SYNTHETIC-A1",
        "trade": {
          "id": "T1",
          "side": "short",
          "notional_cents": 40000000,
          "open_price_bps": 10100,
          "close_price_bps": 10099,
          "fees_cents": 4003,
          "closed_at": "2026-11-09T15:00:00+00:00",
          "close_observed_at": "2026-11-09T15:00:01+00:00",
          "opened_at": "2026-11-01T12:00:00+00:00",
          "open_observed_at": "2026-11-01T12:00:01+00:00"
        },
        "position_events": [
          {
            "id": "P1",
            "trade_id": "T1",
            "state": "open",
            "effective_at": "2026-11-01T12:00:00+00:00",
            "observed_at": "2026-11-01T12:00:01+00:00"
          },
          {
            "id": "P2",
            "trade_id": "T1",
            "state": "closed",
            "effective_at": "2026-11-09T15:00:00+00:00",
            "observed_at": "2026-11-09T15:00:01+00:00"
          }
        ],
        "loans": [
          {
            "id": "L1",
            "trade_id": "T1",
            "commitment_at": "2026-11-06T15:00:00+00:00",
            "weight_bps": 5000,
            "upb_cents": 25000000,
            "net_sale_proceeds_cents": 25137500,
            "operating_cost_cents": 50000,
            "carry_cents": 15000,
            "allocation_observed_at": "2026-11-06T15:00:01+00:00"
          },
          {
            "id": "L2",
            "trade_id": "T1",
            "commitment_at": "2026-11-07T15:00:00+00:00",
            "weight_bps": 5000,
            "upb_cents": 15000000,
            "net_sale_proceeds_cents": 15075000,
            "operating_cost_cents": 30000,
            "carry_cents": 10000,
            "allocation_observed_at": "2026-11-07T15:00:01+00:00"
          },
          {
            "id": "L3",
            "trade_id": "T1",
            "commitment_at": "2026-11-08T15:00:00+00:00",
            "allocation_observed_at": "2026-11-08T15:00:01+00:00",
            "weight_bps": 0,
            "upb_cents": 1000000,
            "net_sale_proceeds_cents": 1000000,
            "operating_cost_cents": 0,
            "carry_cents": 0
          }
        ],
        "plan_contribution_cents": 160000
      },
      "expected": {
        "status": "realized_economics",
        "gross_hedge_cents": 4000,
        "net_hedge_cents": -3,
        "allocated_hedge_cents": -3,
        "unallocated_cents": 0,
        "loans": [
          {
            "loan_id": "L1",
            "loan_sale_gain_cents": 137500,
            "allocated_hedge_cents": -2,
            "contribution_cents": 72498
          },
          {
            "loan_id": "L2",
            "loan_sale_gain_cents": 75000,
            "allocated_hedge_cents": -1,
            "contribution_cents": 34999
          },
          {
            "loan_id": "L3",
            "loan_sale_gain_cents": 0,
            "allocated_hedge_cents": 0,
            "contribution_cents": 0
          }
        ],
        "cohort_principal_cents": 41000000,
        "contribution_cents": 107497,
        "contribution_bps": "26.22",
        "plan_variance_cents": -52503,
        "cash_status": "not_evaluated",
        "external_actions": 0
      }
    }
  ]
}
