Home › Use Cases › License fee billing reconciliation
Use caseUC0447
🧪 Use-case kit · runnable

License fee billing reconciliation

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 distributor licenses a programme to a licensee for a fee paid on a schedule — fixed instalments on due dates and milestone payments that fall due when a deliverable is ACCEPTED — and every month the billing desk raises invoices against it. Before those invoices go out on the statement run they have to agree with four records: the payment schedule and its variations, the delivery desk's tracking sheet, the invoices already raised, and this cycle's own. The billing desk's match reads COLUMNS: a trigger count, an amount total, a duplicate check. What decides the answer is often a sentence: an acceptance the licensee's QC reversed, a sign-off that came through after the sheet was last updated, a variation that was never countersigned, an earlier invoice credited and re-issued, a fee a manual invoice already charged. The desk's own status disagrees with the procedure on 46 of the 64 packs in this corpus — it never checks a trigger, so it never says EARLY-INVOICE. Opening one licence billing pack, checking every invoice raised this cycle against the trigger of the payment it bills — the acceptance date of its deliverable or its instalment's due date — at the AS AT date, reading each note to see whether it withdraws or records an acceptance, credits an earlier invoice, voids a variation or records a manual invoice, pricing each invoice at the schedule row in force, and listing every triggered payment nobody has invoiced.

Audience

The licence billing desk and the finance desk at a content distributor, working a month's licence fee invoices before the statement run — and the delivery desk and deal desk that own the acceptance and variation queries an exception raises. Every number on these pages came from one real run of this code, not from a vendor page.

The inputThe actual licence billing packs

The corpus is 64 licence billing packs, 0.20 MB (txt 64). It is generated because it has to be. A real licence book is a distributor's own commercial record: named licensees, named programmes, negotiated fees that are confidential, delivery QC reports and desk notes written by named people. None of that can be published, and a corpus that could be published would have had the one thing this kit measures — the sentence that decides the reading — stripped out of it first. So the whole thing is invented, declared, and generated from one seed with the key DERIVED by the same rulebook the kit applies.

The corpus

  • The 64 licence billing packsgenerated from a fixed seed, so no real record, person or institution appears in it.
  • Where each came fromdata/SOURCES.md states where every byte came from AND what the generator costs the measurement. Every licensee is an invented code and trading name, every deal, schedule row, deliverable, invoice and credit note is arithmetic on the file index, and THERE ARE NO PEOPLE IN THIS CORPUS AT ALL — a note speaks for the delivery desk, the deal desk, the billing desk, the finance desk or the licensee's accounts payable team. evals/check_labels.py sweeps all 64 files for a person-shaped name on every run and reports 0.

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

One licence billing pack, as the model receives itLFB-0001.txt · 1 of 64
================================================================================
LICENCE FEE BILLING RECONCILIATION -- ONE LICENCE, ONE AS-AT DATE
================================================================================
FILE              LFB-0001
LICENSEE          LS-6101  Brackenholt Media
DEAL              DEAL-4100
AGREEMENT         v1, executed 2026-01-05
PROGRAMME         PKG-2300  a ten-part natural-history series
RIGHTS            territory T-01, first pay-TV window
BILLING CYCLE     2026-06-01 to 2026-06-30
AS AT             2026-07-03
PACK COMPILED     2026-07-07
CURRENCY          USD

-- PAYMENT SCHEDULE (schedule 2 and every variation printed on it) -------------
ROW         TYPE        TRIGGER               AMOUNT  CLAUSE VER  SOURCE
PS-4100-1   INSTALMENT  DUE 2026-01-08     40,000.00  4.1    v1   DEAL-4100 schedule 2
PS-4100-2   MILESTONE   ON DLV-01          60,000.00  4.2    v1   DEAL-4100 schedule 2
PS-4100-3   MILESTONE   ON DLV-02          58,000.00  4.3    v1   DEAL-4100 schedule 2
PS-4100-3V  MILESTONE   ON DLV-02          65,500.00  4.3    v2   VAR-01 letter 2026-05-18
PS-4100-4   INSTALMENT  DUE 2026-06-08     41,500.00  4.4    v1   DEAL-4100 schedule 2
PS-4100-5   MILESTONE   ON DLV-03          53,500.00  4.5    v1   DEAL-4100 schedule 2
PS-4100-6   INSTALMENT  DUE 2026-10-01     90,000.00  4.6    v1   DEAL-4100 schedule 2
PS-4100-7   MILESTONE   ON DLV-04          25,000.00  4.7    v1   DEAL-4100 schedule 2

-- DELIVERY LOG (delivery desk tracking sheet, last updated 2026-06-20) --------
DELIVERABLE ITEM                                 DELIVERED   QC STATUS  STATUS DATE
DLV-01      programme masters, first delivery    2026-05-04  ACCEPTED   2026-05-09
DLV-02      programme masters, second delivery   2026-06-01  ACCEPTED   2026-06-05

Abridged — the file continues.

The outcomeWhat a good result looks like

One licence billing pack in, one row out: which acceptances stand at AS AT and from what date, which schedule rows are in force, which payments were billed before, every invoice's flags, every unbilled trigger, the exceptions and one of five LFB-2026 verdicts, each finding citing its deal, clause and clause version. 60 of 64 packs come back with all seven graded fields right, against 40 for the best free floor and 0 for the billing desk's own status line. ⚠︎ The reply's OWN verdict is right on 37 of 64; the 60 is the station's, computed from the reply's three readings.

And when it cannot

On the scored run 64 of 64 replies parsed, 0 stopped at the ceiling and no call failed. The 4 packs it got wrong are named in the kit README with what it answered, and every one is a reading: 2 notes dated AFTER the AS AT date that it followed anyway (LFB-0018, LFB-0039), 1 late acceptance it left out (LFB-0009) and 1 credited invoice it kept billing (LFB-0049). A reply that cannot be parsed is counted WRONG and stays in the denominator; it is never dropped and never re-fired.

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 billing system records credit notes, cancellations, manual invoices, uncountersigned variations and QC reversals as COLUMNS, and exports the tracking sheet at AS AT — the free modal floor, and do not buy a call at all
    40 of 64 packs for $0.00. Duplicates this cycle, prior billing, early instalments, invoices before a printed acceptance, wrong amounts, effective variations and unbilled triggers are all decidable from columns and dates, and on those 37 packs the floor gets 37.
  • Acceptances, credits, voided variations and manual invoices arrive as free text — a delivery desk note, a billing desk note, an email pasted into the pack — the paid call, with the station
    This is the whole product. On the 27 packs where a sentence decides a reading the paid arm is 23, the modal floor 3 and the best vocabulary floor 12.
  • You want the billing desk's own match audited — either paid or free — both beat it comprehensively
    The desk's status disagrees with LFB-2026 on 46 of 64 packs and gets 0 whole: it returns no reading at all and never checks a trigger. It is published as an arm so the comparison is against what is running today rather than against nothing.

And where nothing here is good enough:

  • You were going to ship the model's own verdict — do not — ship the station's
    The reply's own verdict is right on 37 of 64 and on 3 of the 17 RECONCILED licences; the station's, from the same replies, is right on 60. A pipeline that shipped the reply's verdict would be worse than the free modal floor.
  • Notes are routinely dated after the AS AT date — a QC report or a credit note that lands after the pack is compiled — neither alone — strip or date-filter post-AS-AT notes before the call
    The paid arm got 1 of the 3 date traps; the modal floor, which reads no note, got all 3. A pre-filter on the note's own date would make that reading a column again.
  • Your licences carry royalty or revenue-share fees, partial invoices, withholding tax or an amount tolerance — neither, yet
    No file in this corpus does. The unit of work is fixed-fee schedule rows billed one invoice per payment, and every percentage on this page is against that unit.

At a glanceHow the whole thing runs

94%rechecked all correct pct
1,908 msp50, end to end
$1.50per 1,000 licence billing packs · the fast tier

Run once, for real, on 2026-09-13. 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 data/corpus/*.txt with your own licence billing packs in the same seven-block shape and data/licences.json with your own licence register, then run python3 -m evals.run --run-id b000-<yours>-modal --floor modal — it needs no key and costs nothing. ⚠︎ WHAT STOPS BEING TRUE THE MOMENT YOU DO. Corpus lens →
When is this the wrong choice?Avoid: Paying per licence for arithmetic you already have. That is the case against the best-fitting scenario (“Your billing system records credit notes, cancellations, manual invoices, uncountersigned variations and QC reversals as COLUMNS, and exports the tracking sheet at AS AT”). 6 scenarios scored in all, each with its own. Eval lens →
Where does it stop working?A milestone whose trigger is not an acceptance — a first broadcast, a delivery date, a territory launch. R-1 makes acceptance the trigger; any other event has nothing in the tracking sheet to read. 7 recorded failure modes, each from a run rather than a guess. Corpus lens →
What was never verified?NO SECOND SCORED RUN. One was fired, so the run-to-run spread on this corpus is unknown and no confidence interval is claimed anywhere on this page. 9 items this kit says it could not check. Eval lens →
Can I run this on a model I control?Yes — any OpenAI-compatible endpoint, including one on your own hardware. The shipped adapter takes its host from BASE_URL and its model from MODEL, so nothing in src/ changes. The published figures come from 1 model on the fast tier, one provider, one key. Prompt lens →
And if it fits — what do I stand up?5 artifacts with a stated home and a stated egress, and 3 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-13 — r001-license-billing. 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 four free floors and every committed run. pip install -r requirements.txt installs nothing — the kit is standard library only. The only thing a key buys is the ASK THE MODEL button and a new scored run.

A living map of modern AI — kept current every morning