LOGIKASign in
On this page

nock

A coding agent starts every session knowing nothing of the last one. It doesn't know what was decided yesterday, or why; what you said about it; or which script someone wrote to do the thing it's about to do by hand. On a small task that's fine. Over weeks, the project drifts: the same question is answered three ways, a simplification nobody approved takes root, the same mistake is made again.

nock is a small workflow CLI that keeps a project coherent across agent sessions. It lives in the repository, vendored into .nock/, and is wired into the agent's harness, so every session starts with what earlier ones left. It's open source, on GitHub, and made by the people who make Logika; Logika itself is built with it.

What it keeps

  • Decisions. When an agent chooses between ways that could each work, simplifies something on purpose, reads something ambiguous one way, or leaves a todo, it records it with nock decide: what it chose, why, and the alternatives it weighed, written for someone who knows what the system does but not how it's built. They're files in .nock/decisions/, committed with the code. You review them later, when it suits you: accept, reject, or add a note, which the next session acts on.
  • Your calls. What only you can settle, when you're not there to ask, is a decision tagged important. The agent proposes the most conservative reasonable answer as the title, takes it meanwhile, and keeps going; sessions list it until you accept or reject it, and a rejected one until an agent has reworked it.
  • Tools. The project's own commands: plain Python functions in .nock/tools/, each one live on its next call, with its help, its examples and its exit codes. When agents keep doing something by hand (rebuilding a database, reading a log in a certain way, deploying to a staging box), they turn it into a tool.
  • Checks. One gate, nock check: the checks a change can affect, side by side, printing nothing when they pass; nock check --all runs every one, the full gate at merge. Its exit codes say what to do next: 1 means the code is wrong, 42 the machine or its state, 50 and up retry or escalate, so an agent never investigates the wrong thing with great confidence.
  • Consultation. Before an agent changes code, nock consult has a fresh agent read the project's decisions, tools and checks, and tell it in a few lines which bear on what it's about to do.

You review decisions on nock studio, a page on your own machine, or in a conversation with your agent (/nock-triage), one at a time.

nock decide '{"status": "done", "tags": ["important"], "title": "Refunds never exceed the original charge",
  "summary": "A partial refund after a price change could exceed what was charged.",
  "alternatives": [{"option": "Allow it and log it", "why_not": "pays out more than was taken"}]}'

Why logika init installs it

Two of Logika's steps are conversations with you, and nock is where they happen. While your agent instruments the code, what it can't infer (how an ambiguous flow should behave, which flows matter, what you want caught) it asks you through nock, with options and a recommendation, and writes what you settle into the ledger. And the reflection round, which writes your ledger's rules with you from what the code actually did, is nock's logika round.

So logika init sets nock up every time, once logika.json is written: .nock/nock init where it's vendored already, otherwise through uvx from its repository. It needs Python 3.12 or newer and, to fetch it, uv; without them init says what to install and carries on. Logika works without nock, but best with it.

What a round feels like

Once a component is instrumented and there's data to read, ask your agent:

nock reflect logika

Two parts run side by side, rules (what must hold) and analytics (what you want measured), each reading the code and the captures. Then the session brings you questions, a few at a time, each naming what it would settle and the answer it recommends. Something like:

checkout.captured is sometimes sent twice for one order in the captures
(2 orders of 340, both retries after a timeout). Is a second charge ever right?
  1. Never: add "An order is charged once" (recommended)
  2. Only for split payments: key it on order_id and payment_id
  3. Leave it for now

You answer in a word, or put a question off: it is recorded as a decision tagged important with the answer the session proposes, for you to accept or reject later. Every rule it adds is tested twice before it does: silent on the real captures, and firing on a replay that breaks it. The round ends with a report: what it added or changed and why, how each was tested, what it left out, and the instrumentation it suggests where the data lacked something. Nothing is deployed until you say so, with logika sync.

Rounds are cheap, so have them often. A session start offers one, at most once a week, once the ledger declares events and none has run, then 30 days after the last if logika.json changed since; nock runs one only when you agree.

nock also has a round of its own, nock reflect, about the process rather than the product: it reads how the toolbox was used since the last one (which commands failed, what agents kept doing by hand, which checks were slow) and improves it, keeps the map of decisions in order, and judges how well nock is serving the project. It writes you a report, and a summary you can share.

Local, and what it shares

nock runs on your machine, in your repository, with no server. Its decisions, tools and configuration are files you commit; its record of every call and session is a local database you can read yourself (nock stats, nock query).

It shares nothing unless you say yes. Asked once, your answer is kept in .nock/config.toml, committed. On a yes, nock sends its makers a weekly report of counts and categories: sessions, its commands and how they ended, how many tools and decisions there are, the versions in use, and a random id for the project. Never code, paths, names or prompts. nock usage shows exactly what the next report would carry, before anything is sent. A round's summary is shared only on your word, after a fresh agent has rewritten whatever would identify the project.

This is separate from Logika's own usage statistics, which Logika Monitor asks about, and which you turn on or off in its menu.