feat(rust): add Fd5Builder for sealed file creation#179
Merged
Conversation
Add the Rust fd5 crate implementing Merkle-tree SHA-256 hashing, verification, and attribute editing with byte-level parity to the Python implementation. All 12 conformance tests pass. - Cargo workspace root with members: crates/fd5, h5v - fd5 crate: hash, verify, edit, schema, attr_ser, error modules - Conformance tests validating cross-language hash agreement - JSON schemas extracted from Python product schemas (9 types) - extract_schemas.py script for regenerating schemas - Recon schema updated to v1.1.0 with nested /mips/ group Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements the full builder pattern for the Rust fd5 crate: - Fd5Builder with HashTrackingGroup for inline SHA-256 during writes - ProductSchema trait with registry for pluggable product schemas - dict_to_h5/h5_to_dict helpers for serde_json::Value ↔ HDF5 - Deterministic filename generation - Seal: validate → chunk hashes → schema embed → id → content_hash → rename - Remove h5v from workspace members (extracted to own repo) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HashTrackingGroupwrapshdf5_metno::Groupto hash dataset data inline during writes (tee pattern)ProductSchematrait with registry for pluggable product schemasdict_to_h5/h5_to_dicthelpers forserde_json::Value↔ HDF5 round-tripnaming.pyseal()consumes the builder: validate → chunk hashes → schema embed → id → content_hash → atomic renameh5vfrom workspace members (extracted to its own repo)New files
crates/fd5/src/builder.rs—Fd5Builder,HashTrackingGroup,create()entry pointcrates/fd5/src/product.rs—ProductSchematrait, registry,TestProductSchemacrates/fd5/src/h5io.rs—dict_to_h5,h5_to_dictcrates/fd5/src/naming.rs—generate_filename()Test plan
cargo test -p fd5passesfd5::verify()fd5.verify()validates Rust-created files🤖 Generated with Claude Code