Skip to content

docs: purge never-compiled doc examples — compile, delete, or justify (#146)#147

Open
lxsaah wants to merge 1 commit into
docs/036-doc-rot-fixesfrom
docs/146-doctest-conversion
Open

docs: purge never-compiled doc examples — compile, delete, or justify (#146)#147
lxsaah wants to merge 1 commit into
docs/036-doc-rot-fixesfrom
docs/146-doctest-conversion

Conversation

@lxsaah

@lxsaah lxsaah commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #146 with the revised policy (maintainer decision mid-work): instead of systematically converting every rust,ignore example, remove them unless there is a good reason to keep one — and where the example is the crate's primary usage documentation and the dependencies allow it, convert it to a compiled doctest instead. Stacked on #145 (retarget down the stack as it merges).

Result: 108 ignored fences → 24, every survivor carrying an explicit "Illustrative (not compiled: …)" reason inline. No API or behavior changes; Cargo.toml changes are dev-deps only.

Converted to compiled doctests (~30 examples, now CI-checked)

  • Crate-level quick starts: aimdb-sync (incl. the "no #[tokio::main]" flagship), uds/websocket/mqtt/knx connectors, persistence + sqlite backend.
  • Core: producer/consumer module examples (typed_api), TopicProvider, extensions storage, AimxConfig::socket_permissions, the RecordKey Hash/Borrow contract snippet, connector module example.
  • Trait-extension docs: MQTT with_qos/with_retain link ext, websocket AuthHandler (bearer-token example), websocket server/client builder chains, data-contracts log_tap + MigrationStep.

Rot the conversion surfaced and fixed

Key-less configure()/producer()/consumer() calls (the API takes a key), builder chains that cannot compile (register_record returns &mut Self, build() takes self), .with_buffer()/.finish() on receivers that don't have them, a deserializer returning Box<T> instead of T, AimDbSyncExt's example calling the async build() synchronously, DbError::RecordNotFound vs RecordKeyNotFound, and source + link_from on one record (a build-time conflict) in the MQTT quick start.

Deleted (~50 fragments)

Method-level examples that restated the signature: builder key-access helpers (produce/subscribe/producer/consumer/resolve_key/…), registrar setters (source/tap/link_to/with_*), connector constructors, internal SPI sketches (RouterBuilder, JsonBufferReader, json access), and duplicates of crate-level examples.

Kept as ignore (24, each with a written reason)

  • Core examples wiring downstream crates it cannot depend on (adapters, connectors, the .buffer() registrar ext trait) — e.g. with_connector's three-variant example, remote module usage, sans-io connector-author sketches.
  • aimdb-derive: expansion targets aimdb_core::RecordKey (circular dev-dependency); compiled integration tests live in aimdb-core.
  • Embedded/wasm-only: Embassy peripherals/network stack, #[wasm_bindgen] factory.
  • Macro grammar sketches with placeholder types (migration_chain!), pointing at compiled real usage.

The three buffer_sized recipe mini-fences in the Embassy adapter were folded into prose bullets — recipes preserved, no uncompiled code.

Validation

  • make fmt-checkmake clippy (all feature combos, -D warnings) ✅ make test ✅ (186 doctests passing suite-wide)
  • Per-crate cargo test --doc run for every touched crate during conversion.

🤖 Generated with Claude Code

…#146)

Resolves the ignored-doctest debt from the post-036 scan with the revised
policy (maintainer decision on #146): remove `rust,ignore` examples unless
there is a good reason to keep one. Result: 108 ignored fences → 24, and
every survivor carries an explicit "Illustrative (not compiled: …)" reason.

- Converted to compiled doctests (`no_run`/`rust`) where the crate's deps
  allow it: the crate-level quick starts of aimdb-sync, aimdb-uds-connector,
  aimdb-websocket-connector, aimdb-mqtt-connector, aimdb-knx-connector,
  aimdb-persistence(+sqlite); core's producer/consumer module examples,
  TopicProvider, extensions, AimxConfig, RecordKey Hash-contract; the
  websocket AuthHandler and MQTT link-ext trait docs. ~30 examples now
  compile under `make test` (186 doctests passing suite-wide).
- Conversion surfaced real rot, now fixed in the surviving examples:
  key-less `configure()`/`producer()`/`consumer()` calls (API takes a key),
  builder chains that can't compile (`&mut Self` → by-value `build()`),
  `with_buffer`/`finish()` on the wrong receiver, a deserializer returning
  `Box<T>` instead of `T`, sync's `AimDbSyncExt` example calling the async
  `build()` synchronously, and `DbError::RecordNotFound` vs
  `RecordKeyNotFound`.
- Deleted ~50 method-level fragments that restated the signature (builder
  key-access helpers, registrar setters, connector constructors, internal
  SPI sketches) plus duplicates of the crate-level examples.
- Kept 24 as `ignore`, each with a written reason: downstream-crate types
  core cannot depend on (adapter/connector wiring, `.buffer()` ext trait),
  proc-macro expansion targeting aimdb-core (circular dev-dependency),
  embedded/wasm-only code (Embassy peripherals, `#[wasm_bindgen]`),
  and macro grammar sketches with placeholder types.
- Dev-deps: aimdb-uds-connector gains serde/serde_json for its quick start;
  aimdb-sync's example uses its existing aimdb-tokio-adapter dependency.

Closes #146.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant