fix(cli): cat resolves a full urn:dig:... via the node ladder without a local store#11
Merged
Merged
Conversation
… a local store `digstore cat <full urn:dig:...>` required an active local store even though a full URN is self-contained (store id + optional pinned root), failing NO_STORE (exit 3) for anyone without their own `~/.dig`. `cat` now tries the local store ONLY when it matches the URN's store id (fast, offline — the existing round-trip path), and otherwise resolves via the §5.3 client->node ladder (--node/$DIG_NODE_URL/config > dig.local > localhost > rpc.dig.net), mirroring `pull`'s network read. The bare 64-hex retrieval-key form is unchanged and still requires the active store. Patch bump (0.10.0 -> 0.10.1): backwards-compatible bug fix, no API/behavior break for existing callers. Closes #227
MichaelTaylor3d
added a commit
that referenced
this pull request
Jul 10, 2026
… a local store (#11) `digstore cat <full urn:dig:...>` required an active local store even though a full URN is self-contained (store id + optional pinned root), failing NO_STORE (exit 3) for anyone without their own `~/.dig`. `cat` now tries the local store ONLY when it matches the URN's store id (fast, offline — the existing round-trip path), and otherwise resolves via the §5.3 client->node ladder (--node/$DIG_NODE_URL/config > dig.local > localhost > rpc.dig.net), mirroring `pull`'s network read. The bare 64-hex retrieval-key form is unchanged and still requires the active store. Patch bump (0.10.0 -> 0.10.1): backwards-compatible bug fix, no API/behavior break for existing callers. Closes #227 Co-Authored-By: Claude <noreply@anthropic.com>
MichaelTaylor3d
added a commit
that referenced
this pull request
Jul 10, 2026
… a local store (#11) `digstore cat <full urn:dig:...>` required an active local store even though a full URN is self-contained (store id + optional pinned root), failing NO_STORE (exit 3) for anyone without their own `~/.dig`. `cat` now tries the local store ONLY when it matches the URN's store id (fast, offline — the existing round-trip path), and otherwise resolves via the §5.3 client->node ladder (--node/$DIG_NODE_URL/config > dig.local > localhost > rpc.dig.net), mirroring `pull`'s network read. The bare 64-hex retrieval-key form is unchanged and still requires the active store. Patch bump (0.10.0 -> 0.10.1): backwards-compatible bug fix, no API/behavior break for existing callers. Closes #227 Co-Authored-By: Claude <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
digstore cat <full urn:dig:...>failedNO_STORE(exit 3) even though a full URN is self-contained (store id + optional pinned root) — reproduced live per #227.catnow tries the LOCAL store only when it backs the SAME store the URN names (fast, offline — the existing "cat my own just-committed content" round-trip path, unchanged in outcome). Otherwise it resolves via the §5.3 client->node ladder (--node/$DIG_NODE_URL/node.url>dig.local>localhost>rpc.dig.net), mirroringpull's network read (pull_urn_resource) — including the §8.5 keyless-URN default-view (index.html, falling back to the empty key) resolved over the network via retry rather than a local manifest read.canonical_resource_urn), matching what the generation manifest records at commit time, regardless of whether the input URN happens to carry aroot_hash.Blast radius (gitnexus
detect_changes, scope=all)High risk flagged because the change touches
commands::mod::dispatch(the central command router) — expected, sincecatneeded its own store-resolution branch inserted before the shared store-scoped gate. Affected symbols:cat::run/cat_by_urn/cat_by_retrieval_key/write_out,commands::mod::dispatch,pull::rpc_base(madepub(crate)for reuse),cli::CatArgs. No other command's dispatch path is touched. Verified via the full workspace test suite (cargo test --workspace --locked, 395+ tests) — 0 failures, including the pre-existing decoy/tamper verification-failure tests that must still hard-fail rather than silently retry over the network.Test plan
crates/digstore-cli/tests/cli_cat_urn_no_store.rsFIRST (confirmed RED against the pre-fix code — reproduced the exactNO_STORE/NotFoundfailures), then implemented the fix (GREEN).cat_full_urn_with_no_local_store_resolves_via_node_ladder— no.digever created,--nodepointed at a fakedig.getContentresponder, decrypts correctly.cat_keyless_full_urn_with_no_local_store_defaults_to_index_html— §8.5 default view over the network.cat_keyless_full_urn_falls_back_to_empty_key_when_index_html_missing— network 404-then-retry fallback.cat_full_urn_for_a_different_store_than_the_local_one_resolves_via_network— a local store IS initialized but for a DIFFERENT store id; routing is keyed on a store-id match, not "any local store exists".cli_cat_roundtrip.rs(5 tests, incl.cat_unknown_resource_decoy_fails_verification_exit_5) still green — the local fast path and its anti-decoy verification are unchanged.cargo fmt --all -- --check,cargo clippy -p digstore-cli --all-targets --all-features -- -D warningsclean.cargo test --workspace --locked— 0 failures.cargo install --path crates/digstore-cli --force --locked, then manually verified the exact repro against the GLOBALLY INSTALLED binary (PATH-resolved, notcargo_bin) with a fake node — passed, then removed the scratch verification file (not part of the permanent suite).llvm-covstep inci.yml, confirmed) — pre-existing gap, out of scope for this routine fix. Localcargo llvm-covhit an unrelated native-toolchain (libz-sys/CMake) issue in this sandbox; the new code is covered by 4 new integration tests + the existing local-path regression suite.Version bumped
0.10.0->0.10.1(patch — backwards-compatible bug fix,fix:, no API/behavior break for existing callers).Closes #227