9.1. Implementation plan
Direction, not decided
-
Verified core in Lean 4: the parser, the deploy checks, evaluation, rejection reasons, and an efficient per-key state proved equal to the spec. Compiled to native code and exported as a C library.
-
Every decision in Lean, proved: done for the definition files, JSON and the API (Files and requests); next the append protocol (lock the footprint keys, read, check, write, commit) proved against an abstract database assumed atomic and serializable.
-
Shell: a pure byte layer in a host language: the HTTP server and the Postgres driver, nothing that decides. Only the byte layer, the driver and Postgres itself are assumed; they are covered by differential tests against the Lean model, the way AWS Cedar tests against its Lean model. Lean's thin ecosystem (HTTP servers, Postgres clients) is why this layer is not Lean.
-
Reconciliation: a replay check runs the fast core (proved equal to the spec) over the stored log, read directly from storage, not through the write path. It detects errors in the shell, the storage and concurrency after the fact.
-
Efficiency (O(1) per-key state instead of O(n) rescans of the history) is a property of the core, proved there, not part of the language.