Repository navigation
feat(node): add the HF read surface, release durability, and model fetch - #623
beardthelion wants to merge 15 commits into
Conversation
Serve published model releases through Hugging Face-compatible metadata and resolve routes, resolved from release rows rather than git history and gated on full publicity so private, mirrored, and rule-bearing repos answer the same 404. Byte serving covers git and chunked files with single-range, suffix, If-Range, and conditional support under a dedicated per-IP limiter and download semaphore. Publishing now also enqueues an idempotent durability job set: block, manifest, reconstruction, and block-map pins to Kubo and optionally Pinata, then a compact Irys anchor once every pin lands. A policy fence fails every pending sibling and withholds the anchor when a repo stops being fully public; local serving never waits on the providers.
Off-node fetch could rebuild chunked files but had no source for the small files the manifest keeps in git. The map job now pins those bytes and indexes them under files, keyed by manifest sha256.
Rebuild a published release from Arweave and IPFS without the origin node: discover release anchors by Irys tags, verify the manifest against the caller-supplied DID, then rebuild every file with sha256 checks under a bounded block cache. The CLI becomes a lib+bin so the node e2e can drive the fetch in-process.
Seed a published release against mock Kubo, Irys, and Arweave, drain durability, shut the node down, and rebuild byte-identically through fetch_model: a forged self-signed anchor is skipped and a tampered block fails by name.
Operator enablement, quotas, durability tiers, the HF read surface, independent fetch, and the smoke check. README and the run/storage docs point at the new page.
Review pass on the PR3 diff:
- Fetch the repo row once per durability job and share it with the
publicity gate, git blob reads, and the anchor post instead of
re-fetching it per call.
- still_publishable now delegates to require_fully_public so the
canonical publicity predicate (public, no rules, canonical row) has
one definition.
- Merge the near-identical durability count queries and take borrowed
job tuples so enqueue stops allocating String for static kind names.
- Centralize the release manifest and signature paths in models:: so
the claim reader, HF surface, and durability jobs share them.
- Drop the pin_model_object pass-through; callers use pin_git_object.
- Fix a panic: the fetch output dir sliced untrusted anchor text by
bytes; it now truncates by chars so a multi-byte boundary is safe.
- Emit HF's real LFS pointerSize (the pointer file size, not the
object size) in tree entries.
- Coverage: /tree/{rev}/{path} slash-boundary filtering, all six HF
routes denying private and visibility-ruled repos for anon and
signed stranger, pickle unsafe markers on model-info siblings, and
lastModified proven to report published_at rather than created_at.
- Docs: the HF repo id uses the bare DID key (huggingface_hub rejects
the did:key: colons client-side), the at-or-above threshold wording,
current huggingface_hub wording, and the HF read/download knobs in
.env.example and MODEL-HOSTING.md.
…ation - Echo the requested owner/name in existence-hiding HF denials instead of internal storage identifiers, and assert the body leaks neither. - Validate anchor release_commit as a real hex commit (40 for sha1 repos, 64 for sha256 repos) before it shapes the output dir or fetch URLs, and keep CID path interpolation behind URL-safe checks. - Bound download concurrency with the configured semaphore type and resolve refs through published releases only. - Bound durability retry error recording; leave non-pending jobs alone. - Cover traversal-shaped release commits and 64-hex commits in the fetch suite; keep the node-down e2e honest.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
A sha256-format repo's commit ids are 64 hex, and three gates still required exactly 40: the release claim rejected the commit outright, the HF revision resolver never treated a 64-hex rev as commit-shaped, and the CLI --parent parser rejected the same input. Centralize the check as twigpine_core::cid::is_hex_oid so the next commit-shaped gate cannot reintroduce a sha1-only assumption.
jatmn
left a comment
There was a problem hiding this comment.
The PR adds real value—a coherent HF read surface, durability pipeline, and off-node model fetch with strong tests on the happy path and denials—but merge is blocked today by CI surface fixtures, and the default HF model card can disagree with main when more than one branch has published releases.
Post–are these real, or drift? check: Both findings below are PR-introduced (nothing equivalent exists at merge-base 27e971c). Fixes stay inside this diff—fixture rows for CI, HF resolver + test for model info—not a core or framework rewrite.
Merge readiness
changed surfacesis red on head (run44682749892):scripts/test-ci-surfaces.shfails seven fixture checks becausetwigpine-nodenow dev-depends ontwigpine-clifor the in-process e2e, so the mapper correctly fans out-p twigpine-cli -p twigpine-nodewhile fixtures still expect CLI-only packages. Downstream PR Checks jobs (fmt + clippy, workspacetest, MSRV, release validation, Docker smoke, etc.) were skipped on this run—not evidence they pass on this tree.- Stacked on #622 (
feat/model-hosting-publish→feat/model-hosting-read). Target branch head matches the captured merge-base (27e971c); no extra target drift observed, but the stack still merges into the publish PR, notmain. - Author checklist:
cargo test --workspacenot re-run on final tree; focused suites listed in the PR body were run locally in review and pass (hf_api,model_hosting_e2e,model_fetch). - Deny harness lists six HF routes as
ExternalDependencyUnavailable; denial legs for private/rule-bearing repos are exercised inhf_api.rsinstead (author-noted follow-up to wire deny-harness fixtures).
Findings
🟠 P1 — Keep test-ci-surfaces.sh aligned with reverse dependency fan-out after the node→CLI dev-dependency
📍 Where: scripts/test-ci-surfaces.sh, crates/twigpine-node/Cargo.toml (dev-dependencies.twigpine-cli).
💥 What fails: The PR Checks changed surfaces job exits 1. Seven fixture cases expect rust_packages=-p twigpine-cli (or icaptcha-client fan-out without node) but the live mapper emits -p twigpine-cli -p twigpine-node for those paths because ci-surfaces.sh pulls in every crate that depends on a touched crate—including twigpine-node after the new dev-dependency.
Verified on head: bash scripts/test-ci-surfaces.sh reports the same seven failures. At merge-base the twigpine-cli dev-dependency on twigpine-node is absent.
🔎 Root cause: The E2E harness added a crate dependency edge without updating the pinned fixture expectations that guard the mapper.
📜 Stated contract:
scripts/test-ci-surfaces.shpins the mapping.
🏷️ Attribution: PR-introduced (no twigpine-cli dev-dep on twigpine-node at merge-base).
📌 In this PR:
crates/twigpine-node/Cargo.tomldev-dependency ontwigpine-cliscripts/test-ci-surfaces.shunchanged (stale expectations)
🔒 Unchanged on main: scripts/ci-surfaces.sh reverse-dependency algorithm is correct; do not narrow fan-out to make fixtures pass.
🔧 Required correction: Update every affected fixture row in scripts/test-ci-surfaces.sh (twigpine-cli source paths, icaptcha-client row, crate manifest row, C-quoted path cases) so rust_packages includes -p twigpine-node when the mapper now does. Re-run scripts/test-ci-surfaces.sh locally and confirm PR Checks can schedule Rust jobs again.
🛠️ Author fix: Adjust all listed fixture rows in one commit; verify with bash scripts/test-ci-surfaces.sh. Do not remove the dev-dependency or weaken CI mapping.
🚫 Out of scope: Changing workspace test scope logic in ci-surfaces.sh beyond what the dependency graph requires.
🟡 P2 — Reconcile default HF model metadata with refs / revision/main (in-pr contract conflict)
📍 Where: crates/twigpine-node/src/api/hf.rs (hf_model_info, module doc, hf_refs), crates/twigpine-node/src/db/model_queries.rs (model_release_newest), docs/MODEL-HOSTING.md (HF + snapshot_download path).
💥 What fails: With two published releases on different branches, GET /hf/api/models/{owner}/{repo} returns the repo-wide newest release (model_release_newest → ORDER BY id DESC on all published rows), while GET .../refs and .../revision/main use release_for_rev(..., "main") (newest on main, then default branch). A huggingface_hub client can see one sha and siblings on the model card but download another commit when it follows main / snapshot_download.
No hf_api test covers two branch-published releases today.
🔎 Root cause: This PR documents two different “default release” rules at once: global newest on the model-info path versus main-scoped resolution on refs/revision/resolve.
📜 Stated contract:
mainnames exactly the releaserevision/mainresolves: newest on main, then the git default branch.
Metadata comes from the newest published release row and its manifest
The newest published release on the repo… (the
refsendpoint's default target).
The first and third quotes require model info and refs to agree on the default release. The second (module doc) describes repo-wide newest for metadata. All three are in this PR; they cannot all be true for multi-branch publishes unless operator docs say otherwise.
🏷️ Attribution: PR-introduced (no HF surface at merge-base). Not pre-existing main debt.
📌 In this PR:
hf_model_info→model_release_newesthf_refs,hf_revision_info,hf_tree*,hf_resolve→release_for_rev- Module doc at top of
hf.rs - Misleading doc comment on
model_release_newest
🔒 Unchanged on main: Release rows and branch column semantics from #622.
🔧 Required correction: Pick one default-release rule and apply it consistently on every in-diff HF operator surface:
-
Recommended (matches
refs+ smoke path): Drivehf_model_infofromrelease_for_rev(state, record, "main")(same fallback ashf_refs). Fix themodel_release_newestcomment. Add an integration test that publishes on two branches and asserts model infoshamatchesrefsandrevision/main. -
If global-newest model card is intentional instead: Keep
model_release_newestfor model info but changehf_refs/revision/mainbehavior and rewritedocs/MODEL-HOSTING.md+ module doc sosnapshot_downloadand refs tell the same story. Still add the two-branch regression test.
Either path is in scope; leaving the contradiction in place is not.
🛠️ Author fix: Resolve the contract conflict in one pass—code, comments, and docs together—plus the two-branch test. Do not patch only hf_model_info or only one markdown file.
🚫 Out of scope: Redesigning release storage from #622; durability or model fetch pipelines.
Needs maintainer decision
None for this draft: P2 allows an explicit product choice (path 1 vs 2 above) without blocking merge once docs, code, and tests match.
…cover node fan-out Model info now resolves the default release the way refs and revision/main do (newest on main, then the git default branch) instead of the repo-wide newest. A two-branch test pins all three routes to one commit, and the module doc, query doc and MODEL-HOSTING.md state the single rule. twigpine-node dev-depends on twigpine-cli, so the surface mapper adds -p twigpine-node for CLI paths. The seven pinned fixture rows in test-ci-surfaces.sh now expect it.
… feat/model-hosting-read
model fetch parsed the gateway's GraphQL page with r.json() after a status check, which the no_parse_before_status gate rejects and which left the body uncapped. The read now goes through read_json (status-first, capped, sanitized); a failed page still ends discovery as before.
|
Both findings fixed on d7ab37f. P1: the seven pinned rows in scripts/test-ci-surfaces.sh now expect P2: With the Rust jobs unskipped, the workspace run found one more failure on this diff: The branch was 11 commits behind #622 and is merged with it, no conflicts. On the pushed head: |
jatmn
left a comment
There was a problem hiding this comment.
Follow-up on jatmn's review: the CI surface fixture mismatch and HF default-release split are fixed on this head. This pass did not re-open those items.
The PR still adds substantial value—a coherent HF read surface, durability pipeline, and off-node model fetch with strong denial and verification tests.
Are these real, or drift? (internal challenge on head d7ab37f6): Both findings below are PR-introduced (api/hf.rs absent at merge-base 2a3497ce). Fixes stay inside this diff (rustdoc + release_for_rev normalization + one hf_api case). They are not requests to change unchanged core, durability design, or HF denial JSON shape. Candidate items withdrawn after challenge: Twigpine-shaped 404 on private repos (tested in hf_api.rs), deferred durability jobs (documented), no manifest signature re-check on HF serve (module doc), Windows publish_state_round_trips (unchanged at merge-base).
Merge readiness
- Stacked merge target: PR targets
feat/model-hosting-publish(#622), notmain. Plan merge order through the publish stack. test (windows, non-blocking)fails on head (run 44893511514):model::tests::publish_state_round_tripspanics withAccess is deniedonsave_state→sync_allaftersecret_file::write. Samesave_stateat merge-base; job is non-blocking—not counted as a PR finding.- Deny harness HF rows remain
ExternalDependencyUnavailable; denial legs run inhf_api.rs(author-noted follow-up).
Required checks on head (stable/beta tests, fmt+clippy, changed surfaces, build) are green. The two findings below are P3 polish; they do not block merge if you accept the documented risks.
🔵 P3 — Align hf_refs rustdoc with the implemented default-release rule
📍 Where: crates/twigpine-node/src/api/hf.rs (hf_refs doc comment vs inline comment, release_for_rev, module header, docs/MODEL-HOSTING.md).
💥 What fails: Runtime behavior is already correct. The stale function doc on hf_refs (lines 334–335) says main names the newest published commit regardless of the repo's git default branch. The handler and release_for_rev use newest on main, then default_branch (e.g. master). The mismatch is maintainer/audit copy only.
🔎 Root cause: One handler rustdoc left behind when jatmn’s default-release fix landed across model info, inline hf_refs comment, tests, and MODEL-HOSTING.md.
📜 Stated contract:
Model info,
refsandrevision/mainall name the same default release: the newest onmain, then on the git default branch.
🏷️ Attribution: PR-introduced. Not pre-existing main debt; not scope drift.
📌 In this PR:
hf_refsfunction rustdoc (incorrect)- Module header, inline comment at
hf_refscall site,MODEL-HOSTING.md,release_for_rev,hf_apitwo-branch /mastertests (correct)
🔒 Unchanged on main: No HF surface at merge-base.
🔧 Required correction: Rewrite the hf_refs function doc comment to match the module header and release_for_rev (main, then git default branch). No code-path change.
🛠️ Author fix: Edit that doc comment in one commit; no other HF logic changes required.
🚫 Out of scope: Changing release_for_rev behavior or other handlers.
🔵 P3 — Normalize uppercase hex commit pins on HF revision resolution
📍 Where: crates/twigpine-node/src/api/hf.rs (release_for_rev commit-shaped branch), crates/twigpine-node/src/db/model_queries.rs (model_release_by_commit).
💥 What fails: is_hex_oid accepts uppercase A-F, so /revision/{SHA} is treated as a commit pin, but commit_sha rows are lowercase from git and the SQL bind is case-sensitive. Uppercase spelling returns RevisionNotFound for an existing published release. Most clients send lowercase; this is an edge case, not a typical HF path.
🔎 Root cause: New unified is_hex_oid gate in this PR without lowercasing (or case-insensitive lookup) before model_release_by_commit.
📜 Stated contract:
A hex rev is a commit pin (40 for sha1 repos, 64 for sha256).
twigpine-core::cid::is_hex_oid accepts uppercase hex (unit tests).
🏷️ Attribution: PR-introduced. Not pre-existing; not scope drift.
📌 In this PR:
release_for_revhex branchmodel_release_by_commitequality bind
🔒 Unchanged on main: No HF revision resolver at merge-base.
🔧 Required correction: Lowercase commit-shaped rev in release_for_rev before the DB lookup (one place). Add hf_api coverage: publish a release, call revision with uppercase hex of the same commit, expect success.
🛠️ Author fix: Normalize in release_for_rev + one regression test in hf_api.rs.
🚫 Out of scope: Changing storage format or non-HF commit APIs.
Needs maintainer decision
None.
The sibling publish branch reworded this prompt to say nothing is pinned or anchored, which is true there. Here the durability pipeline exists, so say it is permanent where IPFS and Irys are configured and node-only otherwise.
jatmn
left a comment
There was a problem hiding this comment.
Follow-up on my earlier review: the CI surface fixture mismatch and the HF default-release split are still fixed on 9f2839ee. Your fix(cli): state the durability behavior in the publish confirm text commit lines up with docs/MODEL-HOSTING.md—thanks for that.
I ran another full pass on this head. You still have real value here: a coherent HF read surface, the durability pipeline, and off-node model fetch with strong tests (hf_api 32/32 locally, test-ci-surfaces.sh clean). I am not re-opening the earlier P1/P2 items, and I am not asking you to rework durability tiers, HF denial bodies, or unrelated core for this PR.
Two P3 polish items from the last round are still open on 9f2839ee. They are small fixes inside this diff only.
Merge readiness
- Stack: This targets
feat/model-hosting-publish(#622), notmain. Plan merge order through the publish stack. - Target branch: When I fetched,
origin/feat/model-hosting-publishmatched the merge-base (590207909); I did not see extra target drift. cargo auditis red on head (run 45087066640) —RUSTSEC-2026-0486(rustix) plus yankedcore2/spin. YourCargo.lockdelta here is mostlyhex,sha2, and thetwigpine-clidev-dependency. I am not treating that audit as something you must fix in this PR unless maintainers want every stacked branch green on audit anyway.- Deny harness: HF routes are still
ExternalDependencyUnavailablein the harness; you already exercise the same denial legs inhf_api.rs(reasonable follow-up if you want harness parity later). - Checklist:
cargo test --workspaceis still unchecked in the PR body; the focused suites you list match what I ran successfully on this tree.
Required Rust checks on head (stable/beta tests, fmt+clippy, changed surfaces, build) are green. The two items below are P3; merge is fine if you accept the edge cases as documented.
🔵 P3 — Align hf_refs rustdoc with the implemented default-release rule
📍 Where: crates/twigpine-node/src/api/hf.rs (hf_refs doc comment vs the inline comment, release_for_rev, module header, docs/MODEL-HOSTING.md).
💥 What fails: Runtime behavior is already correct. The function doc on hf_refs (lines 334–335) still says main names the newest published commit regardless of the repo's git default branch. Your handler and release_for_rev use newest on main, then default_branch (e.g. master), and the inline comment at the call site (lines 347–349) says the same. This is maintainer/audit copy only—no client bug.
🔎 Root cause: That function-level rustdoc did not get updated when you aligned model info, the inline hf_refs comment, tests, and MODEL-HOSTING.md.
📜 Stated contract:
Model info,
refsandrevision/mainall name the same default release: the newest onmain, then on the git default branch.
🏷️ Attribution: Introduced in this PR (api/hf.rs is new on the merge-base).
📌 In this PR:
hf_refsfunction rustdoc (incorrect)- Module header, inline comment at
hf_refs,MODEL-HOSTING.md,release_for_rev,hf_apitwo-branch /mastertests (correct)
🔒 Unchanged on main: No HF surface at merge-base.
🔧 Required correction: Rewrite the hf_refs function doc comment to match the module header and release_for_rev (main, then git default branch). No code-path change.
🛠️ Author fix: One commit that updates that doc comment only—no other HF logic changes.
🚫 Out of scope: Changing release_for_rev behavior or other handlers.
🔵 P3 — Normalize uppercase hex commit pins on HF revision resolution
📍 Where: crates/twigpine-node/src/api/hf.rs (release_for_rev commit-shaped branch), crates/twigpine-node/src/db/model_queries.rs (model_release_by_commit).
💥 What fails: is_hex_oid accepts uppercase A-F, so /revision/{SHA} is treated as a commit pin, but commit_sha rows are lowercase from git and the SQL bind is case-sensitive. If someone spells the published commit in uppercase, they get RevisionNotFound even though the release exists. Most clients send lowercase; this is an edge case, not the usual HF path.
🔎 Root cause: The unified is_hex_oid gate in this PR does not lowercase (or case-insensitive lookup) before model_release_by_commit.
📜 Stated contract:
A hex rev is a commit pin (40 for sha1 repos, 64 for sha256).
twigpine-core::cid::is_hex_oid accepts uppercase hex in unit tests.
🏷️ Attribution: Introduced in this PR (resolver + is_hex_oid are new on the merge-base).
📌 In this PR:
release_for_revhex branchmodel_release_by_commitequality bind
🔒 Unchanged on main: No HF revision resolver at merge-base.
🔧 Required correction: Lowercase commit-shaped rev in release_for_rev before the DB lookup (one place). Add hf_api coverage: publish a release, call revision with uppercase hex of the same commit, expect success.
🛠️ Author fix: Normalize in release_for_rev and add one regression test in hf_api.rs in the same pass.
🚫 Out of scope: Changing storage format or non-HF commit APIs.
Needs maintainer decision
None from my side.
|
Both P3 items from the last review are fixed on 32bc4b8. Rustdoc: the Uppercase pins:
|
jatmn
left a comment
There was a problem hiding this comment.
Follow-up on earlier reviews: the CI surface fixture mismatch, HF default-release split, hf_refs rustdoc, HF uppercase commit pins, and Arweave discovery read_json fix are all present on this head (32bc4b8323e1214ff2c4113e806e1c23414b33ce). This pass did not re-open those items.
The PR still delivers substantial value: a coherent HF read surface, the durability pipeline with a publicity fence, and off-node model fetch with strong verification tests.
Post–are these real, or drift? check (head 32bc4b8323e1214ff2c4113e806e1c23414b33ce): The sole finding below is PR-introduced, backed by the in-diff hex-rev contract and current code on head; the correction stays inside verify_candidate + one model_fetch test (same class as your HF lowercase pin, not a REST or durability rewrite). Blind-search themes withdrawn here as not findings: empty-Irys anchor done (documented no-tier behavior), synthetic CIDs without Kubo/Pinata (node-only tier), partial Arweave discovery (warn-and-continue, shared with clone.rs), policy-fence defer without attempt bump (fail-closed), REST release path case sensitivity (unchanged at merge-base), and cargo audit (target lockfile, merge readiness only).
Merge readiness
- Stack: Targets
feat/model-hosting-publish(#622), notmain. Plan merge order through the publish stack. cargo auditis red on head (job log). Author notes the failingurladvisory matches the target branch lockfile; not treated as a PR-owned defect in this diff.- Deny harness: HF routes remain
ExternalDependencyUnavailable; the same denial legs run intests/hf_api.rs(reasonable follow-up for harness parity). - Checklist: PR body still has
cargo test --workspaceunchecked; required PR Checks jobs on head are green (stable/beta, fmt+clippy, changed surfaces, build, MSRV, Docker smoke).
🔵 P3 — Normalize uppercase hex on model fetch --revision
📍 Where: crates/twigpine-cli/src/model.rs — verify_candidate revision gate (anchor.release_commit != want).
💥 What fails: twigpine_core::cid::is_hex_oid accepts uppercase A–F. Anchors and git store release commits in lowercase hex. A caller passing twigpine model fetch … --revision <UPPERCASE_SHA> skips every matching anchor and fails with “no release anchor … verified”, while the same commit resolves on the HF API after this PR’s release_for_rev lowercasing.
🔎 Root cause: This PR unified hex commit recognition with is_hex_oid on the HF resolver but left the off-node fetch revision filter case-sensitive.
📜 Stated contract:
A hex rev is a commit pin (40 for sha1 repos, 64 for sha256).
is_hex_oid unit coverage accepts uppercase hex (crates/twigpine-core/src/cid.rs).
🏷️ Attribution: PR-introduced (verify_candidate / fetch_model are absent at merge-base 590207909; not pre-existing main debt). HF lowercase fix on this head does not cover the CLI --revision filter. Not scope drift: does not require editing claim storage or REST releases/{commit} lookup.
📌 In this PR:
verify_candidaterevision compare- HF
release_for_revcommit branch (already lowercases — sibling reference only)
🔒 Unchanged on main: REST GET …/models/releases/{commit} case sensitivity predates this PR; do not broaden this fix into unchanged API handlers.
🔧 Required correction: Lowercase commit-shaped want in verify_candidate before comparing to anchor.release_commit (one place). Add model_fetch.rs coverage: anchor with lowercase commit, fetch with uppercase --revision, expect success.
🛠️ Author fix: One pass: normalize in verify_candidate + regression test. No HF or durability logic changes.
🚫 Out of scope: Changing stored commit_sha normalization on claim, or REST release lookup semantics on the publish stack.
Needs maintainer decision
None.
Summary
Adds the model-hosting read surface and durability layer: Hugging Face-compatible metadata and ranged download routes, an outbox worker that pins every release object to IPFS and anchors the release on Arweave, and
twigpine model fetchso a client can rebuild a release byte-identically with no node at all. Stacked on #622.Motivation & context
Completes the model-hosting milestone. With this, a published release is retrievable three ways: through the node's HF-compatible API, through IPFS by CID, and end-to-end without the node via
model fetch, which verifies the anchored manifest against the publisher DID before trusting any content.Kind of change
What changed
/hf/api/models/...metadata routes (model info, revision, tree, refs) and/hf/{owner}/{repo}/resolve/{rev}/{path}ranged downloads for both Git-resident and chunked files. Revisions resolve to published releases only;mainfalls back to the newest published release. Private or visibility-ruled repos get the same 404 as a missing repo, and the denial echoes the caller's requested path rather than internal identifiers. Pickle files carry"unsafe": truein tree and sibling entries.model_durability_jobs) drainingpin_block,pin_manifest,pin_reconstruction,pin_block_map, andanchorjobs oldest-first under a batch budget. Git-resident file bytes (config.json, tokenizer, README) are pinned and indexed in the block map too, since an off-node fetch cannot reach the Git store. The publicity policy fence is re-checked between the local Kubo pin and the off-node Pinata pin so a publicity flip cannot publish mid-job. The Irys anchor posts only after every other job completes and carries the repo, owner DID, release commit, manifest CID and signature, reconstruction CID, and block map CID.twigpine model fetch <owner>/<name> --expect-did <did>discovers release anchors on Arweave, verifies each candidate against the caller-supplied DID (the anchor's own DID is never the verifying key), skips forged or malformed candidates with warnings, then streams the rebuild with per-chunk and per-file SHA-256 checks, path-traversal rejection, and a bounded block cache.docs/MODEL-HOSTING.mdcovers operator setup, the durability tiers, HF client usage (including the bare-key owner formhuggingface_hubaccepts), and node-free fetching..env.exampleanddocs/RUN-A-NODE.mdupdated for the new settings.How a reviewer can verify
The e2e seeds a real release, drains the durability worker against mocked IPFS and Arweave providers, shuts the node down, and rebuilds every file byte-identically from the anchor alone, then exercises the forged-anchor and tampered-block legs.
Before you request review
cargo test --workspacepasses locallycargo fmt --allandcargo clippy --workspace --all-targets -- -D warningsare cleanfeat(...),fix(...),docs(...)).env.exampleupdated if behavior or config changed (or N/A)cargo test --workspacewas not re-run on the final tree; the suites above plusmodels_api, the model lib tests, andauthz_guardall pass on it.Protocol & signing impact
did:key, Ed25519 / RFC 9421 signatures, UCAN, ref certs, or P2P wire formatsThe
gitlawb/model-release-anchor/v1Arweave payload is a new artifact carrying the release's manifest CID and claim signature; verification of it inmodel fetchanchors on the caller-supplied--expect-did, never the DID the anchor names.Notes for reviewers
ExternalDependencyUnavailablebecause the harness has no published-release fixture yet; the same denial legs (anonymous and signed stranger, private and visibility-ruled repos) are driven for all six HF routes inhf_api.rs. Converting the rows to driven fixtures is a reasonable follow-up.HF_ENDPOINTpoints unmodifiedhuggingface_hubclients at the node with one caveat: the owner's repo id segment must be the bare DID key (the client'svalidate_repo_idrejects the colons in a literaldid:key:segment before any request). The node normalizes the bare key to the full DID;MODEL-HOSTING.mddocuments this.clone.rsandmodel.rs, and anArcallocation in the CLI block cache.