Skip to content

feat: serve dig.getManifest locally from the embedded public manifest#1

Merged
MichaelTaylor3d merged 1 commit into
mainfrom
feat/get-manifest-176c
Jul 4, 2026
Merged

feat: serve dig.getManifest locally from the embedded public manifest#1
MichaelTaylor3d merged 1 commit into
mainfrom
feat/get-manifest-176c

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

Summary

#176 Phase C: dig.getManifest moves from a blind-passthrough alias to a LOCAL read, resolving the normalized PublicManifest (.dig data-section id 13, Phase A — already merged in digstore's store-libs) embedded in a held capsule's compiled module.

  • dig-node-core: new Node::get_manifest + read_public_manifest_blocking (runs on spawn_blocking, mirroring serve_local_blocking). Params {store_id, root} (a capsule identifier — storeId:rootHash, matching dig.getAvailability/dig.fetchRange's shape); no retrieval_key needed since the manifest is PUBLIC, unencrypted data.
    • Module held + manifest present → result = the manifest JSON ({schema_version, entries:[...]}, byte-identical to PublicManifest::to_json).
    • Module held + no manifest section (an older .dig, or a private store) → result: nullnever an error (store-format §5.1 backwards-compatibility rule).
    • Capsule not held locally at all → -32004 (same code dig.fetchRange uses on a miss).
    • Malformed store_id/root-32602 before any filesystem access.
  • dig.stage now sets FinalizeOptions.include_public_manifest for PUBLIC stores (matching the digstore CLI's own commit rule) — required because the digstore rev bump below adds this as a new field on that struct.
  • Bumped the pinned digstore rev (dig-node-core and dig-wallet, kept in sync per the existing "bump together" contract) to the tip carrying the public-manifest format extension (digstore-core/-store/-compiler/-stage etc., no digstore-guest changes — the vendored guest wasm did not need rebuilding). Added digstore-compiler as a direct dependency of dig-node-core for extract_data_section_blob (a pure wasm-binary-format parse — no wasmtime instantiation needed to read this public section).
  • dig-node-service: meta.rs catalogue entry flipped served: "passthrough""local" with an updated summary; doc comments in server.rs/rpc.rs updated to match (a clarifying comment was added to rpc.rs explaining Route::Passthrough there is a request-normalization classification, independent of local-vs-relay serving).
  • SPEC.md/README.md/USER_JOURNEY.md updated to document the new local behavior (including a new SPEC §5.5.1) instead of describing it as a blind-passthrough alias.

Version bump

dig-node-core 0.1.00.2.0 and dig-node-service 0.3.00.4.0minor: a new capability (dig.getManifest is now resolved by the node instead of always relaying to the upstream), fully backwards compatible (existing callers of the method still get an answer; everything else is unchanged).

Tests (TDD — written before the implementation)

  • dig_get_manifest_returns_embedded_manifest_json_when_present
  • dig_get_manifest_returns_null_when_section_absent
  • dig_get_manifest_reports_unavailable_when_capsule_not_held
  • dig_get_manifest_rejects_malformed_params_without_touching_disk

Both manifest-presence tests build a real compiled .dig module via digstore_stage::stage_and_compile (not a mock) so the data-section extraction + decode is exercised end-to-end. The pre-existing passthrough_alias_methods_are_method_not_found_on_the_node test was updated to drop dig.getManifest from the passthrough-alias list, and the openrpc_drift_guard suite (which dispatches every catalogued method through the real handle_rpc) was re-verified green against the new served: "local" classification.

How verified

  • cargo fmt --all -- --check — clean.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — zero warnings.
  • cargo test --workspace — all green: dig-node-core 193 passed, dig-node-service 92 passed (incl. the 5 openrpc_drift_guard tests + the 25 server.rs integration tests), dig-wallet 71 passed, dig-runtime 3 passed. Zero failures.
  • Confirmed the digstore rev bump resolves to a single coherent version of every digstore-* crate across the whole workspace (dig-wallet had its own independent, now-stale pin — bumped it too to keep the documented "same rev as the node" invariant).

Note: this repo's current required PR checks are "Lint commit messages" (commitlint) and "Check version increment" only — there is no ci.yml running cargo test/clippy/fmt as a required gate yet. I ran all of the above locally per the ecosystem-wide contract; adding a dedicated CI workflow for it would be a separate, repo-wide infra task.

#176 Phase C: dig.getManifest moves from a blind-passthrough alias to a
LOCAL read, resolving the normalized PublicManifest (.dig data-section id
13, Phase A) embedded in a held capsule's compiled module.

- dig-node-core: new Node::get_manifest + read_public_manifest_blocking
  (spawn_blocking, mirrors serve_local_blocking). Params {store_id, root}
  (a capsule identifier, no retrieval_key needed - the manifest is public,
  unencrypted data). A held module with no manifest section (an older
  .dig, or a private store) returns `result: null`, never an error
  (store-format backwards-compatibility rule); a capsule not held at all
  reports -32004, matching dig.fetchRange's miss code.
- dig.stage now sets FinalizeOptions.include_public_manifest for PUBLIC
  stores, matching the digstore CLI's own commit rule (a new required
  field added by the digstore rev bump below).
- Bumped the pinned digstore rev (dig-node-core + dig-wallet, kept in
  sync) to the tip carrying the public-manifest format extension, and
  added digstore-compiler as a direct dependency for
  extract_data_section_blob (already a transitive dep via digstore-stage).
- dig-node-service: meta.rs catalogue entry flipped to served: "local"
  with an updated summary; doc comments in server.rs/rpc.rs updated to
  match.
- SPEC.md/README.md/USER_JOURNEY.md updated to describe the new local
  behavior instead of the old passthrough alias.
- Tests: dig_get_manifest_returns_embedded_manifest_json_when_present,
  dig_get_manifest_returns_null_when_section_absent,
  dig_get_manifest_reports_unavailable_when_capsule_not_held,
  dig_get_manifest_rejects_malformed_params_without_touching_disk. The
  existing passthrough_alias_methods_are_method_not_found_on_the_node
  test and the openrpc_drift_guard suite were updated/re-verified against
  the new classification.

Verified: cargo fmt --all -- --check, cargo clippy --workspace
--all-targets --all-features -- -D warnings, and cargo test --workspace
all green (dig-node-core 193, dig-node-service 92, dig-wallet 71,
dig-runtime 3 - zero failures).
@MichaelTaylor3d MichaelTaylor3d merged commit 0d70f4a into main Jul 4, 2026
2 checks passed
@MichaelTaylor3d MichaelTaylor3d deleted the feat/get-manifest-176c branch July 4, 2026 10:00
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