NarrativeEngine

Turns analysis into English.

Everything here is available as a number elsewhere in the report; the narrative states what those numbers mean. fan-in = 24 becomes "24 modules depend on this, more than half the project, so changes here are never local".

Sentences are assembled from computed values by a finder, so the same graph always produces byte-identical text - which is what makes the output safe to commit, diff, and assert on in CI.

Findings are ordered by severity first and category second, so anything actionable is read before the descriptive material regardless of which finder produced it.

Functions

Link copied to clipboard

Builds the full narrative for context. Returns NarrativeReport.EMPTY for an empty graph.

Link copied to clipboard

Findings grouped by category, in category order, skipping empty categories.

Link copied to clipboard
fun findingsFor(report: NarrativeReport, modulePath: String): List<Finding>

Findings for one module, for its detail page.