Northwind Components ERP Task Skill
API Conventions
- Base URL: read from
environment_access.md (do not assume localhost).
- Core endpoints:
GET /orders?wave= — wave membership; may return more orders than the memo lists. Always restrict to the memo's order_ids.
GET /orders/<order_id> — order detail with lines, warehouse, customer, shipping_speed, destination_zip.
GET /products and GET /products/<sku> — product master; includes active, weight_lb, safety_stock, overstock_threshold, unit_cost, supplier_id.
GET /customers/<customer_id> — account_status (active/blocked/review_required), risk_flag (none/fraud_watch/credit_watch).
GET /inventory?warehouse_id=&sku= — returns list with on_hand, reserved, quarantined.
GET /warehouses — warehouse list.
GET /shipping/quote?warehouse_id=&destination_zip=&weight_lb=&speed= — shipping cost; weight_lb must be exact.
GET /purchase_orders?supplier_id=&sku=&status= — PO list; check status values carefully (open, confirmed, received, cancelled).
GET /incidents?start=&end=&supplier_id=&sku=&incident_type=&status= — incident filtering.
GET /suppliers — supplier master with quality_status.
GET /boms/<bom_id> — BOM components with quantity_per_kit.
Field Conventions & Calculations
Inventory Effective Available
Universal formula across tasks:
effective_available = on_hand - reserved - quarantined
Never treat reserved or quarantined as freely available.
Shipping Quote Weight
Critical: Use actual product weight_lb, never estimates.
weight_lb = sum(line['quantity'] * products[line['sku']]['weight_lb'] for line in order['lines'])
Then call /shipping/quote with exact weight_lb and the order's shipping_speed.
Currency & Rounding
- All USD values:
round(value, 2).
- Percentages: follow template precision (often 1 decimal place).
- Durations: follow template precision (often 2 decimal places).
Sorting Discipline
The answer template always specifies ordering. Common patterns:
order_id ascending
sku ascending
supplier_id ascending
- Multi-key sorts (e.g., transfer requests:
sku asc, quantity desc, from_warehouse_id asc)
Apply exactly; do not rely on API return order.
Controlled Vocabulary & Decision Precedence
Expedite Queue Decisions (train_001 pattern)
- Account-level blocks first:
account_status == 'blocked' → reject_hold / hold_credit_or_fraud
risk_flag == 'fraud_watch' or 'credit_watch' → manual_review / send_account_review
- Then inventory:
- Inactive SKU(s) present →
backorder or inactive_and_shortage; next_action escalate_product_master
- Shortage (effective_available < quantity) →
backorder / create_backorder
- Low stock (effective_available >= quantity but < safety_stock) →
delayed_release / delay_and_monitor
- Ready →
ship_now / release_to_pick
- Then account review:
account_status == 'review_required' → manual_review / send_account_review
Allocation Line Actions (train_004 pattern)
Per-line decision hierarchy:
account_status == 'blocked' → manual_review, primary_reason = 'account_blocked'
risk_flag == 'fraud_watch' → manual_review, primary_reason = 'fraud_watch'
account_status == 'review_required' → manual_review, primary_reason = 'account_review_required'
product.active == False → manual_review, primary_reason = 'inactive_product'
- Inventory check:
effective_available >= quantity → ship
- Else check other warehouses for transfer (one source warehouse; leave usable requested-warehouse quantity as
ship_quantity)
- If transfer covers gap →
transfer
- Else →
backorder with primary_reason = 'insufficient_effective_stock'
Blocked orders: Only orders stopped at account/customer-risk level, not line-only product reviews.
BOM Replenishment (train_002 pattern)
total_required = sum(quantity_per_kit * build_quantity) across all BOMs for the SKU.
target_effective_available = effective stock at the target build warehouse.
- Timely POs = same-warehouse
open or confirmed POs for the SKU.
- Gap =
max(0, total_required - target_effective_available - timely_po_qty).
- Transfers: evaluate other warehouses'
effective_available without dropping below safety_stock (or follow memo's "protected stock" rule).
- Exclusion reasons when no gap or overstock:
target_overstock if target effective > overstock_threshold
stocked_no_gap if gap == 0
timely_po_covers_gap if POs fully cover
- Final actions map to exclusion reasons:
overstock_excluded, no_action_stocked, timely_po_covered, transfer_only, purchase_required.
Supplier Scorecards (train_003 pattern)
- Filter incidents strictly by the
open_date window in the request JSON.
- Duration: calendar days (
close_date - open_date for closed; analysis_date - open_date for open).
- Percentage:
incident_count / total_filtered_incidents, rounded to specified precision.
- Recommendation policy precedence is strict top-to-bottom; evaluate in given order and stop at first match.
- Tie-breaking for top escalation:
incident_count desc, total_resolution_cost desc, supplier_id asc.
Supplier Quality Hold Review (train_005 pattern)
- Analysis window: strict date filter on
open_date.
- Held POs:
open or confirmed purchase orders for the supplier.
- Decisions:
freeze_new_replenishment for suppliers on quality_hold with significant incident load, or any critical/open incidents.
buyer_review_required for watch status with notable risk.
monitor_only otherwise.
release_supplier_ids = only those with monitor_only decision.
Common Pitfalls
- Wrong shipping weight — using
quantity * 0.5 instead of actual weight_lb. This causes large cost errors.
- Ignoring quarantined inventory — forgetting to subtract
quarantined from on_hand.
- Wrong precedence — account
blocked must be checked before inventory; review_required precedence may vary by task type.
- Sorting — missing multi-key sorts or assuming API returns are already ordered.
- PO status filtering — including
received or cancelled POs when only open/confirmed count.
- Date inclusivity — check whether incident date filters are inclusive or exclusive.
- BOM multiplication — remember to multiply
quantity_per_kit by build_quantity for each target build.
1---2name: reflect-3-attempt-01-353description: Northwind Components ERP Task Skill4---5# Northwind Components ERP Task Skill67## API Conventions89- Base URL: read from `environment_access.md` (do not assume localhost).10- Core endpoints:11 - `GET /orders?wave=` — wave membership; may return more orders than the memo lists. **Always restrict to the memo's `order_ids`.**12 - `GET /orders/<order_id>` — order detail with lines, warehouse, customer, shipping_speed, destination_zip.13 - `GET /products` and `GET /products/<sku>` — product master; includes `active`, `weight_lb`, `safety_stock`, `overstock_threshold`, `unit_cost`, `supplier_id`.14 - `GET /customers/<customer_id>` — `account_status` (active/blocked/review_required), `risk_flag` (none/fraud_watch/credit_watch).15 - `GET /inventory?warehouse_id=&sku=` — returns list with `on_hand`, `reserved`, `quarantined`.16 - `GET /warehouses` — warehouse list.17 - `GET /shipping/quote?warehouse_id=&destination_zip=&weight_lb=&speed=` — shipping cost; **weight_lb must be exact**.18 - `GET /purchase_orders?supplier_id=&sku=&status=` — PO list; check status values carefully (`open`, `confirmed`, `received`, `cancelled`).19 - `GET /incidents?start=&end=&supplier_id=&sku=&incident_type=&status=` — incident filtering.20 - `GET /suppliers` — supplier master with `quality_status`.21 - `GET /boms/<bom_id>` — BOM components with `quantity_per_kit`.2223## Field Conventions & Calculations2425### Inventory Effective Available26Universal formula across tasks:27```28effective_available = on_hand - reserved - quarantined29```30Never treat reserved or quarantined as freely available.3132### Shipping Quote Weight33**Critical:** Use actual product `weight_lb`, never estimates.34```python35weight_lb = sum(line['quantity'] * products[line['sku']]['weight_lb'] for line in order['lines'])36```37Then call `/shipping/quote` with exact `weight_lb` and the order's `shipping_speed`.3839### Currency & Rounding40- All USD values: `round(value, 2)`.41- Percentages: follow template precision (often 1 decimal place).42- Durations: follow template precision (often 2 decimal places).4344### Sorting Discipline45The answer template always specifies ordering. Common patterns:46- `order_id` ascending47- `sku` ascending48- `supplier_id` ascending49- Multi-key sorts (e.g., transfer requests: `sku` asc, `quantity` desc, `from_warehouse_id` asc)50Apply exactly; do not rely on API return order.5152## Controlled Vocabulary & Decision Precedence5354### Expedite Queue Decisions (train_001 pattern)551. **Account-level blocks first:**56 - `account_status == 'blocked'` → `reject_hold` / `hold_credit_or_fraud`57 - `risk_flag == 'fraud_watch'` or `'credit_watch'` → `manual_review` / `send_account_review`582. **Then inventory:**59 - Inactive SKU(s) present → `backorder` or `inactive_and_shortage`; next_action `escalate_product_master`60 - Shortage (effective_available < quantity) → `backorder` / `create_backorder`61 - Low stock (effective_available >= quantity but < safety_stock) → `delayed_release` / `delay_and_monitor`62 - Ready → `ship_now` / `release_to_pick`633. **Then account review:**64 - `account_status == 'review_required'` → `manual_review` / `send_account_review`6566### Allocation Line Actions (train_004 pattern)67Per-line decision hierarchy:681. `account_status == 'blocked'` → `manual_review`, `primary_reason = 'account_blocked'`692. `risk_flag == 'fraud_watch'` → `manual_review`, `primary_reason = 'fraud_watch'`703. `account_status == 'review_required'` → `manual_review`, `primary_reason = 'account_review_required'`714. `product.active == False` → `manual_review`, `primary_reason = 'inactive_product'`725. Inventory check:73 - `effective_available >= quantity` → `ship`74 - Else check other warehouses for transfer (one source warehouse; leave usable requested-warehouse quantity as `ship_quantity`)75 - If transfer covers gap → `transfer`76 - Else → `backorder` with `primary_reason = 'insufficient_effective_stock'`7778**Blocked orders:** Only orders stopped at account/customer-risk level, not line-only product reviews.7980### BOM Replenishment (train_002 pattern)81- `total_required = sum(quantity_per_kit * build_quantity)` across all BOMs for the SKU.82- `target_effective_available` = effective stock at the target build warehouse.83- Timely POs = same-warehouse `open` or `confirmed` POs for the SKU.84- Gap = `max(0, total_required - target_effective_available - timely_po_qty)`.85- Transfers: evaluate other warehouses' `effective_available` without dropping below `safety_stock` (or follow memo's "protected stock" rule).86- Exclusion reasons when no gap or overstock:87 - `target_overstock` if target effective > `overstock_threshold`88 - `stocked_no_gap` if gap == 089 - `timely_po_covers_gap` if POs fully cover90- Final actions map to exclusion reasons: `overstock_excluded`, `no_action_stocked`, `timely_po_covered`, `transfer_only`, `purchase_required`.9192### Supplier Scorecards (train_003 pattern)93- Filter incidents strictly by the `open_date` window in the request JSON.94- Duration: calendar days (`close_date - open_date` for closed; `analysis_date - open_date` for open).95- Percentage: `incident_count / total_filtered_incidents`, rounded to specified precision.96- Recommendation policy precedence is strict top-to-bottom; evaluate in given order and stop at first match.97- Tie-breaking for top escalation: `incident_count` desc, `total_resolution_cost` desc, `supplier_id` asc.9899### Supplier Quality Hold Review (train_005 pattern)100- Analysis window: strict date filter on `open_date`.101- Held POs: `open` or `confirmed` purchase orders for the supplier.102- Decisions:103 - `freeze_new_replenishment` for suppliers on `quality_hold` with significant incident load, or any critical/open incidents.104 - `buyer_review_required` for `watch` status with notable risk.105 - `monitor_only` otherwise.106- `release_supplier_ids` = only those with `monitor_only` decision.107108## Common Pitfalls1091101. **Wrong shipping weight** — using `quantity * 0.5` instead of actual `weight_lb`. This causes large cost errors.1112. **Ignoring quarantined inventory** — forgetting to subtract `quarantined` from `on_hand`.1123. **Wrong precedence** — account `blocked` must be checked before inventory; `review_required` precedence may vary by task type.1134. **Sorting** — missing multi-key sorts or assuming API returns are already ordered.1145. **PO status filtering** — including `received` or `cancelled` POs when only `open`/`confirmed` count.1156. **Date inclusivity** — check whether incident date filters are inclusive or exclusive.1167. **BOM multiplication** — remember to multiply `quantity_per_kit` by `build_quantity` for each target build.