Repository navigation
Closed
Labels
kind:choreCleanup, dependencies, tooling or release work; no user-visible changekind:docsREADME, docs/, runbook, rustdoc or ADR prose onlyrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Description
Problem
Every crate except decdn-e2e ships to crates.io (release.yml → publish-crates.sh). That means docs.rs renders each crate's lib.rs //! docs and crates.io renders its README.md. decdn-client reads well to an outside user after #2436: it has a "Choose an entry point" table, runnable examples/, and doctests. The other crate roots are written for workspace contributors instead. They cite issue numbers, link repo-relative paths, use changelog voice, and give no map of the crate's API.
Findings
Survey of crates/*/src/lib.rs and Cargo.toml on main:
| Crate | //! lines |
Issues |
|---|---|---|
protocol |
4 | Has no module map. Does not name the three ALPNs or point at the client/dht/framing/message/coverage/region/identity modules. It is the second crate in the public-API snapshot and a dependency of the client SDK, so SDK users land here. |
incentive |
25 | One dense paragraph. Has no module map for voucher, capability, lane, buyer_pool, or the sol! bindings. Its main types are only reachable by reading the whole paragraph. |
node |
7 | Cargo.toml description says "CLI entry point and runtime wiring". The crate is the daemon. Links appendix-local-admin-http.md as a bare filename. |
reputation |
9 | "persistence deferred per §14a.3": ADR 008 has no §14a.3. This is a dangling reference. |
bao-range |
22 | Changelog voice ("historically had to pull the whole blob"). The Cargo.toml description is a full paragraph that cites #578. |
config-types |
14 | Compat-shim framing ("so existing decdn_cache::* paths in decdn-node keep resolving"). Cites adr/appendix-binaries.md as a repo-relative path. |
cache |
16 | Cites adr/appendix-poc-production-seams.md as a repo-relative path. Has a broken mid-sentence line wrap ("one\n//! such backend — the"). |
common, cli |
13 / 10 | Acceptable. Both still cite issue numbers (#578). |
e2e |
23 | publish = false. Fine as written. Out of scope except for the issue-number description. |
Cross-cutting:
- Issue numbers in published docs. For example
#578,#823,#831,#915,#406, and#1028. On docs.rs these are unlinked noise. They also record history, which goes against the present-tense-canon rule inCLAUDE.md. - Repo-relative links.
adr/…andcrates/…paths do not resolve on docs.rs or crates.io. Use absolutehttps://github.com/decdn/decdn/blob/main/adr/…URLs, matching the workspace citation style. - README and
lib.rsdrift independently. No crate uses#![doc = include_str!("../README.md")], and nothing checks that the two say the same thing. Pick one: include the README, or keep the README to the shared boilerplate plus one paragraph that matches the//!summary. - No
[package.metadata.docs.rs]. docs.rs builds default features only. Sodecdn-incentive'sredbfeature, which providesRedbBuyerPoolStoreand which the CLI enables, is missing from the rendered docs, and no item shows adoc(cfg)badge. Decide per crate which features docs.rs builds. Test-only features (test-util,test-support,public-api-test) should stay out. - No doctests or examples outside
client/incentive. At minimum,protocol(encode/decode a message) andincentive(sign/verify a voucher) should each have one compiled example on the crate root.
Proposed scope
- Rewrite the crate-root
//!forprotocol,incentive,node,reputation,bao-range,config-types, andcache. Each one gets a one-sentence purpose, a short module or entry-point map (modelled ondecdn-client's table), and absolute ADR links. Remove issue numbers and history voice. - Fix the
Cargo.tomldescriptionfornodeandbao-range, and drop issue numbers from everydescription. - Fix the dangling ADR 008 §14a.3 reference.
- Decide on README/
lib.rssingle-sourcing and apply it to every published crate. - Add
[package.metadata.docs.rs]where a user-facing feature exists (incentive/redbat minimum), and enabledoc_cfgbadges undercfg(docsrs). - Add one doctest to
protocolandincentivecrate roots.
Out of scope: item-level docs (missing_docs is already a gate) and decdn-client, which #2436 already covers.
Acceptance
CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemspasses.cargo publish --workspace --dry-runpasses.grep -nE '#[0-9]{3,}|historically|used to' crates/*/src/lib.rsfinds nothing in published crates.- No
//!crate-root link in a published crate is repo-relative. - Public-API snapshots regenerate cleanly if the root re-exports change.
Metadata
Metadata
Assignees
Labels
kind:choreCleanup, dependencies, tooling or release work; no user-visible changekind:docsREADME, docs/, runbook, rustdoc or ADR prose onlyrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsDone
Activity
docs: make published crate-root docs read for crates.io/docs.rs users (…