Every order exception, explained. Traced from order to invoice.
We give every order exception its explanation, with the records behind it.
Provenance trail. Provenance of “on-time rate = 0.874”: on-time rate = 0.874 ← query run ← metric definition ← delivery policy §4 (read right to left: the fact was derived from each step in turn). Every step: entity “on-time rate = 0.874” (the fact in the answer); wasGeneratedBy query run. activity “query run” (2026-10-21 · 09:14); wasAssociatedWith analyst agent, used orders dataset, used metric definition. agent “analyst agent” (ran the query). entity “orders dataset” (snapshot 2026-10-20); wasDerivedFrom ERP export. entity “metric definition” (v3 of 3), versions v1 first draft; v2 excludes cancelled lines; v3 late = after promised date; wasDerivedFrom delivery policy §4, wasAttributedTo data steward. entity “ERP export” (nightly load). entity “delivery policy §4” (source document). agent “data steward” (approved v3).
Explanations need records.
An order that ships short is usually explained by an allocation rule or a stock movement. Nobody has time to trace it before the account team asks.
Planners believe an explanation when they can open the allocation run it points to. We build around those records first and the wording second.
“Why was order 88213 cut by 120 cases?”
- sourceOrder line 3 · 480 cases of SKU 1140, requested for 22 Octorder_lines
- sourceAllocation run 22 Oct 04:00 · 360 cases confirmed at depot 2alloc_runs
- checkPriority rule A-3 placed two key accounts first on a short SKUrules v12
- checkStock on hand 1,900; 1,540 already promised before this runstock_snap
- workflowSame cut on 6 other orders this week, all depot 2, same SKUpattern
- resultCut by allocation priority, not stock error. Draft reply ready for the account owner.needs review
Every quantity has a reason.
Context assembly. Context assembly for “Which vendors delivered late this month?”. 8 candidates ranked by word match, packed into a 6,000-chars window (900 reserved for context-step header + question). Late PO lines by vendor (recipe, score 0.92): in as an excerpt, 1,800 of 5,200; Late lines (old) (recipe, score 0.74): excluded, superseded; Open POs by vendor (recipe, score 0.71): in, 230; Late delivery · undecided (definition, score 0.68): in, 640; On-time delivery (kpi, score 0.60): in, 260; Delivery status codes (decode, score 0.55): in, 380; po.lines · grn.receipts (table, score 0.50): in, 420; Receipts this week (recipe, score 0.38): in, 210. The answer cites Late PO lines by vendor.
Ontology evolution. How the structure changed over 4 proposals: v1: baseline with On-time delivery, Late lines (old), Vendor, Supplier. p-104 (add, from reflection): Add definition page “Late delivery”, applied, giving v2. Diff: + definitions/late-delivery.md; + [[Late delivery]] on the KPI page. p-109 (merge, from admin): Merge “Supplier” into “Vendor”, applied, giving v3. Diff: − entities/supplier.md; + Also called: Supplier. p-112 (add, from external API): Add recipe “Late lines v2”, rejected; v3 unchanged. Diff: + recipes/late-lines-v2.md; ✗ rejected: duplicates an existing recipe. p-118 (deprecate, from reflection): Supersede “Late lines (old)”, applied, giving v4. Diff: ~ status: superseded; + recipes/late-po-lines-by-vendor.md. Selected: p-118 (deprecate, from reflection): Supersede “Late lines (old)”, applied, giving v4. Diff: ~ status: superseded; + recipes/late-po-lines-by-vendor.md.