Skip to content

feat(rust): add Fd5Builder for sealed file creation#179

Merged
gerchowl merged 2 commits intodevfrom
feature/145-rust-fd5-builder
Mar 27, 2026
Merged

feat(rust): add Fd5Builder for sealed file creation#179
gerchowl merged 2 commits intodevfrom
feature/145-rust-fd5-builder

Conversation

@gerchowl
Copy link
Copy Markdown
Contributor

Summary

  • Implements the full Fd5Builder pattern for the Rust fd5 crate (issue [FEATURE] Rust fd5 crate — core read/write library #145)
  • HashTrackingGroup wraps hdf5_metno::Group to hash dataset data inline during writes (tee pattern)
  • ProductSchema trait with registry for pluggable product schemas
  • dict_to_h5 / h5_to_dict helpers for serde_json::Value ↔ HDF5 round-trip
  • Deterministic filename generation matching Python's naming.py
  • seal() consumes the builder: validate → chunk hashes → schema embed → id → content_hash → atomic rename
  • Removes h5v from workspace members (extracted to its own repo)

New files

  • crates/fd5/src/builder.rsFd5Builder, HashTrackingGroup, create() entry point
  • crates/fd5/src/product.rsProductSchema trait, registry, TestProductSchema
  • crates/fd5/src/h5io.rsdict_to_h5, h5_to_dict
  • crates/fd5/src/naming.rsgenerate_filename()

Test plan

  • cargo test -p fd5 passes
  • Builder creates sealed files that pass fd5::verify()
  • Cross-language: Python fd5.verify() validates Rust-created files

🤖 Generated with Claude Code

gerchowl and others added 2 commits March 2, 2026 09:39
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>
@gerchowl gerchowl merged commit 57affda into dev Mar 27, 2026
4 of 7 checks passed
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.

1 participant