aalekh-analysis

Pure graph algorithms and the architecture-rule engine. Every function is deterministic and I/O-free, so the unit tests (including Kotest property tests over graph shapes) run in milliseconds. Consumes an aalekh-model ModuleDependencyGraph and produces analysis results, violations, and metrics — no Gradle types appear here.

Structural analysis considers main edges only (!isTest); test-only cycles are reported separately and never fail a build. Layer resolution and glob matching are single-sourced here (LayerSpecParser, GlobMatcher) and reused verbatim by the report, so a classification never resolves one way in analysis and another in the template.

Packages

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

MetricsEngine and the derived architecture metrics — Lakos coupling, the main-sequence distance, and the graph statistics that power the report's KPI tiles and trend sparklines.

Link copied to clipboard
Link copied to clipboard

The rule engine. ArchRule is the rule contract; RuleEngine (with fromConfig) reconstructs the active rule set from the serialized DSL strings at execution time. Built-in rules — NoCyclicDependenciesRule, LayerDependencyRule, NoFeatureToFeatureDependencyRule, MaxTransitiveDependenciesRule — carry stable kebab-case ids that are a public contract in SARIF, JUnit XML, and suppression config. LayerSpecParser is the one parser for serialized layers { } entries, shared by the rules and the report.

Link copied to clipboard
Link copied to clipboard

Extension points for user-authored analysis. Custom ArchRule implementations ship as a separate jar and are wired in via rules { custom("fqcn") } in the consumer's aalekh { } block.

Link copied to clipboard