//! End-to-end pins for the self-description surfaces (#315, #323): the help //! opens with the two-layer concept, the sugar verbs name the document shape //! they desugar to, every introspection roster carries per-entry meanings, //! and `graph build --help` carries the op-list reference. Driven over the //! built binary — the zero-setup surface a reader without repo access gets. use std::process::Command; const BIN: &str = env!("CARGO_BIN_EXE_aura"); /// Run `aura ` (no stdin); return (stdout, stderr, success). fn run(args: &[&str]) -> (String, String, bool) { let out = Command::new(BIN).args(args).output().expect("spawn aura"); ( String::from_utf8_lossy(&out.stdout).into_owned(), String::from_utf8_lossy(&out.stderr).into_owned(), out.status.success(), ) } /// #315: `aura --help` opens with the concepts paragraph — the two layers, /// the bias-as-target-position + protective-stop execution model, and how /// traces come to exist. Each pin sits on one authored line of the explicit /// `long_about` string, so clap's wrapping cannot split it. #[test] fn top_level_help_opens_with_the_two_layer_concept() { let (out, err, ok) = run(&["--help"]); assert!(ok, "aura --help failed: {err}"); assert!(out.contains("research verbs"), "names the sugar layer: {out}"); assert!(out.contains("directly authorable"), "names the document data plane: {out}"); assert!(out.contains("bias in [-1,+1]"), "names the bias output: {out}"); assert!(out.contains("defines the risk unit"), "names the protective stop / R: {out}"); assert!(out.contains("introspect --unwired"), "names the bare-{{}} ramp: {out}"); assert!(out.contains("aura chart"), "names the trace consumers: {out}"); } /// #315: each document-bridged sugar verb's long help names the process /// shape it desugars to and points at the document layer. `run` (not /// document-bridged) points at the canonical document-first form instead. #[test] fn sugar_verbs_name_their_document_shape() { for (verb, needle) in [ ("sweep", "std::sweep"), ("walkforward", "std::walk_forward"), ("mc", "std::monte_carlo"), ("generalize", "std::generalize"), ] { let (out, err, ok) = run(&[verb, "--help"]); assert!(ok, "aura {verb} --help failed: {err}"); assert!(out.contains("Sugar"), "{verb} --help names the sugar relation: {out}"); assert!(out.contains(needle), "{verb} --help names {needle}: {out}"); assert!(out.contains("aura campaign"), "{verb} --help points at the documents: {out}"); } let (out, err, ok) = run(&["run", "--help"]); assert!(ok, "aura run --help failed: {err}"); assert!(out.contains("document-first"), "run --help names the canonical form: {out}"); } /// #323: `graph build --help` carries the op-list reference — the op kinds /// and fields are learnable from the binary, not only from serde refusals. /// #317: the `use` op joins the roster (nine -> ten). #331: the `name` op /// joins the roster (ten -> eleven). #[test] fn graph_build_help_carries_the_op_reference() { let (out, err, ok) = run(&["graph", "build", "--help"]); assert!(ok, "aura graph build --help failed: {err}"); for op in [ r#"{"op":"source""#, r#"{"op":"input""#, r#"{"op":"add""#, r#"{"op":"feed""#, r#"{"op":"connect""#, r#"{"op":"expose""#, r#"{"op":"tap""#, r#"{"op":"gang""#, r#"{"op":"doc""#, r#"{"op":"use""#, r#"{"op":"name""#, ] { assert!(out.contains(op), "op reference carries {op}: {out}"); } assert!(out.contains("graph introspect --vocabulary"), "points at the node roster: {out}"); } /// #317: `graph introspect --registered` lists every registry label — row /// shape `