Home › Use Cases › Validate a billed accessorial against the contract and the trip's own events
Use caseUC0387
🧪 Use-case kit · runnable

Validate a billed accessorial against the contract and the trip's own events

A small, forkable project that does one job end to end. Run once for real, and every figure on these pages captured from that run.

The business caseThe problem this solves

A carrier's invoice carries accessorials - detention, layover, redelivery, a lumper, a reconsignment, a truck ordered not used - and each one is three questions at once, not one. Is it contracted at all? The description is the CARRIER'S vocabulary and Exhibit B is the agreement's, so 'Driver detention at delivery' may be DET-C and 'Detention - team driver premium' may be nothing. Is the rate right? That is Exhibit B's rate, free time, increment and cap against the units the trip supports. And do the events support it? A detention charge needs the free time to have genuinely elapsed - and a gate note saying the driver was held for his own paperwork means it never accrued, however the guard log reads. Nobody does all three on every line, because doing it means reading a guard log, an event register and a paragraph of free text against a rate exhibit, per charge, per trip. It surfaces as a quarter's accessorial spend nobody can account for. THIS IS NOT A CATALOGUE CHECK. There is no master-data question here and no system export: the question is about ONE BILLED CHARGE on ONE TRIP, and the trip's own event log is the third leg. The line-by-line clearance of a carrier's accessorial charges before settlement - reading a guard log, an event register and the yard's own gate notes against the agreement's rate exhibit, per charge - which in most shops is sampled rather than done.

Audience

The freight-audit desk that clears a carrier's accessorials before settlement, and the carrier contract analyst who owns Exhibit B. The decision in front of them is not 'pay or dispute' - it is which of this week's charge lines to open, and under which clause. This report answers it with a split rather than a headline: buy the call for the clock and for not disputing clean charges, and let free code do the arithmetic, the event register and the vocabulary. Every number on these pages came from one real run of this code, not from a vendor page.

The inputThe actual trip files

The corpus is 58 trip files, 0.14 MB (txt 58). A carrier rate agreement's accessorial exhibit is the commercially sensitive half of a freight contract and a trip's guard log is operational data about named drivers at named sites. There is no public corpus of either and no licence under which a real one could ship inside a kit meant to be forked - so generating one is the only way this kit can carry the thing it is actually about and still be publishable. WHAT IT EXERCISES WAS CHOSEN RATHER THAN SAMPLED, and every choice is a measurement somebody can check. 154 of the 176 properly contracted lines are billed under a description Exhibit B does not print, because carriers bill in their own vocabulary - that is what makes name matching a reading. 10 descriptions LOOK like contracted codes and are not, so a matcher that is generous about synonyms fails a class an exact matcher gets right. 24 lines turn on FA-3.2, where the driver reached the gate before his appointment and the guard log's clock and the contract's clock disagree. 19 turn on a gate note that puts the delay on the carrier, written the way a yard clerk writes - and three of the ordinary notes talk about the driver and the carrier without finding any fault, which is the only reason a keyword floor can be wrong in the generous direction at all. 33 lines are decided by arithmetic alone, so free code's exactness is measurable rather than asserted.

The corpus

  • The 58 trip filesgenerated from a fixed seed, so no real record, person or institution appears in it.
  • Where each came fromSYNTHETIC AND GENERATED - not fetched, not scraped, not derived from any real document. Every byte of the 58 trip files is written by tools/build_corpus.py from seed 20260911, and python3 -m tools.build_corpus --check regenerates them and diffs them against what shipped; it reports REPRODUCES EXACTLY or names the file that moved. No real carrier, shipper, consignee, lane, driver, guard log, negotiated accessorial rate or person appears anywhere in it; 'Cascade Ridge Carriers, Inc.', 'Northbend Distribution Co.' and the rest were invented for this corpus, and FA-2026 is not anybody's freight-audit policy. This sentence is written out because the generic provenance line - that a corpus was obtained from somewhere under some licence - would be FALSE here, and a false provenance sentence is worse than a blunt one.

Swap this folder for your own material and the kit is pointed at your trip files. That is the whole change — there is no database to migrate.

One trip file, as the model receives itTRP-0001.txt · 1 of 58
TRIP FILE TRP-0001
Carrier: Cascade Ridge Carriers, Inc.     Carrier agreement: CA-4471
Shipper: Verity Foods Packing, Modesto CA
Consignee: Kestrel Hardware Depot 7, Rapid City SD
Load LD-80037   dry grocery, 11 pallets   Dispatched 2026-07-10

EVENT LOG  (guard shack and dock systems, local time at each stop)
  ORIGIN
    appointment        2026-07-10 14:30
    gate in            -- no gate stamp recorded --
    gate out           2026-07-10 15:34
    signature          2026-07-10 15:02
  DESTINATION
    appointment        2026-07-11 07:45
    gate in            2026-07-11 07:51
    gate out           2026-07-11 11:51
    signature          2026-07-11 09:11

TRIP EVENTS
    overnight holds recorded     0
    failed delivery attempt      yes
    lumper receipt on file       none on file
    reconsignment instruction    none on file
    cancelled after dispatch     no
    driver assist recorded       yes
    additional delivery stops    0

GATE NOTES  (free text, entered by the yard clerk at each stop)
    Origin: Load was re-tarped at our request before it left the yard.
    Destination: Load was re-tarped at our request before it left the yard.

EXHIBIT B of CA-4471 -- the accessorials this carrier agreement contracts
    code   Exhibit B description    basis          rate       free time  cap
    DET-S  Detention - Shipper      per_hour       $75.00     150 min    $750.00
    DET-C  Detention - Consignee    per_hour       $65.00     120 min    --
    RDLV   Redelivery               per_occurrence $150.00    --         --
    RECON  Reconsignment            per_occurrence $135.00    --         --
    DRVA   Driver assist            per_occurrence $75.00     --         --
    increments: DET-S 30 min, DET-C 30 min

Abridged — the file continues.

The outcomeWhat a good result looks like

Every billed accessorial carries one of five verdicts, the FA-2026 clause that decides it, the entitled amount, the signed amount at issue to the cent, the named desk that owns it, and one line of the trip file copied verbatim as evidence; and every trip carries PASS or QUERY, the lines that do not tie, and the total at issue. On r001-accessorial-validate: 185 of 226 line verdicts correct (81.9 pct), 212 of 226 clocks, 202 of 226 Exhibit B codes, 174 of 226 clauses, and 56 of 58 trips right on the recommendation. Every citation the arm returned located in its own document - 226 of 226, 0 unlocatable.

And when it cannot

IT PASSES CHARGES THE GATE NOTE KILLS. 15 of the 19 lines whose gate note establishes a carrier-caused delay were ruled SUPPORTED and went to settlement - the arm read the note and did not find fault in it. That is the error direction that costs money rather than goodwill, and it is 11 lines across the whole corpus (4.9 pct of all 226). The mirror image is the reassuring half: it wrongly disputed 0 clean charges out of 55. The free floor makes the opposite mistake 21 times.

Where it fitsWhat did work

Every line below is a measured result from this kit's own runs, with the figure that supports it. The headline above is not softened by any of them.

  • Your accessorial exceptions are mostly arithmetic - free time that did not elapse, a rate that does not match the exhibit, an event nobody logged — the free alias floor, and do not buy the call
    free code is EXACT on those: 33 of 33 against the paid call's 24, p = 0.003906. It costs nothing, it never varies, and it is 119 lines of Python.
  • Your carriers bill under their own vocabulary and your free-time clock has a rule about early arrival — the paid call for the clock, the synonym table for the vocabulary
    the call wins which clock governs - 212 of 226 against 193, p = 0.004324 - and LOSES the vocabulary: the floor's synonym table takes 220 of 226 against the call's 202, p = 0.000912.
  • A false dispute costs you more than an overpayment - you are managing a carrier relationship, not a recovery target — the paid call
    it never wrongly disputed a clean charge: 55 of 55 clean lines correct against the floor's 34, p p < 0.0001. The floor raises 21 false disputes on this corpus.

And where nothing here is good enough:

  • You want one arm to do the whole job — neither, on this evidence
    the composite is a draw. Verdict 185 against 169, p = 0.084646; all seven fields 139 against 144 with the FLOOR ahead, p = 0.716294. Nothing here justifies buying a call for the whole job.

At a glanceHow the whole thing runs

82%verdict correct pct
1,765 msp50, end to end
$0.70per 1,000 trip files · GPT-5.6 Luna

Run once, for real, on 2026-09-11. Every figure on these pages was captured from that run — nothing is written from intent.

14 steps, grouped by the question that sends you to them rather than by build order. Each tile carries the one figure that step is about, and opens the page behind it.

Should you use this?What you bring, where it stops, and when not to use it

Before you commit an afternoon to this, these are the answers that decide it. Each one is rendered from the record it lives in — and links the page that holds it in full.

What do I have to bring?Replace tools/build_corpus.py with a reader over your own data and nothing else changes. The kit will rule a trip file it has never seen - src/prompt.py's build(text) takes the document alone, and the governing Exhibit B is read off the document rather than out of data/. Corpus lens →
When is this the wrong choice?Avoid: Do not read the headline verdict rate as if it applied here. That is the case against the best-fitting scenario (“Your accessorial exceptions are mostly arithmetic - free time that did not elapse, a rate that does not match the exhibit, an event nobody logged”). 4 scenarios scored in all, each with its own. Eval lens →
Where does it stop working?A trip file assembled with the WRONG agreement's Exhibit B. This kit is handed the governing exhibit already joined onto the page; in a real shop that join crosses a TMS and a contract repository, and getting it wrong produces a confident NOT_CONTRACTED on a charge the contract does cover. 5 recorded failure modes, each from a run rather than a guess. Corpus lens →
What was never verified?whether a second run would reproduce these figures. The scored run was fired ONCE, by design, so nothing here separates the model's variance from the corpus's difficulty. 6 items this kit says it could not check. Eval lens →
Can I run this on a model I control?The shipped adapter is the runtime provider is not named on this page; the Prompt lens states what swapping it costs. The published figures come from 1 model on the fast tier (THE PUBLISHED RUN). Prompt lens →
And if it fits — what do I stand up?6 artifacts with a stated home and a stated egress, and 4 decisions each with what you provision past its ceiling — plus what was not measured. That is the next page, not this one. step 14 — Run it in your environment →

Not asked of this kit — 2 questions: clone (a fresh clone of this kit runs with nothing fetched); judge (nothing here is graded by a model).

Last verified 2026-09-11 — r001-accessorial-validate. Every figure on these pages was captured from that run.

Run itHow this reaches your data

Every result on this page was produced by pure code over checked-in files, with no API key — which is why you can read the numbers before anyone spends anything.

Run this on your own data

  • The pipeline, its eval harness and the runs behind every numberdeployed inside your environment, on your own model endpoints, against your own documents.
  • The corpus above is the shape, not the limitit is a folder swap, and there is no database to migrate.

Talk to us →

Checked before this shipped — A clean checkout with no key configured renders the whole board - all 58 trip files, the answer key, the scored run, both free floors, the paired tests and the twelve adversarial trials - and scores both free floors offline. tools/build_corpus.py --check, evals/check_labels.py, evals/baseline.py, evals/run.py --stub, evals/run.py --rescore and src/app.py all run with no network and no credential, and nothing is pip-installed. Only evals/run.py without --stub or --rescore, evals/injection.py, and the board's one Check button ever reach a provider.

A living map of modern AI — kept current every morning