HierarchicalBoxing

Issue 29 — hierarchical boxing. Synthesises compound (box) layers above the Activity → Class → Function → Instruction chain that issue 24 #12 already wires in Enrichment.applyClassNesting / Enrichment.applyElementNesting.

v1 (this increment): the FILE layer only. It slots a CodeFile box between the Activity and the per-qualifier Class / orphan Function boxes:

Activity → File → Class → Function → Instruction

A box's file is the most common sourceFile among its descendant instructions — exact for the common single-file class/function, a representative pick for the rare file-spanning case (C++ classes/namespaces legitimately span translation units). Files are keyed by (repoName, relativePath) so identical relative paths in different repos render as distinct boxes. Each CodeFile is bound to a deterministic analyzer-derived reference built from that key.

Deferred to follow-ups (need design / renderer support):

  • Namespace: the existing Class box already derives from the demangled qualifier (= the functionDeclContext namespace+class string), so a separate Namespace layer would double-box — needs reconciliation (rename Class→Namespace for v1, or the namespace/class split) rather than stacking.

  • Segment: data-flow segments are many-to-many overlays on IR instructions (one IR can be in several segments), so they cannot be a normal compound-parent layer like File / Function / SourceLine.

Functions

Link copied to clipboard
fun applyFileLayer(graph: Vista, enabled: Boolean = true): Vista

Inserts a CodeFile compound between the Activity box and its current top-level children (the Class / orphan Function boxes). No-op when enabled is false, when there is no Activity box (the chain isn't built), or when no descendant instruction carries a source location.

Link copied to clipboard
fun applySourceLineLayer(graph: Vista, enabled: Boolean = true): Vista

Inserts a CodeSourceLine compound between each com.stigway.metamodels.highway.CodeFunction box and its child instructions, grouping them by (repo, path, line):

Generated with STIG