A ledger can start empty. Logika then stores everything your application sends, raises an issue only for failures (a span ending in an error, a log record with an exception or an ERROR or FATAL severity), and has nothing declared to chart. What must hold and what is worth measuring are things only you know, and they are best worked out against what your system really does, not guessed while the code is written. That is a reflection round: nock, the toolbox that keeps coding agents coherent across sessions, runs it in your coding agent, with you, over the instrumented code and the data it captures, and writes what you agree on into logika.json.
Running a round
logika init sets nock up in the repository; elsewhere, uvx nock@latest init does (Python 3.12 or newer, and uv). Once a component is instrumented and there is data to read (captures from logika test, or what production sent), ask your agent for a round:
nock reflect logika
A round runs only when you ask for one, or agree when nock says one is due. Its two parts, rules and analytics, run as subagents while the session works with you. It asks what only you know a few questions at a time, each naming the rule or panel it would settle and the answer it proposes; a question you would rather answer later is recorded as a decision tagged important, with the answer it proposes, for you to accept or reject. It ends with nock reflect logika finish, which needs a report and a logika.json that parses: what was added or changed, the evidence for each and how it was tested, what was left out and why, the questions and their answers, and the instrumentation it suggests.
Rules: what must hold
The first part turns the code and its captures into the ledger's judgements: validate conditions on an event's params, span paths and timeouts, rules (one event obliging another within a time) and invariants (what must hold between events). Every rule gets a one-sentence description, which is its issue's title: "Every paid order is fulfilled or refunded within 15 minutes". It starts where a mistake costs most: money, stock, access, anything that changes shared state.
Each rule is tested before it lands: silent on the real captures, and firing on a replay that breaks it (logika replay with events dropped, failed, delayed or duplicated), so Logika wakes your agent when the system misbehaves and never when it doesn't. Where a rule needs a state change the code does not record, the round suggests the event and its params instead of adding the instrumentation itself, unless you say to.
Analytics: what to measure
The second part declares what you want to see on the console's Analytics page: which params identify people or entities (identity: actives and retention, exact per value), which are worth breaking down by (dimension: few values, counted each), the funnels your users go through and the milestones they reach, and the views that put them on one page. It reads the captures for the paths people actually take and the params that actually vary, and proposes each declaration with what it would show.
Funnels and milestones are backfilled from the retained raw data after the sync that adds them, so a new declaration charts the past month at once on a paid tier. Each funnel's conversion is then judged daily, and a fall is an insight.
After the round
logika check must pass before the round finishes. Production is judged by the new rules, and the new panels fill, only once logika sync deploys the ledger; the round leaves that to you. The next round starts with what is owed: the questions you answered since, and any rule that raised a false alarm (logika query), which it fixes or takes out.