A slop-free protocol for agentic functional programming

Agentic programming makes your wildest ideas feasible, but controlling slop requires a highly constraining set of axioms — rules about composition and style that your program must follow.

Agentic (and human) programmers can use ledger to format and check their programs against these axioms, and iteratively converge on a more optimal codebase. The workflow is a simple loop:

  1. 1

    The agent reads AXIOMS.md.

  2. 2

    It writes the code.

  3. 3

    It runs ledger.

  4. 4

    It repeats until the report is empty.

ledger formats whitespace and reports the rest. The rewriting is done by an agent, with ledger as its referee.

cargo install --git https://gitlab.com/jonleff/ledger.git
ledger --format

Lays out every file: line breaks, aligned columns, blank lines and header frames. It only touches whitespace, so the code does exactly what it did before.

ledger --axioms

Changes nothing. Checks every file as it is and points at every line that breaks a checked axiom, failing if it finds any.

Loading the axioms…