Skip to content

Wire the 9 untested crate-README rust fences into the doctest harness (follow-up to #526) #577

Description

@shinaoka

Problem

Follow-up to #526. That issue removed rust,ignore from crate README examples, but only 2 of 9 crates wire their README into the doctest harness:

  • crates/tensor4all-itensorlike/src/lib.rs:2#![doc = include_str!("../README.md")] (2 fences covered)
  • crates/tensor4all-tensorci/src/lib.rs:64 — (1 fence covered)

9 ```rust fences remain compiled by nothing:

  • crates/tensor4all-aci/README.md — 3 fences
  • crates/tensor4all-core/README.md, crates/tensor4all-interpolativeqtt/README.md, crates/tensor4all-quanticstci/README.md, crates/tensor4all-quanticstransform/README.md, crates/tensor4all-simplett/README.md, crates/tensor4all-treetn/README.md — 1 each

A 2026-08-04 spot-check verified all 5 sampled snippets against source and found them API-correct today, so this is prevention, not repair: these are the first files an agent or human sees when browsing GitHub, and nothing stops them from rotting. The book-side mechanism (docs/book-tests + scripts/test-mdbook.sh) already covers all 57 book fences; crate READMEs are the only unverified user-facing snippet surface left.

Proposed direction

Add #![doc = include_str!("../README.md")] (on a mod readme_doctests {} shim if crate-level docs already exist) to the 7 crates above, mirroring the itensorlike pattern. Where a README snippet needs setup lines, use hidden # doctest lines rather than weakening the snippet.

Reference: tensor4all/tenferro-rs#1609 (closed by tensor4all/tenferro-rs#1632) did the equivalent sweep for tenferro guide snippets.

Acceptance criteria

  • All ```rust fences in crates/*/README.md execute as doctests in `cargo test --doc --workspace`.
  • No fence carries ignore/no_run (per REPOSITORY_RULES.md doctest policy).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions