feat: compound-FK bus routing + complete V1 relationship visualization (ADR-0044)

Completes requirement V1. A compound (multi-column) FK now routes a
bus connector — each paired endpoint's stub merges into a shared
vertical channel that splits to the other side — plus an explicit
"(a, b) ▶ P.(x, y)" pairing line; the bus generalises the single-column
jog (reproducing it exactly, so prior snapshots are unchanged).
Self-referential FKs render as two same-named boxes.

- output_render.rs: gutter_seg routes all endpoint pairs via a
  junction() bus; pairing line for compound FKs; compound, self-ref,
  and compound-from-data (build_diagram_table glue) tests + snapshots
- compound_fk.rs: worker test that show_relationship carries both
  paired column lists into the diagram payload
- db.rs: document do_show_one's now-app-superseded relationship prose
  branch (retained as a worker-API/text fallback; could back a future
  non-visual display option, cf. ADR-0044 OOS-7)

Second /runda pass over the implementation: confirmed ADR-compliance,
UTF-8/byte-range safety, and edge-case routing. The ADR §3 last-resort
helper line was considered and rejected (vertical fallback + ratatui
truncation cover all realistic cases). ADR-0044 marked implemented;
requirements.md V1 -> [x].

Full suite 2207 pass / 0 fail / 1 ignored; clippy nursery clean.
This commit is contained in:
claude@clouddev1
2026-06-10 10:17:09 +00:00
parent a0ee32393f
commit 0a343036d8
8 changed files with 325 additions and 57 deletions
+21 -9
View File
@@ -2,7 +2,13 @@
## Status
Accepted (2026-06-09)
Accepted (2026-06-09); **implemented 2026-06-10** (commits: `cad90ec`
`show relationship` full diagram, `a0ee323` `show table` compact
diagrams, + compound-FK bus routing and self-referential diagrams). A
second `/runda` DA pass over the implementation confirmed
ADR-compliance, UTF-8/byte-range safety, and edge-case routing; the §3
last-resort helper line was **considered and rejected** (see §3).
Closes `requirements.md` **V1**.
Resolves **ADR-0016 OOS-1** ("Relationship visualization — two
structures side-by-side with an arrow; its own ADR; will compose
@@ -251,14 +257,20 @@ render. The App-side render path then chooses layout per diagram:
└──────────────┘
```
- **Last-resort helper.** Only when even a single vertical diagram
cannot fit (e.g. an extremely narrow pane, or a box wider than the
pane), `show table` emits a one-line pointer per relationship —
`<child> → <parent> · run `show relationship <name>` for the
diagram` — so nothing is silently dropped. `show relationship`
itself always renders (it is the detail view); if its single box is
wider than the pane, ratatui's existing right-edge handling applies
(ADR-0016 §4), no new truncation.
- **Last-resort helper — considered and rejected (2026-06-10,
implementation).** The draft proposed that, when even a single
*vertical* diagram cannot fit (a box wider than the pane), `show
table` emit a one-line `run `show relationship <name>`` pointer per
relationship. In implementation we **decided against it**: the
vertical fallback already covers every realistic narrow terminal,
and the only remaining case — a box wider than the *whole* pane —
requires an extreme combination (very long identifiers on a tiny
terminal) and is handled the same way as all other over-wide output
(ratatui's right-edge truncation, ADR-0016 §4). A dedicated pointer
would add a code path and a worse result (less information than even
a truncated diagram) for a near-unreachable case. `show relationship`
itself always renders the diagram; if its box is wider than the pane,
the same truncation applies — no new truncation logic.
**No live reflow.** Because the output buffer is a historical line
log, resizing the terminal *after* a diagram is rendered does not