refactor(sdk): extract transport-free query core into dash-platform-queries - #4388
refactor(sdk): extract transport-free query core into dash-platform-queries#4388PastaPastaPasta wants to merge 4 commits into
Conversation
…ueries Split rs-sdk per the maintainer guidance to refactor rather than duplicate: the query-building, wire-encoding, and proof-decoding core that a transport-free embedder needs now lives in a new packages/dash-platform-queries crate, and rs-sdk depends on it and re-exports every moved item at its old path, so no rs-sdk consumer changes imports. Moved out of rs-sdk: DocumentQuery and its wire encoders (document_query.rs), the count/sum/average/ranked proof helpers and their FromProof aggregate views (DocumentCount, DocumentSum, DocumentAverage, DocumentSplitCounts, DocumentSplitSums, DocumentSplitAverages, DocumentRankedEntries), DocumentHistoryQuery, block_info_from_metadata, QuerySettings, FinalizedEpochQuery, ensure_valid_state_transition_structure, and the DPNS username helpers (convert_to_homograph_safe_chars, is_valid_username, is_contested_username). Sdk-bound pieces stay behind: the contract-fetching DocumentQuery constructor (now the DocumentQuerySdk extension trait), the Query<GetDocumentsRequest> encoder impl, the Fetch bindings for the aggregate views, and the Query impls for FinalizedEpochQuery. QuerySettings loses its request_settings field: it was documented dead weight (not consulted by any encoder) and was the only rs-dapi-client tie in the moved struct. Sdk::query_settings and the few test construction sites were updated accordingly. The new crate has its own small thiserror enum (Config/Drive/Protocol); rs-sdk converts it via From, so existing ? call sites keep compiling. wasm-sdk gains the matching From impl for WasmSdkError, routed through SdkError so the mapping is unchanged. Coherence fallout: with DocumentQuery now foreign to rs-sdk, the blanket 'impl Query<T> for T where T: TransportRequest' would conflict with the explicit identity impl for DocumentQuery. The blanket is now additionally bounded by a local, explicitly-implemented WireQuery marker covering every wire request proto (list mirrors rs-dapi-client's TransportRequest impls); rustc can then prove the impl sets disjoint. The new crate's dependency tree is transport-free: no rs-dapi-client, hyper, rustls, or tonic transport.
dapi-grpc gets a crate-level feature table (including the new transport feature and the types-only build recipe), dash-platform-queries gets a README describing who the crate is for and what lives in it, and rs-sdk's README points transport-free embedders at the split crate.
Feature unification hides transport-stack regressions in whole-workspace builds, so add a PR-time step checking the standalone graphs (types-only dapi-grpc, drive-proof-verifier, dash-platform-queries) and failing if hyper, rustls, or tower leaks into drive-proof-verifier's tree. Add both verification crates to the nightly per-feature check matrix and to the check-features tool's crate list.
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds the transport-free ChangesTransport-free query extraction
Estimated code review effort: 4 (Complex) | ~45 minutes Mergeability Score: 🟡 Moderate · up to The refactor currently risks sending document queries with proofs enabled when callers disable them and may break existing consumers using the prior DocumentQuery constructor, contradicting the stated compatibility goal. These bounded correctness and integration issues should be fixed or explicitly accepted before merging. Sequence Diagram(s)sequenceDiagram
participant SDK
participant DocumentQuerySdk
participant dash-platform-queries
participant DAPI
SDK->>DocumentQuerySdk: create SDK-bound document query
DocumentQuerySdk->>DAPI: fetch data contract
DAPI-->>DocumentQuerySdk: return contract metadata
DocumentQuerySdk->>dash-platform-queries: build and encode query
dash-platform-queries-->>SDK: return typed query or proof result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
⛔ Blockers found — Opus deferred (commit fb66886) |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/tests-rs-workspace.yml (1)
201-205: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winGuard the new crate's transport-free dependency graph.
cargo check -p dash-platform-queriesverifies compilation only. Thecargo treeassertions cover other packages, notdash-platform-queries. A futuretokio,tonic,hyper,rustls, ortowerdependency could pass this job and violate the crate's transport-free contract. Add an equivalentcargo treeassertion or verify that another workflow enforces it.Suggested check
cargo check -p dash-platform-queries --locked + for banned in hyper rustls tower tokio tonic; do + if cargo tree --locked -p dash-platform-queries -e normal -i "$banned" 2>/dev/null | grep -q .; then + echo "::error::$banned leaked into dash-platform-queries's dependency tree" + exit 1 + fi + done🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/tests-rs-workspace.yml around lines 201 - 205, Add a transport-free dependency assertion alongside the dash-platform-queries cargo check in “Check transport-free feature cuts”. Ensure its cargo tree validation fails if tokio, tonic, hyper, rustls, or tower enters the crate’s dependency graph, matching the existing assertions for other packages.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/dash-platform-queries/README.md`:
- Around line 19-20: Define valid Markdown reference links for ContextProvider
and drive-proof-verifier in the README, or replace both references with inline
links, ensuring the rendered documentation makes each referenced project or
component clickable.
In `@packages/dash-platform-queries/src/documents/document_query.rs`:
- Line 300: Update the examples at
packages/dash-platform-queries/src/documents/document_query.rs:300,
packages/dash-platform-queries/src/documents/document_ranked_entries.rs:83, and
packages/dash-platform-queries/src/documents/document_ranked_entries.rs:130 by
moving SDK-dependent examples to packages/rs-sdk documentation or rewriting them
to use dash-platform-queries APIs; after doing so, restore the rust,no_run
annotation on all three documentation fences.
In `@packages/rs-sdk/src/platform/documents/document_query_sdk.rs`:
- Around line 61-68: Update DocumentQuery::query to apply settings.prove to the
encoded GetDocumentsRequest for both supported wire versions, rather than only
passing settings.protocol_version. Preserve the existing versioned conversion
and return behavior, and add regression coverage verifying prove: false is
encoded when configured through QuerySettings.
- Around line 18-21: Preserve source compatibility for callers importing only
DocumentQuery by exposing new_with_data_contract_id through an API that does not
require DocumentQuerySdk to be explicitly in scope. Update the DocumentQuerySdk
extension-trait arrangement or add a compatible facade while retaining the
existing DocumentQuery::new_with_data_contract_id(...) call pattern; otherwise
explicitly treat the change as a versioned breaking API change.
---
Nitpick comments:
In @.github/workflows/tests-rs-workspace.yml:
- Around line 201-205: Add a transport-free dependency assertion alongside the
dash-platform-queries cargo check in “Check transport-free feature cuts”. Ensure
its cargo tree validation fails if tokio, tonic, hyper, rustls, or tower enters
the crate’s dependency graph, matching the existing assertions for other
packages.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5a8827f5-26a3-4480-b7f4-bb2ddb628fb0
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (58)
.github/package-filters/rs-packages-direct.yml.github/package-filters/rs-packages-no-workflows.yml.github/package-filters/rs-packages.yml.github/workflows/tests-rs-nightly-long-running.yml.github/workflows/tests-rs-workspace.ymlCargo.tomlpackages/check-features/src/main.rspackages/dapi-grpc/src/lib.rspackages/dash-platform-queries/Cargo.tomlpackages/dash-platform-queries/README.mdpackages/dash-platform-queries/src/block_info_from_metadata.rspackages/dash-platform-queries/src/documents/average_proof_helpers.rspackages/dash-platform-queries/src/documents/count_proof_helpers.rspackages/dash-platform-queries/src/documents/document_average.rspackages/dash-platform-queries/src/documents/document_count.rspackages/dash-platform-queries/src/documents/document_history_query.rspackages/dash-platform-queries/src/documents/document_query.rspackages/dash-platform-queries/src/documents/document_ranked_entries.rspackages/dash-platform-queries/src/documents/document_split_averages.rspackages/dash-platform-queries/src/documents/document_split_counts.rspackages/dash-platform-queries/src/documents/document_split_sums.rspackages/dash-platform-queries/src/documents/document_sum.rspackages/dash-platform-queries/src/documents/mod.rspackages/dash-platform-queries/src/documents/ranked_proof_helpers.rspackages/dash-platform-queries/src/documents/sum_proof_helpers.rspackages/dash-platform-queries/src/dpns_usernames.rspackages/dash-platform-queries/src/error.rspackages/dash-platform-queries/src/lib.rspackages/dash-platform-queries/src/mock.rspackages/dash-platform-queries/src/query_settings.rspackages/dash-platform-queries/src/transition/mod.rspackages/dash-platform-queries/src/transition/validation.rspackages/dash-platform-queries/src/types/finalized_epoch.rspackages/dash-platform-queries/src/types/mod.rspackages/rs-sdk/Cargo.tomlpackages/rs-sdk/README.mdpackages/rs-sdk/src/error.rspackages/rs-sdk/src/lib.rspackages/rs-sdk/src/platform.rspackages/rs-sdk/src/platform/delegate.rspackages/rs-sdk/src/platform/documents/document_query_sdk.rspackages/rs-sdk/src/platform/documents/fetch_bindings.rspackages/rs-sdk/src/platform/documents/mod.rspackages/rs-sdk/src/platform/dpns_usernames/mod.rspackages/rs-sdk/src/platform/identities_contract_keys_query.rspackages/rs-sdk/src/platform/query.rspackages/rs-sdk/src/platform/query_settings.rspackages/rs-sdk/src/platform/transition/validation.rspackages/rs-sdk/src/platform/types/epoch.rspackages/rs-sdk/src/platform/types/evonode.rspackages/rs-sdk/src/platform/types/finalized_epoch.rspackages/rs-sdk/src/sdk.rspackages/rs-sdk/tests/fetch/common.rspackages/rs-sdk/tests/fetch/document.rspackages/rs-sdk/tests/fetch/document_query_v0_v1.rspackages/rs-sdk/tests/fetch/mock_fetch.rspackages/rs-sdk/tests/fetch/tokens/token_contract_info.rspackages/wasm-sdk/src/error.rs
💤 Files with no reviewable changes (3)
- packages/rs-sdk/src/platform/query_settings.rs
- packages/rs-sdk/tests/fetch/common.rs
- packages/rs-sdk/tests/fetch/tokens/token_contract_info.rs
| [`ContextProvider`], and verifies every response proof with | ||
| [`drive-proof-verifier`]. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Define the Markdown reference links.
[ContextProvider] and [drive-proof-verifier] have no definitions in this README. The rendered document therefore does not provide links for these references. Add reference definitions or replace them with valid inline links.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/dash-platform-queries/README.md` around lines 19 - 20, Define valid
Markdown reference links for ContextProvider and drive-proof-verifier in the
README, or replace both references with inline links, ensuring the rendered
documentation makes each referenced project or component clickable.
| /// # The 5th-best group | ||
| /// | ||
| /// ```rust,no_run | ||
| /// ```rust,ignore |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- targeted diff ---'
git diff -- packages/dash-platform-queries/src/documents/document_query.rs packages/dash-platform-queries/src/documents/document_ranked_entries.rs
printf '%s\n' '--- document_query outline ---'
ast-grep outline packages/dash-platform-queries/src/documents/document_query.rs
printf '%s\n' '--- document_ranked_entries outline ---'
ast-grep outline packages/dash-platform-queries/src/documents/document_ranked_entries.rs
printf '%s\n' '--- relevant source sections ---'
sed -n '270,330p' packages/dash-platform-queries/src/documents/document_query.rs
sed -n '55,145p' packages/dash-platform-queries/src/documents/document_ranked_entries.rs
printf '%s\n' '--- package and workspace manifests ---'
sed -n '1,220p' packages/dash-platform-queries/Cargo.toml
sed -n '1,180p' Cargo.toml
printf '%s\n' '--- referenced imports and example symbols ---'
rg -n 'DocumentQuery|DocumentRankedEntry|no_run|ignore|dash_sdk|Query' packages/dash-platform-queries/src/documents/document_query.rs packages/dash-platform-queries/src/documents/document_ranked_entries.rs packages/dash-platform-queries/Cargo.tomlRepository: dashpay/platform
Length of output: 25056
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- repository state ---'
git status --short
git diff --stat
printf '%s\n' '--- current and parent versions of the affected lines ---'
git show HEAD:packages/dash-platform-queries/src/documents/document_query.rs | sed -n '288,318p'
git show HEAD:packages/dash-platform-queries/src/documents/document_ranked_entries.rs | sed -n '75,142p'
printf '%s\n' '--- package module exports ---'
fd -t f . packages/dash-platform-queries | sort
rg -n 'pub mod|pub use|dash_sdk|dash-platform-queries|rustdoc|test.*doc|doc.*test' packages/dash-platform-queries packages/rs-sdk .github Cargo.toml
printf '%s\n' '--- SDK declarations and re-exports ---'
rg -n '^name\s*=\s*"dash-sdk"|dash-platform-queries|pub use .*DocumentQuery|pub use .*DocumentRankedEntries|pub mod documents' packages/rs-sdk packages/dash-platform-queries
printf '%s\n' '--- all matching documentation fences ---'
rg -n -C 3 'rust,(no_run|ignore)|dash_sdk::platform|dash_sdk::drive' packages/dash-platform-queries packages/rs-sdkRepository: dashpay/platform
Length of output: 50375
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- extracted crate exports and error type ---'
sed -n '1,120p' packages/dash-platform-queries/src/lib.rs
sed -n '1,80p' packages/dash-platform-queries/src/documents/mod.rs
sed -n '1,120p' packages/dash-platform-queries/src/error.rs
printf '%s\n' '--- SDK document-query integration modules ---'
sed -n '1,180p' packages/rs-sdk/src/platform/documents/document_query_sdk.rs
sed -n '1,100p' packages/rs-sdk/src/platform/documents/mod.rs
sed -n '1,70p' packages/rs-sdk/src/platform.rs
printf '%s\n' '--- SDK manifest dependencies and package identity ---'
rg -n -C 3 '^\[package\]|^name\s*=|dash-platform-queries|drive-proof-verifier|futures' packages/rs-sdk/Cargo.toml
printf '%s\n' '--- doctest workflow commands ---'
sed -n '460,505p' .github/workflows/tests-rs-workspace.yml
sed -n '210,240p' .github/workflows/tests-rs-wallet.yml
sed -n '430,465p' .github/workflows/tests.yml
printf '%s\n' '--- focused documentation ownership references ---'
rg -n -C 4 'transport-free|SDK-dependent|document_query_sdk|DocumentRankedEntries|ranked entries' packages/dash-platform-queries/README.md packages/rs-sdk/README.md packages/rs-sdk/src/platform/documents packages/rs-sdk/src/platformRepository: dashpay/platform
Length of output: 27859
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
import re
import tomllib
root = Path("packages/dash-platform-queries")
manifest = tomllib.loads((root / "Cargo.toml").read_text())
declared = set(manifest.get("dependencies", {})) | set(manifest.get("dev-dependencies", {}))
declared_crates = {name.replace("-", "_") for name in declared}
files = [
root / "src/documents/document_query.rs",
root / "src/documents/document_ranked_entries.rs",
]
fence_re = re.compile(r"```rust,(no_run|ignore)\n(.*?)```", re.S)
use_re = re.compile(r"^\s*(?:#\s*)?use\s+([A-Za-z_][A-Za-z0-9_]*)", re.M)
found = []
for path in files:
text = path.read_text()
for match in fence_re.finditer(text):
flag, body = match.groups()
line = text[:match.start()].count("\n") + 1
roots = sorted(set(use_re.findall(body)))
missing = [name for name in roots if name not in declared_crates and name not in {"std", "core", "alloc"}]
found.append((path.as_posix(), line, flag, roots, missing))
print("Declared crate roots:", ", ".join(sorted(declared_crates)))
print("Affected documentation fences:")
for path, line, flag, roots, missing in found:
print(f"{path}:{line}: rust,{flag}; imports={roots}; undeclared={missing}")
assert len(found) == 3
assert all(flag == "ignore" for _, _, flag, _, _ in found)
assert all("dash_sdk" in missing for _, _, _, _, missing in found)
print("Conclusion: all three fences suppress doctest compilation, and all three import undeclared dash_sdk APIs.")
PYRepository: dashpay/platform
Length of output: 274
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
import re
root = Path("packages/dash-platform-queries")
manifest_text = (root / "Cargo.toml").read_text()
# Read dependency-table keys without requiring a TOML parser.
declared = set()
table = None
for line in manifest_text.splitlines():
stripped = line.strip()
if stripped.startswith("[") and stripped.endswith("]"):
table = stripped
continue
if table in {"[dependencies]", "[dev-dependencies]"}:
match = re.match(r"([A-Za-z0-9_-]+)\s*=", stripped)
if match:
declared.add(match.group(1).replace("-", "_"))
files = [
root / "src/documents/document_query.rs",
root / "src/documents/document_ranked_entries.rs",
]
fence_re = re.compile(r"```rust,(no_run|ignore)\n(.*?)```", re.S)
use_re = re.compile(r"^\s*(?:#\s*)?use\s+([A-Za-z_][A-Za-z0-9_]*)", re.M)
found = []
for path in files:
text = path.read_text()
for match in fence_re.finditer(text):
flag, body = match.groups()
line = text[:match.start()].count("\n") + 1
roots = sorted(set(use_re.findall(body)))
missing = [
name for name in roots
if name not in declared and name not in {"std", "core", "alloc"}
]
found.append((path.as_posix(), line, flag, roots, missing))
print("Declared crate roots:", ", ".join(sorted(declared)))
print("Documentation fences:")
for path, line, flag, roots, missing in found:
print(f"{path}:{line}: rust,{flag}; imports={roots}; undeclared={missing}")
assert len(found) == 3
assert all(flag == "ignore" for _, _, flag, _, _ in found)
assert all("dash_sdk" in missing for _, _, _, _, missing in found)
print("Conclusion: all three fences suppress doctest compilation, and all three import undeclared dash_sdk APIs.")
PYRepository: dashpay/platform
Length of output: 758
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
import re
root = Path("packages/dash-platform-queries")
manifest_text = (root / "Cargo.toml").read_text()
declared = set()
table = None
for line in manifest_text.splitlines():
stripped = line.strip()
if stripped.startswith("[") and stripped.endswith("]"):
table = stripped
continue
if table in {"[dependencies]", "[dev-dependencies]"}:
match = re.match(r"([A-Za-z0-9_-]+)\s*=", stripped)
if match:
declared.add(match.group(1).replace("-", "_"))
files = [
root / "src/documents/document_query.rs",
root / "src/documents/document_ranked_entries.rs",
]
fence_re = re.compile(r"```rust,(no_run|ignore)\n(.*?)```", re.S)
use_re = re.compile(r"^\s*(?:#\s*)?use\s+([A-Za-z_][A-Za-z0-9_]*)", re.M)
found = []
for path in files:
text = path.read_text()
for match in fence_re.finditer(text):
flag, body = match.groups()
line = text[:match.start()].count("\n") + 1
normalized = "\n".join(
re.sub(r"^\s*//!?\s?", "", line) for line in body.splitlines()
)
roots = sorted(set(use_re.findall(normalized)))
missing = [
name for name in roots
if name not in declared and name not in {"std", "core", "alloc"}
]
found.append((path.as_posix(), line, flag, roots, missing))
print("Declared crate roots:", ", ".join(sorted(declared)))
print("Documentation fences:")
for path, line, flag, roots, missing in found:
print(f"{path}:{line}: rust,{flag}; imports={roots}; undeclared={missing}")
assert len(found) == 3
assert all(flag == "ignore" for _, _, flag, _, _ in found)
assert all("dash_sdk" in missing for _, _, _, _, missing in found)
print("Conclusion: all three fences suppress doctest compilation, and all three import undeclared dash_sdk APIs.")Repository: dashpay/platform
Length of output: 931
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
import re
root = Path("packages/dash-platform-queries")
manifest_text = (root / "Cargo.toml").read_text()
declared = set()
table = None
for line in manifest_text.splitlines():
stripped = line.strip()
if stripped.startswith("[") and stripped.endswith("]"):
table = stripped
continue
if table in {"[dependencies]", "[dev-dependencies]"}:
match = re.match(r"([A-Za-z0-9_-]+)\s*=", stripped)
if match:
declared.add(match.group(1).replace("-", "_"))
files = [
root / "src/documents/document_query.rs",
root / "src/documents/document_ranked_entries.rs",
]
fence_re = re.compile(r"```rust,(no_run|ignore)\n(.*?)```", re.S)
use_re = re.compile(r"^\s*(?:#\s*)?use\s+([A-Za-z_][A-Za-z0-9_]*)", re.M)
found = []
for path in files:
text = path.read_text()
for match in fence_re.finditer(text):
flag, body = match.groups()
line = text[:match.start()].count("\n") + 1
normalized = "\n".join(
re.sub(r"^\s*//[/!]?\s?", "", source_line)
for source_line in body.splitlines()
)
roots = sorted(set(use_re.findall(normalized)))
missing = [
name for name in roots
if name not in declared and name not in {"std", "core", "alloc"}
]
found.append((path.as_posix(), line, flag, roots, missing))
print("Declared crate roots:", ", ".join(sorted(declared)))
print("Documentation fences:")
for path, line, flag, roots, missing in found:
print(f"{path}:{line}: rust,{flag}; imports={roots}; undeclared={missing}")
assert len(found) == 3
assert all(flag == "ignore" for _, _, flag, _, _ in found)
assert all("dash_sdk" in missing for _, _, _, _, missing in found)
print("Conclusion: all three fences suppress doctest compilation, and all three import undeclared dash_sdk APIs.")
PYRepository: dashpay/platform
Length of output: 881
Move SDK-dependent examples or restore rust,no_run.
These examples import undeclared dash_sdk APIs, and one also imports undeclared futures. Move them to packages/rs-sdk documentation or rewrite them with dash-platform-queries APIs. Then restore rust,no_run at all three fences.
📍 Affects 2 files
packages/dash-platform-queries/src/documents/document_query.rs#L300-L300(this comment)packages/dash-platform-queries/src/documents/document_ranked_entries.rs#L83-L83packages/dash-platform-queries/src/documents/document_ranked_entries.rs#L130-L130
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/dash-platform-queries/src/documents/document_query.rs` at line 300,
Update the examples at
packages/dash-platform-queries/src/documents/document_query.rs:300,
packages/dash-platform-queries/src/documents/document_ranked_entries.rs:83, and
packages/dash-platform-queries/src/documents/document_ranked_entries.rs:130 by
moving SDK-dependent examples to packages/rs-sdk documentation or rewriting them
to use dash-platform-queries APIs; after doing so, restore the rust,no_run
annotation on all three documentation fences.
| /// Kept as an extension trait because [`DocumentQuery`] is defined in the | ||
| /// transport-free `dash-platform-queries` crate, so its Sdk-dependent | ||
| /// constructor cannot be an inherent method there. Bring this trait into | ||
| /// scope to keep calling `DocumentQuery::new_with_data_contract_id(...)`. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- candidate file outline ---'
ast-grep outline packages/rs-sdk/src/platform/documents/document_query_sdk.rs || true
printf '%s\n' '--- candidate source ---'
cat -n packages/rs-sdk/src/platform/documents/document_query_sdk.rs
printf '%s\n' '--- DocumentQuery declarations and constructor references ---'
rg -n -C 3 'struct DocumentQuery|impl DocumentQuery|new_with_data_contract_id|trait DocumentQuerySdk|DocumentQuerySdk' packages/rs-sdk packages -g '*.rs'
printf '%s\n' '--- relevant test imports and calls ---'
cat -n packages/rs-sdk/tests/fetch/mock_fetch.rs
printf '%s\n' '--- SDK checklist ---'
cat -n packages/rs-sdk/README.mdRepository: dashpay/platform
Length of output: 35498
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- targeted working-tree change ---'
git diff --stat -- packages/rs-sdk/src/platform/documents/document_query_sdk.rs packages/rs-sdk/src/platform/documents/mod.rs packages/rs-sdk/tests/fetch/mock_fetch.rs packages/rs-sdk/tests/fetch/document.rs
git diff -- packages/rs-sdk/src/platform/documents/document_query_sdk.rs packages/rs-sdk/src/platform/documents/mod.rs packages/rs-sdk/tests/fetch/mock_fetch.rs packages/rs-sdk/tests/fetch/document.rs
printf '%s\n' '--- public platform re-exports ---'
rg -n -C 4 'pub use.*DocumentQuery|pub mod documents|mod documents|DocumentQuerySdk' packages/rs-sdk/src -g '*.rs'
printf '%s\n' '--- original DocumentQuery implementation ---'
cat -n packages/dash-platform-queries/src/documents/document_query.rs | sed -n '45,190p'
printf '%s\n' '--- standalone Rust method-resolution verifier ---'
if command -v rustc >/dev/null 2>&1; then
cat >/tmp/document_query_trait_resolution.rs <<'RS'
trait SdkBound {
fn new_with_data_contract_id() -> Self;
}
struct DocumentQuery;
impl SdkBound for DocumentQuery {
fn new_with_data_contract_id() -> Self {
DocumentQuery
}
}
fn with_trait_in_scope() {
use crate::SdkBound;
let _ = DocumentQuery::new_with_data_contract_id();
}
fn main() {
with_trait_in_scope();
}
RS
rustc --edition=2021 --crate-name document_query_trait_resolution \
/tmp/document_query_trait_resolution.rs \
-o /tmp/document_query_trait_resolution
printf '%s\n' 'trait-in-scope case: compiles'
sed '/fn with_trait_in_scope()/,/^}/d' \
/tmp/document_query_trait_resolution.rs \
| sed '/fn main()/,$d' >/tmp/document_query_trait_resolution_without_import.rs
cat >>/tmp/document_query_trait_resolution_without_import.rs <<'RS'
fn main() {
let _ = DocumentQuery::new_with_data_contract_id();
}
RS
if rustc --edition=2021 --crate-name document_query_trait_resolution_without_import \
/tmp/document_query_trait_resolution_without_import.rs \
-o /tmp/document_query_trait_resolution_without_import \
2>/tmp/document_query_trait_resolution_without_import.err; then
printf '%s\n' 'trait-out-of-scope case: unexpectedly compiles'
else
printf '%s\n' 'trait-out-of-scope case: fails as expected'
cat /tmp/document_query_trait_resolution_without_import.err
fi
else
printf '%s\n' 'rustc unavailable; source-level verification only'
fiRepository: dashpay/platform
Length of output: 11925
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- repository revision context ---'
git status --short
git log --oneline -5 -- packages/rs-sdk/src/platform/documents/document_query_sdk.rs packages/rs-sdk/src/platform/documents/mod.rs packages/dash-platform-queries/src/documents/document_query.rs
printf '%s\n' '--- parent revision: SDK document query files ---'
parent="$(git rev-parse HEAD^)"
if git cat-file -e "$parent:packages/rs-sdk/src/platform/documents/document_query_sdk.rs" 2>/dev/null; then
git show "$parent:packages/rs-sdk/src/platform/documents/document_query_sdk.rs" | cat -n
else
printf '%s\n' 'document_query_sdk.rs did not exist in the parent revision'
fi
printf '%s\n' '--- parent revision: DocumentQuery constructor references ---'
git grep -n -C 3 'new_with_data_contract_id\|impl DocumentQuery' "$parent" -- \
packages/rs-sdk packages/dash-platform-queries '*.rs' || true
printf '%s\n' '--- corrected standalone Rust method-resolution verifier ---'
if command -v rustc >/dev/null 2>&1; then
cat >/tmp/document_query_trait_resolution_with_import.rs <<'RS'
struct DocumentQuery;
mod sdk_api {
use super::DocumentQuery;
pub trait DocumentQuerySdk: Sized {
fn new_with_data_contract_id() -> Self;
}
impl DocumentQuerySdk for DocumentQuery {
fn new_with_data_contract_id() -> Self {
DocumentQuery
}
}
}
fn main() {
use sdk_api::DocumentQuerySdk;
let _ = DocumentQuery::new_with_data_contract_id();
}
RS
cat >/tmp/document_query_trait_resolution_without_import.rs <<'RS'
struct DocumentQuery;
mod sdk_api {
use super::DocumentQuery;
pub trait DocumentQuerySdk: Sized {
fn new_with_data_contract_id() -> Self;
}
impl DocumentQuerySdk for DocumentQuery {
fn new_with_data_contract_id() -> Self {
DocumentQuery
}
}
}
fn main() {
let _ = DocumentQuery::new_with_data_contract_id();
}
RS
rustc --edition=2021 \
/tmp/document_query_trait_resolution_with_import.rs \
-o /tmp/document_query_trait_resolution_with_import
printf '%s\n' 'trait-in-scope case: compiles'
if rustc --edition=2021 \
/tmp/document_query_trait_resolution_without_import.rs \
-o /tmp/document_query_trait_resolution_without_import \
2>/tmp/document_query_trait_resolution_without_import.err; then
printf '%s\n' 'trait-out-of-scope case: unexpectedly compiles'
else
printf '%s\n' 'trait-out-of-scope case: fails as expected'
cat /tmp/document_query_trait_resolution_without_import.err
fi
else
printf '%s\n' 'rustc unavailable'
fiRepository: dashpay/platform
Length of output: 12548
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- current revision ---'
git rev-parse HEAD
git show --stat --oneline HEAD
printf '%s\n' '--- commits that added or removed the constructor ---'
git log --all --oneline -S'new_with_data_contract_id' -- \
packages/rs-sdk packages/dash-platform-queries
printf '%s\n' '--- commits that changed DocumentQuery ownership or re-exports ---'
git log --all --oneline -S'pub struct DocumentQuery' -- \
packages/rs-sdk packages/dash-platform-queries
git log --all --oneline -S'pub use documents::document_query::DocumentQuery' -- \
packages/rs-sdk
printf '%s\n' '--- refactor commit details ---'
git show --format=fuller --stat 2c3f1fda9
git show --format= --find-renames --find-copies 2c3f1fda9 -- \
packages/rs-sdk/src/platform/documents \
packages/rs-sdk/src/platform.rs \
packages/dash-platform-queries/src/documents/document_query.rs \
packages/rs-sdk/tests/fetch
printf '%s\n' '--- all public constructor-like APIs for DocumentQuery ---'
rg -n -C 3 'DocumentQuery::|impl DocumentQuery|new_with_' packages/rs-sdk packages/dash-platform-queries -g '*.rs'Repository: dashpay/platform
Length of output: 853
🏁 Script executed:
#!/bin/bash
set -u
commit=2c3f1fda9
parent="$(git rev-parse "${commit}^" 2>/dev/null || true)"
printf '%s\n' '--- refactor commit and parent ---'
printf 'commit: %s\nparent: %s\n' "$commit" "$parent"
printf '%s\n' '--- refactor commit summary ---'
git show --format=fuller --stat "$commit" || true
printf '%s\n' '--- refactor commit targeted patch ---'
git show --format= --find-renames --find-copies "$commit" -- \
packages/rs-sdk/src/platform/documents \
packages/rs-sdk/src/platform.rs \
packages/dash-platform-queries/src/documents/document_query.rs \
packages/rs-sdk/tests/fetch || true
printf '%s\n' '--- parent constructor references ---'
if [ -n "$parent" ]; then
git grep -n -C 4 'new_with_data_contract_id\|impl DocumentQuery' "$parent" -- \
packages/rs-sdk packages/dash-platform-queries '*.rs' || true
fi
printf '%s\n' '--- refactor-commit constructor references ---'
git grep -n -C 4 'new_with_data_contract_id\|impl DocumentQuery' "$commit" -- \
packages/rs-sdk packages/dash-platform-queries '*.rs' || true
printf '%s\n' '--- local history for the exact API symbol ---'
git log --all --oneline --no-renames -S'new_with_data_contract_id' -- \
packages/rs-sdk packages/dash-platform-queries || trueRepository: dashpay/platform
Length of output: 50375
Preserve DocumentQuery::new_with_data_contract_id(...) compatibility.
The refactor removes the inherent constructor and replaces it with DocumentQuerySdk. Rust requires DocumentQuerySdk to be in scope for this associated call, so existing consumers that import only DocumentQuery no longer compile. Add a source-compatible facade, or document and version this as a breaking API change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/rs-sdk/src/platform/documents/document_query_sdk.rs` around lines 18
- 21, Preserve source compatibility for callers importing only DocumentQuery by
exposing new_with_data_contract_id through an API that does not require
DocumentQuerySdk to be explicitly in scope. Update the DocumentQuerySdk
extension-trait arrangement or add a compatible facade while retaining the
existing DocumentQuery::new_with_data_contract_id(...) call pattern; otherwise
explicitly treat the change as a versioned breaking API change.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v4.2-dev #4388 +/- ##
============================================
- Coverage 86.81% 86.23% -0.58%
============================================
Files 2647 2664 +17
Lines 340850 343532 +2682
============================================
+ Hits 295913 296250 +337
- Misses 44937 47282 +2345
🚀 New features to boost your workflow:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Preliminary review — Codex only
The extraction does not satisfy two of its explicit guarantees: the new crate's native dependency graph still includes Tokio, and several public dash-sdk APIs are source-incompatible despite the stated absence of breaking changes. The transport-free CI check also does not inspect the new crate, while two documentation issues leave examples untested and references unresolved.
Source: reviewer backend gpt-5.6-sol; final verifier backend gpt-5.6-sol.
Orchestration-only: openclaw-agent/cliproxy/gpt-5.6-sol (not reviewer evidence).
Validated blockers were found in the Codex precheck. Opus is deferred until a fresh Codex revalidation clears the blocker gate.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed) - Verifier:
gpt-5.6-sol— verifier - Sonnet: not run (deferred by blocker gate)
🔴 4 blocking | 🟡 2 suggestion(s) | 💬 1 nitpick(s)
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-sdk/src/platform/documents/document_query_sdk.rs`:
- [BLOCKING] packages/rs-sdk/src/platform/documents/document_query_sdk.rs:16-31: Moving the constructor to an extension trait breaks existing SDK callers
`DocumentQuery::new_with_data_contract_id` was an inherent public method at the merge base. It is now provided by `DocumentQuerySdk`, which Rust requires callers to import before the associated-function syntax resolves. The SDK's own tests had to add that import, demonstrating that existing code importing only `dash_sdk::platform::DocumentQuery` no longer compiles. This contradicts the PR's explicit guarantee that SDK consumers need no import changes; preserve an SDK-facing source-compatible facade or classify and version this as a breaking API change.
In `packages/dash-platform-queries/src/query_settings.rs`:
- [BLOCKING] packages/dash-platform-queries/src/query_settings.rs:21-28: Removing the public request_settings field is source-incompatible
`dash_sdk::platform::QuerySettings` now re-exports this struct, but the merge-base type included `pub request_settings: &'a RequestSettings`. Existing callers that construct `QuerySettings` with a struct literal or read that field will fail to compile. The fact that current encoders do not use the field does not make removing a public field source-compatible. Keep a transport-free internal settings type if needed, but retain an SDK-facing compatibility layer under the historical public type.
In `packages/rs-sdk/src/platform/query.rs`:
- [BLOCKING] packages/rs-sdk/src/platform/query.rs:201-204: The new WireQuery bound narrows the public blanket implementation
At the merge base, every type satisfying `TransportRequest` received the blanket `Query<T> for T` implementation. Adding `WireQuery` removes that implementation for downstream crates' custom transport request types unless those crates are changed to implement a newly introduced SDK trait. Listing all in-workspace request types keeps this repository compiling but does not preserve the public blanket implementation for external consumers. Use a coherence strategy that does not narrow the existing public implementation, or treat the change as a versioned breaking API change.
In `packages/dash-platform-queries/Cargo.toml`:
- [BLOCKING] packages/dash-platform-queries/Cargo.toml:20-24: The transport-free crate still pulls Tokio and native networking features
The PR description explicitly promises no Tokio anywhere in this crate's dependency graph, but `dash-context-provider` is an unconditional normal dependency and itself unconditionally depends on `dash-async`. On native targets, `dash-async` enables Tokio's `rt`, `rt-multi-thread`, `time`, and `net` features, so the resulting normal graph includes Tokio plus its native networking support. The `dapi-grpc` code-generation path also retains Tokio-related support dependencies. The dependency cut therefore does not meet the stated no-Tokio embedder requirement; the context-provider/async boundary must be split or feature-gated so this crate's normal graph excludes Tokio.
In `.github/workflows/tests-rs-workspace.yml`:
- [SUGGESTION] .github/workflows/tests-rs-workspace.yml:205-211: CI does not inspect the new crate for banned transport dependencies
The step compiles `dash-platform-queries`, but its inverse dependency-tree assertions inspect only `drive-proof-verifier`. A direct or transitive `hyper`, `rustls`, or `tower` dependency unique to the new crate would pass this check, despite both the PR description and README claiming the new crate's dependency graph is guarded. Include `dash-platform-queries` in the package loop.
In `packages/dash-platform-queries/src/documents/document_query.rs`:
- [SUGGESTION] packages/dash-platform-queries/src/documents/document_query.rs:300: Moved SDK examples are now excluded from doctest compilation
This example and the two examples at `document_ranked_entries.rs:83` and `document_ranked_entries.rs:130` were `rust,no_run` doctests before the extraction. They now live in `dash-platform-queries`, still import undeclared `dash_sdk` APIs, and were changed to `rust,ignore`, so rustdoc no longer checks them. Move the SDK-specific examples back to SDK-owned documentation or rewrite them against dependencies exposed by `dash-platform-queries`, then restore `rust,no_run` so API drift is caught.
In `packages/dash-platform-queries/README.md`:
- [NITPICK] packages/dash-platform-queries/README.md:19-20: README reference links are undefined
`[ContextProvider]` and `[drive-proof-verifier]` use shortcut reference-link syntax, but the README defines neither reference. They therefore do not render as clickable links. Use inline repository links or add reference definitions.
| /// Sdk-bound extension methods for [`DocumentQuery`]. | ||
| /// | ||
| /// Kept as an extension trait because [`DocumentQuery`] is defined in the | ||
| /// transport-free `dash-platform-queries` crate, so its Sdk-dependent | ||
| /// constructor cannot be an inherent method there. Bring this trait into | ||
| /// scope to keep calling `DocumentQuery::new_with_data_contract_id(...)`. | ||
| #[allow(async_fn_in_trait)] | ||
| pub trait DocumentQuerySdk: Sized { | ||
| /// Create new document query for provided document type name and data contract ID. | ||
| /// | ||
| /// Note that this method will fetch data contract first. | ||
| async fn new_with_data_contract_id( | ||
| api: &Sdk, | ||
| data_contract_id: Identifier, | ||
| document_type_name: &str, | ||
| ) -> Result<Self, Error>; |
There was a problem hiding this comment.
🔴 Blocking: Moving the constructor to an extension trait breaks existing SDK callers
DocumentQuery::new_with_data_contract_id was an inherent public method at the merge base. It is now provided by DocumentQuerySdk, which Rust requires callers to import before the associated-function syntax resolves. The SDK's own tests had to add that import, demonstrating that existing code importing only dash_sdk::platform::DocumentQuery no longer compiles. This contradicts the PR's explicit guarantee that SDK consumers need no import changes; preserve an SDK-facing source-compatible facade or classify and version this as a breaking API change.
source: ['codex', 'coderabbit']
There was a problem hiding this comment.
Resolved in this update — Moving the constructor to an extension trait breaks existing SDK callers no longer present.
Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread.
| #[derive(Debug, Clone, Copy)] | ||
| pub struct QuerySettings<'a> { | ||
| /// Platform protocol version, used to pick wire encoding (V0 vs V1, etc). | ||
| pub protocol_version: &'a PlatformVersion, | ||
|
|
||
| /// Whether to request and verify cryptographic proofs. | ||
| pub prove: bool, | ||
| } |
There was a problem hiding this comment.
🔴 Blocking: Removing the public request_settings field is source-incompatible
dash_sdk::platform::QuerySettings now re-exports this struct, but the merge-base type included pub request_settings: &'a RequestSettings. Existing callers that construct QuerySettings with a struct literal or read that field will fail to compile. The fact that current encoders do not use the field does not make removing a public field source-compatible. Keep a transport-free internal settings type if needed, but retain an SDK-facing compatibility layer under the historical public type.
source: ['codex']
There was a problem hiding this comment.
Resolved in this update — Removing the public request_settings field is source-incompatible no longer present.
Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread.
| impl<T> Query<T> for T | ||
| where | ||
| T: TransportRequest + Sized + Send + Sync + Clone + Debug, | ||
| T: TransportRequest + WireQuery + Sized + Send + Sync + Clone + Debug, | ||
| T::Response: Send + Sync + Debug, |
There was a problem hiding this comment.
🔴 Blocking: The new WireQuery bound narrows the public blanket implementation
At the merge base, every type satisfying TransportRequest received the blanket Query<T> for T implementation. Adding WireQuery removes that implementation for downstream crates' custom transport request types unless those crates are changed to implement a newly introduced SDK trait. Listing all in-workspace request types keeps this repository compiling but does not preserve the public blanket implementation for external consumers. Use a coherence strategy that does not narrow the existing public implementation, or treat the change as a versioned breaking API change.
source: ['codex']
| dapi-grpc = { path = "../dapi-grpc", default-features = false, features = [ | ||
| "platform", | ||
| "client", | ||
| ] } | ||
| dash-context-provider = { path = "../rs-context-provider", default-features = false } |
There was a problem hiding this comment.
🔴 Blocking: The transport-free crate still pulls Tokio and native networking features
The PR description explicitly promises no Tokio anywhere in this crate's dependency graph, but dash-context-provider is an unconditional normal dependency and itself unconditionally depends on dash-async. On native targets, dash-async enables Tokio's rt, rt-multi-thread, time, and net features, so the resulting normal graph includes Tokio plus its native networking support. The dapi-grpc code-generation path also retains Tokio-related support dependencies. The dependency cut therefore does not meet the stated no-Tokio embedder requirement; the context-provider/async boundary must be split or feature-gated so this crate's normal graph excludes Tokio.
source: ['codex']
| /// # The 5th-best group | ||
| /// | ||
| /// ```rust,no_run | ||
| /// ```rust,ignore |
There was a problem hiding this comment.
🟡 Suggestion: Moved SDK examples are now excluded from doctest compilation
This example and the two examples at document_ranked_entries.rs:83 and document_ranked_entries.rs:130 were rust,no_run doctests before the extraction. They now live in dash-platform-queries, still import undeclared dash_sdk APIs, and were changed to rust,ignore, so rustdoc no longer checks them. Move the SDK-specific examples back to SDK-owned documentation or rewrite them against dependencies exposed by dash-platform-queries, then restore rust,no_run so API drift is caught.
source: ['coderabbit']
There was a problem hiding this comment.
Resolved in this update — Moved SDK examples are now excluded from doctest compilation no longer present.
Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread.
| [`ContextProvider`], and verifies every response proof with | ||
| [`drive-proof-verifier`]. |
There was a problem hiding this comment.
💬 Nitpick: README reference links are undefined
[ContextProvider] and [drive-proof-verifier] use shortcut reference-link syntax, but the README defines neither reference. They therefore do not render as clickable links. Use inline repository links or add reference definitions.
| [`ContextProvider`], and verifies every response proof with | |
| [`drive-proof-verifier`]. | |
| [`ContextProvider`](../rs-context-provider), and verifies every response proof with | |
| [`drive-proof-verifier`](../rs-drive-proof-verifier). |
source: ['coderabbit']
The new workspace crate packages/dash-platform-queries was missing from the four COPY --parents package lists in the root Dockerfile, so cargo chef prepare failed with 'failed to load manifest for workspace member' when building the Drive, RS-DAPI, and Dashmate helper images. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
thepastaclaw
left a comment
There was a problem hiding this comment.
Preliminary review — Codex only
The extraction still violates its central compatibility and dependency-graph guarantees: four existing SDK surfaces are source-incompatible, and the new crate transitively enables Tokio's native runtime and networking features. CI does not guard the new crate's dependency graph, and the moved documentation examples are no longer compiled.
Source: reviewer backend gpt-5.6-sol; final verifier backend gpt-5.6-sol.
Orchestration-only: openclaw-agent/cliproxy/gpt-5.6-sol (not reviewer evidence).
Validated blockers were found in the Codex precheck. Opus is deferred until a fresh Codex revalidation clears the blocker gate.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed) - Verifier:
gpt-5.6-sol— verifier - Sonnet: not run (deferred by blocker gate)
🔴 5 blocking | 🟡 1 suggestion(s)
2 additional finding(s) omitted (not in diff).
6 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/dash-platform-queries/src/documents/document_query.rs`:
- [BLOCKING] packages/dash-platform-queries/src/documents/document_query.rs:150-155: Re-exported DocumentQuery methods now expose a different error type
Moving `DocumentQuery` into this crate changes the observable error type of its existing inherent APIs from `dash_sdk::Error` to `dash_platform_queries::Error`. This affects `DocumentQuery::new`, `try_into_request_for_version`, the `TryFromPlatformVersioned` associated error, and conversion from `&DocumentQuery` into `DriveDocumentQuery`. The SDK tests now explicitly convert these errors with `SdkError::from(...)`, demonstrating the incompatibility. Existing callers with explicit `Result<_, dash_sdk::Error>` signatures, direct error matching, or associated-error bounds will no longer compile despite importing the type from its historical path. Preserve an SDK-facing compatibility wrapper or classify and version this as a breaking API change.
- [SUGGESTION] packages/dash-platform-queries/src/documents/document_query.rs:298-304: Moved SDK examples are now excluded from doctest compilation
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764878)
This example and the examples at `document_ranked_entries.rs:83` and `document_ranked_entries.rs:130` were `rust,no_run` doctests before the extraction. They now remain SDK-specific, import `dash_sdk` APIs that are not declared dependencies of `dash-platform-queries`, and are marked `rust,ignore`, so rustdoc no longer type-checks them. Move the examples to SDK-owned documentation or rewrite them against the transport-free crate's declared dependencies, then restore `rust,no_run` so API drift is detected.
In `.github/workflows/tests-rs-workspace.yml`:
- [SUGGESTION] .github/workflows/tests-rs-workspace.yml:203-211: CI does not inspect the new crate for banned transport dependencies
The workflow compiles `dash-platform-queries`, but the native inverse dependency-tree assertions still inspect only `drive-proof-verifier`. A direct or transitive banned dependency unique to the new crate would therefore pass this check, despite the README claiming that its dependency tree is guarded by this step. Include `dash-platform-queries` in the native package loop and cover Tokio as well as the listed transport dependencies.
In `packages/rs-sdk/src/platform/documents/document_query_sdk.rs`:
- [BLOCKING] packages/rs-sdk/src/platform/documents/document_query_sdk.rs:16-31: Moving the constructor to an extension trait breaks existing SDK callers
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764868)
`DocumentQuery::new_with_data_contract_id` was an inherent public method at the merge base. It is now provided by `DocumentQuerySdk`, which Rust requires callers to import before the associated-function syntax resolves. The SDK's own document tests were changed to import `DocumentQuerySdk`, confirming that callers importing only `dash_sdk::platform::DocumentQuery` no longer compile. This contradicts the PR's explicit guarantee that SDK consumers need no import changes; preserve an SDK-facing source-compatible facade or classify and version this as a breaking API change.
In `packages/dash-platform-queries/src/query_settings.rs`:
- [BLOCKING] packages/dash-platform-queries/src/query_settings.rs:21-28: Removing the public request_settings field is source-incompatible
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764870)
`dash_sdk::platform::QuerySettings` now re-exports this struct, but the merge-base type included `pub request_settings: &'a RequestSettings`. Existing callers that construct `QuerySettings` with a struct literal or access that field will no longer compile. The SDK tests were updated by deleting that field from their literals, confirming the source break. Keep a transport-free internal settings type if needed, but retain an SDK-facing compatibility layer under the historical public type or classify this as a breaking change.
In `packages/rs-sdk/src/platform/query.rs`:
- [BLOCKING] packages/rs-sdk/src/platform/query.rs:201-204: The new WireQuery bound narrows the public blanket implementation
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764874)
At the merge base, every downstream type satisfying `TransportRequest` received the blanket `Query<T> for T` implementation. Adding the `WireQuery` bound removes that implementation from existing external custom request types until their owners explicitly implement a newly introduced SDK trait. The trait is implementable downstream, but requiring a new implementation is still a source-breaking change. Preserve the previous blanket implementation through a compatible coherence strategy or classify and version this API change.
In `packages/dash-platform-queries/Cargo.toml`:
- [BLOCKING] packages/dash-platform-queries/Cargo.toml:20-24: The transport-free crate still pulls Tokio and native networking features
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764875)
The PR explicitly promises no Tokio anywhere in this crate's dependency graph, but `dash-context-provider` is an unconditional normal dependency and itself unconditionally depends on `dash-async`. On native targets, `dash-async` enables Tokio's `rt`, `rt-multi-thread`, `time`, and `net` features. Therefore `dash-platform-queries` still includes Tokio and native networking support in its normal graph. Split or feature-gate the context-provider/async boundary so the normal embedder graph satisfies the stated no-Tokio requirement.
In `packages/dash-platform-queries/README.md`:
- [NITPICK] packages/dash-platform-queries/README.md:17-20: README reference links are undefined
(existing thread: https://github.com/dashpay/platform/pull/4388#discussion_r3771764881)
`[ContextProvider]` and `[drive-proof-verifier]` use shortcut reference-link syntax, but the README defines neither reference. They therefore do not render as clickable links. Add reference definitions or use inline repository links.
Issue being fixed or feature implemented
Dash Core's Platform GUI integration (PastaPastaPasta/dash#67, tracked in dashpay/dash#7512) needs the SDK's query-building, wire-encoding, and proof-related core without the networking stack. Per maintainer guidance to refactor rather than duplicate ("make an SDK with a feature set so small it matches what you want / split up rs-sdk"), this extracts that core instead of letting embedders reimplement it.
Second slice of the
feat/transport-free-embedder-coreseries (#4335), following #4344 and #4345.What was done?
packages/dash-platform-queriescrate:DocumentQuerybuilding and wire encoding for both request versions, aggregate proof helpers (count/sum/average/ranked), DPNS username helpers, and structural state-transition validation — with no transport, no tokio, no tonic channel/TLS anywhere in its dependency graph.dash-sdkdepends on the new crate and re-exports every moved item at its old path — no rs-sdk consumer changes imports (verified:dash-sdk,wasm-sdk,rs-sdk-ffi, andplatform-walletall compile unchanged).check-featuresknows about it.Wire-request decoding, request-driven proof verification, and pure DPNS/DashPay document builders follow in the next slice.
How Has This Been Tested?
cargo test -p dash-platform-queries(24 tests),cargo checkfordash-sdk(incl.--tests --features mocks),wasm-sdk,rs-sdk-ffi,platform-wallet,check-features;cargo fmt --check;cargo clippy -p dash-platform-queriesclean.[[package]]entry plus thedash-sdkdependency edge — no version churn.Breaking Changes
None. All moved items remain importable at their previous
dash_sdkpaths.Summary by CodeRabbit
New Features
Documentation
Bug Fixes