fix(dialect): compute pinned dialect hash from canonical bytes #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/5/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
./release.shfailed cutting v0.1.1 becausecore::dialect::tests::dialect_hash_is_pinnedpanicked:The test read
d.hash, which cbcl-core only populates from a self-declared(hash "...")field in the.cbclfile. The vendoredcbcl-elephant.cbcldeclares none, sod.hashwasNoneand.expect("hash computed on install")panicked. cbcl-core never computes a hash on install, so this test could not pass as written.Fix
PINNED_DIALECT_HASHis asha256over cbcl-rs's canonical dialect bytes (the same bytes used for signing) — which is why elephant depends onsha2and cbcl-core exposesdialect_canonical_bytes. This adds adialect_hash()helper that recomputes that hash from content and compares it against the pin.The test now does what its own comment always claimed: a silent change to the vendored file or to cbcl-rs canonicalisation breaks the build visibly — and it no longer trusts a self-declared field a tamperer could just edit. The pinned value
sha256:9042…matches the computed canonical hash unchanged, confirming it was correct all along.Cargo.lock: cbcl-core no longer depends onsha2(sibling path-dep regeneration).Verification
The v0.1.1 version bump is intentionally not in this branch —
./release.showns versioning/tag/push and can be re-run cleanly once this merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q6GBsN4CfVF7QXAycnK2ip