Repository navigation
docs: make published crate-root docs read for crates.io/docs.rs users - #2447
Merged
Merged
Conversation
Rewrite the crate-root docs of decdn-protocol, -incentive, -node, -reputation, -bao-range, -config-types and -cache for a reader who lands on docs.rs. Each opens with a one-sentence purpose and a module or entry-point table modelled on decdn-client's, links ADRs by absolute URL, and drops issue numbers and history voice. - protocol: ALPN table, module map, frames-and-extensions model, and a compiled frame round-trip example. - incentive: module map by area, a compiled voucher sign/verify example, and who drives settlement. docs.rs builds the `redb` feature, and `doc_cfg` badges render under `cfg(docsrs)`. - reputation: replace the dangling ADR 008 §14a.3 reference (here and in local.rs) with the present fact: scores live in memory only. - bao-range, cache: entry-point tables, and the item docs and comments in their lib.rs lose their issue numbers. - Package descriptions for node, bao-range, config-types, incentive and e2e say what the crate is, with no issue numbers. - READMEs keep the shared boilerplate; their summary matches the new crate-root purpose, with absolute ADR links. decdn-client's item-level docs still cite issue numbers; they are out of scope here. Closes #2442 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The docs.rs configuration does not currently produce the promised feature badges, and the changelog overstates the table coverage.
2 open findings
What changed in this PR
Reworks published crate documentation for docs.rs and crates.io users.
Changes:
- Adds crate-root API maps, absolute ADR links, and protocol/payment doctests.
- Clarifies crate purposes in READMEs and package descriptions.
- Configures docs.rs to include incentive buyer-store modules.
| File | Description |
|---|---|
CHANGELOG.md |
Records the documentation overhaul. |
crates/bao-range/Cargo.toml |
Improves package description. |
crates/bao-range/README.md |
Clarifies verified-range functionality. |
crates/bao-range/src/lib.rs |
Adds entry-point documentation. |
crates/cache/src/lib.rs |
Adds cache API guidance. |
crates/common/README.md |
Uses an absolute ADR link. |
crates/common/src/lib.rs |
Removes issue-history wording. |
crates/config-types/Cargo.toml |
Improves package description. |
crates/config-types/src/lib.rs |
Adds a config-type map. |
crates/e2e/Cargo.toml |
Removes issue-history wording. |
crates/e2e/src/lib.rs |
Simplifies fixture documentation. |
crates/incentive/Cargo.toml |
Configures docs.rs features. |
crates/incentive/README.md |
Clarifies payment-layer scope. |
crates/incentive/src/lib.rs |
Adds module guidance and a voucher doctest. |
crates/node/Cargo.toml |
Corrects the daemon description. |
crates/node/src/lib.rs |
Documents daemon modules and stability. |
crates/protocol/src/lib.rs |
Adds protocol maps and a round-trip doctest. |
crates/reputation/README.md |
Documents in-memory scoring. |
crates/reputation/src/lib.rs |
Replaces the dangling ADR reference. |
crates/reputation/src/local.rs |
Clarifies restart behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Rewrites the published crate roots so they read well to someone who lands on docs.rs or crates.io, using
decdn-client's root as the model.encode_message/decode_messageround-trip doctest.[package.metadata.docs.rs] features = ["redb"]and#![cfg_attr(docsrs, feature(doc_cfg))], sobuyer_pool_redbandbuyer_pool_tableshow up on docs.rs with feature badges.decdn-nodedaemon's library with no stability promise, adds a module map, and makes the links absolute.lib.rsandlocal.rs) with the current fact: scores live in memory only.lib.rstoo.description: node, bao-range, config-types, incentive, and e2e now say what the crate is, with no issue numbers.lib.rs, with noinclude_str!, so the//!tables can keep intra-doc links.Out of scope, as the issue says:
decdn-client's item-level docs, which still cite issue numbers inlib.rs. So the issue's literalgrep … crates/*/src/lib.rsstill matches there. Also,used to <verb>is valid prose, so this PR doesn't treat it as changelog voice.Test plan
CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemsCARGO_BUILD_WARNINGS=deny cargo doc -p <crate> --no-depsfor each of the nine crates (public view)RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--cfg docsrs" cargo doc -p decdn-incentive --features redb --no-deps: theredb/buyer-store-corebadges rendercargo test --doc -p decdn-protocol -p decdn-incentivecargo clippy --workspace --all-targets --all-features -- -D warnings,cargo fmt -- --checkcargo publish --workspace --locked --dry-run#NNN/historicallyin the in-scopelib.rsfiles, no repo-relative//!links, no issue numbers in anydescriptionpub usechanges, so the public-API snapshots are unchangedCloses #2442
🤖 Generated with Claude Code