{
  "process_id": "FA-09",
  "policy_version": "synthetic-v1",
  "event_id": "fa-09-example-v1",
  "input": {
    "entity": "LENDER-1",
    "currency": "USD",
    "cutoff": "2026-10-31T23:59:59Z",
    "window_start": "2026-10-01T00:00:00Z",
    "account_lines": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "source_line_id": "GL1",
        "account": "REV",
        "amount_cents": 2400000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "source_line_id": "GL2",
        "account": "DIRECT",
        "amount_cents": 1400000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "source_line_id": "GL3",
        "account": "OVERHEAD",
        "amount_cents": 400000
      }
    ],
    "recipients": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "recipient_id": "CFO",
        "report_id": "MGT-PROFIT",
        "valid_from": "2026-01-01T00:00:00Z",
        "valid_to": "2026-12-31T23:59:59Z"
      }
    ],
    "definition": {
      "report_id": "MGT-PROFIT",
      "version": "D1",
      "source_close_version": "CLOSE-OCT-1",
      "account_classification": {
        "REV": "revenue",
        "DIRECT": "expense",
        "OVERHEAD": "expense"
      }
    },
    "signed_close_version": "CLOSE-OCT-1",
    "signed_close_period": "2026-10",
    "period": "2026-10",
    "source_profit_control_cents": 600000,
    "approved_content_hash": "645d4d070e36598bf50c7c76326e3a5e794d66b4def9fe51cf42d2dbbe6f5527",
    "approved_at": "2026-10-31T23:59:59Z",
    "intended_recipient_ids": [
      "CFO"
    ],
    "approved_recipient_ids": [
      "CFO"
    ],
    "manifest": {
      "account_lines": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 3,
        "received_records": 3,
        "complete": true
      },
      "recipients": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 1,
        "received_records": 1,
        "complete": true
      }
    }
  },
  "expected": {
    "status": "ready_for_authorized_publication_review",
    "report_totals": {
      "revenue_cents": 2400000,
      "expense_cents": 1800000,
      "profit_cents": 600000
    },
    "content_hash": "645d4d070e36598bf50c7c76326e3a5e794d66b4def9fe51cf42d2dbbe6f5527",
    "publication_completed": false,
    "errors": []
  },
  "changes": [
    {
      "name": "Changed source after approval invalidates the report",
      "path": [
        "account_lines",
        0,
        "amount_cents"
      ],
      "value": 2400100,
      "expected": {
        "status": "hold",
        "report_totals": {
          "revenue_cents": 2400100,
          "expense_cents": 1800000,
          "profit_cents": 600100
        },
        "content_hash": "bc3f35c1fbedb7d05fa4bd459419c2af91912a8b6835f6742809d031798193d6",
        "publication_completed": false,
        "errors": [
          "report:profit_control",
          "report:approval_payload_mismatch"
        ]
      }
    },
    {
      "name": "Expired recipient entitlement holds",
      "path": [
        "recipients",
        0,
        "valid_to"
      ],
      "value": "2026-10-01T00:00:00Z",
      "expected": {
        "status": "hold",
        "report_totals": {
          "revenue_cents": 2400000,
          "expense_cents": 1800000,
          "profit_cents": 600000
        },
        "content_hash": "645d4d070e36598bf50c7c76326e3a5e794d66b4def9fe51cf42d2dbbe6f5527",
        "publication_completed": false,
        "errors": [
          "CFO:invalid_entitlement"
        ]
      }
    },
    {
      "name": "Missing mapping cannot drop expense",
      "path": [
        "definition",
        "account_classification",
        "DIRECT"
      ],
      "value": "unknown",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:report:unmapped_or_unsupported_account"
        ]
      }
    },
    {
      "name": "Wrong accepted close version holds",
      "path": [
        "signed_close_version"
      ],
      "value": "CLOSE-OCT-2",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:report:source_close_version_mismatch"
        ]
      }
    },
    {
      "name": "A new audience is not covered by the recipient registry",
      "path": [
        "intended_recipient_ids"
      ],
      "value": [
        "CFO",
        "unapproved-recipient"
      ],
      "expected": {
        "status": "hold",
        "report_totals": {
          "revenue_cents": 2400000,
          "expense_cents": 1800000,
          "profit_cents": 600000
        },
        "content_hash": "645d4d070e36598bf50c7c76326e3a5e794d66b4def9fe51cf42d2dbbe6f5527",
        "publication_completed": false,
        "errors": [
          "report:approval_audience_mismatch",
          "unapproved-recipient:missing_entitlement"
        ]
      }
    },
    {
      "name": "Duplicate source line cannot inflate totals",
      "replace_input": {
        "entity": "LENDER-1",
        "currency": "USD",
        "cutoff": "2026-10-31T23:59:59Z",
        "window_start": "2026-10-01T00:00:00Z",
        "account_lines": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "source_line_id": "GL1",
            "account": "REV",
            "amount_cents": 2400000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "source_line_id": "GL2",
            "account": "DIRECT",
            "amount_cents": 1400000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "source_line_id": "GL3",
            "account": "OVERHEAD",
            "amount_cents": 400000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "source_line_id": "GL1",
            "account": "REV",
            "amount_cents": 2400000
          }
        ],
        "recipients": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "recipient_id": "CFO",
            "report_id": "MGT-PROFIT",
            "valid_from": "2026-01-01T00:00:00Z",
            "valid_to": "2026-12-31T23:59:59Z"
          }
        ],
        "definition": {
          "report_id": "MGT-PROFIT",
          "version": "D1",
          "source_close_version": "CLOSE-OCT-1",
          "account_classification": {
            "REV": "revenue",
            "DIRECT": "expense",
            "OVERHEAD": "expense"
          }
        },
        "signed_close_version": "CLOSE-OCT-1",
        "signed_close_period": "2026-10",
        "period": "2026-10",
        "source_profit_control_cents": 600000,
        "approved_content_hash": "645d4d070e36598bf50c7c76326e3a5e794d66b4def9fe51cf42d2dbbe6f5527",
        "approved_at": "2026-10-31T23:59:59Z",
        "intended_recipient_ids": [
          "CFO"
        ],
        "approved_recipient_ids": [
          "CFO"
        ],
        "manifest": {
          "account_lines": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 4,
            "received_records": 4,
            "complete": true
          },
          "recipients": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 1,
            "received_records": 1,
            "complete": true
          }
        }
      },
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:source_line_id:duplicate_identifier"
        ]
      }
    },
    {
      "name": "Missing source page is an incomplete population",
      "path": [
        "manifest",
        "account_lines",
        "received_records"
      ],
      "value": 0,
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:account_lines:incomplete_population"
        ]
      }
    },
    {
      "name": "Malformed source timestamp holds",
      "path": [
        "manifest",
        "account_lines",
        "known_at"
      ],
      "value": "2026-13-32T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:account_lines.known_at:invalid_utc_timestamp"
        ]
      }
    },
    {
      "name": "Old source as-of cannot satisfy the declared exact cutoff",
      "path": [
        "manifest",
        "account_lines",
        "as_of"
      ],
      "value": "2026-10-01T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:account_lines:invalid_source_cutoff"
        ]
      }
    }
  ]
}
