Home › Use Cases › Reconcile one local advertising fund's period, contributions in and spend out
Use caseUC0293
🧪 Use-case kit · runnable

Reconcile one local advertising fund's period, contributions in and spend out

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 franchisor's local advertising fund collects a contracted percentage of every contributing store's net sales and spends it on advertising for that market. Somebody has to check both halves each period: did every store pay what its agreement requires on the base the charter defines, did the money actually reach the fund, and is everything the fund paid out something the charter lets it pay for. Today that is a spreadsheet per market per period, a fund accountant re-adding a contribution schedule, and an exception list that either goes to the fund manager or does not. The expensive version of getting it wrong is not the arithmetic: it is a SETTLED REMITTANCE — a store's contribution netted against a credit the franchisor already owed it, showing in the REMITTED column at its full contracted amount. The schedule ties, the period is signed off, and the fund is short. Nobody queries it because nothing looks wrong. Re-adding a market's contribution schedule by hand each period and deciding, store by store and allocation by allocation, whether what the fund received is what the charter required and whether what it spent is what the charter allows. It does not replace the exception schedule, the conversation with the franchisee, the adjustment or the approval — none of the four exists anywhere in this kit.

Audience

A fund accountant working one market's period pack, and the fund manager who reads what they produce. The decision this report is for is narrower than it looks: not 'should we buy a model', but 'which HALF of this job should a model touch' — and on this corpus the answer is one seventh of it. Every number on these pages came from one real run of this code, not from a vendor page.

The inputThe actual ad-fund period reconciliation packs

The corpus is 62 ad-fund period reconciliation packs, 0.18 MB (txt 62). An ad-fund period pack is the smallest thing that carries BOTH halves of the job: contributions in from every store at a contracted rate on a defined base, and spend out against an eligible list and an administration cap. A corpus of store lines alone would be a third royalty kit; a corpus of allocations alone would be an expense-coding kit. It is synthetic because the alternative is a real franchise system's fund file, and those carry the franchisee as a named person, their contact details and their commercial terms — none of which this job needs. Generating it also makes the key DERIVABLE rather than typed: the generator builds each pack from lists of cents, renders the panels from those lists, and computes the answer from the same lists, so a corpus change cannot leave a stale key behind. What that costs the measurement is written up in full in data/SOURCES.md, including the two families a regular expression still takes outright and the one word that separates the whole trap family.

The corpus

  • The 62 ad-fund period reconciliation packsgenerated from a fixed seed, so no real record, person or institution appears in it.
  • Where each came fromSYNTHETIC. Nowhere. tools/build_corpus.py generates all 62 packs, the fund charter register and the answer key from seed 20260903; --check rebuilds every file byte-identically under two different PYTHONHASHSEEDs. Every brand, market, fund, store number, franchisee, agency, sales figure, remittance, allocation and note is invented. See data/SOURCES.md.

Swap this folder for your own material and the kit is pointed at your ad-fund period reconciliation packs. That is the whole change — there is no database to migrate.

One ad-fund period reconciliation pack, as the model receives itAFP-0001.txt · 1 of 62
AD FUND PERIOD RECONCILIATION PACK   AFP-0001
======================================================================================================================

FUND FACTS
  Brand                     Mirenda Taqueria
  Local advertising fund    Pinecrest market
  Charter reference         AFC-2026-PIN12
  Period                    2026-05-01 to 2026-07-31
  Pack raised               2026-09-03

FUND CHARTER
  Effective                 2025-01-01 to 2027-12-31
  System contribution rate  3.00 pct of net sales
  Contracted variances      STR-40295 at 2.75 pct (renewal); all other stores at the system rate
  Contribution base         net sales GROSS OF third-party delivery commission
  Opening waiver            a store contributes nothing until its opening waiver end date
  Administration fee cap    12.00 pct of contributions received in the period
  Eligible spend            media placement, creative production, agency retainer, local store marketing, consumer research, fund administration

CONTRIBUTING STORES
  STORE       FRANCHISEE               APPLIED   SALES REPORTED  BASIS               DELIVERY COMM        REMITTED  REMITTANCE NOTE
  --------------------------------------------------------------------------------------------------------------------
  STR-40295   Ardley Holdings          2.75 pct  $   552,341.57  gross of delivery  $     5,472.37  $    15,189.39  remitted 2026-06-21, bank credit 67764
  STR-40277   Munro & Tay              3.00 pct  $   362,875.55  gross of delivery  $    32,726.30  $    10,886.26  received 2026-06-10 in full against the period schedule
  STR-40218   Oakhampton Dining        3.00 pct  $   580,490.08  gross of delivery  $    39,090.88  $    17,414.70  received 2026-06-09 by ACH

Abridged — the file continues.

The outcomeWhat a good result looks like

One period pack in, six graded answers out: the contribution shortfall to the cent, the ineligible spend to the cent, the finding, the fund position, the action, and the line that establishes the finding quoted verbatim and locatable in the pack at character offsets. On this corpus the paid call returns 62 of 62 contribution figures exact, 62 of 62 ineligible figures exact, 62 of 62 findings, 62 of 62 actions and — after AFR-2026 is re-applied in code — 62 of 62 positions and 62 of 62 packs correct on all six.

And when it cannot

And what it does when it cannot. The paid call's only two raw misses are the same miss: AFP-0055 and AFP-0056 have NO advertising-fund covenant on file for their market at all — a fact the charter register holds and the pack does not print — and the call read both schedules as clean reconciliations and answered position RECONCILED where the key says NO-COVENANT. src/recheck.py re-derives both from data/funds.json, so the rechecked count is 0. Note what it did NOT get wrong: the action is NO-FLAG either way, so it reached the right answer by the wrong route, and no franchisee's name would have moved as a result. ⚠︎ THE CONFIDENCE DOES NOT SEPARATE RIGHT FROM WRONG: median 0.98 on the 60 correct against 0.92 on the 2 wrong, floor 0.78. In the other direction the free rules floor closes 3 short periods with NO-FLAG and the paid call closes 0.

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.

  • You want the spend side checked and nothing else — the free rules floor alone — evals/baseline.py, the allocation loop
    62 of 62 ineligible-spend figures exact for $0.00, tying the paid call. An eligible-spend list and an administration cap are a list lookup and an integer comparison.
  • Your contribution schedules are clean and columnar — the free rules floor, whole
    55 of 62 packs completely right for $0.00. Every structured family — a plain underpayment, a wrong base, a wrong rate, a store inside its opening waiver — is right on both arms.
  • Your packs carry prose that contradicts a column — the paid call WITH src/recheck.py bolted to it, never without
    Seven packs and one mechanism: three masked settled remittances (floor 0 of 3, call 3 of 3) and four bulletins the floor mistakes for transactions (0 of 4 against 4 of 4). Paired rechecked, 7 wins and 0 losses, p = 0.016.

And where nothing here is good enough:

  • You want a guarantee that no franchisee is named wrongly — neither arm, and read wrongly_flagged instead
    It is 0 of 62 on EVERY committed arm including the adversarial one — but 0 on 62 packs is not a guarantee, it is a measurement with a small base.

At a glanceHow the whole thing runs

60%pack all correct
87,622 msp50, end to end
$41.22per 1,000 ad-fund period packs · Gemini 3 Flash

Run once, for real, on 2026-09-03. 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?Drop your own packs in data/corpus/ as .txt with the same six panel headings, add one row per pack to data/funds.json with a register value from the five the vocabulary declares, and put your own answers in data/gold.jsonl. ⚠︎ WHAT YOU CANNOT SWAP IN WITHOUT REWRITING THE KEY. Corpus lens →
When is this the wrong choice?Avoid: Paying for it. It is half the job by line count and none of the value. That is the case against the best-fitting scenario (“You want the spend side checked and nothing else”). 4 scenarios scored in all, each with its own. Eval lens →
Where does it stop working?TWO FINDINGS ON ONE PACK. Every pack here carries at most one, and the answer contract offers one finding field. 9 recorded failure modes, each from a run rather than a guess. Corpus lens →
What was never verified?Whether any margin here survives a second run. ONE run was fired on one corpus with one model, and the whole model-versus-floor gap is seven packs. 8 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?8 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-03 — r001-adfund-recon. 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 — Clone, no install, python3 tools/build_corpus.py rebuilds all 62 packs plus funds.json, gold.jsonl and corpus-stats.json from seed 20260903 in under a second; python3 -m evals.check_labels re-derives the entire key with its own parser and reports 0 problems across ten checks; python3 -m evals.run --run-id b000-adfund-recon-rules --floor rules scores all 372 graded cells at $0.00 with no key and no network. The board then renders both committed paid runs from results/ with the model button disabled. A forker sees the whole kit working before deciding whether to configure a provider at all.

A living map of modern AI — kept current every morning