{
  "schemaVersion": 1,
  "id": "uk-wholesale-1015-153431",
  "title": "Invoice exception investigation",
  "scope": {
    "mode": "Retrospective analysis of a public dataset; historical replay, not a customer deployment.",
    "period": {
      "start": "2011-01-01",
      "end": "2011-06-30",
      "label": "H1 2011"
    },
    "validLineRule": "Invoice date in H1 2011, unit price > 0 and quantity > 0.",
    "flagRule": "Unit price deviates from the SKU’s most common unit price in the same month by more than max(£0.01, 2%).",
    "classification": "Heuristic attribution for this exercise, not a confirmed price list or independently validated error labels."
  },
  "dataset": {
    "creator": "Chen, D.",
    "year": 2012,
    "title": "Online Retail II",
    "repository": "UCI Machine Learning Repository",
    "doi": "https://doi.org/10.24432/C5CG6D",
    "license": "CC BY 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by/4.0/",
    "adaptation": "Analysis of a valid-line subset covering January–June 2011; aggregate results and heuristic categories prepared by Polaris."
  },
  "metrics": {
    "validLines": 174619,
    "flaggedLines": 43109,
    "patternMatchedLines": 41958,
    "unexplainedLines": 1151
  },
  "categories": [
    {
      "id": "customer_type",
      "label": "Customer-type pricing",
      "count": 33849,
      "explanation": "These lines match a higher-price pattern associated with missing customer IDs. Comparing those records against one monthly common price creates apparent exceptions.",
      "nextStep": "Confirm whether a separate walk-in or customer-type price list applies, then use that price list as the comparison reference.",
      "sourceRefs": [
        "report:Management Conclusions, item 1",
        "report:Hypothesis Tree and Findings, H3"
      ]
    },
    {
      "id": "volume",
      "label": "Volume pricing",
      "count": 7721,
      "explanation": "These lines follow a lower-price pattern at larger order quantities, consistent with quantity tiers.",
      "nextStep": "Confirm the approved quantity tiers and compare each invoice against the relevant tier.",
      "sourceRefs": [
        "report:Management Conclusions, item 1",
        "report:Hypothesis Tree and Findings, H2"
      ]
    },
    {
      "id": "price_change",
      "label": "Price changes",
      "count": 388,
      "explanation": "These lines match price changes between adjacent months rather than a single stable monthly reference.",
      "nextStep": "Check the effective date of the price change and the price that should have applied to the invoice.",
      "sourceRefs": [
        "report:Management Conclusions, item 1",
        "report:Hypothesis Tree and Findings, H4"
      ]
    },
    {
      "id": "unexplained",
      "label": "Needs investigation",
      "count": 1151,
      "explanation": "These lines do not match the three identified patterns. The analysis does not establish whether they are mistakes or negotiated prices.",
      "nextStep": "Review the underlying invoice, agreement and any override approval before deciding whether a correction is needed.",
      "sourceRefs": [
        "report:Management Conclusions, items 1 and 5",
        "report:Evidence Grading Detail"
      ]
    }
  ],
  "methodology": [
    "Recompute the 174,619 valid invoice lines for January–June 2011.",
    "Use the most common unit price for each SKU in the same month as the initial reference.",
    "43,989 lines differ exactly from that reference; the displayed review set is the narrower 43,109 lines outside max(£0.01, 2%) tolerance.",
    "Assign the 43,109 flagged lines to customer-type, volume, price-change or unexplained categories using the exercise’s heuristic rules.",
    "The first three categories sum to 41,958 pattern-matched lines. The remaining 1,151 lines need further investigation.",
    "Treat this as a historical reclassification of the review set. It does not measure deployed workload reduction, hours saved, recovered revenue or corrected errors."
  ],
  "validation": {
    "explanation": {
      "pilot": "PASS",
      "expanded": "PASS",
      "meaning": "Both checks require a valid category output: tier, customer_type, price_change or unexplained. Passing these checks does not validate the accuracy of the assigned labels.",
      "labelAccuracy": "Agreement with the host rule was report-only pending a 50-row human spot check reaching 90%; no completed human validation is recorded in the provided run.",
      "sourceRefs": [
        "run:/frozen_checks",
        "run:/frozen_criteria/2"
      ]
    },
    "quotePrototype": {
      "pilot": "PASS — 500 held-out lines",
      "expanded": "FAIL — 3,000 held-out lines",
      "failedGates": [
        "overall_gain",
        "unseen_family_ape"
      ],
      "failedGateDefinitions": {
        "overall_gain": "Required hit-rate improvement of at least 5 percentage points over the strongest trivial baseline.",
        "unseen_family_ape": "Required median absolute percentage error on eligible held-out product-family descriptions no greater than 0.8 times the noun median-price baseline."
      },
      "recommendation": "The separate suggested-price prototype did not meet expanded acceptance criteria and was not recommended for use.",
      "relationToCase": "The website example shows invoice exception investigation. It does not present the failed quote prototype as a successful production pricing system.",
      "sourceRefs": [
        "run:/frozen_checks",
        "run:/frozen_criteria/1",
        "report:Management Conclusions, item 4"
      ]
    },
    "run": {
      "displayState": "delivered",
      "overallGatePassed": false,
      "researchClosed": false,
      "status": "A run snapshot was delivered. The investigation remained open (requires_input) and the overall delivery gate did not pass.",
      "openQuestions": [
        "Whether formal customer-type price lists and quantity tiers exist.",
        "Whether unexplained deviations are errors or negotiated prices.",
        "Who owns price lists and override approvals."
      ],
      "sourceRefs": [
        "run:/state",
        "run:/gate",
        "report:Items Needing Human Confirmation and Interview Questions"
      ],
      "deliveryChecks": [
        {
          "name": "report_exists",
          "passed": true
        },
        {
          "name": "required_sections",
          "passed": true
        },
        {
          "name": "evidence_tags_present",
          "passed": true
        },
        {
          "name": "citations_resolve",
          "passed": true
        },
        {
          "name": "questions_file",
          "passed": true
        },
        {
          "name": "research_closed",
          "passed": false
        },
        {
          "name": "privacy_masked",
          "passed": true
        }
      ]
    }
  },
  "provenance": [
    {
      "id": "run",
      "path": "polaris-demo/static/run-review/uk-wholesale-1015-153431.json",
      "sha256": "001c82999473423201a459fc34896a266912e52ad08eef267907d719b96f5d29",
      "location": "/charts/0/points/0; /sections; /gate; /frozen_checks; /frozen_criteria"
    },
    {
      "id": "report",
      "path": "polaris-demo/runs/uk-wholesale-1015-153431/translations/artifacts__report.md.en.md",
      "sha256": "5ea35a4c9e3a1d9e15c64752ff9e72c1396a35a2f609cfcb445fca9d4c1fd9f4",
      "location": "Management Conclusions; Reproducible Baseline; Evidence Grading Detail; Restructuring and Improvement Plan"
    }
  ],
  "boundaries": [
    "Public-dataset retrospective analysis, not a measured customer deployment.",
    "Pattern matches are heuristic explanations, not validated labels or confirmed pricing errors.",
    "No production changes were deployed and no automatic invoice correction is shown.",
    "No time-saving, recovered-revenue or realized workload-reduction claim is made.",
    "The separate quote prototype failed expanded validation; the full run remained open pending human input."
  ]
}
