You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: batch agent recorder import integrity state (#32)
Summary
- Add a flush hook to record adapters and let integrity wrapping choose immediate or on-flush state persistence.
- Keep live run integrity state crash-durable after each record, but persist import integrity state once after the replayable batch completes.
- Document the import/run durability distinction and add coverage for on-flush state persistence.
Testing
- node scripts/sync-platform-package-versions.js
- cd tools/agent-recorder && cargo fmt --check
- cd tools/agent-recorder && cargo test --quiet
- cd tools/agent-recorder && cargo test --examples --quiet
Notes/Risks
- Interrupted integrity-backed imports may leave partial output/state alignment that should be discarded or rerun from a clean/aligned backend and state file.
- This preserves per-record durability for run.
Copy file name to clipboardExpand all lines: docs/info/src/content/docs/tools.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Tool calls and tool results are message annotations. Edges such as `follows-mess
62
62
63
63
### Integrity
64
64
65
-
`agent-recorder` can add optional forward-integrity metadata to each record. For the 0.1.0 tool, treat this as initial tamper-evidence and forward-integrity plumbing for review and experimentation, not as a cryptographically audited production guarantee. The public metadata contains the algorithm, key id, absolute index, payload hash, and authenticator. Local key-evolution state stays private and is not stored in backend records.
65
+
`agent-recorder` can add optional forward-integrity metadata to each record. For the 0.1.x tool, treat this as initial tamper-evidence and forward-integrity plumbing for review and experimentation, not as a cryptographically audited production guarantee. The public metadata contains the algorithm, key id, absolute index, payload hash, and authenticator. Local key-evolution state stays private and is not stored in backend records.
66
66
67
67
The integrity layer authenticates each indexed record independently. Backend storage, including Sync Web, remains responsible for ordering and history. The recorder provides `read --integrity-key`, `verify`, `status`, and `rekey` commands for verification and emergency key cutover workflows.
Copy file name to clipboardExpand all lines: tools/agent-recorder/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ The stable public JSON uses kebab-case where field names are controlled by `agen
154
154
155
155
## Integrity
156
156
157
-
Integrity is optional and backend-independent. In the 0.1.0 tool, treat this as initial tamper-evidence and forward-integrity plumbing for review and experimentation, not as a cryptographically audited production guarantee. Enable it on writes with `--integrity agent-recorder-integrity-v1`, an integrity state path, and an initial key.
157
+
Integrity is optional and backend-independent. In the 0.1.x tool, treat this as initial tamper-evidence and forward-integrity plumbing for review and experimentation, not as a cryptographically audited production guarantee. Enable it on writes with `--integrity agent-recorder-integrity-v1`, an integrity state path, and an initial key.
158
158
159
159
```sh
160
160
AGENT_RECORDER_INTEGRITY_KEY='example secret' \
@@ -197,6 +197,8 @@ Local integrity state stores private future keys and is not written into records
197
197
198
198
At one-based event `i`, compute `h = v2(i)` and generate future edge keys for levels `0..h`, each targeting `i + 2^d`. At event `j`, consume pending incoming keys whose target is `j`; after the backend write succeeds, consumed keys are deleted and the local state advances. A verifier with the root key derives `K_i` in logarithmic time and verifies the selected indexed record independently. Cryptographic review is still recommended before relying on this for high-assurance audit workflows.
199
199
200
+
`run` persists integrity state after each new record because it is live capture. `import` treats the input as a replayable batch and persists integrity state after the batch completes, avoiding one durable state-file rewrite per imported record. If an integrity-backed import is interrupted, discard the partial output or rerun from a clean/aligned backend and state file.
201
+
200
202
Read with verification:
201
203
202
204
```sh
@@ -271,7 +273,7 @@ A real signed JSON-LD example is checked in at `examples/integrity-agent-record.
271
273
272
274
The `Agent Recorder Binaries` GitHub Actions workflow builds downloadable `agent-recorder-*` binaries for Linux, Linux musl/Alpine, macOS, and Windows targets. Branch workflow artifacts can be downloaded for testing before a tagged release.
273
275
274
-
Tagged releases use `agent-recorder-v*` tags, for example `agent-recorder-v0.1.0`. Ledger binary releases use separate `ledger-v*` tags so agent-recorder artifacts do not mix with ledger/journal release assets.
276
+
Tagged releases use `agent-recorder-v*` tags, for example `agent-recorder-v0.1.1`. Ledger binary releases use separate `ledger-v*` tags so agent-recorder artifacts do not mix with ledger/journal release assets.
0 commit comments