Writing a core
A core builds and captures projects for one stack, runs as a separate process and returns trace records.
A core builds and captures projects for one stack. It runs as a separate process
and returns pitafix.trace/1 records, so you can write it in any language.
Start with the script example below, then add commands or streaming when you need them.
- Pick a level
- Build a script core
- Write the manifest
- Emit trace records
- Describe the UI tree
- Handle evidence and secrets
- Add command verbs
- Stream over JSON-RPC
- Offer Live sessions
- Capture a project by its rig
- Check and install
Pick a level
All three levels produce the same trace. They differ only in how the core is started and how the records travel.
| Level | What it is | Good for |
|---|---|---|
| 0 | Any program that leaves .pitafix/traces/<run>/trace.ndjson behind | A first core, a spike, an exporter from a tool you already have |
| 1 | A manifest table that maps verbs such as doctor and capture to commands | Scripts and existing CLI tools; no protocol to speak |
| 2 | One process per project, speaking JSON-RPC 2.0 on stdio, streaming each record as it happens | Real cores: live progress, cancel that works mid-step, devices, mirror sessions |
Start at level 0. Everything you learn there — the manifest, the trace, the artifacts — is the same at every level, and a level 0 core is already installable and testable.