Lab for procurement
Score three supplier quotes against weighted criteria, then match twelve invoices to purchase orders.
You can ask Codex to score supplier quotes and find mistakes in invoices, and you can check what it finds.
You can have Codex score quotes against a stated method and test invoices against purchase orders and GST, then check both results against an answer key.
You can have an agent apply a published scoring rule to extracted quote data and run rule-based exception tests over invoices, and you can verify both against a known-good key.
What you will make
You will do two jobs that buyers do all the time.
In part 1, Codex reads three quotes for 40 laptops. It gives each one a score and picks a winner. In part 2, Codex checks twelve invoices. It finds the ones that look wrong.
Codex does the first draft. You check it.
Part 1: Codex reads three supplier quotes and scores them with the method in the request for quotation (RFQ). The method weighs price, delivery, warranty and support. Codex writes a score table and a recommendation that shows the working.
Part 2: Codex checks twelve supplier invoices against the purchase orders and tests the GST on each. In this lab, a three-way match means the invoice is compared with the purchase order. Codex writes an invoice register and a short exceptions report.
Both parts follow the same routine: brief, plan, act, check.
Part 1 separates extraction from scoring. The agent pulls four attributes from each quote PDF, then applies the RFQ formulas. The recommendation must show the formulas and the inputs, so a reviewer can recompute every score by hand.
Part 2 runs rule-based exception tests: invoice against purchase order on supplier, quantity and unit price; GST against 10 per cent of net; and duplicate detection on invoice number. Each is a deterministic test that a script can run and that you can recompute.
Both outputs have a known correct form, so you can verify them.
| File | What it holds |
|---|---|
procurement/rfq-laptops.md | Request for quotation with weighted criteria |
procurement/quotes/*.pdf | Quotes from Northgate Technology, Kestrel IT Supply and Harbourline Systems |
procurement/purchase-orders.csv | Eleven purchase orders |
procurement/invoices/*.pdf | Twelve supplier invoices |
Part 1, score the quotes
Send the brief and read the plan
Open Codex with the
CodexWorkfolder. Check that the mode says Ask for approval. Start a new thread.Copy the brief below and send it. Read the plan. It should say that Codex will use the scoring method in the RFQ and not its own.
Open Codex with
CodexWorkas the project folder and check that the mode says Ask for approval. Start a new thread and send the brief below.Read the plan. It should say that the score uses the RFQ method, not a method Codex invents. Correct it now if it does not.
Start a new thread with Ask for approval and send the brief. In the plan, check that the scoring formulas come from the RFQ text, that rounding follows the RFQ, and that extraction is a separate step from scoring.
Approve and read the recommendation
Reply: Approved. Go ahead. Approve each file.
If Codex asks to install a tool to read the PDF files, read the request. Say no if you do not understand it. Ask Codex for another way.
Open
outputs\recommendation.md. Check that it shows the sums.Reply: Approved. Go ahead. Approve each file. If Codex asks to install a tool so that it can read the PDFs, read the request first. Network access is off by default, so an install needs your approval.
Open
outputs\recommendation.md. It must show each score with the working, so that you can recompute one by hand.Reply: Approved. Go ahead. Approve each file write. Decline an install you did not expect and ask what else can read the PDFs. Then open
outputs\recommendation.mdand recompute one supplier's score by hand from the quote inputs.New thread
- Laptop quotes
Approved. Go ahead.
I scored the three quotes with the method in the RFQ. The supplier with the lowest price does not rank first. The working is in the recommendation. I changed no source file.
Ask Codex to do something
Codex ranks the three quotes and lists the files it wrote.
Goal: Score the three laptop quotes with the method in the RFQ and recommend a supplier. Inputs: procurement/rfq-laptops.md and the three PDF files in procurement/quotes/ Output: outputs/quote-scores.csv with one row for each supplier, and outputs/recommendation.md. Constraints: Use only the scoring method in the RFQ. Do not change any source file. Write only in outputs/. In recommendation.md, show the formula and the inputs for every score. If you need a package to read the PDFs, tell me which one and ask before you install it. Done when: each supplier has a score for price, delivery, warranty and support, and a total. How to check: Recompute one supplier's total by hand and show the working. Make a plan first. Do not create any file until I approve the plan.
Part 2, match the invoices
Send the brief and read the plan
Start a new thread. Copy the brief below and send it. Read the plan.
The plan should list the checks. Each check is a yes or no test.
Start a new thread and send the brief below. Read the plan. It should list each test as a rule: supplier, quantity and unit price against the purchase order, GST against 10 per cent of the net amount, and duplicate invoice numbers.
Start a new thread and send the brief. Check that the plan names each rule as a deterministic test and says what Codex does with an invoice that has no matching purchase order.
Approve and read the exceptions
Reply: Approved. Go ahead. Approve the files.
Open
outputs\exceptions.md. For each problem, open the PDF and check it yourself.Reply: Approved. Go ahead. Approve the files. Open
outputs\exceptions.mdand, for each exception, open the invoice PDF and the purchase order row and confirm the problem yourself.Reply: Approved. Go ahead. Open
outputs\exceptions.md. Confirm each exception from the PDF and the purchase order row. Then ask which invoices passed, and spot-check one that passed to test for false negatives.New thread
- Laptop quotes
- Invoice checks
Approved. Go ahead.
I checked 12 invoices. Three have exceptions: a duplicate, a price that differs from the purchase order, and a GST error. The details are in exceptions.md.
Ask Codex to do something
Codex reports its exceptions. Check each one against the PDF.
Goal: Check the supplier invoices against the purchase orders and find the exceptions. Inputs: procurement/purchase-orders.csv and the twelve PDF files in procurement/invoices/ Output: outputs/invoices.csv with one row for each invoice, and outputs/exceptions.md. Constraints: Check each invoice against its purchase order for supplier, quantity and unit price. Check that GST is 10 per cent of the net amount. Check for duplicate invoice numbers. Do not change any source file. Write only in outputs/. Ask before you install anything. Done when: every invoice has a result and every exception has the reason and the file name. How to check: Print the total of all invoices and the count of exceptions. Make a plan first. Do not create any file until I approve the plan.
Answer key
Open each question below. Compare the answer with your own result.
Open each question below and compare the answer with your own result. A match is evidence. A mismatch is a reason to ask Codex to show its working.
Compare each answer with your outputs. The key came from the data that built the starter pack, so a mismatch points to a defect in the output.
| Supplier | Unit price | Delivery (days) | Warranty (years) | Support | Score |
|---|---|---|---|---|---|
| Harbourline Systems | $1,520 | 5 | 4 | Next business day, on site | 96.32 |
| Northgate Technology | $1,450 | 10 | 3 | Next business day, on site | 83.07 |
| Kestrel IT Supply | $1,380 | 20 | 3 | Return to base | 70.00 |
Check yourself
Part 1. What are the scores, and does the lowest price win?
The scores are Harbourline Systems 96.32, Northgate Technology 83.07, Kestrel IT Supply 70.00. The best quote is from Harbourline Systems. The lowest price is from Kestrel IT Supply at $1,380. It does not win. Price is only 40 of 100 points.
The scores are Harbourline Systems 96.32, Northgate Technology 83.07, Kestrel IT Supply 70.00. The weights are price 40, delivery 20, warranty 20 and support 20. Kestrel IT Supply has the lowest unit price at $1,380 but ranks last, because it has the longest delivery time and the lower support level.
The scores are Harbourline Systems 96.32, Northgate Technology 83.07, Kestrel IT Supply 70.00. The weights are price 40, delivery 20, warranty 20 and support 20, so the lowest price earns at most 40 of 100 points. Kestrel IT Supply has the lowest unit price and ranks last because it has the longest delivery time and the lower support level. Recompute one score by hand from the RFQ formulas. If it differs from Codex's, check the rounding rule.
Part 2. What is the total invoiced?
$81,788.00. This is the sum of all 12 invoices as sent. It includes the invoice that was sent twice.
$81,788.00, the sum of all 12 invoices as submitted. It includes the duplicate, so a payment run based on this figure would overpay.
$81,788.00, the sum of all 12 invoice totals as submitted, including the duplicate. This is the gross total before exceptions are resolved, so a reconciliation should report it next to the exception adjustments.
Part 2. Which three exceptions should Codex find?
1. Duplicate: invoice K-1043 was sent twice (invoice-05.pdf and invoice-09.pdf). 2. Price mismatch: invoice N-2210 (invoice-07.pdf). Unit price 1495 against 1450 on PO-3007. 3. GST error (GST is the 10 per cent goods and services tax): invoice H-778 (invoice-06.pdf). GST 340 should be 304 on a net of 3040.
1. Duplicate: K-1043, in invoice-05.pdf and invoice-09.pdf. Same invoice number, PO and amount submitted twice. 2. Price mismatch: N-2210, in invoice-07.pdf. Unit price 1495 against 1450 on PO-3007. 3. GST error: H-778, in invoice-06.pdf. GST 340 should be 304 on a net of 3040.
1. Duplicate: K-1043, in invoice-05.pdf and invoice-09.pdf. Same invoice number, PO and amount submitted twice. 2. Price mismatch: N-2210, in invoice-07.pdf. Unit price 1495 against 1450 on PO-3007. 3. GST error: H-778, in invoice-06.pdf. GST 340 should be 304 on a net of 3040. Exactly three means no false positives and no false negatives on this set. A fourth flag is a false positive to explain.
Go further
Ask Codex to write a program that checks invoices. A program runs the same checks each time, so you can trust it more.
You can also ask Codex for a short email that asks a supplier to correct an invoice. Read it before you send anything.
Turn part 2 into a reusable skill. Ask Codex to use $skill-creator to make an invoice-match skill that reads any invoice folder and a purchase order file, and always writes the same two outputs.
For part 1, ask Codex to rerun the scores with different weights and show which supplier wins under each set.
Package part 2 as a skill with $skill-creator, with a script that applies the three rules deterministically and a test fixture built from the exceptions above. Then the agent handles extraction and the script handles judgement that has a fixed answer.
For part 1, run a sensitivity analysis on the weights. For scripted runs, codex exec can run either brief non-interactively.
OtterBlock is not affiliated with OpenAI. Codex and ChatGPT are OpenAI products.