DEV Community

Cover image for 110,897 proof lines vs 124,617 code lines in Truss
frank chu
frank chu

Posted on

110,897 proof lines vs 124,617 code lines in Truss

110,897 proof lines vs 124,617 code lines in Truss

Truss's standard library ships 110,897 lines of proof files against 124,617 lines of Truss source — 89 proof lines for every 100 lines of code. Truss is Bret Taylor's new programming language "optimized for agent-written software," posted to Hacker News today, and its README makes a specific claim: "when you publish a package, you spend as many tokens generating proofs as you do writing the code." I downloaded the repo to see whether the artifact in front of us actually looks like that.

What Truss is betting on

The pitch inverts the usual design goal. Traditional languages optimize for human authoring convenience; Truss optimizes for human verification, on the assumption that agents write the code and tokens at authoring time are cheap relative to enduring correctness. The atomic unit is a contract: data structures and functions with formally verified behavior — what they return, what memory they can touch, what state they can change. Providers implement contracts and ship a package.proof evidence file next to the implementation, so downstream users can replay the conformance check instead of redoing the proof. The README is explicit that this is a prototype meant to start a conversation, which is the right frame for reading the numbers below.

I counted the repo

I pulled the main tarball (created 2026-11-30, 582 stars when I checked) and counted files, bytes, and lines by extension:

import os, collections
by, cnt = collections.Counter(), collections.Counter()
for dp, _, fns in os.walk("truss-main"):
    for fn in fns:
        s = os.path.getsize(os.path.join(dp, fn))
        ext = "." + fn.rsplit(".", 1)[-1] if "." in fn else "(none)"
        by[ext] += s; cnt[ext] += 1
Enter fullscreen mode Exit fullscreen mode
whole repo: 5,883 files
.truss   2,920 files  13,388,128 bytes   261,284 lines
.rs        397 files   8,561,328 bytes
.lock    1,433 files   5,857,877 bytes
.proof     429 files   3,724,883 bytes   111,209 lines
.md        246 files     596,632 bytes

library/ only:
.truss   2,032 files   6,230,717 bytes   124,617 lines
.proof     397 files   3,714,595 bytes   110,897 lines
Enter fullscreen mode Exit fullscreen mode

Two things stand out. First, in the library — the part that is supposed to model the publish-a-package workflow — proof lines are at 89% of code lines, close to the README's "as many tokens" framing, though proof bytes are only 60% of code bytes because proof lines are short. Second, there are 1,433 .lock files totaling 5.86 MB, more bytes than all the proofs. The verification story gets the headline, but the dependency-pinning story is quietly the second-largest artifact in the repo.

The median package is not the aggregate

Aggregates hide the distribution, so I paired each package.proof with the .truss files in its own directory:

397 provider directories with a package.proof
median proof/code byte ratio        0.151
directories where proof > code      58 of 397
largest ratio   library/encoding/hex/inline        12.82x
sort            library/collections/sort/inline     7.00x
                  proof 1,523,605 bytes, code 217,620 bytes
Enter fullscreen mode Exit fullscreen mode

The typical provider's proof is 15% the size of its code. The aggregate is dragged up by a minority of heavy packages — above all sort, whose single 1.52 MB package.proof is 41% of all proof bytes in the repo and 7.0x its own implementation. That is actually a plausible shape for formal verification: most contracts are cheap to evidence, a few (sorting with payload stability, HTTP/2 HPACK, flow control) are where the proof mass concentrates. If you are budgeting agent tokens for a Truss-style workflow, the median says proofs are a 15% tax and the tail says occasionally they are the whole bill.

What the proof files actually look like

They are not human-readable proof scripts. The sort proof opens like this:

truss-proof-v1

claim operation InlineSort.binary_search_ordered_word {
  subject a9509d9c9f9bdd7ddb331ec26a7e3aec7f650c928b40f9fbcfd8bbb051b0f0dc
}
Enter fullscreen mode Exit fullscreen mode

Claims with SHA-256-looking subject and root hashes. That fits the design — evidence for a verifier to replay, not for a human to read — but it also means "optimize for human verification" happens at the contract layer, not in these files. A human reviews the contract's requires/ensures; the 110,897 lines underneath are machine evidence. Whether that is the right split is the real question Truss poses, and it is a better question than "can agents write code."

Caveats: I counted the repo as published on 2026-12-02; I did not build the compiler, run truss proof check, or verify that any proof actually replays. Line counts include blank lines and comments in source, and proof files are hash-heavy, so lines are a rough proxy for tokens, not a measurement of them. The 89% figure is library-only; repo-wide it is 111,209 proof lines against 261,284 Truss lines (43%), because the compiler and bootstrap code carry proportionally less proof.

Sources

Top comments (0)