Skip to main content

graft verify

Verify that the files in a branch directory match the Merkle tree root recorded in the DAG.

Usage

graft verify [branch] [flags]
If no branch is specified, the active branch is verified.

Behavior

  1. Resolve the branch’s tip commit
  2. Load the stored tree entries and Merkle root
  3. Walk the branch directory, hash every file with BLAKE3
  4. Build the Merkle tree from current files
  5. Compare computed root against stored root
  6. If the commit was unverified (verified=0) and verification passes, flip to verified=1

Flags

FlagAliasDefaultDescription
--verbose-vfalseShow per-file integrity details

Examples

Verify Active Branch

graft verify
✓ Integrity OK (147 files, root f0e1d2)

Verify Specific Branch

graft verify experiment

Verify with File Details

graft verify --verbose
✓ Integrity OK (147 files, root f0e1d2)

Failed Verification

graft verify experiment
✗ Integrity FAILED for experiment (2 changed, 1 missing)
  stored root: a1b2c3d
  actual root: f0e1d2

Failed Verification with Verbose

graft verify experiment --verbose
✗ Integrity FAILED for experiment (2 changed, 1 missing)
  stored root: a1b2c3d
  actual root: f0e1d2

STATUS    FILE                  EXPECTED HASH   ACTUAL HASH
changed   base/16384/12547     a1b2c3d4e5…     f0e1d2c3b4…
missing   global/pg_control    9876543210ab…   (none)

Diff Types

StatusMeaning
changedFile exists but content hash differs from stored
missingFile expected by the DAG but not found on disk
extraFile on disk not recorded in the DAG for this commit

Exit Codes

CodeMeaning
0Integrity check passed
1Verification failed or error occurred