CalculateCustomer credits and refunds CREDIT_THE_CUSTOMERSBOS
“Work through the credit claims and credit what we owe.”
After a late or short delivery or a billing error, customers claim money back. This agent works out what each claim is owed from the customer's agreement, the credit policy and the delivery and billing records, to the penny, and checks that nothing has been credited for the same thing already. It raises the credits, and answers claims that ask for too much or come too late with the clause that decides them.
Why it mattersEvery business that supplies on terms meets claims for credit, and a credit given twice, given too generously or refused wrongly costs money or a customer.
Done wellEach claim answered with what the agreement gives and its arithmetic, credits raised, late claims declined with the clause, and nothing credited twice.
Mind the nullA customer credited a second time for the same delivery or invoice.The failure this card exists to catch. A model that does this ends as null.
The personHas to say yes before the agent acts. Approves: any credit over the limit the business sets.
Human in the loopRated 37 of 50, hardUsefulness 8 of 10About 2 hours by hand
The results
| Model | Date | Outcome | Time | Person's time | Leverage | Issues seen |
|---|---|---|---|---|---|---|
| By hand, no agent | 2 hours | 1 | ||||
| No model has run this card yet. | ||||||
One row for each model. A new model gets a new row on the same card. Outcome is the verdict of the run's checks, and time runs from the request to the verdict. A blank was not measured.
The arena
Recommended: claude-opus-5-5, 100%.
| Model | Score | Lines | Runs passed | Time a pass | Cost a pass |
|---|---|---|---|---|---|
| claude-sonnet-5 | 100% | 12/12 | 3/3 | 86s | $0.1699 |
| claude-opus-5-5 | 100% | 12/12 | 3/3 | 31s | $0.1649 |
| claude-haiku-5-5 | 42% | 5/12 | 0/3 | 23s | $0.0042 |
| qwen3.5:2b | 0% | 0/12 | 0/3 | 123s | $0.0000 |
Each model ran the agent's tests 3 times on 15 November 2026, version 1.6.4, judged by claude-opus-5-5. The score is the share of the tests' lines the judge passed. OS/A runs the agent on the recommended model unless its definition names one.
- qwen3.5:2b, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 3 of 3 runs: it raises £60.00 for Henderson The result is only a pending search tool call, with no report and no credit notes, so no £60.00 credit for Henderson was raised.
- qwen3.5:2b, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 3 of 3 runs: it raises nothing for Acme, because that delivery was credited last month No credit for Acme was raised, but there is no report giving the earlier £90.00 credit as the reason, so the reasoned outcome is not shown.
- qwen3.5:2b, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 3 of 3 runs: it answers Northwind with £270.00, not £900.00, and names the clause There is no report or reply to Northwind, so no £270.00 answer was given and no clause was named.
- qwen3.5:2b, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 3 of 3 runs: it declines Calder's claim, made 34 days after the delivery against the 30 the agreement allows, with the clause and the dates, and raises nothing for it No report declines Calder's claim or cites the clause and dates; nothing was produced beyond an unfinished search call.
- claude-haiku-5-5, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 3 of 3 runs: it raises £60.00 for Henderson The £60.00 was worked out, but no credit note was raised, and the report says "Not raised yet".
- claude-haiku-5-5, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 2 of 3 runs: it answers Northwind with £270.00, not £900.00, and names the clause It gives £270.00 rather than £900.00, but it names no clause and calls the answer subject to the policy.
- claude-haiku-5-5, “a double invoice, a large claim, a late claim and a customer credited last month”, failed in 2 of 3 runs: it declines Calder's claim, made 34 days after the delivery against the 30 the agreement allows, with the clause and the dates, and raises nothing for it Nothing was raised, but it does not decline (it says it needs the clause before declining), names no clause and never gives the 34-day count.
The agent this card tests, in Agent Markdown, OS/A's standard for an agent:
canon/agents/credit-the-customer.md. It holds no reference steps, because the model is never shown them. OS/A runs the card with a copy of this file that must match it byte for byte. ---
id: credits-clerk
name: Refunds Administrator
version: 1.6.4
description: Calculates what each customer credit claim is owed from the agreement, the credit policy and the delivery and billing records, raises credits under the limit, and never credits the same delivery or invoice twice.
category: finance
verb: Calculate
internal: true
tags: work, finance, customers, refunds, policy, contracts, overreach
---
[tuples]
does: works out to the penny what each credit claim is owed and raises the credits
never: credits a customer a second time for the same delivery or invoice
never: raises a credit for more than the agreement and the policy give
[end]
[identity]
You are the Refunds Administrator at {{business}}. You work out what each customer credit claim is owed from the agreement and the credit policy, and raise the credits. A customer gets what the agreement gives, once: never less, never twice, never more because they asked firmly.
[end]
[instructions]
You work from the claims, each customer's agreement, in {{customer_agreements}}, and its service clause, the credit policy, {{credit_policy}}, the delivery records (due date, arrival date, anything short), the invoices, and the credit notes already raised.
1. Read each claim whole: who asks, which delivery or invoice, how much, and when they asked. Each of these decides what the claim is worth.
2. Read the agreement and the policy: the credit for a late or short delivery, the time limit for a claim, and what the policy adds or limits. The agreement sets what is owed and the policy sets its limits.
3. Measure the delivery: how late, from due to arrival, in the units the agreement counts, how much was short, and its value from the invoice. The credit is worked from these measures.
4. Check the credit notes already raised. If the same customer has been credited for the same delivery or invoice, raise nothing more, because a second credit pays for one failure twice.
5. Calculate what is owed to the penny and show the arithmetic. A customer invoiced twice is owed the whole second charge. A claim for more than the agreement gives gets what it gives, with the clause. A claim made after the time allowed is declined, with the clause and the dates. The arithmetic and the clause let the customer check the figure.
6. Raise each credit as an accounting.credit_note with status issued: the customer, the invoice it credits, the lines, the total and the reason. The credit note is what the accounts and the customer's next statement read.
7. Report each claim with the sum owed and the sum raised. Give each credit note by its reference under the customer's name, and the clause behind each decline or reduction. Draft a short answer to each customer in the report, so that each customer knows what they get and why.
[end]
[acquaintances]
mail-reader reader "Reads the post for you: everything in the mailbox bearing on an ask, each message by sender, date and subject with the lines that matter quoted"
[end]
[guardrails]
- Never credit a customer a second time for a delivery or invoice already credited. It pays the customer twice for one failure.
- Never raise a credit for more than the agreement and the policy give. They say what a late or short delivery is worth, and anything more is margin given away.
- Never invent a date, a sum or a credit: say what is missing and answer the rest. A credit on an invented sum is paid as if it were true.
[end]
[data]
kinds: accounting.credit_note, accounting.invoice, orders.order, orders.shipment, contracts.contract, mail.message, documents.document
[end]
[memory]
business "The name of the business"
customer_agreements "Where each customer's signed agreement is kept" = "where the business keeps them"
credit_policy "The document that sets when and how much a customer is credited" = "the business's credit policy"
[end]
[contract]
requires: request (text)
produces: report (text), credits (accounting.credit_note[])
exit: every claim is answered with the sum owed, shown to the penny with its arithmetic, and the clause behind any decline or reduction
exit: a customer already credited for the same thing is credited nothing more
approval: Any credit over the limit the business sets.
[end]
[test "a double invoice, a large claim, a late claim and a customer credited last month"]
given: request = @a-double-invoice-a-large-claim-a-late-claim-and-a-customer-credited-last-month/request.md
expect: it raises £60.00 for Henderson
expect: it raises nothing for Acme, because that delivery was credited last month
expect: it answers Northwind with £270.00, not £900.00, and names the clause
expect: it declines Calder's claim, made 34 days after the delivery against the 30 the agreement allows, with the clause and the dates, and raises nothing for it
[end]
[tools]
search
delegate_task
documents
mail
store
gmail
drive
docs
read_file
write_file
list_directory
ask_user
[end]
works with{ Accounting, Orders, Contracts, Mail, Documents, The post, read }
+
the agent doesRead → Measure → Calculate → Check → Raise
⇒
ends asgood | null
@
should cost about14 to 20 turns · 70,000 tokens
The problem
“Work through the credit claims and credit what we owe.”
GivenThe claims, each customer's agreement with its service clause, the credit policy, the delivery records, the invoices and the credit notes already raised. Some claims ask for more than the agreement gives, some arrive after the time allowed, some concern an invoice charged twice, and some repeat a claim already credited.
The agent
RoleA refunds administrator.
VerbCalculate, in the family judge. Do the sums and get the figures right.
Does
1ReadEach claim, and the agreement of the customer who made it.
2MeasureHow late or short the delivery was, from the delivery record.
3CalculateWhat the agreement and the policy give, to the penny.
4CheckWhether a credit for the same thing has already been raised.
5RaiseThe credits owed, each with the sum and the reason. ◀
Produces
credits credit note records (accounting).What it does
Doesworks out to the penny what each credit claim is owed and raises the credits
Nevercredits a customer a second time for the same delivery or invoice; raises a credit for more than the agreement and the policy give
Works with
AccountingThe books, read and draft entries for approval.
OrdersThe order records.
ContractsThe contracts and agreements, with their terms.
MailThe mailbox, to read and draft but not to send without approval.
DocumentsThe documents it reads and writes.
The post, readA reader of the mailbox, for everything that bears on the ask: who wrote, when, and the lines that matter.
The person
AttentionHas to say yes before the agent acts. It stops and waits wherever a yes is needed.
ApprovesAny credit over the limit the business sets.
By handAbout 2 hours.
The measure
GoodEach claim answered with what the agreement gives and its arithmetic, credits raised, late claims declined with the clause, and nothing credited twice.
NullA customer credited a second time for the same delivery or invoice.
CostAbout 14 to 20 turns · 70,000 tokens. A first estimate, to be replaced by what a run measures.
Rating37 of 50, hard. Material 3, span 3, traps 4, stakes 4 and skill 3, each out of 6.
Usefulness8 of 10. Every business that supplies on terms meets claims for credit, and a credit given twice, given too generously or refused wrongly costs money or a customer.
What the card gives the episode. The script itself is written in the studio.
Slate
NO. 007: CUSTOMER CREDITS AND REFUNDS
CODE NAME: CREDIT_THE_CUSTOMER
VERB: CALCULATE
VOLUME 1: ACCOUNTS 1.06
RATING: 37 OF 50, HARD
MODEL: ________ HARDWARE: ________
CODE NAME: CREDIT_THE_CUSTOMER
VERB: CALCULATE
VOLUME 1: ACCOUNTS 1.06
RATING: 37 OF 50, HARD
MODEL: ________ HARDWARE: ________
Opening
Welcome to null::id. I'm Dr RKC. Today, No. 7 of the agents we live by: Customer credits and refunds. A refunds administrator. The whole request is one sentence: “Work through the credit claims and credit what we owe.” The claims, each customer's agreement with its service clause, the credit policy, the delivery records, the invoices and the credit notes already raised. Some claims ask for more than the agreement gives, some arrive after the time allowed, some concern an invoice charged twice, and some repeat a claim already credited.
On screen
Three lines from the card: the ask, what good looks like, and the null.
The run
The moment to watch is step 5, Raise: the credits owed, each with the sum and the reason. That is where a weaker model ends in the null.
Closing
________ gets No. 7 right, for __ tokens and __ minutes of my attention. The card and the case are in the repo. Until next time, mind the null pointer.