{
  "schemaVersion": "1.0",
  "experimentId": "gk-contribution-api-acceptance-2026-10-04-v1",
  "author": "George Kelly",
  "inputProvenance": "All amounts and caller metadata are deliberately authored synthetic examples; they are not merchant or employer records.",
  "selection": "Eight arithmetic controls and six malformed HTTP requests, selected before execution; five separate local caller-metadata cases. This is an editorial acceptance panel, not a random sample.",
  "httpCases": [
    {
      "id": "positive-control",
      "question": "Can a caller obtain all results and the original inputs for the published worked example?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=200",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "450",
          "contributionBeforeAds": "300",
          "contributionAfterAds": "100",
          "revenueRoas": "5",
          "grossProfitReturn": "9/4",
          "contributionReturn": "3/2",
          "breakEvenRoas": "10/3",
          "contributionMarginBeforeAds": "3/10"
        }
      }
    },
    {
      "id": "negative-contribution",
      "question": "Does a loss remain negative instead of being clipped to zero?",
      "query": "netRevenue=1000&costOfGoods=700&variableCosts=400&adSpend=200",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "300",
          "contributionBeforeAds": "-100",
          "contributionAfterAds": "-300",
          "revenueRoas": "5",
          "grossProfitReturn": "3/2",
          "contributionReturn": "-1/2",
          "breakEvenRoas": null,
          "contributionMarginBeforeAds": "-1/10"
        }
      }
    },
    {
      "id": "zero-ad-spend",
      "question": "Do undefined spend ratios remain null while monetary contribution remains available?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=0",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "450",
          "contributionBeforeAds": "300",
          "contributionAfterAds": "300",
          "revenueRoas": null,
          "grossProfitReturn": null,
          "contributionReturn": null,
          "breakEvenRoas": "10/3",
          "contributionMarginBeforeAds": "3/10"
        }
      }
    },
    {
      "id": "zero-revenue",
      "question": "Are zero ROAS and undefined revenue-based margin distinguished?",
      "query": "netRevenue=0&costOfGoods=55&variableCosts=15&adSpend=20",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "-55",
          "contributionBeforeAds": "-70",
          "contributionAfterAds": "-90",
          "revenueRoas": "0",
          "grossProfitReturn": "-11/4",
          "contributionReturn": "-7/2",
          "breakEvenRoas": null,
          "contributionMarginBeforeAds": null
        }
      }
    },
    {
      "id": "zero-pre-ad-margin",
      "question": "Does zero pre-ad contribution yield null break-even ROAS?",
      "query": "netRevenue=1000&costOfGoods=700&variableCosts=300&adSpend=200",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "300",
          "contributionBeforeAds": "0",
          "contributionAfterAds": "-200",
          "revenueRoas": "5",
          "grossProfitReturn": "3/2",
          "contributionReturn": "0",
          "breakEvenRoas": null,
          "contributionMarginBeforeAds": "0"
        }
      }
    },
    {
      "id": "all-zero",
      "question": "Does the empty arithmetic scenario preserve undefined denominators?",
      "query": "netRevenue=0&costOfGoods=0&variableCosts=0&adSpend=0",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "0",
          "contributionBeforeAds": "0",
          "contributionAfterAds": "0",
          "revenueRoas": null,
          "grossProfitReturn": null,
          "contributionReturn": null,
          "breakEvenRoas": null,
          "contributionMarginBeforeAds": null
        }
      }
    },
    {
      "id": "decimal-inputs",
      "question": "Are decimal amounts accepted without integer truncation or display rounding?",
      "query": "netRevenue=100.50&costOfGoods=55.25&variableCosts=15.25&adSpend=20.00",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "45.25",
          "contributionBeforeAds": "30",
          "contributionAfterAds": "10",
          "revenueRoas": "201/40",
          "grossProfitReturn": "181/80",
          "contributionReturn": "3/2",
          "breakEvenRoas": "67/20",
          "contributionMarginBeforeAds": "20/67"
        }
      }
    },
    {
      "id": "upper-input-bound",
      "question": "Is the inclusive 1e12 input limit distinct from a limit on output magnitudes?",
      "query": "netRevenue=1000000000000&costOfGoods=1000000000000&variableCosts=1000000000000&adSpend=1000000000000",
      "expected": {
        "status": 200,
        "result": {
          "grossProfit": "0",
          "contributionBeforeAds": "-1000000000000",
          "contributionAfterAds": "-2000000000000",
          "revenueRoas": "1",
          "grossProfitReturn": "0",
          "contributionReturn": "-1",
          "breakEvenRoas": null,
          "contributionMarginBeforeAds": "-1"
        }
      }
    },
    {
      "id": "missing-ad-spend",
      "question": "Is missing input rejected rather than filled with zero?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150",
      "expected": {
        "status": 400,
        "error": "adSpend is required exactly once as a non-negative decimal number."
      }
    },
    {
      "id": "duplicate-ad-spend",
      "question": "Is a duplicate rejected even when both values agree?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=200&adSpend=200",
      "expected": {
        "status": 400,
        "error": "adSpend is required exactly once as a non-negative decimal number."
      }
    },
    {
      "id": "negative-input",
      "question": "Are negative inputs rejected while negative outputs remain possible?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=-1",
      "expected": {
        "status": 400,
        "error": "adSpend is required exactly once as a non-negative decimal number."
      }
    },
    {
      "id": "exponent-input",
      "question": "Is exponent notation rejected even when it represents 200?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=2e2",
      "expected": {
        "status": 400,
        "error": "adSpend is required exactly once as a non-negative decimal number."
      }
    },
    {
      "id": "above-input-bound",
      "question": "Is an amount immediately above the bound rejected?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=1000000000001",
      "expected": {
        "status": 400,
        "error": "Advertising spend must be a finite number between 0 and 1,000,000,000,000."
      }
    },
    {
      "id": "unknown-currency-parameter",
      "question": "Does the HTTP contract reject a made-up currency field rather than imply currency verification?",
      "query": "netRevenue=1000&costOfGoods=550&variableCosts=150&adSpend=200&currency=USD",
      "expected": {
        "status": 400,
        "error": "Unknown parameter. Use netRevenue, costOfGoods, variableCosts, and adSpend only."
      }
    }
  ],
  "callerCases": [
    {
      "id": "matching-labels-ready",
      "question": "Four complete, agreeing metadata labels permit a request to be prepared; no request is sent in this caller check.",
      "records": {
        "netRevenue": {
          "amount": "1000",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "costOfGoods": {
          "amount": "550",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "variableCosts": {
          "amount": "150",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "adSpend": {
          "amount": "200",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        }
      },
      "expectedStatus": "ready"
    },
    {
      "id": "mixed-currency-hold",
      "question": "Revenue in USD and cost of goods in EUR need reconciliation before arithmetic.",
      "records": {
        "netRevenue": {
          "amount": "1000",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "costOfGoods": {
          "amount": "550",
          "currency": "EUR",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "variableCosts": {
          "amount": "150",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "adSpend": {
          "amount": "200",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        }
      },
      "expectedStatus": "hold"
    },
    {
      "id": "missing-currency-hold",
      "question": "An absent currency label is unknown, not an implied USD amount.",
      "records": {
        "netRevenue": {
          "amount": "1000",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "costOfGoods": {
          "amount": "550",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "variableCosts": {
          "amount": "150",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "adSpend": {
          "amount": "200",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        }
      },
      "expectedStatus": "hold"
    },
    {
      "id": "different-cohort-hold",
      "question": "Advertising spend assigned to another cohort must be reconciled.",
      "records": {
        "netRevenue": {
          "amount": "1000",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "costOfGoods": {
          "amount": "550",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "variableCosts": {
          "amount": "150",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "adSpend": {
          "amount": "200",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-08-settled-v1"
        }
      },
      "expectedStatus": "hold"
    },
    {
      "id": "missing-cohort-hold",
      "question": "Missing cohort evidence must not be inferred from the other values.",
      "records": {
        "netRevenue": {
          "amount": "1000",
          "currency": "USD"
        },
        "costOfGoods": {
          "amount": "550",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "variableCosts": {
          "amount": "150",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        },
        "adSpend": {
          "amount": "200",
          "currency": "USD",
          "cohortId": "fictional-orders-2026-09-settled-v1"
        }
      },
      "expectedStatus": "hold"
    }
  ],
  "notTested": [
    "Independent integrations, adoption, repeat use, or audience demand",
    "Any language model, tool-selection policy, or model performance",
    "Correctness, settlement, authenticity, currency conversion, or cohort assignment of real business data",
    "Advertising incrementality, forecasting, profit after fixed overhead, or a spend recommendation",
    "Exhaustive input space, load, uptime, latency, security, or compatibility with every API client",
    "Provider validation of an OpenAPI document or admission to any tool directory"
  ]
}
