{
  "tool_id": "art-537-qfc-recordkeeping-file-validator",
  "note": "Vectors computed directly from the shipped kernel. Covers a clean file-conforms-and-ties-out pass, a structural error excluding a row from totals (review_required regardless of totals), a totals mismatch against a supplied control-total summary (escalate), and a missing control-total summary (did_not_run).",
  "vectors": [
    {
      "name": "conforms-and-ties-out",
      "description": "Two conforming rows, no structure errors, file totals equal the supplied control-total summary exactly. QFCFILE_CONFORMS_AND_TOTALS_TIE_OUT, auto_pass.",
      "policy_parameters": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0001",
        "file_records": [
          {
            "row_ref": "FR-1",
            "position_id": "sha256-salted@1:aa11",
            "counterparty_id": "sha256-salted@1:cc01",
            "qfc_type": "interest_rate_swap",
            "currency_code": "USD",
            "notional_minor_units": 500000000,
            "collateral_minor_units": 25000000
          },
          {
            "row_ref": "FR-2",
            "position_id": "sha256-salted@1:aa22",
            "counterparty_id": "sha256-salted@1:cc02",
            "qfc_type": "repurchase_agreement",
            "currency_code": "USD",
            "notional_minor_units": 200000000,
            "collateral_minor_units": 21000000
          }
        ],
        "control_totals": {
          "position_count": 2,
          "distinct_counterparty_count": 2,
          "notional_minor_units": 700000000,
          "collateral_minor_units": 46000000
        }
      },
      "output_payload": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0001",
        "file_totals": {
          "position_count": 2,
          "distinct_counterparty_count": 2,
          "notional_minor_units": 700000000,
          "collateral_minor_units": 46000000
        },
        "file_structure_errors": [],
        "conforming_row_count": 2,
        "supplied_row_count": 2,
        "control_totals_supplied": true,
        "control_totals": {
          "position_count": 2,
          "distinct_counterparty_count": 2,
          "notional_minor_units": 700000000,
          "collateral_minor_units": 46000000
        },
        "mismatches": [],
        "totals_mismatch": false,
        "decision": {
          "gate_policy": "auto_pass",
          "execution_state": "ran",
          "reason": null
        },
        "qfc_code_handling": "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
        "identifier_salting": "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
        "rationale": [
          "Part 371 recordkeeping file validation for institution reference IDI-SYNTH-0001 as of 2026-06-30, over 2 supplied file rows.",
          "Every supplied row conforms to the part 371 appendix record layout: 2 rows carried every required field and no position identifier repeated.",
          "The file's totals tie out exactly against the supplied control-total summary across every tied field.",
          "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
          "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
          "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here."
        ],
        "boundary": "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here.",
        "note": "Deterministic 12 CFR part 371 recordkeeping-file shape validator and totals reconciler. Single-run and stateless: it holds no records, runs on no schedule, and retains nothing. It validates the file's own declared rows against the part 371 appendix record layout and ties the file's totals to a supplied control-total summary, reporting a shape defect and a totals mismatch as two separate, never-merged findings. It holds no QFC-type or currency-code rule table and is not a filing."
      },
      "compliance_flags": [
        "QFCFILE_CONFORMS_AND_TOTALS_TIE_OUT",
        "QFCFILE_ALL_ROWS_CONFORM"
      ],
      "golden_hash": "a6be8ca5ee5d4f5f7a7bf311972d4044a0ef5c9a8b13f90c83c996683aa231fc"
    },
    {
      "name": "structure-error-missing-field",
      "description": "One row missing collateral_minor_units -- excluded from totals, review_required regardless of what the remaining totals would show.",
      "policy_parameters": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0002",
        "file_records": [
          {
            "row_ref": "FR-1",
            "position_id": "sha256-salted@1:aa11",
            "counterparty_id": "sha256-salted@1:cc01",
            "qfc_type": "interest_rate_swap",
            "currency_code": "USD",
            "notional_minor_units": 500000000
          },
          {
            "row_ref": "FR-2",
            "position_id": "sha256-salted@1:aa22",
            "counterparty_id": "sha256-salted@1:cc02",
            "qfc_type": "repurchase_agreement",
            "currency_code": "USD",
            "notional_minor_units": 200000000,
            "collateral_minor_units": 21000000
          }
        ],
        "control_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 200000000,
          "collateral_minor_units": 21000000
        }
      },
      "output_payload": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0002",
        "file_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 200000000,
          "collateral_minor_units": 21000000
        },
        "file_structure_errors": [
          {
            "row_ref": "FR-1",
            "position_id": "sha256-salted@1:aa11",
            "missing_field": "collateral_minor_units",
            "reason": "The row is missing or carries a malformed value for collateral_minor_units. The part 371 appendix record layout requires this field on every row, and a malformed value is reported rather than coerced or dropped."
          }
        ],
        "conforming_row_count": 1,
        "supplied_row_count": 2,
        "control_totals_supplied": true,
        "control_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 200000000,
          "collateral_minor_units": 21000000
        },
        "mismatches": [],
        "totals_mismatch": false,
        "decision": {
          "gate_policy": "review_required",
          "execution_state": "ran",
          "reason": null
        },
        "qfc_code_handling": "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
        "identifier_salting": "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
        "rationale": [
          "Part 371 recordkeeping file validation for institution reference IDI-SYNTH-0002 as of 2026-06-30, over 2 supplied file rows.",
          "1 row did not conform and is excluded from the file totals, each with the defect named: FR-1 (collateral_minor_units).",
          "The file's totals tie out exactly against the supplied control-total summary across every tied field.",
          "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
          "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
          "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here."
        ],
        "boundary": "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here.",
        "note": "Deterministic 12 CFR part 371 recordkeeping-file shape validator and totals reconciler. Single-run and stateless: it holds no records, runs on no schedule, and retains nothing. It validates the file's own declared rows against the part 371 appendix record layout and ties the file's totals to a supplied control-total summary, reporting a shape defect and a totals mismatch as two separate, never-merged findings. It holds no QFC-type or currency-code rule table and is not a filing."
      },
      "compliance_flags": [
        "QFCFILE_STRUCTURE_ERRORS_PRESENT"
      ],
      "golden_hash": "e236ee55943cb4a644dddb03a4bb1bafee90161fee7442d18874009682c2fc1b"
    },
    {
      "name": "totals-mismatch-escalate",
      "description": "File conforms structurally but its notional total disagrees with the supplied control-total summary -- escalate, never silently reconciled.",
      "policy_parameters": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0003",
        "file_records": [
          {
            "row_ref": "FR-1",
            "position_id": "sha256-salted@1:aa11",
            "counterparty_id": "sha256-salted@1:cc01",
            "qfc_type": "interest_rate_swap",
            "currency_code": "USD",
            "notional_minor_units": 500000000,
            "collateral_minor_units": 25000000
          }
        ],
        "control_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 480000000,
          "collateral_minor_units": 25000000
        }
      },
      "output_payload": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0003",
        "file_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 500000000,
          "collateral_minor_units": 25000000
        },
        "file_structure_errors": [],
        "conforming_row_count": 1,
        "supplied_row_count": 1,
        "control_totals_supplied": true,
        "control_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 480000000,
          "collateral_minor_units": 25000000
        },
        "mismatches": [
          {
            "field": "notional_minor_units",
            "file_value": 500000000,
            "control_value": 480000000,
            "reason": "The file's declared total for this field does not equal the tied control-total summary."
          }
        ],
        "totals_mismatch": true,
        "decision": {
          "gate_policy": "escalate",
          "execution_state": "ran",
          "reason": null
        },
        "qfc_code_handling": "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
        "identifier_salting": "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
        "rationale": [
          "Part 371 recordkeeping file validation for institution reference IDI-SYNTH-0003 as of 2026-06-30, over 1 supplied file row.",
          "Every supplied row conforms to the part 371 appendix record layout: 1 row carried every required field and no position identifier repeated.",
          "1 tied field did not reconcile against the supplied control-total summary, reported individually rather than netted: notional_minor_units (file 500000000, control 480000000).",
          "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
          "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
          "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here."
        ],
        "boundary": "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here.",
        "note": "Deterministic 12 CFR part 371 recordkeeping-file shape validator and totals reconciler. Single-run and stateless: it holds no records, runs on no schedule, and retains nothing. It validates the file's own declared rows against the part 371 appendix record layout and ties the file's totals to a supplied control-total summary, reporting a shape defect and a totals mismatch as two separate, never-merged findings. It holds no QFC-type or currency-code rule table and is not a filing."
      },
      "compliance_flags": [
        "QFCFILE_TOTALS_MISMATCH",
        "QFCFILE_ALL_ROWS_CONFORM"
      ],
      "golden_hash": "0878741ccf4dacce532922ac65a1eaed886da58032dd42ed4b65bd41b649e515"
    },
    {
      "name": "no-control-totals-did-not-run",
      "description": "No control-total summary supplied at all -- did_not_run, the file totals cannot be reconciled against nothing.",
      "policy_parameters": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0004",
        "file_records": [
          {
            "row_ref": "FR-1",
            "position_id": "sha256-salted@1:aa11",
            "counterparty_id": "sha256-salted@1:cc01",
            "qfc_type": "interest_rate_swap",
            "currency_code": "USD",
            "notional_minor_units": 500000000,
            "collateral_minor_units": 25000000
          }
        ]
      },
      "output_payload": {
        "as_of_date": "2026-06-30",
        "institution_ref": "IDI-SYNTH-0004",
        "file_totals": {
          "position_count": 1,
          "distinct_counterparty_count": 1,
          "notional_minor_units": 500000000,
          "collateral_minor_units": 25000000
        },
        "file_structure_errors": [],
        "conforming_row_count": 1,
        "supplied_row_count": 1,
        "control_totals_supplied": false,
        "control_totals": null,
        "mismatches": [],
        "totals_mismatch": false,
        "decision": {
          "gate_policy": null,
          "execution_state": "did_not_run",
          "reason": "no_control_totals_supplied: the file's totals cannot be reconciled without a tied control-total summary."
        },
        "qfc_code_handling": "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
        "identifier_salting": "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
        "rationale": [
          "Part 371 recordkeeping file validation for institution reference IDI-SYNTH-0004 as of 2026-06-30, over 1 supplied file row.",
          "Every supplied row conforms to the part 371 appendix record layout: 1 row carried every required field and no position identifier repeated.",
          "no_control_totals_supplied: the file's totals cannot be reconciled without a tied control-total summary.",
          "QFC type and currency code on each file row are opaque strings. Nothing in this computation branches on the text of either, and no table of part 371 QFC contract-type codes or currency codes is held here.",
          "Position identifier and counterparty identifier are enumerable low-entropy identifiers within the meaning of SPEC.md section 25.1. Both arrive at this kernel already salted (sha256-salted@1); the kernel uses each only to detect a repeated position or count distinct counterparties, and no raw identifier or salt ever enters this computation.",
          "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here."
        ],
        "boundary": "This validates the shape of a supplied 12 CFR part 371 qualified-financial-contract recordkeeping file against the appendix's published record layout and ties the file's declared totals to a supplied control-total summary. It is not a filing, it does not produce the part 371 appendix submission format, it carries no claim that the FDIC or the institution's primary regulator would accept the file, and it offers no advice on whether a particular contract is a covered QFC. That determination is made under 12 CFR part 371 by the institution and its counsel, never here.",
        "note": "Deterministic 12 CFR part 371 recordkeeping-file shape validator and totals reconciler. Single-run and stateless: it holds no records, runs on no schedule, and retains nothing. It validates the file's own declared rows against the part 371 appendix record layout and ties the file's totals to a supplied control-total summary, reporting a shape defect and a totals mismatch as two separate, never-merged findings. It holds no QFC-type or currency-code rule table and is not a filing."
      },
      "compliance_flags": [
        "QFCFILE_NO_CONTROL_TOTALS_SUPPLIED",
        "QFCFILE_ALL_ROWS_CONFORM"
      ],
      "golden_hash": "aee7c8edf3f3dafb581772e93ca5766012902f57dc6940d9d32a2556c7aaaea3"
    }
  ]
}
