Follow-up to #146 (JSON-family sidecar backend). Two threads:
1. Harden the JSON store
- Cross-process write locking: serialise concurrent writers to a json sidecar (the SQLite path serialises via the DB write lock; the json path was single-writer-by-assumption). Dependency-free advisory lock file (
<path>.lock) with backoff + stale-lock steal; RAII release.
- Atomic writes: formalise the temp-file + same-dir
rename durability already in save(), held under the write lock across the load→mutate→save cycle.
2. Wire the stub CLI subcommands
provenance <entity>: list the entity's provenance chain and report verification (verify_chain) + any fork points. Both sqlite and json backends.
history <entity> [--at T]: list temporal versions (or the point-in-time snapshot at T) for the entity. Both backends.
postgres reads remain explicit "not yet implemented".
3. Docs + config
- rustdoc + README section on sidecar backends and the now-working subcommands.
- Example manifest showcasing
storage = "json" / format.
- Version bump + CHANGELOG.
.claude/settings.json permission allowlist to reduce harness friction.
Acceptance
Follow-up to #146 (JSON-family sidecar backend). Two threads:
1. Harden the JSON store
<path>.lock) with backoff + stale-lock steal; RAII release.renamedurability already insave(), held under the write lock across the load→mutate→save cycle.2. Wire the stub CLI subcommands
provenance <entity>: list the entity's provenance chain and report verification (verify_chain) + any fork points. Both sqlite and json backends.history <entity> [--at T]: list temporal versions (or the point-in-time snapshot atT) for the entity. Both backends.postgresreads remain explicit "not yet implemented".3. Docs + config
storage = "json"/format..claude/settings.jsonpermission allowlist to reduce harness friction.Acceptance
JsonStorewrites are guarded by a cross-process lock and remain crash-safe (atomic rename); concurrentgc/append don't corrupt or lose data.provenanceandhistorywork against both sqlite and json sidecars (tests cover both).