{
  "fictional": true,
  "unitContract": "100 integer minor units per fictional MU; no currency/tax/payroll rule implied",
  "rows": [
    {
      "id": "A",
      "weight": 1
    },
    {
      "id": "B",
      "weight": 1
    },
    {
      "id": "C",
      "weight": 1
    }
  ],
  "baselineAmountMinor": 101,
  "policy": "Allocate absolute amount by proportional integer floor; rank exact fractional remainders descending; ties by stable ascending ASCII identifier; restore sign after magnitude allocation",
  "expected": {
    "equalWeights101": [
      34,
      34,
      33
    ],
    "equalWeightsNegative101": [
      -34,
      -34,
      -33
    ],
    "weights123Amount101": [
      17,
      34,
      50
    ],
    "weights123Amount100": [
      17,
      33,
      50
    ],
    "weights011Amount101": [
      0,
      51,
      50
    ],
    "allZeroAmountZero": [
      0,
      0,
      0
    ],
    "hierarchyABThenAB": {
      "firstStageAB": 67,
      "firstStageC": 34,
      "final": [
        34,
        33,
        34
      ],
      "directMinusHierarchy": [
        0,
        1,
        -1
      ]
    },
    "increasingAmountCounterexample": {
      "weights": [
        5,
        3,
        1
      ],
      "amount4": [
        2,
        1,
        1
      ],
      "amount5": [
        3,
        2,
        0
      ],
      "consequence": "C falls1to0 as amount rises4to5; the method is not recipient-wise amount-monotone"
    },
    "eventVersusMonth": {
      "twoSeparate101Allocations": [
        68,
        68,
        66
      ],
      "oneCombined202Allocation": [
        68,
        67,
        67
      ]
    }
  },
  "tests": [
    {
      "change": "Permute input rows",
      "expected": "same identity-to-allocation mapping"
    },
    {
      "change": "Reverse signed amount with unchanged weights",
      "expected": "exact row-level negation"
    },
    {
      "change": "All weights0 and nonzero amount",
      "expected": "reject unsupported denominator"
    },
    {
      "change": "Negative/fractional weight, blank amount, duplicate ID",
      "expected": "reject"
    },
    {
      "change": "Large supported amount times large weights",
      "expected": "exact integer intermediates and conserved output"
    }
  ],
  "sources": [
    {
      "url": "https://www.postgresql.org/docs/18/datatype-numeric.html",
      "claim": "Exact/inexact representation, precision, scale and implementation-specific rounding; no business allocation policy endorsement"
    }
  ]
}