feat(aura-cli, aura-engine): use-aware unwired introspection; gang-rule prose; LinComb discovery
Harvest sweep, batch 5 of 6. - introspect --unwired resolves use refs through the registry store: the parse+resolve phase is extracted from graph build's path into the shared parse_and_resolve_ops, so a use-bearing document introspects identically to how it builds (fetch, C29 gate, label resolution) — retiring both the hard miss and the 'content id' mislabeling of by-name refs. The engine's subgraph closure contract is unchanged (store-freedom binds the engine, not the CLI caller). - ganging a spliced instance's member path refuses with the rule (OpError::GangOfSplicedInstance) instead of the typo-shaped no-such-param prose; the leaf-typo case keeps its UnknownParam shape under a new sibling pin. - the --node pending note names the follow-up moves on the current surface (build, then introspect --params / --unwired), and the authoring guide gains a worked LinComb op-script example (args-then-bind order, term[i]/weights[i], verified by building it). refs #339 refs #341
This commit is contained in:
@@ -282,7 +282,11 @@ fn graph_build_bad_tz_is_exit_1_naming_the_arg() {
|
||||
|
||||
/// #271: `graph introspect --node Session` self-describes its declared
|
||||
/// construction args (name, kind, hint) plus the pending note — the
|
||||
/// discovery surface an author reads before writing the `args` object.
|
||||
/// discovery surface an author reads before writing the `args` object. The
|
||||
/// note itself names the follow-up moves on the current surface (#341 item 3
|
||||
/// harvest): `graph build` + `introspect --params` for the open knobs,
|
||||
/// `--unwired` for a partial document's unfilled slots — so a consumer's
|
||||
/// first port/param guess isn't a coin flip.
|
||||
#[test]
|
||||
fn graph_introspect_node_session_lists_arg_rows() {
|
||||
let (stdout, _stderr, ok) = run(&["graph", "introspect", "--node", "Session"], "");
|
||||
@@ -294,6 +298,14 @@ fn graph_introspect_node_session_lists_arg_rows() {
|
||||
stdout.contains("ports and params form at construction"),
|
||||
"shows the pending note: {stdout}"
|
||||
);
|
||||
assert!(
|
||||
stdout.contains("aura graph introspect --params <bp.json>") && stdout.contains("open knobs"),
|
||||
"the note names the params discovery follow-up: {stdout}"
|
||||
);
|
||||
assert!(
|
||||
stdout.contains("--unwired") && stdout.contains("unfilled slots"),
|
||||
"the note names the unwired-slots follow-up: {stdout}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -2190,6 +2202,30 @@ fn graph_build_use_resolves_a_label_and_echoes_the_id() {
|
||||
);
|
||||
}
|
||||
|
||||
/// `graph introspect --unwired` on a use-bearing document (#339 item 4
|
||||
/// harvest): the build-free introspection path resolves `use` refs through
|
||||
/// the store exactly like `graph build` does now, so a document splicing a
|
||||
/// registered pattern lists the open slots reaching THROUGH the splice (the
|
||||
/// pattern's own open input role, surfaced as `trend.x`) alongside an
|
||||
/// ordinary leaf node's open slot — instead of a hard `UnknownSubgraph` miss.
|
||||
#[test]
|
||||
fn graph_introspect_unwired_lists_open_slots_through_a_use_splice() {
|
||||
let dir = temp_cwd("unwired-use-splice");
|
||||
let bp = build_envelope_in(&dir, OPEN_PATTERN_DOC, "pattern");
|
||||
let (reg_out, reg_err, reg_code) =
|
||||
run_in(&dir, &["graph", "register", bp.to_str().unwrap(), "--name", "smooth"]);
|
||||
assert_eq!(reg_code, Some(0), "register --name: {reg_out} {reg_err}");
|
||||
|
||||
let consumer = r#"[
|
||||
{"op":"add","type":"SMA","name":"solo"},
|
||||
{"op":"use","ref":{"name":"smooth"},"name":"trend"}
|
||||
]"#;
|
||||
let (stdout, stderr, code) = run_in_stdin(&dir, &["graph", "introspect", "--unwired"], consumer);
|
||||
assert_eq!(code, Some(0), "a use-bearing document introspects: {stderr}");
|
||||
assert!(stdout.contains("trend.x"), "the splice's own open role surfaces through: {stdout}");
|
||||
assert!(stdout.contains("solo.series"), "the leaf node's own open slot still lists: {stdout}");
|
||||
}
|
||||
|
||||
/// An unknown `use` label enumerates every registered label (C29's "name the
|
||||
/// closed set" idiom) and refuses at exit 1 (op-list content fault, #175).
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user