NAPL

Source

The napl toolchain's own source: prompts targeting Rust, generated, gated, and regenerated to a literal fixed point.

The napl toolchain is written as .napl prompts targeting Rust. A coding agent generates each module into a real crate, and the generated crates compose only on their generated siblings. This page is the proof track: what the prompts produced, how it is gated, and the point at which the generator reproduces itself exactly.

src/*.napl                 behavior prose + tests as given/expect data
        │  napl gen rust

src/.napl/src/rust/        real crates the agent wrote, locked after cargo test


equivalence gates          the hand-written modules' own unit-test corpora,
                           replayed against the generated code

The fixpoint is behavioral, not byte-identical

A generated module passes when the hand-written module's exact test corpus passes against it, whatever the implementation looks like. The pilot module (body_lines, frontmatter line-offset math) genned on attempt 1, passed its corpus 5/5, and honestly flagged the one thing the prose left open (the return type) as a machine-layer assumption rather than hiding it. That is the compile-as-dialogue model working on the toolchain's own code.

From there the source was generated in dependency-ordered waves: the pure napl-core crate (all 23 modules), then the pure cores extracted from the napl-cli I/O layer. Each generated crate composes on its generated siblings by path (a wave-2 module depends on the generated wave-1 crate, never on hand-written code) expressed entirely in prompt prose, with the conformance corpus staying byte-identical throughout.

The toolchain regenerates itself

The proof went further than behavioral equivalence. All 36 pure-logic modules were force-regenerated from prose (in dependency order) and the full gate battery was run against the result:

  • Conformance 47/47 byte-identical · equivalence 226/226 · cargo test --workspace 245/245 · clippy clean · napl status 36/36 clean · generated-workspace cargo test 419/419.
  • Every module converged on gen attempt 1; the escape-hatch list is empty.
  • Every force-regen was a byte-identical no-op: gen(src) == src, verified by all 36 journal entries recording 0 file patches, so the regenerated source is bit-identical to the source it read.

That last point is the strong result: the generated source is a literal fixed point of the generator, not merely a behavioral one. The toolchain reads its own prompts, regenerates its own source, and produces exactly what was already there.

The shell modules

The fixpoint covered the pure logic. The shell modules go the rest of the way, generating the napl-cli I/O shells themselves (filesystem, subprocess, and orchestration plumbing) gated by the conformance corpus (byte-identical goldens) rather than unit vectors. The first batches pushed the count of generated modules past 39 (fsutil, the deprecation notice, the discovery stragglers, then the subprocess and state I/O leaves), each converging on attempt 1 and each keeping conformance byte-identical before and after the swap.

A gen-time gate was added along the way: a generated module whose Cargo.toml declares a path dependency on a sibling not listed in its prompt's deps: now fails the gen, the enforcement half of the enumeration-vs-imperative lesson. The corpus grew 47 → 48 to pin it.

The escape-hatch list is the honest measure

Not every module has to gen cleanly, and convergence is never forced. Scaling keeps an escape-hatch list: modules that stay hand-written until their prompt drives a generation that passes its corpus. The list is the honest measure of how much of the toolchain actually generates from prose, and it is currently empty, which is the claim, stated so it can be checked.

Browse the toolchain source: each generated module with its prompt on the left and the generated Rust on the right, attribution hover-linked both ways, replayable generations, and machine-layer notes. Nothing there is hand-authored.

On this page