Skip to content

feat(dir-tree): single-file roots — snapshot returns a content-addressed Link - #111

Merged
hartsock merged 6 commits into
mainfrom
issue-109/single-file-roots
Oct 15, 2026
Merged

hartsock merged 6 commits into
mainfrom
issue-109/single-file-roots

Conversation

@hartsock

Copy link
Copy Markdown
Owner

Summary

  • Link is now ContentAddressable, and the one root id always names a Link: a file root is Link::File, a directory root is Link::Dir wrapping the existing DirNode id.
  • snapshot / snapshot_with accept a regular file or a directory, return the root Link, and store it so its id can be fetched; symlink and special-file roots are still refused.
  • resolve takes the root Link's id: an empty path on a file root yields that file's proof; a path on a file root is NotADirectory. Proofs carry the root Link as their first node.
  • DirNode bytes are unchanged (pinned by a test against an id captured before this change).
  • Documents InvalidDigest on resolve (feat(dir-tree): multi-digest file links — BLAKE3 identity plus carried digests #108 review nit).

Test plan

  • New tests: file-root snapshot → resolve → verify_file, file vs directory roots over the same bytes get different ids, tampered or mismatched root nodes rejected, wrong-kind paths typed; existing directory tests adapted to Link roots; proptest round-trip green.
  • just check green; cargo +1.85 test --all-features green.

Fixes #109

🤖 Generated with Claude Code

hartsock and others added 3 commits October 15, 2026 12:44
…sed Link

Link is ContentAddressable; snapshot/snapshot_with return the root Link
(also stored). resolve/verify take a Link root; nodes[0] is its bytes.
DirNode bytes unchanged (pinned). Documents InvalidDigest on resolve (#108 nit).

Fixes #109

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Adapts the proptest round-trip to Link roots; covers extra digests on a
file root and refusal of a symlink / fifo given directly as the root.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
@hartsock hartsock added the risk:high High-risk change per CLAUDE.md PR workflow (byte/wire/CI/build) label Oct 15, 2026
hartsock and others added 3 commits October 15, 2026 12:50
…ix storage docs

Tests for InvalidDigest on file roots (resolve and verify), a surplus node
on a file-root proof, and the storage description (#109 review).

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Only a multi-digest test uses it, so a `--features dir-tree` build warned
(unused import) and `clippy --all-targets --features dir-tree -D warnings`
failed. CI and `just check` build with --all-features, which hid it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hartsock
hartsock merged commit f653743 into main Oct 15, 2026
8 checks passed
@hartsock
hartsock deleted the issue-109/single-file-roots branch October 15, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high High-risk change per CLAUDE.md PR workflow (byte/wire/CI/build)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(dir-tree): single-file roots — snapshot returns a content-addressed Link

1 participant