Skip to main content

Module architecture_roles

Module architecture_roles 

Expand description

architecture-roles analysis — per-file architectural role from the structural import graph’s “hidden structure” (Baldwin, MacCormack & Rusnak 2014).

Each file is classified by its transitive visibility fan-in (vfi: how many files reach it) and visibility fan-out (vfo: how many it reaches), relative to the system’s Core:

  • core — a member of the largest cyclic group (the dominant SCC). The architectural “knot” everything routes through.
  • shared — depended on as widely as the Core but depends on little (vfi ≥ vfi_core, vfo < vfo_core): utilities, libraries.
  • control — depends on as much as the Core but little depends on it (vfi < vfi_core, vfo ≥ vfo_core): orchestrators, main.
  • periphery — low on both axes: leaf features (the healthy bulk).

When the graph is acyclic (no Core), roles are classified relative to the median vfi/vfo instead — there is no dominant knot to anchor on, so “as central as the Core” becomes “above the median”.

reach_pct = vfo / file_count × 100 is the per-file downstream blast radius (“a change here can reach X% of the system”); the repo-level mean of vfo / n is MacCormack’s propagation cost.

Accuracy follows the import resolver’s language coverage, same caveat as god_classes fan-in.

Structs§

ArchitectureRoleRow
One file’s architectural role + visibility reach.

Functions§

run_architecture_roles
Run the architecture-roles analysis. Returns one row per file in the import graph, ranked by visibility fan-in (most depended-upon first).