Audit-chain verification for :crypto-hash? true scriptum branches.
verify-chain walks the linear sequence of Lucene commit generations
for a branch, asks the underlying BranchIndexWriter.verifyCommit to
recompute each commit's segment-file hashes against the stored
merkle metadata, and reports any divergence.
The protocol shape (IAuditable, -merkle-root,
-recompute-merkle-root) and the result-map vocabulary
({:status :ok|:mismatch|:unsupported|:advisory|:incomplete}) are
intentionally identical to the rest of the replikativ index libs
(datahike.index.audit, stratum.audit, proximum.audit). Bridges in
datahike pass results through without translation.
Audit-chain verification for `:crypto-hash? true` scriptum branches.
`verify-chain` walks the linear sequence of Lucene commit generations
for a branch, asks the underlying `BranchIndexWriter.verifyCommit` to
recompute each commit's segment-file hashes against the stored
merkle metadata, and reports any divergence.
The protocol shape (`IAuditable`, `-merkle-root`,
`-recompute-merkle-root`) and the result-map vocabulary
(`{:status :ok|:mismatch|:unsupported|:advisory|:incomplete}`) are
intentionally identical to the rest of the replikativ index libs
(datahike.index.audit, stratum.audit, proximum.audit). Bridges in
datahike pass results through without translation.(-merkle-root this)Cheap. Returns the cached/known content-addressed UUID of this
thing's current state. Returns nil when no commit has happened yet
or :crypto-hash? was off. Never throws.
Cheap. Returns the cached/known content-addressed UUID of this thing's current state. Returns nil when no commit has happened yet or `:crypto-hash?` was off. Never throws.
(-recompute-merkle-root this)Expensive. Re-derives the merkle root by re-hashing the underlying storage and confirming it matches the cached root. Returns a result map; never throws on mismatch:
{:status :ok :root <uuid>} {:status :mismatch :root <recomputed?> :errors [{:address, :expected, :recomputed, :details}]} {:status :unsupported :reason <kw>}
Expensive. Re-derives the merkle root by re-hashing the underlying
storage and confirming it matches the cached root. Returns a
result map; never throws on mismatch:
{:status :ok :root <uuid>}
{:status :mismatch :root <recomputed?>
:errors [{:address, :expected, :recomputed,
:details}]}
{:status :unsupported :reason <kw>}(verify-chain writer)(verify-chain writer {:keys [from-gen to-gen limit] :or {limit Long/MAX_VALUE}})Walk every Lucene commit on writer's branch, recompute each
commit's segment-file hashes via verifyCommit, and return
{:head <head-commit-uuid> :status :ok | :mismatch | :advisory | :incomplete :commits [{:generation, :cid, :status [, :errors :reason]}] :mismatches [...] :missing []}
Options: :from-gen — start at this generation (default: oldest) :to-gen — stop at this generation (default: newest) :limit — max commits to verify (default: unbounded)
Without :crypto-hash? enabled, every entry is reported as
:unsupported :reason :crypto-hash-disabled and the overall
:status is :advisory.
Walk every Lucene commit on `writer`'s branch, recompute each
commit's segment-file hashes via `verifyCommit`, and return
{:head <head-commit-uuid>
:status :ok | :mismatch | :advisory | :incomplete
:commits [{:generation, :cid, :status [, :errors :reason]}]
:mismatches [...]
:missing []}
Options:
:from-gen — start at this generation (default: oldest)
:to-gen — stop at this generation (default: newest)
:limit — max commits to verify (default: unbounded)
Without `:crypto-hash?` enabled, every entry is reported as
`:unsupported :reason :crypto-hash-disabled` and the overall
`:status` is `:advisory`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |