Northwind Components ERP Skill — Task Group 007
Overview
Tasks in this group involve querying a shared Northwind ERP API (http://127.0.0.1:8007) and producing strictly-structured JSON outputs. There are four main task families:
- Expedite queue decisions — per-order release/hold/backorder/review decisions.
- Allocation / transfer desk — per-line warehouse action (ship, transfer, backorder, manual_review).
- Kit replenishment / production planning — BOM component coverage with POs, transfers, and purchase requisitions.
- Supplier quality / procurement control — incident scorecards and freeze/buyer-review decisions.
Environment & API Setup
- Start the API with
bash setup.sh start or python server.py --host 127.0.0.1 --port 8007.
- Base URL:
http://127.0.0.1:8007
- Query live endpoints; never rely on cached snapshots. Relevant endpoints include
/orders, /products, /customers, /inventory, /warehouses, /shipping_quotes, /boms, /purchase_orders, /incidents, /suppliers.
Universal Sorting Rules
Apply ascending sort unless the task template specifies otherwise:
- Order IDs:
SO-70000 style — sort ascending lexicographically.
- SKU strings:
NW-1000 style — sort ascending.
- Supplier IDs:
SUP-001 style — sort ascending.
- PO IDs:
PO-50001 style — sort ascending.
- Incident IDs:
INC-90001 style — sort ascending.
- Line-level lists: sort by
order_id ascending, then line_id ascending.
- Transfer-request tie-breaking (kit planning): sort by
sku ascending, then quantity descending, then from_warehouse_id ascending.
Rounding & Precision
- Currency (USD): round to exactly 2 decimal places in all fields named
*_cost_usd, total_cost_usd, unit_cost, extended_cost.
- Percentages: round to 1 decimal place.
- Durations (days): round to 2 decimal places.
- Quantities: integers, no rounding needed.
Controlled Vocabularies
Learn the exact enums allowed by each template. Common ones across tasks:
Inventory Status (expedite tasks)
ready, low_stock, shortage, inactive_sku, inactive_and_shortage
Customer Exception (expedite tasks)
none, review_required, account_blocked, fraud_watch, credit_watch
Final Decision (expedite tasks)
ship_now, delayed_release, manual_review, backorder, reject_hold
Next Action (expedite tasks)
release_to_pick, delay_and_monitor, send_account_review, create_backorder, hold_credit_or_fraud, escalate_product_master
Allocation Line Actions
ship, transfer, backorder, manual_review
Allocation Primary Reasons
none, account_blocked, account_review_required, fraud_watch, inactive_product, insufficient_effective_stock
Kit Component Final Actions
no_action_stocked, transfer_only, purchase_required, timely_po_covered, overstock_excluded
Exclusion Reasons (kit planning)
none, target_overstock, timely_po_covers_gap, stocked_no_gap
Supplier Recommendation Codes (scorecards)
ESCALATE_SUPPLIER, PROCESS_REVIEW, WATCHLIST, MONITOR — evaluated in that precedence order.
Procurement Decisions
freeze_new_replenishment, buyer_review_required, monitor_only
Supplier Quality Status
approved, watch, quality_hold
Inventory & Availability Rules
- Effective available for a warehouse = on-hand minus reserved, quarantined, and normal operating buffer quantities. Do not treat protected stock as freely available.
- In allocation tasks, if the requested warehouse cannot fully cover a line but another warehouse has sufficient effective stock without dipping into protected stock, the action is
transfer (not backorder).
- In kit planning, compute
target_effective_available = current effective available − total required for the build.
- An SKU is inactive when the product master status is inactive/discontinued.
Order & Account Rules
- Account flags (
account_blocked, review_required, fraud_watch, credit_watch) on a customer override inventory decisions and force manual_review or reject_hold at the order level.
- If any line forces
manual_review because of account risk, the whole order is typically blocked or rolled up to manual_review.
- Inactive product master on a line forces
manual_review with reason inactive_product.
Shipping Quotes
- Requested via the API per order (or per order + speed). Return fields:
zone_distance (int), service_days (int), total_cost_usd (number, 2 decimals).
- Even if the order decision is not release, the memo may still require a quote.
Kit Replenishment Logic
- Compute
total_required = BOM qty per unit × build_quantity, summed across all target builds.
- Check timely POs: open or confirmed purchase orders for the same warehouse that arrive before the build date. Their quantities can cover the gap.
- Check inter-warehouse transfers: other warehouses with surplus effective stock. Prefer feasible transfers before raising purchase requisitions.
- Final action:
- If
target_effective_available ≥ 0 and no gap exists → overstock_excluded or no_action_stocked.
- If timely PO covers the gap →
timely_po_covered.
- If transfer covers the gap →
transfer_only.
- Else →
purchase_required for remaining gap.
- Excluded components list gets its own section with reason and supporting PO IDs.
- Purchase requisitions require
supplier_id, warehouse_id, quantity, needed_by, unit_cost, extended_cost (qty × unit_cost, rounded to 2 decimals).
Supplier Scorecard & Quality Rules
- Filter incidents by
open_date within the requested window (inclusive).
- Duration:
- Closed incidents: calendar days from
open_date to close_date.
- Open incidents: calendar days from
open_date to analysis_date.
- Incident percentage = supplier incident count ÷ total filtered incident count × 100, rounded to 1 decimal.
- Severe incidents: severity in
high or critical.
- Recommendation precedence (evaluate in order; first match wins):
- ESCALATE_SUPPLIER: supplier on
quality_hold with ≥3 filtered incidents, OR any critical RMA, OR ≥3 RMAs and ≥15,000 total resolution cost.
- PROCESS_REVIEW: WORK_ORDER incidents ≥3 and exceed RMA incidents.
- WATCHLIST: quality status is
watch or quality_hold, OR incident count ≥4, OR total resolution cost ≥12,000, OR severe incident count ≥2.
- MONITOR: default.
- Top escalation suppliers: only those with
ESCALATE_SUPPLIER, sorted by incident count descending, then total resolution cost descending, then supplier_id ascending.
- Highest cost supplier: supplier with greatest total resolution cost.
- Highest share supplier: supplier with greatest incident percentage.
Procurement Control Desk Logic
- Review target suppliers for recent incidents in the analysis window.
- Collect open/confirmed PO IDs for each supplier.
- Decision mapping:
freeze_new_replenishment for serious risk (e.g., quality_hold with multiple incidents).
buyer_review_required for moderate risk (e.g., watch status with incidents).
monitor_only when risk is acceptable.
held_po_ids in output = sorted unique union of all PO IDs from suppliers not released (monitor_only).
release_supplier_ids = sorted list of suppliers whose decision is monitor_only.
sample_incident_ids = up to 5 most representative incident IDs, sorted ascending.
affected_skus = sorted unique SKUs from filtered incidents.
JSON Output Discipline
- Return only the JSON object; no markdown fences, no narrative text.
- Include every key required by the task-specific
answer_template.json.
- Use exact enum strings; never paraphrase.
- Empty lists are preferred over
null for missing collections.
- For transfer fields that are optional, use
null when the action does not involve a transfer.
Common Pitfalls
- Using raw on-hand instead of effective available — always subtract reserved, quarantined, and buffer stock.
- Sorting incorrectly — almost every list must be ascending by its primary key; double-check composite sorts (e.g., transfer requests).
- Currency precision — forgetting to round
total_cost_usd or extended_cost to exactly 2 decimals.
- Missing summary keys — the summary block usually requires explicit zero counts and sorted ID lists.
- Wrong precedence in recommendations — supplier scorecards and procurement decisions have strict precedence; do not default to the safest code without checking higher-precedence rules.
- Not filtering POs by warehouse or status — timely POs must be open/confirmed and directed to the correct warehouse.
- Including protected stock in transfers — only surplus effective stock above buffer may be transferred.
- Wave ID or task ID mismatch — always echo the exact
wave_id or task_id from the memo/template.
1---2name: fewshot-attempt-01-223description: Northwind Components ERP Skill — Task Group 0074---5# Northwind Components ERP Skill — Task Group 00767## Overview8Tasks in this group involve querying a shared Northwind ERP API (`http://127.0.0.1:8007`) and producing strictly-structured JSON outputs. There are four main task families:91. **Expedite queue decisions** — per-order release/hold/backorder/review decisions.102. **Allocation / transfer desk** — per-line warehouse action (ship, transfer, backorder, manual_review).113. **Kit replenishment / production planning** — BOM component coverage with POs, transfers, and purchase requisitions.124. **Supplier quality / procurement control** — incident scorecards and freeze/buyer-review decisions.1314## Environment & API Setup15- Start the API with `bash setup.sh start` or `python server.py --host 127.0.0.1 --port 8007`.16- Base URL: `http://127.0.0.1:8007`17- Query live endpoints; never rely on cached snapshots. Relevant endpoints include `/orders`, `/products`, `/customers`, `/inventory`, `/warehouses`, `/shipping_quotes`, `/boms`, `/purchase_orders`, `/incidents`, `/suppliers`.1819## Universal Sorting Rules20Apply ascending sort unless the task template specifies otherwise:21- **Order IDs**: `SO-70000` style — sort ascending lexicographically.22- **SKU strings**: `NW-1000` style — sort ascending.23- **Supplier IDs**: `SUP-001` style — sort ascending.24- **PO IDs**: `PO-50001` style — sort ascending.25- **Incident IDs**: `INC-90001` style — sort ascending.26- **Line-level lists**: sort by `order_id` ascending, then `line_id` ascending.27- **Transfer-request tie-breaking** (kit planning): sort by `sku` ascending, then `quantity` descending, then `from_warehouse_id` ascending.2829## Rounding & Precision30- **Currency (USD)**: round to exactly 2 decimal places in all fields named `*_cost_usd`, `total_cost_usd`, `unit_cost`, `extended_cost`.31- **Percentages**: round to 1 decimal place.32- **Durations (days)**: round to 2 decimal places.33- **Quantities**: integers, no rounding needed.3435## Controlled Vocabularies36Learn the exact enums allowed by each template. Common ones across tasks:3738### Inventory Status (expedite tasks)39`ready`, `low_stock`, `shortage`, `inactive_sku`, `inactive_and_shortage`4041### Customer Exception (expedite tasks)42`none`, `review_required`, `account_blocked`, `fraud_watch`, `credit_watch`4344### Final Decision (expedite tasks)45`ship_now`, `delayed_release`, `manual_review`, `backorder`, `reject_hold`4647### Next Action (expedite tasks)48`release_to_pick`, `delay_and_monitor`, `send_account_review`, `create_backorder`, `hold_credit_or_fraud`, `escalate_product_master`4950### Allocation Line Actions51`ship`, `transfer`, `backorder`, `manual_review`5253### Allocation Primary Reasons54`none`, `account_blocked`, `account_review_required`, `fraud_watch`, `inactive_product`, `insufficient_effective_stock`5556### Kit Component Final Actions57`no_action_stocked`, `transfer_only`, `purchase_required`, `timely_po_covered`, `overstock_excluded`5859### Exclusion Reasons (kit planning)60`none`, `target_overstock`, `timely_po_covers_gap`, `stocked_no_gap`6162### Supplier Recommendation Codes (scorecards)63`ESCALATE_SUPPLIER`, `PROCESS_REVIEW`, `WATCHLIST`, `MONITOR` — evaluated in that precedence order.6465### Procurement Decisions66`freeze_new_replenishment`, `buyer_review_required`, `monitor_only`6768### Supplier Quality Status69`approved`, `watch`, `quality_hold`7071## Inventory & Availability Rules72- **Effective available** for a warehouse = on-hand minus reserved, quarantined, and normal operating buffer quantities. Do not treat protected stock as freely available.73- In allocation tasks, if the requested warehouse cannot fully cover a line but another warehouse has sufficient effective stock without dipping into protected stock, the action is `transfer` (not `backorder`).74- In kit planning, compute `target_effective_available` = current effective available − total required for the build.75- An SKU is **inactive** when the product master status is inactive/discontinued.7677## Order & Account Rules78- Account flags (`account_blocked`, `review_required`, `fraud_watch`, `credit_watch`) on a customer override inventory decisions and force `manual_review` or `reject_hold` at the order level.79- If any line forces `manual_review` because of account risk, the whole order is typically blocked or rolled up to `manual_review`.80- Inactive product master on a line forces `manual_review` with reason `inactive_product`.8182## Shipping Quotes83- Requested via the API per order (or per order + speed). Return fields: `zone_distance` (int), `service_days` (int), `total_cost_usd` (number, 2 decimals).84- Even if the order decision is not release, the memo may still require a quote.8586## Kit Replenishment Logic871. Compute `total_required` = BOM qty per unit × build_quantity, summed across all target builds.882. Check **timely POs**: open or confirmed purchase orders for the same warehouse that arrive before the build date. Their quantities can cover the gap.893. Check **inter-warehouse transfers**: other warehouses with surplus effective stock. Prefer feasible transfers before raising purchase requisitions.904. **Final action**:91 - If `target_effective_available` ≥ 0 and no gap exists → `overstock_excluded` or `no_action_stocked`.92 - If timely PO covers the gap → `timely_po_covered`.93 - If transfer covers the gap → `transfer_only`.94 - Else → `purchase_required` for remaining gap.955. **Excluded components** list gets its own section with reason and supporting PO IDs.966. **Purchase requisitions** require `supplier_id`, `warehouse_id`, `quantity`, `needed_by`, `unit_cost`, `extended_cost` (qty × unit_cost, rounded to 2 decimals).9798## Supplier Scorecard & Quality Rules991. **Filter incidents** by `open_date` within the requested window (inclusive).1002. **Duration**:101 - Closed incidents: calendar days from `open_date` to `close_date`.102 - Open incidents: calendar days from `open_date` to `analysis_date`.1033. **Incident percentage** = supplier incident count ÷ total filtered incident count × 100, rounded to 1 decimal.1044. **Severe incidents**: severity in `high` or `critical`.1055. **Recommendation precedence** (evaluate in order; first match wins):106 - **ESCALATE_SUPPLIER**: supplier on `quality_hold` with ≥3 filtered incidents, OR any critical RMA, OR ≥3 RMAs and ≥15,000 total resolution cost.107 - **PROCESS_REVIEW**: WORK_ORDER incidents ≥3 and exceed RMA incidents.108 - **WATCHLIST**: quality status is `watch` or `quality_hold`, OR incident count ≥4, OR total resolution cost ≥12,000, OR severe incident count ≥2.109 - **MONITOR**: default.1106. **Top escalation suppliers**: only those with `ESCALATE_SUPPLIER`, sorted by incident count descending, then total resolution cost descending, then supplier_id ascending.1117. **Highest cost supplier**: supplier with greatest total resolution cost.1128. **Highest share supplier**: supplier with greatest incident percentage.113114## Procurement Control Desk Logic1151. Review target suppliers for recent incidents in the analysis window.1162. Collect open/confirmed PO IDs for each supplier.1173. Decision mapping:118 - `freeze_new_replenishment` for serious risk (e.g., `quality_hold` with multiple incidents).119 - `buyer_review_required` for moderate risk (e.g., `watch` status with incidents).120 - `monitor_only` when risk is acceptable.1214. `held_po_ids` in output = sorted unique union of all PO IDs from suppliers not released (`monitor_only`).1225. `release_supplier_ids` = sorted list of suppliers whose decision is `monitor_only`.1236. `sample_incident_ids` = up to 5 most representative incident IDs, sorted ascending.1247. `affected_skus` = sorted unique SKUs from filtered incidents.125126## JSON Output Discipline127- Return **only** the JSON object; no markdown fences, no narrative text.128- Include every key required by the task-specific `answer_template.json`.129- Use exact enum strings; never paraphrase.130- Empty lists are preferred over `null` for missing collections.131- For transfer fields that are optional, use `null` when the action does not involve a transfer.132133## Common Pitfalls1341. **Using raw on-hand instead of effective available** — always subtract reserved, quarantined, and buffer stock.1352. **Sorting incorrectly** — almost every list must be ascending by its primary key; double-check composite sorts (e.g., transfer requests).1363. **Currency precision** — forgetting to round `total_cost_usd` or `extended_cost` to exactly 2 decimals.1374. **Missing summary keys** — the summary block usually requires explicit zero counts and sorted ID lists.1385. **Wrong precedence in recommendations** — supplier scorecards and procurement decisions have strict precedence; do not default to the safest code without checking higher-precedence rules.1396. **Not filtering POs by warehouse or status** — timely POs must be open/confirmed and directed to the correct warehouse.1407. **Including protected stock in transfers** — only surplus effective stock above buffer may be transferred.1418. **Wave ID or task ID mismatch** — always echo the exact `wave_id` or `task_id` from the memo/template.