Skip to content

Document Rust applications and publish versioned SDK reference - #8422

Merged
Amaury Chamayou (achamayou) merged 42 commits into
mainfrom
achamayou-cautious-system
Sep 28, 2026
Merged

Amaury Chamayou (achamayou) merged 42 commits into
mainfrom
achamayou-cautious-system

Conversation

@achamayou

@achamayou Amaury Chamayou (achamayou) commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Motivation

Follows #8200. The Rust guide describes the experimental interface, but has no runnable walkthrough and no API reference.

Implementation summary

  • Rewrite the Rust guide as a walkthrough (build, write, run, use an installed SDK) using snippets from samples/apps/basic_rust, followed by a short list of handler rules.
  • Document every public SDK item, with executable and compile-fail doctests, and deny missing docs and broken intra-doc links. ABI items are hidden from the docs, not removed.
  • Add a rustdoc Sphinx extension, like the existing TypeDoc integration, that runs cargo doc on the SDK for each documentation version, publishes it under rust/, and checks :rustdoc: links. Versions without the SDK are skipped, and failures are fatal.
  • Add a Rust API landing page and short Rust notes on related pages.

Validated with the warnings-as-errors Sphinx build, SDK tests and doctests, and scripts/ci-checks.sh.

Safety and compatibility

Documentation only: no runtime, ABI, ledger, consensus or compatibility impact. Rust changes are doc comments, doc lints and #[doc(hidden)] attributes, and sample changes are snippet markers. The docs build runs cargo doc on the SDK only, not a CCF build; SKIP_RUSTDOC is for local previews and is not used in CI or publishing.

Copilot AI and others added 30 commits August 28, 2026 15:05
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve compaction retry semantics, reject unsupported HTTP status codes, and keep the CI test bucket inventory in sync.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Stabilize the C ABI, preserve Cargo dependency tracking, register Rust unit tests, enforce unwind panics, and clarify native application trust semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
The /app/panic endpoint correctly returns HTTP 500, but Rust's default
panic hook writes fixed lines to node stderr, which
tests/infra/network.py treats as fatal at shutdown. Narrowly catch
NetworkShutdownError and only ignore it when every stderr line matches
the exact expected panic-hook output; anything else still fails.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve test-body failures during expected panic teardown, validate response
headers before serialization, and support Cargo library names that differ
from package names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adopt the label-aggregate build targets from main so that the CI bucket C
job builds the Rust sample app: the e2e test is renamed to e2e_basic_rust
(the basic_rust name is taken by the app target) and declares
BUILD_DEPENDS basic_rust; ccf_app_rust_test gets a same-named target and
the unit label via add_test_label.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: cjen1-msft <chrisjensen@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a source-backed tutorial, public SDK contracts and doctests, and SDK-only rustdoc generation integrated with CCF's versioned Sphinx documentation. Validate generated API links and document the experimental interface's limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from achamayou-rust-interface-exploration to main September 24, 2026 16:59
#8200 was squash-merged into main, so resolve by taking main's final
Rust interface and re-applying only this branch's documentation commit.
Keep main's experimental warning, bridge/linking notes and panic-hook
support, and update docs that described superseded behaviour: the
installed bridge is now a precompiled object, and empty error codes
are accepted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Shorten the Rust guide, API landing page, contributor notes and SDK
rustdoc, keeping the runnable walkthrough, doctests and compile-fail
checks. Merge the execution and KV sections into one list of handler
rules, and replace per-method contract essays with one- or two-line
summaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 28, 2026 09:10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Rustdoc output may retain stale pages, and transaction-commit wording needs clarification.

Review effort: Lite
Findings: None

What changed in this PR

Expands experimental Rust application documentation and publishes versioned Rust SDK rustdoc alongside Sphinx documentation.

Changes:

  • Adds Rust SDK guides, examples, API documentation, doctests, and capability limits.
  • Adds versioned rustdoc generation, link validation, and CI tests.
  • Documents build, authentication, KV, logging, and sandbox workflows.
File Description
src/​rust/​ccf-app/​src/​lib.rs Adds SDK documentation and doctests.
samples/​apps/​basic_rust/​src/​lib.rs Adds documentation snippet markers.
doc/​test_rustdoc.py Tests rustdoc generation and link validation.
doc/​rustdoc.py Generates and validates versioned rustdoc.
doc/​contribute/​build_ccf.rst Documents rustdoc build behavior.
doc/​conf.py Registers the rustdoc extension.
doc/​build_apps/​rust_api.rst Adds the Rust SDK API reference.
doc/​build_apps/​logging.rst Documents Rust logging limitations.
doc/​build_apps/​kv/​index.rst Clarifies Rust KV behavior.
doc/​build_apps/​index.rst Adds Rust API navigation.
doc/​build_apps/​get_started.rst Links to the Rust API reference.
doc/​build_apps/​example_rust.rst Adds the Rust application walkthrough.
doc/​build_apps/​build_app.rst Clarifies native Rust application builds.
doc/​build_apps/​auth/​index.rst Documents Rust authentication limitations.
.github/​workflows/​ci.yml Runs documentation helper tests in CI.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The docs CTest test already runs the rustdoc extension end to end with
warnings as errors, so drop the mocked helper tests and the extra CI
step that ran them outside CTest.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the trait's summary from #8200, and name the trait in the guide's
handler rules instead of listing its Send and Sync bounds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix the installed-SDK sandbox command, which resolved a relative package
path against the install's bin directory, and note that retries also
discard the response. Align terminology across the guide, API page,
notes and rustdoc, drop the redundant sandbox constitution flag, and
show the registration function's signature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The guide tells readers to copy the sample, which also registers
unauthenticated test-only endpoints, including KV writes. Restore the
instruction to remove them, where the copy is described.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) merged commit 1548ce9 into main Sep 28, 2026
12 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the achamayou-cautious-system branch September 28, 2026 12:34
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.

4 participants