Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

crossmem verify

Verify chunk integrity by re-hashing verbatim text against stored SHA-256 hashes.

Usage

crossmem verify [cite_key]

Arguments

ArgumentDescription
[cite_key]Optional. If provided, only verify chunks for this cite key. If omitted, verify all wiki entries.

What it does

  1. Walks ~/crossmem/wiki/ for all .md files (or the one matching cite_key)
  2. For each wiki entry with a cite_key in frontmatter:
    • Extracts all <!-- chunk id=... --> blocks
    • Finds the text_sha256 in each chunk’s provenance YAML
    • Re-computes SHA-256 from the verbatim quoted text (> ... lines)
    • Reports any mismatches as “DRIFT”
  3. Prints summary: total chunks checked, total drifts detected

Exit codes

CodeMeaning
0All chunks verified, no drift
1Error or drift detected

Example

$ crossmem verify vaswani2017attention
[verify] Checking vaswani2017attention

Verified 47 chunks, 0 drift(s) detected.
$ crossmem verify
[verify] Checking vaswani2017attention
[verify] Checking lecun2015deep

Verified 93 chunks, 0 drift(s) detected.

When drift is detected:

DRIFT: vaswani2017attention chunk p4s32c1
  expected: 5f3e1c...
  actual:   a8b2d4...

Verified 47 chunks, 1 drift(s) detected.