`:xray [namespace|all]` opens a live ownership graph, replacing the old stub
and closing gap #3 from the k9s parity audit (4.7). Rather than a per-kind tree,
it's a single namespace-rooted forest of the workload topology:
ns/<name>
├─ deploy → rs → pod → container
├─ sts / ds → pod → container
├─ cronjob → job → pod
├─ job / bare rs → pod
└─ standalone pods (no controller)
`:xray` defaults to the current namespace; `:xray all` spans the cluster grouped
by namespace.
Rendering is a real tree, not indented text: box-drawing connectors
(├──/└──/│), ▾/▸ expand markers, severity-colored per-node status, and a
selectable cursor. Navigate j/k (+ g/G); →/← expand/collapse the node under the
cursor, Enter toggles, esc closes. Collapse state is keyed by stable node id so
it survives the per-frame rebuild.
The graph rebuilds from store state every frame so it tracks the cluster live;
opening it adds the workload kinds it draws to the active watch plan so it fills
in within a moment. Large graphs truncate with `… N more` nodes (no silent
caps). Cross-cutting relations (Service/PVC/ConfigMap/Node — non-ownership,
multi-parent edges that don't fit a tree) are intentionally left to the Enter
drill-down and describe views.
Reuses the existing owner-chain helpers (the log fan-in's
deployment/replicaset/pod key lookups).
Tests: namespace-rooted tree structure + connectors + expand marker; collapse
hides a subtree; arrow-key directed collapse/expand.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>