Journal and provenance
Every state change is an event in one journal, the single source of every output; every run records how it was made.
Every state change in a run is an event appended to one journal. Indicators, reports and every other output are computed from the journal, never from the engine's memory. A full journal holds enough to rebuild the final state of the population.
Rows
A row records one event: the day and step, the canonical event type, the person it is about (ego), the other people it names, the person's territorial unit, a run-wide sequence number, and the event's payload. When an event writes a value to a column that a plugin owns, the value written is in the row too. The columns are listed in read the outputs.
Files
The journal is Parquet, one partition per contract: journal/<namespace>/<Contract>/part-000000.parquet, one row group per step, sealed at the end of the run. Each file's metadata names the contract and version of every event type it holds and the persistence mode.
Persistence
outputs.persistence chooses what is written:
| Mode | What is written |
|---|---|
full (default) | Every event. The final state can be replayed from the journal. |
subset | Only the event types listed in outputs.events. The sequence numbers keep their run-wide numbering. |
none | No journal file. The provenance still counts every row. |
outputs.size_budget asks for an estimate before the run: the engine runs a pilot of the first year, scales it to the whole run and warns (W5102) when the estimate is above the budget. The run goes on.
Provenance
Every run writes provenance.json, the canonical manifest, and provenance.toml, the same content for reading. It records:
- the seed tree and the run seed, and every decision type drawn;
- the engine version, commit, compiler and build target, and the hash of the
Cargo.lockit was built with; - the time settings, the initial number of people and the phase order;
- every active plugin with its version and variant, every active contract with its version, and the handler order of every phase;
- the persistence mode, the row count and the BLAKE3 hash of every journal file;
- the effective configuration, its text and its hash;
- the timing of each step.
Two runs of one configuration differ only in the timing. The format is defined by the JSON Schema schemas/output/v1/provenance.schema.json (schema id [email protected]).
Restricted data
When a run reads a restricted table (DHS or HDSS microdata, for example), provenance records restricted = true, and no diagnostic, log or error ever prints a value of that table. Survey cluster coordinates never reach the journal or the provenance, whatever their restriction.