Content-Addressable Hash Verification

Using cryptographic hash values derived from data contents to verify identity and integrity mechanically, eliminating reliance on volatile metadata.

General Meaning

External metadata such as filenames and modification timestamps is fragile, mutating easily across file copies, archive operations, and network transfers. Relying on metadata alone to verify data identity leaves systems vulnerable to silent corruption, partial overwrites, and unauthorized modifications.

Content hashing computes a cryptographic digest (such as SHA-256) directly from the raw byte stream of a file or data payload. Because even a single-bit difference completely changes the resulting digest due to the avalanche effect, matching hashes mathematically proves data integrity and exact identity, forming the bedrock of Git commits and content-addressable storage systems.

Why It Matters

  • Reliable detection of corruption and tampering: Detects dropped packets, incomplete downloads, or accidental overwrites immediately when hash values fail to match.
  • Independence from naming and location: Identifies identical data across different machines, storage tiers, or file paths regardless of local naming variations.
  • Objective, deterministic validation: Replaces self-reported agent assertions and optimistic assumptions with automated, binary pass-fail verification in code.

How the Site Factory Uses It

The Site Factory mandates content hash verification across receipt collection, agent-to-agent contracts, model selection, and automated PR merging. In honbu/receipts.py and tools/work.py, tasks cannot reach completion merely by returning exit code 0; workers must compute the SHA-256 digest of output artifacts and match it against the receipt before submission is accepted.

In cross-agent handoffs, honbu/a2a_contract.py and dispatch/src/a2a-evidence.js track input_sha256, artifact.sha256, and acceptance_sha256. Furthermore, rule K100 in ops/local-first.md matches model_digest hashes to ensure benchmark numbers correspond to exact local model weights, while ops/watchdog/patrol.py locks --match-head-commit hashes during auto-merges.

Caveats & Operational Rules

  • Do not conflate structural integrity with semantic correctness: A matching hash proves the payload has not changed, but does not guarantee business logic correctness, which requires schema and test validation.
  • Standardize JSON representations before hashing: Differing key order or whitespace produces conflicting hashes; payloads must be normalized to canonical JSON before computing digests.
  • Never fabricate or estimate hash digests: Hashes must always be calculated directly from physical artifacts; placeholder or hypothetical hashes are rejected as invalid receipts.

Related Terms

References

  • Book: Martin Kleppmann, *Designing Data-Intensive Applications*, Chapter 11 (Stream Processing: Immutability)

Verified: 2026-11-08