fix(aura-cli): sweep --list-axes joins the gated intake class

Fieldtest finding B1: the one remaining authored-envelope FILE route,
sweep --list-axes, skipped the root-name gate — a hand-edited
"name":"../escape" listed mangled, non-bindable wrapped axis names
at exit 0 while every sibling intake refused. The discovery surface now
gates before any axis line prints (exit 1, shared prose), restoring
both the #331 every-authored-intake claim and #328's discovery-surface
identity. RED-first: the e2e refusal test was written and observed
failing (exit 0, axis lines printed) before the fix.

Re-enumeration of every read_to_string-fed envelope load confirms the
class is now closed; C24 additionally ratifies the fieldtest's SG1 —
the refusal core sentence is byte-uniform across sites while the
leading context prefix varies by site convention.

refs #331, #328
This commit is contained in:
2026-07-25 05:14:50 +02:00
parent 4ff85b94e5
commit 564a767974
4 changed files with 74 additions and 7 deletions
+42
View File
@@ -5510,6 +5510,48 @@ fn aura_sweep_list_axes_rejects_malformed_blueprint() {
assert!(!stderr.contains("panicked"), "must reject cleanly, not panic: {stderr}");
}
/// Property (#331 fieldtest finding, cycle-331-blueprint-name c331_2e): `--list-axes`
/// is a FRESH-FILE intake exactly like `register` / `introspect --content-id` /
/// `introspect --params`, but its own root-name gate was missing — a hand-edited
/// envelope with a shape-violating root name (`"../x"`) printed mangled,
/// non-bindable axis names instead of being refused. The route now shares
/// `gate_authored_root_name` + `name_gate_fault_prose` and exits 1 — the
/// register-route convention (this route never `put_blueprint`s anything, unlike
/// the exit-2 sweep-EXECUTION route pinned by
/// `aura_sweep_synthetic_blueprint_refuses_a_hand_crafted_envelope_with_a_bad_root_name`)
/// — printing no axis line at all.
#[test]
fn aura_sweep_list_axes_refuses_a_hand_crafted_envelope_with_a_bad_root_name() {
let dir = temp_cwd("sweep_list_axes_bad_root_name_refusal");
let fixture_text =
std::fs::read_to_string(format!("{}/tests/fixtures/r_sma_open.json", env!("CARGO_MANIFEST_DIR")))
.expect("read r_sma_open.json fixture");
let bad = fixture_text.replacen("\"name\":\"sma_signal\"", "\"name\":\"../x\"", 1);
assert!(bad.contains("\"name\":\"../x\""), "the root-name replace landed: {bad}");
let file = dir.join("bad-root-name.json");
std::fs::write(&file, &bad).expect("write envelope fixture");
let out = Command::new(BIN)
.args(["sweep", file.to_str().unwrap(), "--list-axes"])
.current_dir(&dir)
.output()
.expect("spawn aura sweep --list-axes (bad root name)");
assert_eq!(
out.status.code(),
Some(1),
"a shape-violating root name must be refused (register-route convention), not listed: status={:?} stderr={}",
out.status,
String::from_utf8_lossy(&out.stderr)
);
let stderr = String::from_utf8_lossy(&out.stderr).into_owned();
assert!(
stderr.contains("blueprint name \"../x\" is invalid") && stderr.contains("must not contain '/' or '\\'"),
"names the offending root name with the shared gate prose: {stderr}"
);
assert!(out.stdout.is_empty(), "a refused root name must print no axis line: {out:?}");
let _ = std::fs::remove_dir_all(&dir);
}
/// E2E (#210 c0110 fieldtest, "aura sweep <op-script> rejects the op-script
/// array with a raw serde error"): `aura sweep`'s blueprint slot accepts only
/// the built blueprint envelope; an un-built op-script (a JSON array) is