piloop sql or through the CLI. CHECK constraints fix the allowed values, foreign keys
and unique keys fix the relations, and triggers record who changed a row and log each change in events.
Core’s tables hold what every campaign has:
- A campaign is one repo.
- An agent session is one agent process, in any role.
- A comment or an event points at any row through
(target_kind, target_id), so it has no foreign key. A program reads the events after a cursor withpiloop events: see the event feed.
optimization campaign type’s tables hold the research:
- An idea is something to try.
idea_linksrelates two ideas of one campaign: one runsafterthe other, orsupersedesit.ideas.trackis the name of a track inpiloop.toml. - A run is one attempt at an idea. Its agent session has its
run_id. - A candidate is a distinct state of the code. Its git tree identifies it, and
parent_idis its lineage. - An evaluator is one version of the evaluate command and the metrics.
piloop initadds one when they change. A measurement is one run of an evaluator on a candidate. - A technique is an outside technique that a scout sweep found.
lessons, documents, journal) and the archive’s (archives) are their providers’.
Three columns hold a candidate id or an evaluator id without a foreign key: campaigns.evaluator_id,
ideas.base_candidate_id and runs.base_candidate_id. The foreign keys would make a cycle.
Each line of the diagram is a foreign key, labeled with its column. The database schema has the
full DDL with the indexes, by the plugin that owns each table.
The full-text indexes are not in the diagram: ideas_fts (title, hypothesis, plan), comments_fts (body), documents_fts (title, body).
Statuses
A CHECK constraint fixes the values of each status column. The daemon and the CLI move a row from one value to the next, as ideas and runs, the verdict and agents show. Anyone withpiloop sql can set any value, for example to park an
idea.