Skip to content

cache & verify

canontra cache <info|verify|prune|clean> [-d|--dir DIR] [--json]
canontra verify <FILE> [-n|--runs N] [--json]
canontra completions <bash|zsh|fish|powershell>
  • cache: Manages .canontra/cache.bin (CNTR\x07 incremental binary slab cache with automatic read support for CNTR\x06 and CNTR\x05):
    • info: Shows record counts, FileGraphSummary slab page usage, and cache metadata.
    • verify: Checks the global header and every 4KB page IEEE 802.3 CRC-32C checksum.
    • prune: Removes entries for files that were deleted from disk.
    • clean: Deletes .canontra/cache.bin.
  • verify: Parses and hashes FILE N times in a row (default 10) to verify bit-identical repeat execution (ΔF=0\Delta F = 0).
  • completions: Prints shell autocompletion scripts to stdout for bash, zsh, fish, or powershell (including all canontra snap subcommands and flags).
Flag Short Applies To Default Description
--dir -d cache . Repository root containing .canontra/cache.bin
--runs -n verify 10 Number of repeat determinism runs
--json - cache, verify false Print CacheInfo or VerificationResult as JSON
  • verify exits 0 when vrDeterministic == True across all N runs, and 1 if any hash differs.
  • cache verify exits 0 when all slab pages pass CRC-32C checks.
  • completions exits 0 on supported shells and 2 on unsupported shell names.
Terminal window
# Inspect and CRC-verify the local cache
canontra cache info --dir .
canontra cache verify --dir . --json
# Confirm repeat determinism over 25 runs
canontra verify src/core.rs -n 25
# Install shell completions
canontra completions bash > ~/.local/share/bash-completion/completions/canontra
canontra completions zsh > ~/.zfunc/_canontra
canontra completions fish > ~/.config/fish/completions/canontra.fish
canontra completions powershell >> $PROFILE