Skip to content

refactor(core): centralize SHA-256 digest ownership - #803

Merged
morluto merged 1 commit into
mainfrom
agent/centralize-sha256-digest
Aug 8, 2026
Merged

refactor(core): centralize SHA-256 digest ownership#803
morluto merged 1 commit into
mainfrom
agent/centralize-sha256-digest

Conversation

@morluto

@morluto morluto commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Fixes #741.

Problem

The generic byte-to-sha256: digest helper lived in storage.identity, forcing unrelated contracts and persistence code either to repeat it or to take an inappropriate storage dependency. That location creates both an import-cycle risk and an ownership error: byte hashing is canonicalization infrastructure, not storage behavior.

Change

Move the helper to dependency-free jacobian.canonical and migrate the SAT, SMT, linear, and storage-blob callers to that owner. The output remains exactly sha256: plus the lowercase SHA-256 hexadecimal digest.

storage.identity no longer exports the helper. This is intentional: retaining a re-export would leave the obsolete dependency path and compatibility shim in place.

Validation

  • make test-unit TESTS=tests/unit/contracts/test_canonical_json.py tests/unit/contracts/test_sat_contracts.py tests/unit/contracts/test_smt_contracts.py tests/unit/contracts/test_linear_contracts.py — 40 passed
  • make test-storage TESTS=tests/boundary/storage/transactions/test_artifact_integrity.py — 16 passed
  • make check-static — passed

@morluto
morluto marked this pull request as ready for review August 8, 2026 07:06
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@morluto
morluto merged commit 38694ae into main Aug 8, 2026
39 checks passed
@morluto
morluto deleted the agent/centralize-sha256-digest branch August 8, 2026 07:10
@morluto morluto changed the title Centralize SHA-256 digest ownership refactor(core): centralize SHA-256 digest ownership Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech debt]: 45 hand-rolled SHA256 digest computations duplicate existing sha256_digest helper

1 participant