Home › Use Cases › Recompute the ceded premium for one policy under the treaty's own terms
Use caseUC0331
🧪 Use-case kit · runnable

Recompute the ceded premium for one policy under the treaty's own terms

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 reinsurance treaty says which part of a risk the cedent keeps and which part it passes on: a quota share section takes a flat percentage of every policy in its class, a surplus section takes everything above a retention up to a stated number of lines. A cession system computes that share of the premium, books it, and puts it on a bordereau. Nobody recomputes it. When it is wrong the reasons are ordinary — an endorsement premium that was flat cancelled and still counts, a written line returned in full, a transaction keyed twice, an amount column that is the hundred per cent figure rather than this company's signed share, a treaty endorsement agreed mid-term against a schedule nobody re-issued — and every one of them lives in a sentence printed under a row. Opening one policy's cession file, reading the note under every posted premium row, deciding which of them earned, checking the amount column against the co-insurance memo, finding the section that responds, applying its share by hand and comparing the result with what was booked.

Audience

A reinsurance operations desk working a bordereau before a statement of account goes out, and the treaty accountant who has to explain a variance to a broker. Every number on these pages came from one real run of this code, not from a vendor page.

The inputThe actual cession file

The corpus is 63 cession file, 0.17 MB (txt 63). It is generated because it has to be. A real bordereau is a cedent's own trading record and a treaty slip is a commercial contract between two named parties; neither can be published, and an anonymised extract would still carry the shape of somebody's book. So every file is built as a STRUCTURE — the policy, its treaty, the transactions that really earned, and the messiness the cession system printed on top — and the panels are rendered from that structure while the key is RCP-2026 applied to the same structure. There is no second place the answer lives.

The corpus

  • The 63 cession filegenerated 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, including two leaks found by attacking the corpus on its own behalf. Every cedent is an invented trading name, every policy number, class code, section code and transaction reference is arithmetic on the file index, and there is no personal data at all — evals/check_labels.py sweeps all 63 files for five families of identifier on every run and reports 0.

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

One cession file, as the model receives itCES-0001.txt · 1 of 63
==============================================================================
CESSION FILE                                               CES-0001
Cedent: CED-3100 - Ridgeline Mutual (invented)
Policy: POL-400000   commercial property   Period: 2026-01-01 to 2026-12-31   Procedure: RCP-2026
==============================================================================

POLICY AND TREATY AS THE MASTER HOLDS THEM
  policy number                  POL-400000
  class code                       FIRE-COM
  currency                              USD
  sum insured                  1,507,000.00
  policy inception               2026-01-23
  treaty                          TR-2026-A
  treaty period                  2026-01-01   to 2026-12-31
  booked cession                  53,454.87
  tolerance pct                        0.25   pct of the recomputed cession
  threshold amount                 1,000.00   or more
  threshold pct                       15.00   pct or more
  bordereau period                full-year

TREATY SECTION SCHEDULE AS PRINTED
  SECTION    CLASS        BASIS              RETENTION   LINES   QUOTA SHARE  COMMISSION
  SEC-A      FIRE-COM     surplus           250,000.00       5             -       25.00
  SEC-B      LIAB-GEN     quota_share                -       -         30.00       25.00
  EXCLUSIONS  NUCLEAR

PREMIUM TRANSACTIONS AS POSTED TO THE BORDEREAU
  TXN        DATE                 AMOUNT  TYPE          STATUS    REF          MEMO
  PRM-0101   2026-01-23        58,400.00  written       POSTED    SL-40000     annual premium at inception, policy commercial property
  PRM-0102   2026-05-02         9,956.00  endorsement   POSTED    EN-1002      additional premium, mid-term increase in cover

Abridged — the file continues.

The outcomeWhat a good result looks like

One policy in, one row out: which premium transactions this procedure treats differently from the bordereau that printed them, quoted verbatim; whether a treaty endorsement was in force; and then, in pure code, the subject premium, the responding section, the ceded premium, the commission, the variance against the booked cession and one of six verdicts.

And when it cannot

And what it does when it cannot. On the scored run 63 of 63 replies parsed and nothing stopped at the ceiling, so there is no unanswered row to report — the failures here are wrong answers rather than missing ones, and they are counted by name in the taxonomy. A reply that returned nothing would be scored WRONG and left inside the denominator; it is 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 bordereau's bad rows announce themselves — every flat cancellation says "cancelled", every duplicate says "duplicate" — the free rules floor, and do not buy a call at all
    It scores 39 of 63 against the paid arm's 37, and the two are statistically indistinguishable (McNemar exact p = 0.8318). A keyword list over the notes reaches everything a keyword can reach, for $0.00.
  • Your treaty file carries changes that were QUOTED and not agreed, in prose, with real dates and real figures — the call — and this is the only place on this kit where that sentence is true
    declined_endorsement_applied is 0 of 63 for the paid arm and 11 of 63 for the regex. Every free test — the date test, the membership test, the basis test, the shape test — passes a change that was never agreed. Only the sentence says no.
  • Your amount columns are sometimes gross and sometimes net of a co-insurance share — free code, and give it the memo
    share_arithmetic is 1 of 5 for the paid arm and 3 of 5 for the floor. Whether a column is the hundred per cent figure is decidable by multiplying the memo out; a model is being paid to do arithmetic it does worse.

And where nothing here is good enough:

  • You need to know whether the treaty responds at all — exclusions, treaty dates, a retention above the sum insured — neither arm; the register decides it in pure code
    RC-1 is a lookup on fields data/treaties.json already holds, so the station answers it whatever an arm said. The floor scores 5 of 5 on that family and the paid arm 3 — the call is not being asked a question here, it is being given the chance to get one wrong.
  • You want one number for a board — do not take one from this kit
    37 of 63 against a free 39 of 63 is the whole result, and per family it splits four ways in both directions. Any single figure from this page is either the loss without the reason or the one win without the loss.

At a glanceHow the whole thing runs

59%all five correct pct
1,693 msp50, end to end
$0.00per 1,000 cession file · google/gemini-3-flash

Run once, for real, on 2026-09-09. 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 cession files in the same shape and data/treaties.json with your own register, and every arm still runs — the four floors, the stub, the label check and the graders are all free. ⚠︎ WHAT STOPS BEING TRUE THE MOMENT YOU DO. Corpus lens →
When is this the wrong choice?Avoid: Paying per policy for a regex you could write in an afternoon. That is the case against the best-fitting scenario (“Your bordereau's bad rows announce themselves — every flat cancellation says "cancelled", every duplicate says "duplicate"”). 5 scenarios scored in all, each with its own. Eval lens →
Where does it stop working?A bordereau that is not fixed-layout rows. Everything here rests on the columns being parseable; a photographed statement or a free-text email is a different kit. 6 recorded failure modes, each from a run rather than a guess. Corpus lens →
What was never verified?WHETHER A REAL BORDEREAU LOOKS LIKE THIS. Every one of the 63 files is generated in-process from one seed. 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?6 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-09 — r001-cession-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 — A clean checkout with no key configured renders the whole board, all four free floors, the stub, the label check and every committed run. The only thing a key buys is the ASK THE MODEL button, which says so when it is disabled.

A living map of modern AI — kept current every morning