classify

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package classify assigns Balanced Coupling classifications to graph edges: strength, distance, volatility, and explicitness.

Package classify — distance_structure.go provides codeStructureDistance, the always-available deterministic baseline for the distance composite (§4.2).

Package classify assigns Balanced Coupling classifications to graph edges: strength, distance, volatility, and explicitness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AugmentModulesFromGraph added in v0.6.0

func AugmentModulesFromGraph(g *graph.Graph, modules map[string]config.ModuleDef) map[string]config.ModuleDef

AugmentModulesFromGraph returns a Modules map extended with a synthetic module for every first-party module-graph node not already covered by a configured module's path globs. Rust intra-crate module nodes ("<crate>::<mod>", produced by the cargo-modules extractor) are otherwise unknown to moduleFor, so their edges classify as distance-unknown and never count toward coupling_balance or encapsulation. The gate is the "::" separator, which only the Rust module-graph convention uses (Go/TS use "/", Python "."), so Go/TS/Python graphs and their configured modules are untouched. Existing config modules keep precedence — a synthetic module is only added when nothing already covers the node. The input map is not mutated; a copy is returned only if something is added.

func Run

Run classifies every edge in g and returns a coupling.Index keyed by the edge canonical key (from + "\x00" + to + "\x00" + kind).

For each edge:

  • Strength: contract if the target path matches a public glob of any module; intrusive if it matches an internal glob; unknown otherwise.
  • Distance: derived from module ownership (same_module / cross_module_same_owner / cross_module_different_owner / cross_deploy_unit). When either endpoint cannot be resolved to a module, distance is unknown.
  • Volatility: derived from the to-module's subdomain field (core→high, supporting→low, generic→low, ""/"unknown"→unknown).
  • Explicitness: explicit when strength=contract; implicit when strength=intrusive; unknown otherwise.
  • Score: continuous EdgeScore from the configured Scorer (default: BookScorer, bc_score.v3). Applied to cross-boundary edges only (same-module and unknown-distance are zero).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL