ProcureOps Task Group Skill — Sourcing, Receiving, AP, and Change Control
1. Environment
- API base URL: Use the URL from
environment_access.md (overrides any localhost/127.0.0.1 in task text).
- Public endpoints:
/programs, /suppliers, /items, /contracts, /purchase_requisitions, /purchase_orders, /receipts, /ap/invoices, /ap/payments, /approval_events, /budget_snapshots, /vendor_risk_events.
- Query with query parameters for filtering (e.g.,
?program_id=PRG-AX17, ?supplier_id=SUP-LUMA).
2. Source Precedence
- ProcureOps API — system of record for all operational data (POs, receipts, invoices, contracts, suppliers, approvals, budgets, risk events).
- Local chargeback register — authoritative for chargeback statuses and amounts (train_005 pattern). When it exists, use its
status, reason_code, basis_quantity, and unit_cost over API-derived values.
- Task payloads (memos, packets, templates) — provide target IDs, business parameters (tax rates, as-of dates), and context; do NOT use them to override API facts.
- When the API and a memo disagree, the API wins. When a chargeback register and the API disagree on chargeback details, the register wins.
3. Field Conventions
| Domain |
Pattern |
Examples |
| Program ID |
PRG-XXXX or PRG-XXXX-NN |
PRG-AX17, PRG-NOVA-31 |
| Supplier ID |
SUP-XXXX |
SUP-LUMA, SUP-VANTIX |
| PO ID |
PO-XXXX-NNNN or PO-NNNNN |
PO-AX17-4481, PO-00031 |
| Receipt ID |
RCV-XXXX-NN or RCV-NNNNN |
RCV-BLUE-14, RCV-00017 |
| Invoice ID |
AP-XXXX-NNNN or AP-NNNNN |
AP-LUMA-7714, AP-00027 |
| Contract ID |
CR-XXXX-NNN |
CR-LMP-228 |
| Requisition ID |
REQ-XXXX-NNN |
REQ-AX17-141 |
| Risk Event ID |
VRE-NNNNN |
VRE-00005 |
| Approval Event ID |
APR-NNNNN |
APR-00001 |
| Budget Snapshot ID |
BUD-XXXX |
BUD-PRG-AX17 |
| SKU |
Alphanumeric; may contain hyphens |
LMP-228, DRV-AX17 |
- All amounts in USD, rounded to 2 decimal places (cents). Use
round(x, 2).
- Dates:
YYYY-MM-DD strings.
- ID lists: sort ascending unless the template says "set; evaluator sorts".
- Missing optional IDs: use
null, never empty string "".
- Booleans:
true/false (not strings).
- Empty lists: use
[], never null for list-typed fields.
4. Reusable Business Rules
4.1 Three-Way Match (PO ↔ Receipt ↔ Invoice)
quantity_variance = billed_qty - received_qty
quantity_variance_pct = round((quantity_variance / billed_qty) * 100, 1)
- If no receipt exists:
received_qty = 0, quantity_variance = billed_qty.
- Match is good when
variance == 0.
4.2 Receipt Line Reconciliation
short_qty_vs_po = ordered_qty - received_qty
unreceived_billed_qty = billed_qty - received_qty
receipt_completion_ratio = round(received_qty / ordered_qty, 4)
received_goods_value = round(received_qty * unit_price, 2)
unreceived_goods_value = round(short_qty_vs_po * unit_price, 2)
invoice_subtotal = round(billed_qty * unit_price, 2)
invoice_total = round(subtotal + freight + tax, 2)
4.3 Contract Ceiling Check
noncancelled_subtotal = sum of all non-cancelled PO subtotals under the contract
headroom_before_change = ceiling_amount - noncancelled_subtotal
requested_subtotal = round(requested_quantity * unit_price, 2)
headroom_after_change = headroom_before_change - requested_subtotal
ceiling_ok = (headroom_after_change >= 0)
- Exclude cancelled POs from
noncancelled_subtotal.
- Subtotal = line items only, before tax and freight.
4.4 Program Budget Check
remaining_budget = budget_cap - committed_amount
requested_tax = round(requested_subtotal * tax_rate_pct / 100, 2)
requested_total = round(requested_subtotal + requested_tax, 2)
budget_after_change = round(remaining_budget - requested_total, 2)
budget_ok = (budget_after_change >= 0)
max_quantity_with_current_budget = floor(remaining_budget / (unit_price * (1 + tax_rate_pct/100)))
- Freight is only added when the task memo explicitly provides a freight amount.
4.5 AP Close Balance
close_balance = opening_balance + invoice_total - scheduled_payments
held_invoice_total = sum of invoice_totals where hold_decision == "HOLD"
releasable_invoice_total = sum of invoice_totals where hold_decision == "RELEASE"
total_close_balance = sum of all close_balances
balance_status: "FULLY_SCHEDULED" when close_balance ≈ 0; "OPEN_HELD" when held > 0; "OPEN_APPROVED" when approved but not fully scheduled.
- Scheduled payments through the end of the close month count toward reducing the balance.
4.6 Chargeback Netting (AP Release)
net_release_amount = invoice_total - approved_chargeback_amount (when releasing)
net_release_amount = 0 (when holding)
approved_chargeback_total = sum of all approved chargeback amounts
net_release_total = sum of all net_release_amounts
4.7 Readiness & Blocker Assessment
Blocker codes (apply per SKU line):
| Code |
Trigger |
missing_contract |
No contract found for the SKU-supplier pair |
supplier_watch |
Supplier has risk rating "watch" |
open_supplier_risk |
Supplier has ≥1 open vendor risk event |
ap_hold |
Invoice status is "on_hold" or "pending_receipt" |
pending_receipt |
No receipts exist for the PO (or all receipts are after as_of_date) |
late_due_date |
PO delivery date is past the as_of_date and not fully received |
none |
No blockers apply |
Readiness status: "ready" (0 blockers), "at_risk" (only supplier_watch), "not_ready" (any hard blocker).
Nomination decision: "nominate" (ready), "conditional_nomination" (at_risk), "hold" (not_ready).
4.8 Approval Check
- Find the latest approval event for the source requisition (by event date).
approval_ok = true ONLY when latest_action == "approved".
"submitted", "rejected", "pending" → approval_ok = false.
4.9 Supplier Risk Check
supplier_risk_ok = true unless ≥1 severe open risk event exists.
- Watch rating alone does not fail the risk check, but it becomes a blocker/warning.
open_event_ids: all open events. severe_open_event_ids: only severe open events.
4.10 Invoice Hold/Release Decision
| Condition |
Decision |
Hold Code |
Reason Code |
| Three-way match, payment scheduled |
RELEASE |
null |
APPROVED_THREE_WAY_MATCH, SCHEDULED_PAYMENT_FOUND |
| Qty variance (billed > received) |
HOLD |
QTY_VARIANCE |
QTY_VARIANCE |
| No receipt at all |
HOLD |
NO_RECEIPT |
NO_RECEIPT |
| Receipt underage + pending quality |
HOLD |
— |
inspection_hold variants |
| Receipt underage + approved chargeback |
Release net |
— |
approved_qty_chargeback |
4.11 Receiving Exception Codes
Use these controlled codes for receiving exception classification:
"Underage Quantity" — received < ordered
"Severe Unmatched Quantity" — significant shortfall
"Inspection Hold" — quality hold on receipt
"AP Quantity Variance" — billed ≠ received
4.12 Date-Bounded Filtering
- When an
as_of_date is given, only include records with dates ≤ as_of_date.
- Receipts dated after as_of_date are excluded from evidence.
- Risk events opened after as_of_date are excluded.
5. Output Schema Pitfalls
- Match the answer template exactly — include every required key; do not add extra keys.
- task_id in the output must match the template's expected value (see template
required_value).
- Lists sorted ascending unless the template says "set; evaluator sorts".
- Null vs empty: missing optional scalar →
null; empty list → [].
- Enum values must be exact strings — case-sensitive. Do not invent variant spellings.
- Numeric precision: USD amounts → 2 decimals; ratios → as specified (often 4 decimals for completion ratio, 1 decimal for variance pct).
- Committee action:
send_to_committee: "yes" only when ≥1 conditional nomination exists AND there are unresolved blockers. Otherwise "no".
- next_owner in committee_action:
"ap_team" if any blocker is AP-related; "buyer" if contract/sourcing issues; "quality_ops" if quality/receiving issues; "program_owner" if budget/approval issues; "finance_ops" for payment scheduling gaps.
6. Workflow SOP
Step 0: Read task inputs
- Read the task prompt, the answer template, AND all payload files under
input/payloads/.
- Extract: target IDs, as_of_date, business parameters (tax rate, freight, ceiling, budget cap).
Step 1: Query the API
- Fetch relevant records from the ProcureOps API using the target IDs as filters.
- Use ALL relevant endpoints — a single task typically needs 3-6 different endpoints.
- Always cross-reference: a PO links to a contract, supplier, program, receipts, and invoices.
Step 2: Reconcile
- Apply the business rules in Section 4 using API data.
- If a chargeback register is present in payloads, use it for chargeback details.
- Check dates against as_of_date for temporal filtering.
Step 3: Build the answer
- Start from the answer template structure.
- Fill every field; compute derived values using the formulas above.
- Sort all ID lists ascending.
- Round all amounts to the specified precision.
Step 4: Validate
- All required keys present?
- All amounts in USD rounded to cents?
- All enum values match the allowed set exactly?
- All boolean fields are
true/false not strings?
- No invented IDs — every ID must come from the API or the task payloads.
- Null used for missing optionals,
[] for empty lists.
7. Common Task Archetypes
| Archetype |
Key endpoints |
Key payload |
Distinctive output |
| Sourcing nomination |
programs, contracts, POs, receipts, invoices, suppliers, vendor_risk |
nomination memo (target SKUs/POs) |
blocker_codes, committee_action |
| Receiving closeout |
POs, receipts, contracts, invoices, suppliers, vendor_risk |
receiving memo (batch ID) |
line_reconciliation, financials, decision |
| AP close desk |
invoices, POs, receipts, payments, suppliers, budget_snapshots |
close memo (invoice list) |
invoice_decisions, vendor_balances, program_summary |
| Change control |
contracts, POs, programs, approvals, suppliers, vendor_risk, budget_snapshots |
change memo (contract, variant, qty) |
contract_check, program_budget_check, approval_check |
| AP release file |
POs, receipts, invoices, vendor_risk |
release packet (IDs + chargeback register) |
release_decisions, receiving_exceptions, chargeback netting |
1---2name: fewshot-attempt-03-303description: ProcureOps Task Group Skill — Sourcing, Receiving, AP, and Change Control4---5# ProcureOps Task Group Skill — Sourcing, Receiving, AP, and Change Control67## 1. Environment89- **API base URL**: Use the URL from `environment_access.md` (overrides any `localhost`/`127.0.0.1` in task text).10- **Public endpoints**: `/programs`, `/suppliers`, `/items`, `/contracts`, `/purchase_requisitions`, `/purchase_orders`, `/receipts`, `/ap/invoices`, `/ap/payments`, `/approval_events`, `/budget_snapshots`, `/vendor_risk_events`.11- Query with query parameters for filtering (e.g., `?program_id=PRG-AX17`, `?supplier_id=SUP-LUMA`).1213## 2. Source Precedence14151. **ProcureOps API** — system of record for all operational data (POs, receipts, invoices, contracts, suppliers, approvals, budgets, risk events).162. **Local chargeback register** — authoritative for chargeback statuses and amounts (train_005 pattern). When it exists, use its `status`, `reason_code`, `basis_quantity`, and `unit_cost` over API-derived values.173. **Task payloads** (memos, packets, templates) — provide target IDs, business parameters (tax rates, as-of dates), and context; do NOT use them to override API facts.184. When the API and a memo disagree, the API wins. When a chargeback register and the API disagree on chargeback details, the register wins.1920## 3. Field Conventions2122| Domain | Pattern | Examples |23|--------|---------|----------|24| Program ID | `PRG-XXXX` or `PRG-XXXX-NN` | PRG-AX17, PRG-NOVA-31 |25| Supplier ID | `SUP-XXXX` | SUP-LUMA, SUP-VANTIX |26| PO ID | `PO-XXXX-NNNN` or `PO-NNNNN` | PO-AX17-4481, PO-00031 |27| Receipt ID | `RCV-XXXX-NN` or `RCV-NNNNN` | RCV-BLUE-14, RCV-00017 |28| Invoice ID | `AP-XXXX-NNNN` or `AP-NNNNN` | AP-LUMA-7714, AP-00027 |29| Contract ID | `CR-XXXX-NNN` | CR-LMP-228 |30| Requisition ID | `REQ-XXXX-NNN` | REQ-AX17-141 |31| Risk Event ID | `VRE-NNNNN` | VRE-00005 |32| Approval Event ID | `APR-NNNNN` | APR-00001 |33| Budget Snapshot ID | `BUD-XXXX` | BUD-PRG-AX17 |34| SKU | Alphanumeric; may contain hyphens | LMP-228, DRV-AX17 |3536- **All amounts in USD**, rounded to **2 decimal places** (cents). Use `round(x, 2)`.37- **Dates**: `YYYY-MM-DD` strings.38- **ID lists**: sort **ascending** unless the template says "set; evaluator sorts".39- **Missing optional IDs**: use `null`, never empty string `""`.40- **Booleans**: `true`/`false` (not strings).41- **Empty lists**: use `[]`, never `null` for list-typed fields.4243## 4. Reusable Business Rules4445### 4.1 Three-Way Match (PO ↔ Receipt ↔ Invoice)4647```48quantity_variance = billed_qty - received_qty49quantity_variance_pct = round((quantity_variance / billed_qty) * 100, 1)50```51- If no receipt exists: `received_qty = 0`, `quantity_variance = billed_qty`.52- Match is good when `variance == 0`.5354### 4.2 Receipt Line Reconciliation5556```57short_qty_vs_po = ordered_qty - received_qty58unreceived_billed_qty = billed_qty - received_qty59receipt_completion_ratio = round(received_qty / ordered_qty, 4)60received_goods_value = round(received_qty * unit_price, 2)61unreceived_goods_value = round(short_qty_vs_po * unit_price, 2)62invoice_subtotal = round(billed_qty * unit_price, 2)63invoice_total = round(subtotal + freight + tax, 2)64```6566### 4.3 Contract Ceiling Check6768```69noncancelled_subtotal = sum of all non-cancelled PO subtotals under the contract70headroom_before_change = ceiling_amount - noncancelled_subtotal71requested_subtotal = round(requested_quantity * unit_price, 2)72headroom_after_change = headroom_before_change - requested_subtotal73ceiling_ok = (headroom_after_change >= 0)74```75- **Exclude cancelled POs** from `noncancelled_subtotal`.76- Subtotal = line items only, before tax and freight.7778### 4.4 Program Budget Check7980```81remaining_budget = budget_cap - committed_amount82requested_tax = round(requested_subtotal * tax_rate_pct / 100, 2)83requested_total = round(requested_subtotal + requested_tax, 2)84budget_after_change = round(remaining_budget - requested_total, 2)85budget_ok = (budget_after_change >= 0)86max_quantity_with_current_budget = floor(remaining_budget / (unit_price * (1 + tax_rate_pct/100)))87```88- Freight is only added when the task memo explicitly provides a freight amount.8990### 4.5 AP Close Balance9192```93close_balance = opening_balance + invoice_total - scheduled_payments94held_invoice_total = sum of invoice_totals where hold_decision == "HOLD"95releasable_invoice_total = sum of invoice_totals where hold_decision == "RELEASE"96total_close_balance = sum of all close_balances97```98- `balance_status`: `"FULLY_SCHEDULED"` when close_balance ≈ 0; `"OPEN_HELD"` when held > 0; `"OPEN_APPROVED"` when approved but not fully scheduled.99- Scheduled payments through the end of the close month count toward reducing the balance.100101### 4.6 Chargeback Netting (AP Release)102103```104net_release_amount = invoice_total - approved_chargeback_amount (when releasing)105net_release_amount = 0 (when holding)106approved_chargeback_total = sum of all approved chargeback amounts107net_release_total = sum of all net_release_amounts108```109110### 4.7 Readiness & Blocker Assessment111112Blocker codes (apply per SKU line):113| Code | Trigger |114|------|---------|115| `missing_contract` | No contract found for the SKU-supplier pair |116| `supplier_watch` | Supplier has risk rating `"watch"` |117| `open_supplier_risk` | Supplier has ≥1 open vendor risk event |118| `ap_hold` | Invoice status is `"on_hold"` or `"pending_receipt"` |119| `pending_receipt` | No receipts exist for the PO (or all receipts are after as_of_date) |120| `late_due_date` | PO delivery date is past the as_of_date and not fully received |121| `none` | No blockers apply |122123Readiness status: `"ready"` (0 blockers), `"at_risk"` (only `supplier_watch`), `"not_ready"` (any hard blocker).124Nomination decision: `"nominate"` (ready), `"conditional_nomination"` (at_risk), `"hold"` (not_ready).125126### 4.8 Approval Check127128- Find the latest approval event for the source requisition (by event date).129- `approval_ok = true` ONLY when `latest_action == "approved"`.130- `"submitted"`, `"rejected"`, `"pending"` → `approval_ok = false`.131132### 4.9 Supplier Risk Check133134- `supplier_risk_ok = true` unless ≥1 **severe** open risk event exists.135- Watch rating alone does not fail the risk check, but it becomes a blocker/warning.136- `open_event_ids`: all open events. `severe_open_event_ids`: only severe open events.137138### 4.10 Invoice Hold/Release Decision139140| Condition | Decision | Hold Code | Reason Code |141|-----------|----------|-----------|-------------|142| Three-way match, payment scheduled | `RELEASE` | `null` | `APPROVED_THREE_WAY_MATCH`, `SCHEDULED_PAYMENT_FOUND` |143| Qty variance (billed > received) | `HOLD` | `QTY_VARIANCE` | `QTY_VARIANCE` |144| No receipt at all | `HOLD` | `NO_RECEIPT` | `NO_RECEIPT` |145| Receipt underage + pending quality | `HOLD` | — | inspection_hold variants |146| Receipt underage + approved chargeback | Release net | — | approved_qty_chargeback |147148### 4.11 Receiving Exception Codes149150Use these controlled codes for receiving exception classification:151- `"Underage Quantity"` — received < ordered152- `"Severe Unmatched Quantity"` — significant shortfall153- `"Inspection Hold"` — quality hold on receipt154- `"AP Quantity Variance"` — billed ≠ received155156### 4.12 Date-Bounded Filtering157158- When an `as_of_date` is given, only include records with dates **≤ as_of_date**.159- Receipts dated after as_of_date are excluded from evidence.160- Risk events opened after as_of_date are excluded.161162## 5. Output Schema Pitfalls1631641. **Match the answer template exactly** — include every required key; do not add extra keys.1652. **task_id** in the output must match the template's expected value (see template `required_value`).1663. **Lists sorted ascending** unless the template says "set; evaluator sorts".1674. **Null vs empty**: missing optional scalar → `null`; empty list → `[]`.1685. **Enum values must be exact strings** — case-sensitive. Do not invent variant spellings.1696. **Numeric precision**: USD amounts → 2 decimals; ratios → as specified (often 4 decimals for completion ratio, 1 decimal for variance pct).1707. **Committee action**: `send_to_committee: "yes"` only when ≥1 conditional nomination exists AND there are unresolved blockers. Otherwise `"no"`.1718. **next_owner** in committee_action: `"ap_team"` if any blocker is AP-related; `"buyer"` if contract/sourcing issues; `"quality_ops"` if quality/receiving issues; `"program_owner"` if budget/approval issues; `"finance_ops"` for payment scheduling gaps.172173## 6. Workflow SOP174175### Step 0: Read task inputs176- Read the task prompt, the answer template, AND all payload files under `input/payloads/`.177- Extract: target IDs, as_of_date, business parameters (tax rate, freight, ceiling, budget cap).178179### Step 1: Query the API180- Fetch relevant records from the ProcureOps API using the target IDs as filters.181- Use ALL relevant endpoints — a single task typically needs 3-6 different endpoints.182- Always cross-reference: a PO links to a contract, supplier, program, receipts, and invoices.183184### Step 2: Reconcile185- Apply the business rules in Section 4 using API data.186- If a chargeback register is present in payloads, use it for chargeback details.187- Check dates against as_of_date for temporal filtering.188189### Step 3: Build the answer190- Start from the answer template structure.191- Fill every field; compute derived values using the formulas above.192- Sort all ID lists ascending.193- Round all amounts to the specified precision.194195### Step 4: Validate196- All required keys present?197- All amounts in USD rounded to cents?198- All enum values match the allowed set exactly?199- All boolean fields are `true`/`false` not strings?200- No invented IDs — every ID must come from the API or the task payloads.201- Null used for missing optionals, `[]` for empty lists.202203## 7. Common Task Archetypes204205| Archetype | Key endpoints | Key payload | Distinctive output |206|-----------|--------------|-------------|-------------------|207| Sourcing nomination | programs, contracts, POs, receipts, invoices, suppliers, vendor_risk | nomination memo (target SKUs/POs) | blocker_codes, committee_action |208| Receiving closeout | POs, receipts, contracts, invoices, suppliers, vendor_risk | receiving memo (batch ID) | line_reconciliation, financials, decision |209| AP close desk | invoices, POs, receipts, payments, suppliers, budget_snapshots | close memo (invoice list) | invoice_decisions, vendor_balances, program_summary |210| Change control | contracts, POs, programs, approvals, suppliers, vendor_risk, budget_snapshots | change memo (contract, variant, qty) | contract_check, program_budget_check, approval_check |211| AP release file | POs, receipts, invoices, vendor_risk | release packet (IDs + chargeback register) | release_decisions, receiving_exceptions, chargeback netting |