Skip to content

fix(docs): resolve private-item intra-doc links and check them in CI - #2615

Merged
robcohen merged 2 commits into
mainfrom
fix/private-intra-doc-links
Oct 12, 2026
Merged

robcohen merged 2 commits into
mainfrom
fix/private-intra-doc-links

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

CI builds docs with cargo doc --all-features --no-deps, which skips private items, so a broken intra-doc link on a private item never failed anything. On main, RUSTDOCFLAGS=-D warnings cargo doc --workspace --all-features --no-deps --document-private-items fails in 8 crates with 13 errors. A 9th crate, rustledger-plugin, fails without default features. Each is fixed:

Crate Link Fix
core render_lines super::render_lines (re-exported from format::align)
core format_posting test-only fn, so a code span
core pool_total_cost (renamed) Inventory::pool_total
core Self::reduce_from_lot (split into plan/commit) reworded: "a reduction from one lot, applying a plan_from_lot result"
booking round_interpolated test-only fn, so a code span
booking crate::book: both a function and a module fn@crate::book
validate rayon::par_iter (not an item) code span
loader ValidationOptions (not in scope) rustledger_validate::ValidationOptions
lsp LedgerState::grouping_style_for (not in scope) crate::ledger_state::LedgerState::grouping_style_for
wasm Options (not in scope) rustledger_loader::Options
ffi-component AccountTypes (not in scope) rustledger_core::AccountTypes
rustledger (CLI) register_wasm_dir (another crate, feature-gated) code span ImporterRegistry::register_wasm_dir
plugin, no default features crate::python::is_python_plugin_file_ref in dispatch.rs code span noting the module is python-plugins-only
plugin, no default features crate::PluginManager::register_wasm_dir in wasm_dir_scan.rs, which became ungated in #2593 while PluginManager is still wasm-runtime-only code span

CI: a new ci matrix row, Documentation (private items), runs cargo doc --no-deps --document-private-items with RUSTDOCFLAGS=-Dwarnings for:

  • the workspace with all features;
  • rustledger-plugin --no-default-features;
  • rustledger --no-default-features --features mimalloc,ag-rledger, the release configuration.

Like every ci row, it is part of the required build gate. The plan in the issue was to start with -p rustledger-query and widen the check crate by crate. Since every crate is fixed here, the check covers the whole workspace from the start.

How tested

  • Fails without the fix: the same command on main exits 101, with the 13 errors listed above (8 could not document).
  • With the fix, it exits 0 for the workspace with all features. It also exits 0 for each of: rustledger-plugin (default and no default features), rustledger (release configuration), rustledger-loader (default and no default features), rustledger-importer (no default features).
  • actionlint: the same 10 pre-existing findings as main. cargo fmt --check is clean.
  • Only doc comments changed, so there is no behavior change and no test.

Closes #2512

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

cargo doc --document-private-items -D warnings failed in 9 crates (13
errors: links to renamed, test-only or feature-gated items, one path
not in scope, and `crate::book` naming both a fn and a module). Each is
now a resolvable path or a code span. A new "Documentation (private
items)" matrix row checks the workspace with all features,
rustledger-plugin without default features, and the CLI in its release
configuration.

Closes #2512

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen requested a review from a team as a code owner October 11, 2026 17:32
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 47.1ms ± 2.0ms 878.9ms ± 23.7ms 18.6x 51.1 MB / 50.1 MB
investment 77.0ms ± 0.3ms 3135.0ms ± 74.9ms 40.7x 57.2 MB / 58.0 MB
fifo 74.3ms ± 0.7ms 16662.4ms ± 170.6ms 224.4x 57.2 MB / 57.8 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 45.4ms ± 0.3ms 47.1ms ± 2.0ms +3.8% ✅ within noise 51.2 MB → 51.1 MB (-0.2%)
investment 76.8ms ± 0.5ms 77.0ms ± 0.3ms +0.3% ✅ within noise 57.2 MB → 57.2 MB (+0.1%)
fifo 75.0ms ± 1.1ms 74.3ms ± 0.7ms -0.9% ✅ within noise 57.1 MB → 57.2 MB (+0.2%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 0.9ms, investment 0.3ms, fifo 0.6ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 819
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen

Copy link
Copy Markdown
Member Author

Review loop

Round Scope Finding Fix
1 The private-items doc build in other feature configurations: rustledger-plugin with and without default features, rustledger in the release configuration, rustledger-loader with and without default features, rustledger-importer with no default features. rustledger-plugin --no-default-features also failed on wasm_dir_scan.rs (ungated by #2593, links the gated PluginManager) fixed before opening; every listed configuration exits 0
2 A re-read of every changed doc line (each either resolves or is now a code span) and the CI row (folded >- command, RUSTDOCFLAGS=-Dwarnings) none n/a

The new Documentation (private items) row passed in CI. Required checks are green on 1d07898f. Slim Build is red for main's sccache reason (#2606). rustfava: 8/671, expected.

@robcohen
robcohen merged commit b9f3514 into main Oct 12, 2026
68 of 70 checks passed
@robcohen
robcohen deleted the fix/private-intra-doc-links branch October 12, 2026 01:05
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.

Private intra-doc links fail in 9 crates; add a --document-private-items docs check

1 participant