nika.traceVerify(receipt) asks the engine to check the record against it.
The SDK never reads a trace or does cryptography itself.
~/.nika/keys/
(quickstart step 2). Without one, the same run
succeeds and prints false invalid receipt_mismatch and sealed: false.
Admitted, executed, sealed: three different facts. check() refuses a file that runs ls under permits: {} (NIKA-SEC-004, with its fix) and run() never starts it: no run, events or trace exist. One permits line fixes it. On a machine with no signing key, prove.mts runs hello.nika: the run succeeds, its receipt reads sealed false · 5 events and traceVerify(receipt) answers receipt_mismatch. After the quickstart’s NIKA_KEYCHAIN=off nika key init (step 1 in the SDK README on GitHub, as the comment on screen says), the next run reads sealed true · 6 events and verified. Then tamper.mts changes one byte on line 4 of the trace, and the stored receipt no longer verifies: the engine reports BROKEN at line 5. Recorded in a terminal from @supernovae-st/nika 0.123.0 and its bundled engine nika 0.123.0 (0bfde3765); every model call is mock/echo, the engine’s offline rehearsal model, with no provider key and no network.
Transcript: every screen of the recording, in order
Transcript: every screen of the recording, in order
What the verdict means
Measured with@supernovae-st/nika 0.123.0 on both transports:
ok, sealed, anchored and
replayed hold; incomplete, tampered and broken do not; unavailable
means the server holds no journal for that job (refused before its first
event, or still queued). The SDK sets verified: true only for a verdict that
holds and names this receipt’s trace_id.
What a receipt carries
Pass a receipt back exactly as you received it.- A local receipt carries
trace_path,chain_head,chain_len,sealed,trace_id,execution_id,snapshot_digestandreceipt_format. - A
nika servereceipt carriesjob_id,execution_id,trace_id,snapshot_digest,origin({ kind: 'manual' }for a job your code submitted) andchain_head. Store it with the job id.
Keep a local receipt verifiable
A local receipt points at its trace file by a path relative to the client’scwd, and that file is subject to retention:
-
Verify it from a client with the same
cwd. From another directory, or once the file is gone,traceVerify(receipt)answersverdict: 'invalid'withexitCode3 and noreason: the engine cannot read the trace. -
By default the engine keeps the last 10 traces per workflow, at most 30
days old, within 256 MB.
NIKA_TRACE_KEEP,NIKA_TRACE_MAX_AGE_DAYSandNIKA_TRACE_BUDGET_MBchange the three bounds, andtraces.keepinnika.yamlsets the age cap. For long-lived audit evidence, export a dossier (journal, manifest, receipt andVERIFY.md) when the run ends:The pack is redacted by default: it proves the run’s integrity, not its content.--fullincludes the content verbatim. -
Store
receipt.trace_idandreceipt.execution_idto identify a run.run.idis a throwaway id on the local transport.
Inspect a trace from the command line
Which version is this?
Which version is this?