Blue: the parts whose contracts this module defines. The API, the ledger, the agent and the tables under them.
High-level design named the boxes. This module zooms into what passes between them: the tables in Postgres, the request and response shapes on the API, and the state the agent carries through a turn. Every later module builds on these three contracts.
The rest of this project is yours to keep
This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.