Chapter 8 — Exceptions¶
8.1 — Chapter summary¶
⚙ Process: the
exceptionsstep — the pipeline's final validation pass (each exception's evidence is also recomputed on demand when you open it). Run: the ProcessRunner card, or the full pipeline run (the API equivalents are in 8.D).Netting results PIPE_forecast_netting (5.8) → Supply results PIPE_supply_recommendations + exceptions + capacity (7) → MEIO results PIPE_meio_results (6) → Allocation results PIPE_allocation_results (7.9) → exceptions step rule checks per (item, site) demand + supply + inventory + capacity → PIPE_series_exceptions + PIPE_supply_exceptions per (item, site, week)
The one-sentence model: the exceptions step is the plan's quality gate — it walks every planned (item, site) pair and flags the conditions a planner must look at: demand anomalies, supply shortages, capacity overruns, stock below safety, high variability, stale data. Each exception carries its type, severity, metric value, and the threshold it breached — so the planner can triage.
8.2 — The exception types (verified from live data)¶
| Family | Types | What they flag | Example trigger |
|---|---|---|---|
Supply exceptionsPIPE_supply_exceptions |
CapacityExceeded |
The plan exceeds a resource's weekly capacity (7.4) | Route capacity 500/wk, planned 550 → 50 over |
Shortage |
A site's projected stock goes negative (7.7's projection) | W12 stock: −23 (planned demand exceeds arrivals) | |
UnmetDemand |
Allocation left demand unfulfilled (7.9's shortfall) | Demand 100, allocated 60, shortfall 40 | |
Series exceptionsPIPE_series_exceptions |
23 numeric types + custom scenario types |
Demand anomalies (spike, drop, high-variability, low-observations), forecast issues (no forecast, low confidence, forecast in the past), data quality (stale data, zero demand), inventory (below SS, negative stock) | Type 1: "demand spike" when a week's demand exceeds the mean + 3σ |
8.3 — Exception scenarios, snoozes & the review log¶
⚙ Process: no pipeline step — the scenario is
scen_exception_scenario(PG, linked per pipeline viaconfig_scenario_pipeline.exception_scenario_id). It carries the threshold configuration and the per-series snoozes (interact_exception_snooze— a snoozed exception is suppressed for N days).
The review log stays with the pipeline (Decision D15): the open/reviewed/snoozed/actioned state per run is a pipeline-level audit — not scenario-scoped. The snooze (the future-behavior-changing part) is the only piece that moves to the exception scenario's scope.
The exception step refreshes open log rows from the current planning bucket, not the older snapshot selected in Scenario Review. Projected unserved demand is picked up from shortage > 0 on the serviceable stock projection, even if projected inventory is zero rather than negative. The refresh leaves reviewed, snoozed, and actioned rows intact. In Filter & Sort, Status: All includes all statuses while keeping the selected pipeline and your other filters.
The dual-mode demand read (the established rule, not a fallback): direct nodes read
master.demand_actuals; warehouse/rollup nodes read PIPE_indirect_demand — the
exception chart shows which mode it used (demand_source: "direct" | "indirect").
8.4 — Worked example: a supply Shortage exception¶
An item at a site whose projected inventory goes negative in week 12:
| W10 | W11 | W12 | W13 | W14 | |
|---|---|---|---|---|---|
| Opening stock | 150 | 100 | −23 | 0 | 0 |
| Planned demand | 50 | 73 | 100 | 80 | 90 |
| Planned arrivals | 0 | 0 | 0 | 50 | 60 |
| Exception | Shortage |
exception row written:
exception_type = 'Shortage'
item_id/site_id = the affected pair
week = W12, severity = the stock deficit magnitude
the panel shows the chart (the stock trajectory dipping below zero)
the planner's remediation: expedite the W13 arrival, or raise the W11 order
The flag is only the raw output. The rest of this section walks the planner's full triage
journey on the same example — Step 1 filter the list down to the exception
type, Step 2 handle the exception without leaving the screen,
Step 3 drill into the series and walk the remaining exceptions with the
left/right arrows. The surface is the Workflows → Exceptions screen
(left menu ⚡ Workflows → Exceptions tab, the
/exceptions route; the sibling tabs on the same page are Supply Approval,
Forecast SKUs, New Parts, Last-Time Buy). The list is scoped to the active
pipeline (the header shows the item count + pipeline name), paginated 50
items per page, and grouped: one expandable card per item, one
sub-row per site with exceptions (sites paginate 4 at a time inside a card).
Step 1 — Filter the list per exception type¶
Filtering is all one-click controls on the list itself:
| Control | What it filters | Behavior |
|---|---|---|
| Type chips — All / Forecast / IO / Supply | The exception's type family (8.2) — exception_types overlap |
Click Supply to see only supply exceptions (our Shortage); clicking the already-active chip returns to All. Free multi-type combinations are set in the Filter & Sort modal. |
| Severity chips — Critical / High / Medium / Low (+ clear) | Rows carrying at least one issue at that severity | Single-select; filters on the effective severity — the read-time ontology override, i.e. what the row displays, not the raw stored severity |
| Issues dropdown | The individual issue categories ("Stock shortage / stockout", "Orders pending approval", "High forecast error (MAPE)"…), each with a live count | Multi-select checkboxes, grouped by family (Forecast / IO / Supply / Other) + "Clear all" |
| Segment dropdown | Membership in a segment (4.4) | "All segments" default |
| Filter & Sort button (funnel) | The combined set: types + issue categories + segment + status (open default / snoozed / reviewed / all) | Apply resets to page 1 and is remembered per browser; the colored status chip beside the type chips (amber = open, purple = snoozed, green = reviewed) shows the active status. Known gap (documented): the modal's Sort By options (Severity / Item Code / Created At) persist but are not applied by the list yet — pages always come newest-item-first (first exception created_at DESC, then site). |
⚙ Process: the list is served by the exception-log API — every control above maps one-to-one onto its filter parameters (the exact calls are in 8.D). Pagination is per item group: 50 distinct items per page with all their site rows together.
Step 2 — Handle the exception in the screen (no navigation)¶
Direct handling. Hover any row — or the item header — and a kebab menu (⋮) appears with the three triage actions; nothing needs expanding:
-
Mark Reviewed — acknowledged:
status='reviewed',resolved_atstamped; the row leaves the Open queue (find it under statusreviewed). -
Snooze 1 / 3 / 7 days —
status='snoozed'+snoozed_until = now + 24/72/168h: hidden from Open for the window (8.3's suppression), listed under statussnoozedwith its expiry, re-triable from there. -
Action Taken —
status='actioned',resolved_atstamped.
The item header's kebab applies the chosen action in bulk to every
site exception of that item — one click clears the whole item. Handled rows leave the Open list
immediately, and the triage state is the pipeline-level review log (8.3, Decision D15): the
next exceptions run refreshes only the open rows — reviewed/snoozed/actioned
decisions survive re-runs.
The evidence and the fix, inline. Click the site sub-row to expand it:
-
the evidence chart — demand / stock / supply over one year of history + one year forward, the dual-mode demand-read badge (8.3), the method dropdown (best method starred), and legend trace toggles; IO/Supply rows also show the inventory zone panel — the DDMRP zone bar (SS / demand-over-LT / EOQ / Max against current on-hand) with inline-editable SS and EOQ (per-series inventory overrides);
-
the 52-week forecast table — lead-time weeks highlighted, projected stock red below safety stock, and editable cells: type a corrected weekly value (Enter or blur) to post a per-week forecast override for the series — the in-screen, demand-side remediation when the W12 demand is the wrong part of the plan (the corrected week replaces the model's value in subsequent runs);
-
the supply orders table (supply rows) — the planned orders to act on (the W13 arrival to expedite), plus the site's outbound orders and the amber "no inbound route" diagnosis when the site cannot be replenished at all;
-
the status action bar — the same Reviewed / Snooze / Action Taken buttons, for the expanded row.
⚙ Process: the triage actions, the evidence charts, and the inline overrides (forecast week, SS/EOQ) all write through the exception-log and override APIs — the exact calls are in 8.D; every action lands in the
interact_planning_eventaudit trail.
Step 3 — Drill into the series & walk the list with the arrows¶
The expanded row's Open detail button jumps to the series detail page: a
supply-only exception (our Shortage) lands directly on the series Supply tab
(/series/{uid}?tab=supply); a mixed-type exception lands on the series overview.
From that point a semi-transparent navigation overlay is mounted on the
page:
-
↑ top-center — back to the Exceptions list: the same filtered list, scrolled to and highlighting the exception you left (its item card auto-expands, the site pagination jumps to it);
-
← left edge — previous exception;
-
→ right edge — next exception. The arrows walk the list in its displayed order (item cards in list order, sites within each card). Reaching the end of the current 50-item page auto-fetches the next page and continues; on the last page the walk wraps to the first exception. The evidence for neighbors (±2 positions) is preloaded, so arrow-walking renders instantly;
-
the arrows appear only when you arrived from the exception list — a direct URL visit shows none — and only one drill is active at a time: entering the exception list clears the sibling drill overlays' back-arrows (Supply Approval, Forecast SKUs, the allocation overview), and vice versa.

Fig. 26 — The Exceptions Dashboard (the demo tenant): the exception list with type/severity/week filters, the per-series drill-down chart (the dual-mode demand read + supply orders + the "no inbound route" diagnosis), and the action buttons (review, snooze, create adjustment). Captured 2026-11-10.
8.5 — Consumers¶
| Consumer | Meaning |
|---|---|
| The Exceptions Dashboard | The primary review surface: the list, the charts, and the actions. |
| Mirabelle AI | Reads: “backorder / unfulfilled” queries route to PIPE_supply_exceptions and PIPE_allocation_unfulfilled. |
(The freeze/historization archived copies were removed with those features, Dec 2026.)
Not consumed by: the forecast chain, netting, MEIO, or supply — the exceptions step is a read-only observer of their outputs; it never feeds back into planning.
8.D — For developers — the exception-log APIs¶
The UI paths above cover the planner's loop; the equivalents for scripts and add-ons:
| Call | Purpose |
|---|---|
POST /api/pipeline/run/exceptions {"pipeline_id": N} |
Run the step standalone (CLI: python files/run_pipeline.py --only exceptions --pipeline-id N). |
GET /api/exception-log |
The list — pipeline_id required; optional status (default open), types (CSV), severity, issue_categories (\|\|-separated issue ids), segment_id, page/page_size. |
PATCH /api/exception-log/{id}/status · POST /api/exception-log/bulk-status |
The triage actions — body {"status": "reviewed" \| "snoozed" \| "actioned", "snoozed_until": ISO} (any other status is 422); bulk adds exception_ids. Both write the interact_planning_event audit trail. |
GET /api/exception-log/{id}/chart-data (also /forecast-data, /io-data, /supply-data) |
The expanded evidence panels. |
POST /api/adjustments/{uid} (adjustment_type='override') · POST /api/io-overrides |
The inline remediations — the 52-week forecast override cells and the SS/EOQ edits. |
8.T — Step-by-step test walkthrough¶
The exception triage loop (complements 8.4's worked example).
| # | Where to look / what to click | You should see |
|---|---|---|
| 1 | Processes → Exceptions card → Run | the plan's quality gate computes over the latest outputs |
| 2 | Workflows → Exceptions (route /exceptions) |
the list scoped to the active pipeline; type chips (All/Forecast/IO/Supply) + severity chips |
| 3 | Click the Supply chip | only supply-family rows remain (Shortage, CapacityExceeded, UnmetDemand) |
| 4 | Expand a site row | evidence chart (dual-mode demand badge), the 52-week forecast table, supply orders, action bar |
| 5 | Snooze a row 3 days | it leaves Open; status filter snoozed lists it with its expiry |
| 6 | Re-run the exceptions step | reviewed/snoozed/actioned decisions SURVIVE (only open rows refresh) |
| 7 | Open detail → walk with ←/→ → ↑ back | the arrows walk the filtered list; ↑ returns scrolled to your row |

The triage surface: filters, evidence, actions.