> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Receipts and replay

> Keep a hash-chained run journal that survives the process and the interface.

export const LocalContract = () => <Tip>
    <strong>Live surface.</strong> <code>@supernovae-st/nika-client/local</code>
    drives the released <code>nika</code> binary through its versioned machine
    contracts. It is the production path today.
  </Tip>;

<LocalContract />

A live stream is presentation. A trace is evidence.

<div className="sdk-flight">
  <span>RECEIPT PATH · NO RE-EXECUTION</span>

  <pre tabIndex={0}>
    {`run
        ├── stdout NDJSON ─────────────── live interface
        └── .nika/traces/<run>.ndjson
                   │
                   ├── verify ───────── chain intact?
                   ├── show ─────────── final frames
                   ├── replay ───────── original event timing
                   └── export ───────── OTLP projection`}
  </pre>
</div>

## Store identity, not a shadow journal

Keep the trace path or run identity beside the application's business record.
Do not copy selected event fields into a second log and call that the receipt.

```ts theme={"system"}
const verdict = await nika.traceVerify(tracePath)

await auditStore.write({
  tracePath,
  intact: verdict.intact,
  chainHead: verdict.head,
})
```

## Verify before trust

`traceVerify()` is offline. It does not call a model or execute a task. A
broken or unchained journal remains readable, but should not be presented as
verified evidence.

## Re-project with the engine

```sh theme={"system"}
nika trace show .nika/traces/<run>.ndjson
nika trace replay .nika/traces/<run>.ndjson
nika trace export .nika/traces/<run>.ndjson
```

Replay passes recorded events through the renderer. It never reruns the
workflow.

## Retention

Trace content is local by default. Choose retention, redaction and export
policy from the workflow's data sensitivity. Content-inclusive telemetry is
an explicit widening, not a default.

## Continue

<CardGroup cols={2}>
  <Card title="Test and trace" icon="vial-circle-check" href="/sdk/local/test-and-trace">
    Compare behavior and verify integrity.
  </Card>

  <Card title="Trace concepts" icon="timeline" href="/concepts/traces">
    Learn the journal and chain model.
  </Card>

  <Card title="Run receipts pattern" icon="receipt" href="/patterns/run-receipts">
    Carry receipts through application boundaries.
  </Card>

  <Card title="Observability" icon="eye" href="/guides/observability">
    Inspect before, during and after a run.
  </Card>
</CardGroup>
