Full Report
Contents8 sections
us-tax-model
The forms-and-instructions layer of US federal individual income tax as public, cited, machine-checkable data, with a guided self-preparation interview as its first client. The interview asks a person questions, decides which forms apply, computes them, explains every value and hands back a values sheet the person files themselves. The software never files, signs or transmits a return, and no return data leaves the machine. What is encoded is the IRS's published procedure, not the Internal Revenue Code.
Why you can check it
The encoding was written largely by language-model agents, so it cannot be trusted because of who wrote it; it is built so that what matters can be checked from the repository alone by someone who trusts none of the authors. Each layer states what it is, what it guarantees, what it does not, and where to look.
1. Forms as data, with a citation on every line
Each form or worksheet is a YAML file under forms/<year>/. A line is a record: id, printed line number,
IRS label, type, one expression, and a citation naming the document, tax year, revision, locator and the
hash of the archived page under sources/<year>/ it was read from (spec/spec.md section 5).
Guarantees: the build fails if any line, parameter, gate or question lacks a citation or cites a hash
absent from the manifest, and tools/citations.py verifies every quote and locator against the archived
text; reports/2025/citations.md reports 2,313 anchors and 1,252 quotes, 0 findings without a recorded
ruling, and 305 computed-line locator segments too coarse to verify. Does not guarantee: that the
expression says what the cited page says. A citation proves a line points at a page, not that it was read
correctly.
2. A closed atom vocabulary
Every computed line is one application of one atom from the list in spec/spec.md section 4.2 (sum,
subtract_floor0, smaller_of, multiply_rate, round, table_lookup, choose and a dozen others);
there are no user-defined functions, loops, variables, strings or recursion. Guarantees: the whole
meaning of the data is the meaning of about twenty operations, each small enough to read; the one escape,
opaque, a host-language function, is counted and published, and reports/2025/coverage.md reports 0 of
2,384 lines use it. Does not guarantee: that the right atom was chosen for a line.
3. The build-time checker
engine/src/check.ts fails the build unless every copy, operand and param reference resolves within
the stated revision; the line graph is acyclic; every expression type-checks (cents, rates, counts and
booleans do not mix); every choose has exhaustive and disjoint guards, decided by enumeration and
interval analysis; and the provenance rules of layer 1 hold (spec/design.md section 2.3). Guarantees:
no dangling reference, cycle, unit confusion, or gap or overlap in a guarded alternative anywhere in the
data. Does not guarantee: agreement with the IRS text; a wrong operand that type-checks passes.
4. The renderer
Each atom has one English template in IRS worksheet phrasing, and the renderer writes every line's
non-programmer can read any line against the printed form, and a change to the data appears in review as a readable English diff. Does not guarantee: that anyone has done that reading.
5. Integer arithmetic
Money is integer cents, rates are integer pairs, and the evaluator (engine/, BigInt) has no floating
point. Rounding happens only in the round atom, only where a cited instruction says to round, by the
rule it states (spec/spec.md section 3, item 10). Guarantees: every value is exact and every rounding
is cited. Does not guarantee: that the IRS meant its arithmetic to be exact; where the text leaves
rounding open, the reading chosen is in ambiguities/<year>.yaml.
6. Lean
lean/TaxFormalization/ defines every atom over the integers (Atoms.lean), proves the properties of
spec/spec.md section 6.3 (Lemmas.lean: subtractFloor0_nonneg, roundHalfUpToUnit_idem,
prorate_le_amount), and has a reference evaluator over the same canonical JSON as the TypeScript one,
proved to terminate and to be deterministic (EvalProps.lean). Both evaluators run over every fixture
and generated return; reports/2025/evaluator_agreement.md reports 1,648 cases, 2,895,826 line values
compared, 0 differences. Guarantees: the atoms behave as specified, and two independently written
evaluators of the same data compute the same values. Does not guarantee: anything about whether the data
matches the IRS text. Both evaluators read the same files, so agreement shows the evaluators agree, not
that the data is right. BUG_INVENTORY.md entry BUG-0001 is the canonical case: Form 1040 line 9 summed
line 3a as well as 3b; every fixture and both evaluators agreed with the wrong sum; an outside engine
caught it.
7. Independent constructions
No comprehensive human line-by-line reading is claimed, so the project supplements optional readings with constructions that share
nothing but the archived pages (spec/spec.md section 6.5): a second transcription of each worksheet by
an isolated model given only the pages and the schema, compared atom by atom with the project's; a render
comparison, in which an isolated model that has not seen the YAML reads each line's English against the
page; class M hand-work, in which an isolated model works branch-covering inputs on the printed
worksheet; and blind predictions of whole-return values made before the encoding was run. Each model runs
with no repository access and no network (tools/transcription/README.md); every disagreement is ruled
against the source with the page and quote recorded, and the logs are committed under reviews/2025/.
Guarantees: for each line, two readings of the same page produced the same structure, or the difference
is on record with its ruling. Does not guarantee: independence of the readers.
(注:更多技术实现细节与完整 API 文档请查阅原项目 README)
作者发帖说明(HN):
The linked repo is 100% vibe coded, but it was built on a handful of principles:
-
Most tax software derives trust from the party who maintains it (e.g. Intuit, the IRS, etc.)
-
Vibe coded software lacks this trustworthiness.
-
Therefore any formalization should build in verifiability and mechanisms that make it possible for users/maintainers to trace claims/interpretations back to authoritative source documents.
It's very much a back-burner passive project right now (do not use this for anything real!), but I feel strongly that something like this ought to exist for the public good. I built it to get a sense of what the shape of what such a thing might be.