Skip to content

Methodology

Models draft. Code computes. People approve.

Three boundaries keep the fleet defensible: arithmetic runs in a tested engine, uncertain fields route to a person by a threshold enforced in code, and nothing ships without approval.

Where each kind of work happens

Model

Reads documents, classifies, extracts, retrieves sources, writes prose.

Returns null rather than guess. Every field carries a confidence and a citation.

Engine

Every number: taxable income, SE tax, safe harbor, depreciation.

Called as compute_tax. Deterministic, cited, unit-tested. The model quotes it; it never recomputes it.

Person

Reviews routed fields, signs off on the workpaper.

requireHumanApproval is a code gate. No prompt can skip it.

The tax engine

Six rules for numbers a reviewer can trust.

@taxline/tax-engine is a dependency-free TypeScript package shared by the site’s calculators and the agent service.

01

Pure functions

No I/O, no clock, no randomness. Same inputs, same outputs — in the browser, in the service, in tests.

02

One table per year

Every indexed figure lives in years/2026.ts with its citation. Adding a year is a data change, not a code change.

03

Round where the form rounds

Half away from zero to the cent at each published line; the Tax Table midpoint rule below $100,000; whole dollars where the IRS allows.

04

Coerce, never NaN

Bad or empty input becomes 0 and is shown as 0. A field the fleet could not extract stays null and blocks the computation instead.

05

Trace every line

Each result is a list of lines with value, operands, form line, and authority — the workpaper is the output, not a rendering of it.

06

Test against the source

Expected values are worked from the IRS tables by hand. The MACRS table is re-derived from first principles and checked to the hundredth.

Confidence routing

The threshold is a line in code, not a request in a prompt.

Each extracted field carries a confidence c in [0, 1]. The routing rule is the same in the service (assess_confidence) and the offline demo.

Routing rule
route(f)={reviewv=∅∨c=∅∨c<τpassotherwise,τ=0.85

A missing value or a missing score routes to review: absence is never treated as confidence.

Review load
L(τ)=∑i=1N1[ci<τ]

Raising τ sends more to people and fewer errors through; lowering it does the reverse. The explorer below runs this on the demo queue.

Threshold explorer

16 fields from the demo intake queue. Drag τ to see what routes to a person.

0.000.501.00
To review
—
Pass
—
Demo fields and their routing at the chosen threshold
DocumentFieldConfidenceRoute
acme_w2_2024.pdfEmployer0.93—
acme_w2_2024.pdfEIN0.98—
acme_w2_2024.pdfWages · box 10.99—
acme_w2_2024.pdfFederal w/h · box 20.98—
acme_w2_2024.pdfState w/h · box 170.65—
acme_w2_2024.pdfLocal code · box 200.39—
1099-nec_batch.pdfPayer0.93—
1099-nec_batch.pdfPayer TIN0.96—
1099-nec_batch.pdfNonemployee comp · box 10.97—
1099-nec_batch.pdfFederal w/h · box 40.99—
depr_schedule.xlsxTotal basis0.99—
depr_schedule.xlsxCurrent-year depr0.98—
depr_schedule.xlsx§179 election0.99—
vendor_invoices_q1.pdfInvoices0.96—
vendor_invoices_q1.pdfTotal0.71—
vendor_invoices_q1.pdfDeductible (est.)0.58—

Check the math yourself.

Every calculator shows its workpaper. Change an input and watch each line move.