diff --git a/crates/aura-cli/src/graph.rs b/crates/aura-cli/src/graph.rs index 6b180bd..36641f9 100644 --- a/crates/aura-cli/src/graph.rs +++ b/crates/aura-cli/src/graph.rs @@ -137,17 +137,11 @@ pub fn render_compilat(nodes: &[Box], sources: &[SourceSpec], edges: & labels.push(format!("source:{:?}", src.kind)); } - let mut g = Graph::with_mode(RenderMode::Vertical); - for (id, l) in labels.iter().enumerate() { - g.add_node(id, l); - } - for e in edges { - g.add_edge(e.from, e.to, None); - } + let mut edge_pairs: Vec<(usize, usize)> = edges.iter().map(|e| (e.from, e.to)).collect(); for (i, src) in sources.iter().enumerate() { for t in &src.targets { - g.add_edge(source_base + i, t.node, None); + edge_pairs.push((source_base + i, t.node)); } } - g.render() + render_flat(&labels, &edge_pairs) } diff --git a/docs/design/INDEX.md b/docs/design/INDEX.md index e215fa8..5395b4c 100644 --- a/docs/design/INDEX.md +++ b/docs/design/INDEX.md @@ -569,6 +569,25 @@ invariant). The value *domain* (e.g. `length ≥ 1`) stays the constructor's own detail for C22: the blueprint view (pre-run, param-generic) labels a leaf by **bare type** (`LeafFactory::label` → `[SMA]`) — the value-bearing `SMA(2)` of C8's render- label refinement now appears only in the *compiled* view (built nodes, `Node::label`). +**Realization (cycle 0017 — blueprint render = main graph + definitions).** The +`aura graph` blueprint view (C9 graph-as-data, #13) renders the **authored +structure** as a *program with subroutines*: a flat **main graph** wiring the +harness with each composite shown as a **single opaque node** `[name]`, plus a +`where:` section that defines each **distinct** composite type **once** (its +interior with `[in:k]`/`[out]` port markers; deduped by `name()`, collected +recursively so nested composites are opaque nodes with their own definitions). This +supersedes #13's original cluster-box model and is the durable split this view +realizes: **blueprint = source** (composites as named subroutines, body once) vs. +**compiled = inlined machine form** (C23, boundary dissolved). The substantive cause +for retiring cluster boxes is a real renderer defect — `ascii-dag` 0.9.1's subgraph +level-centering rounds sibling x-positions with `/2`, overlapping wide sibling +labels (width/parity-sensitive, no config/padding dodge surviving unequal-width +siblings); the **flat** layout is collision-free, and both views now build flat +graphs only. The model also scales (blueprint size tracks top-level wiring, not +inlined node count) and removes #13's nested-composite `unimplemented!` (the +definitions pass recurses). The interactive *enter/focus* counterpart (a composite +collapsed to a navigable node) is the playground's, parked as a separate concern +(#37); the static CLI keeps the all-at-once definitions form (#38). ### C20 — Strategy ↔ harness; the harness is the root sim graph **Guarantee.** A **strategy** is a reusable composite-node blueprint (C9):