diff --git a/crates/aura-core/src/node.rs b/crates/aura-core/src/node.rs index dd5c1de..969f792 100644 --- a/crates/aura-core/src/node.rs +++ b/crates/aura-core/src/node.rs @@ -811,6 +811,25 @@ mod tests { assert_eq!(doc_gate("rolling_max", "Rolling Max"), Err(DocGateFault::RestatesName)); } + /// C29 tightening (#316 fieldtest): for a namespaced entry, the bare + /// display segment is a restatement too — a doc that adds nothing beyond + /// the name must not pass just because the name carries a `::` prefix. + /// Genuine meaning lines that merely *contain* the name stay legal. + #[test] + fn doc_gate_refuses_namespaced_short_name_restatement() { + // The most natural alibi at the extension-author seam: the node's + // own display name as its doc. + assert_eq!(doc_gate("lab316_nodes::Scale", "Scale"), Err(DocGateFault::RestatesName)); + // Guard: a real meaning line stays Ok even when it contains the + // short name as a substring... + assert_eq!( + doc_gate("lab316_nodes::Scale", "scalar gain: emits the input times the factor param"), + Ok(()) + ); + // ...and a namespaced entry with a genuine doc is untouched. + assert_eq!(doc_gate("und::Opaque", "one-input f64 pass-through"), Ok(())); + } + #[test] fn doc_gate_accepts_a_meaning_line() { assert_eq!(doc_gate("EMA", "exponential moving average over the input series"), Ok(()));