Skip to content
docs
Arxo ↗

End-to-end worked example

For LLMs11 sections

Task: follow one real dossier through every pipeline stage, from pinned bytes to acceptance, so the method reads as one story rather than separate rules. Place: capstone of the pipeline pages. Read the workflow first, then the stage pages in order; this page replays them against a single package and shows the checks that close each loop.

  • The pinned source bytes: edition EAI_EDITION, label PINNED_UNOFFICIAL_COPY — an Adilet API copy retrieved 2026-09-13, sha256 pinned, local copy kept in the package.
  • The scope question: what does an employer owe, and what does a worker receive, under five articles of the employer accident-insurance act?
  • A working law tool, version 0.1.0, semantics law.core/0.2.
  • Blank records to fill along the way: the scope card template, the source inventory template, the decision record template, and the review record template.
  • Sources. The Russian text of the act was taken from the publisher document feed in mid-September and preserved unchanged. The edition declares the literal label PINNED_UNOFFICIAL_COPY, so every later check certifies a pinned copy and never claims the official publication. The pinning check exits silently on the good package (local 0.1.0 build — the published build has no gen command, as the pin page states):
Terminal
$ law gen pinning corpus/laws/kz/laws/employee-accident-insurance --check; echo "exit=$?"
exit=0
  • Scope. The scope card answers the scope question for five articles: the employer duty to insure, the assumed insured-sum input, the tariff table with the premium formula, the payout condition, and the late-payment penalty. The other twenty-three articles stay out with a grouped reason. The v1 card files article 19 whole; the confirmed v2 card splits it into the insurer and employer branches; the v3 card re-grounds the premium branch on the insured sum with the minimum floor. Filled forms: the EAI scope card, its confirmed revision, and the R3 revision.
  • Inventory. The act was walked article by article over the pinned bytes: five articles touched with their rule mapping, twenty-three excluded, zero unprocessed. The branch-level revision re-walks article 19 unit by unit — two branches formalized, the rest excluded by name — which is the walk that would have caught EAI-R1 at the source stage; the R3 revision re-walks articles 16 and 17 the same way, which is the walk that would have caught EAI-R3. Filled forms: the EAI source inventory, its branch-level revision, and the R3 revision.
  • Decisions. Four records settled the flagged calls: EAI-D1 takes the tariff as twenty-two strict rules, EAI-D2 reads the payout bound as inclusive thirty through one hundred, EAI-D3 keeps the penalty exact with no rounding step, EAI-D4 grounds the premium base on the insured sum with the minimum floor. Filled forms: the EAI tariff decision, the EAI threshold decision, the EAI penalty decision, and the EAI premium-base decision.
  • Model. The model holds strict rules only: one duty rule, twenty-two tariff rules from class 1 at 0.12 percent to class 22 at 0.0296, one base rule as insured sum times rate plus two premium rules splitting on the minimum floor, one payout rule for loss thirty through one hundred, one penalty rule as unpaid times 0.015 times days. The package declares name kz.corpus.employee_accident_insurance, version 0.1.0, language 0.2, zero dependencies, explicit local imports.
  • Scenarios. Seven checks were written with expectations fixed before the run: the duty, the class twenty-two premium, the penalty, the lower-bound pair, a world probe, and a property. The static check reports OK and all seven pass; the transcripts sit under Verify below.
  • Finding. EAI-R1 — the model covers only the insurer branch of article nineteen. That one line is all this page owns; the statement, severity, and disposition live in the filled EAI review record. A later re-review added EAI-R3 — the premium base reads payroll instead of the insured sum, with no minimum floor — caught under a green thirty-four of thirty-four.
  • Fix. The fixes became a separate accepted candidate, not edits to the live package: the EAI bytes plus the employer-branch rule, the premium-base rules, the full tariff suite, both boundary pairs, the fractional-penalty probe, and the three premium-base probes — thirty-seven checks, snapshot id 7635d197…, reviewed in the R3 review (the pre-R3 review stays on file as history). Rule text, probes, and re-run transcripts belong to the semantic review page; the live package stays untouched at seven of seven with EAI-R1 and EAI-R3 open there.
  • Re-verify. The candidate was checked end to end: static check OK, thirty-seven checked with thirty-seven passed and zero failed, identity recomputed against the snapshot. The live package re-verifies unchanged at seven of seven.
  • Acceptance. The candidate verdict reads accept with recorded limits, bound to snapshot 7635d197…. The dossier below is the handover.
  • Synthetic change. In a scratch copy outside the repo, the payout bound was flipped from thirty to thirty-one to prove the suite trips. The run below is verbatim from that scratch copy, observed with the local 0.1.0 build (binary hash sha256:78de…c95d7, Russian output); [...] marks omitted lines:
Output
$ law test /tmp/eai-mutant
law test kz.corpus.employee_accident_insurance: мир kz.corpus.employee_accident_insurance
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-EMPLOYER-MUST-INSURE
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-MINING-CLASS-22-PREMIUM
FAIL [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-LOSS-THIRTY-QUALIFIES
truth_status == TRUE_ONLY: в документе NEITHER
[...]
итого: 7 проверено, 4 прошли, 3 не прошли, 0 не исполнены; код 1

[translation] The header line names the tested world; the detail line reads “in the document: NEITHER”; the summary line reads: seven checked, four passed, three failed, zero unexecuted, code one.

Three checks failed — the thirty-qualifies check plus the world probe and the property that read the same bound — and the scratch copy was discarded. The bound at thirty stands, tripped by its pair.

  • EAI-D1: tariff as twenty-two strict rules, tripped per row by the twenty-two premium checks.
  • EAI-D2: inclusive thirty-through-one-hundred boundary, tripped by the 29/30 and 100/101 pairs.
  • EAI-D3: penalty with no rounding policy, tripped by the fractional 1.5 KZT probe.
  • EAI-D4: premium base on the insured sum with the minimum floor, tripped by the three premium-base probes.
  • EAI-R1 disposition: closed in the accepted candidate (snapshot 7635d197…), open in the live package.
  • EAI-R3 disposition: closed in the accepted candidate (snapshot 7635d197…), open in the live package.

The dossier hands over the filled records plus the model and its suite: the EAI scope card with its confirmed revision and R3 revision, the EAI source inventory with its branch-level revision and R3 revision, the EAI tariff decision, the EAI threshold decision, the EAI penalty decision, the EAI premium-base decision, the filled EAI review record, the candidate review, and the R3 review bound to snapshot 7635d197…. Blank shapes for reuse: the scope card template, the source inventory template, the decision record template, and the review record template.

The dossier at a glance, with states labeled — [source snapshot] is the frozen before-state at seven of seven, [accepted candidate] is the fixed snapshot at thirty-seven of thirty-seven. [Accepted candidate]: employer duty established per employer with employees; twenty-two tariff classes from 0.12 percent to 2.96 percent with class 22 at 0.0296; premium base as insured sum times rate with the minimum floor, giving 29600 KZT on a sum of one million and 59200 on a doubled sum; payout for capacity loss thirty through one hundred on the insurer side, with thirty established and twenty-nine undecided; employer reimbursement for losses five through twenty-nine; penalty as unpaid times 0.015 times days, giving exactly 3000 KZT on one hundred thousand unpaid for two days. [Source snapshot]: the same dossier with two gaps — losses five through twenty-nine carry no employer-side conclusion (that gap is EAI-R1, finding open), and the premium multiplies payroll instead of the insured sum with no floor (that gap is EAI-R3, finding open). Sources stay pinned to EAI_EDITION with materialization PINNED_UNOFFICIAL_COPY throughout.

Closing the loop on paper: writing the finding, skipping the fix, and never re-running. A disposition without its confirming re-run is a wish; the re-runs in the Actions list above are what turn EAI-R1 from an open question into a demonstrated fix with the package confirmed unchanged. The twin failure is editing an expectation to match a surprising run instead of fixing the model or justifying the change.

All runs below were observed with the published tool law 0.1.0, semantics law.core/0.2:

Output
$ law version
law 0.1.0
semantics: law.core/0.2
std for language 0.2: 0.2.0
lawql: lawql/1 (queryResult 0.1)
binary hash: sha256:c56e69e761c20f9019753c4b22c9dc7e810e290512ac763d7bb89c69ef93210d
Terminal
$ law engine check corpus/laws/kz/laws/employee-accident-insurance
check OK: corpus/laws/kz/laws/employee-accident-insurance
Output
$ law test corpus/laws/kz/laws/employee-accident-insurance
law test kz.corpus.employee_accident_insurance: world kz.corpus.employee_accident_insurance
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-EMPLOYER-MUST-INSURE
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-MINING-CLASS-22-PREMIUM
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-LOSS-THIRTY-QUALIFIES
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-LOSS-TWENTY-NINE-IS-NOT-INSURER-PAYOUT
ok [kz.corpus.employee_accident_insurance#authored] tests/core.lawtest / EAI-SPECIAL-LATE-PAYMENT-PENALTY
ok [kz.corpus.employee_accident_insurance#authored] tests/goals.lawtest / GoalEstablishedCapacityLossHasPayout-world
ok [kz.corpus.employee_accident_insurance#authored] tests/goals.lawtest / urn:kz:corpus:clir:employee-accident-insurance#GoalEstablishedCapacityLossHasPayout
total: 7 checked, 7 passed, 0 failed, 0 not run; code 0

The candidate closes the loop the live package leaves open:

Output
$ law test docs/handbook/files/fixtures/eai-candidate
[...]
ok [kz.corpus.employee_accident_insurance#authored] tests/tariff.lawtest / EAI-TARIFF-CLASS-22-PREMIUM
ok [kz.corpus.employee_accident_insurance#authored] tests/bounds.lawtest / EAI-LOSS-100-QUALIFIES
ok [kz.corpus.employee_accident_insurance#authored] tests/bounds.lawtest / EAI-LOSS-101-SILENT
ok [kz.corpus.employee_accident_insurance#authored] tests/penalty-fractional.lawtest / EAI-PENALTY-FRACTIONAL-EXACT
ok [kz.corpus.employee_accident_insurance#authored] tests/premium-base.lawtest / EAI-PREMIUM-SUM-DISTINGUISHES
total: 37 checked, 37 passed, 0 failed, 0 not run; code 0

([...] marks the header plus the thirty-two omitted passing lines; the full transcript is the candidate run.) Criterion: the static check reports OK, the live run reports seven of seven, the candidate run reports thirty-seven of thirty-seven against snapshot 7635d197…, and the synthetic bound flip fails its three bound-reading checks in a scratch copy. A dossier that misses any of the four has not closed its loop.

The dossier covers five articles, not the act; review left EAI-R1 and EAI-R3 open in the live package, so the five-through-twenty-nine employer branch and the insured-sum premium base are proven only in the accepted candidate; insurer-side silence below thirty is intended, not proven complete. The synthetic change proves the live suite trips on one bound; per-row tripping is proven by the candidate’s twenty-two tariff checks, not here. A passing dossier never proves the model matches the act — that reading stays with the author and the reviewer.

Continue with Record templates, which gives the blank record shapes behind this dossier plus a field checker.

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.