Door scan: say it is a line-based tripwire and what it misses

Docs only; no behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Weksa 2026-11-10 03:04:48 +00:00
commit 62059337a3
2 changed files with 13 additions and 6 deletions

View file

@ -93,8 +93,9 @@ impl SplitScheme {
/// let _ = weksa::split::Checkpoint::declare(1);
/// ```
///
/// The test constructor is not exported (its name today; the door scan in
/// `tests/checkpoint_door.rs` pins the shape under any name):
/// The test constructor is not exported (this doctest names it today; the
/// line-based tripwire in `tests/checkpoint_door.rs` catches only common
/// single-line forms of a new public constructor):
///
/// ```compile_fail
/// let _ = weksa::split::Checkpoint::for_test(1);

View file

@ -1,7 +1,13 @@
//! The Checkpoint door is pinned by source shape, not by a name: no public item
//! of the lib can mint one, and nothing may derive, implement or default one.
//! `Checkpoint::for_test` is `cfg(test)`; a doctest names it today, and this
//! scan catches a rename.
//! A line-based tripwire on the Checkpoint door, not a proof. The real defence
//! is that `Checkpoint::for_test` is `cfg(test)`, pinned by the compile_fail
//! doctest on its current name in `split.rs`. This scan reads `split.rs` line by
//! line and catches the common single-line forms: a `pub fn` in `impl
//! Checkpoint` whose signature line says `-> Self` or `-> Checkpoint` without
//! `cfg(test)` above it, a trait impl for `Checkpoint`, a derive on it, a `pub`
//! field in its braces, and a `-> Checkpoint` line in any other `src` file. It
//! misses: signatures wrapped over several lines, `Option`, `Box`, `Result` or
//! tuple returns from `split.rs`, tuple structs with `pub` fields, and
//! constructors made by macros.
/// Why `src` lets code outside the lib make a `Checkpoint`, if it does.
fn door_leaks(split_rs: &str) -> Vec<String> {