You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(fuse): add --reproducible for byte-stable output (#325) (#327)
* fix(fuse): add --reproducible for byte-stable output (#325)
meld's fused output was byte-nondeterministic: identical input yielded a
different sha256 each run, breaking reproducible-build / supply-chain
attestation (scry/loom/witness/sigil key on the fused bytes).
Root cause (found by structural diff, not the issue's HashMap guess): the ONLY
nondeterministic bytes are in the `wsc.transformation.attestation` custom
section — a random `attestation_id` UUID + a wall-clock `timestamp`. Everything
else is already deterministic (`--no-attestation` is byte-identical across runs;
the section's own `output.hash` is stable).
Add a `--reproducible` flag (FuserConfig.reproducible). When set, the
attestation id is derived from the output content (`entropy_from_hex(output_hash)`
→ `generate_uuid_from`) and the timestamp from the ecosystem-standard
`SOURCE_DATE_EPOCH` (default epoch 0) via `chrono_timestamp_from`, instead of a
random UUID + system clock — so identical input yields an identical artifact.
Both attestation builders are covered: the default `FusionAttestationBuilder`
path and the `feature = "attestation"` `wsc` path.
Verified end-to-end: `--reproducible` → identical sha256 across runs;
`SOURCE_DATE_EPOCH=0` → `1970-01-01T00:00:00Z`; control (no flag) still varies.
Regression test `test_reproducible_attestation_is_byte_stable` pins it (and
asserts the control differs, so the flag can't silently become a no-op).
The new FuserConfig field is threaded through the existing explicit test
literals (reproducible: false).
Refs #325.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(fuse): scope #325 reproducibility test to the default build path
The Coverage job (cargo test --all-features) exposed a real gap: under the
optional `attestation` (wsc) feature, the emitted section carries
`tool_parameters` / `metadata` as `wsc_attestation` `HashMap` fields whose
serde serialization order is process-random — meld can't control it from this
side (the field types live in the upstream crate). So `--reproducible` makes
the shipped default build (`features = []`, `FusionAttestationBuilder`, no such
maps) fully byte-stable, but not the optional wsc path.
Gate `test_reproducible_attestation_is_byte_stable` to
`#[cfg(not(feature = "attestation"))]` — it asserts the guarantee meld actually
provides (the default build) and documents the wsc-path limitation (needs an
upstream sorted/BTreeMap serialization fix). The default-path fix and its
verification are unchanged.
Refs #325.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments