Code domain: implement directory-level insight dimension
Background
The @gabriel/code domain currently declares three dimensions: symbol, file, and directory. The first two have engine-level support. directory was added to the domain capabilities to reflect the semantic reality that directory structure carries architectural intent — src/, tests/, api/routes/ are not neutral containers, they are part of the design.
We opted out of .musekeep precisely because directory layout has meaning. A file moving between directories is a meaningful change even when its content is identical. This dimension should be a first-class citizen.
What directory dimension insight means
Unlike symbol and file, a directory has no byte content — its content is its membership and its position in the tree. So directory-level insight is:
- Membership diff: what files moved in or out of a directory between two refs
- Structural diff: did the directory itself move, rename, or disappear
- Churn: which directories change most often (hotspot at the architectural level)
- Coupling: which directories always change together (entanglement at module level)
- Blast radius: if this directory's structure changes, what else is affected
What needs to be implemented in muse
InsightProviderfor the code domain should emit adirectorydimension in its insight outputmuse divergenceshould include directory-level divergence scores between branchesmuse diffshould surface directory-level structural changes (moves, renames, deletions) as a distinct dimension, not just a side-effect of file diffsmuse code hotspotsandmuse code entangleshould be able to operate at directory granularity, not just symbol/filemuse code impactshould optionally roll up blast radius to the directory level
Current state
- Domain capabilities:
dimensions: [symbol, file, directory]✅ - Engine insight output for
directory: not implemented - GUI stat strip on domain detail page: shows 3 dimensions ✅
Notes
This is a parity ticket — the dimension is declared, the engine needs to catch up. No MuseHub changes required.