← Principles

Derived obligations

The system computes what "correct" looks like from the specification.

The agent writes the source (the SQL query, the Go struct, the protobuf definition) and a tool derives everything downstream. Every codegen step is a layer where the agent cannot produce wrong output because it does not produce the output at all.

The test: Can the correct output for this layer be computed from the layer above? If yes, codegen it.

Evidence

  • Olausson et al. (ICLR 2024): self-repair is bottlenecked by feedback quality, not generation capability. Derivation removes the need for repair by removing hand-written code.
  • Mundler et al. (PLDI 2025): 94% of LLM compilation errors are type errors. Codegen eliminates that class entirely for derived layers.

In practice

  • sqlc: SQL query becomes Go function signatures (derived).
  • Huma: Go struct becomes the OpenAPI spec (derived).
  • openapi-typescript: OpenAPI becomes TypeScript types (derived).
  • protobuf / buf: .proto becomes language bindings (derived).
  • This reference: tokens.json becomes colors.css / themes.css / colors.tex, and the SKILL.md files become llms.txt. The agent edits the source; the artifacts are derived and CI fails on drift.