Repository navigation
feat(module-graph): draw inheritance alone where a pair both imports and extends - #749
Conversation
…and extends Checked against owner-api's own generated graph (Ownima/owner-api#2317): on its reservation domain, cgis_module_graph had all 25 of its edges plus 5 more, each an import beside an inheritance edge of the same pair (core --> effects and core ==> effects). Inheritance implies the import, so only ==> is drawn now, and the count is reported: `covered` in the JSON, "Imports drawn as their inheritance: N." under the diagram. Applied after the reduction, so which imports are implied by a longer path is still decided over all of them. On reservation the picture now matches owner-api's edge for edge (25 = 25). Closes #748 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to omit redundant import edges from the module graph when an inheritance ('extends') edge already exists between the same pair of modules. It adds a 'covered' attribute to track these omitted imports, updating the API documentation, Mermaid rendering, and JSON serialization accordingly. The review feedback correctly identifies a potential bug where the 'found' parameter in '_uncovered' is annotated as 'Iterable'. Since 'found' is evaluated multiple times, passing a non-reusable iterator could lead to silent exhaustion bugs; updating this annotation to 'Sequence' is recommended.
…in a cycle Review of #749: - Coverage came from the unreduced extends set, so where a ==> b was reduced away (implied through c) the import a --> b vanished too and the pair had no arrow at all, while the footnote counted it as "drawn as inheritance". It now comes from the kept extends edges. - An import that closes an import cycle is never covered, so the cycle stays readable in --> alone. - The legend, the dataclass and the MCP docstring say that a covered pair's ==> also stands for the import, so an import closure reads over both kinds; "inheritance implies the import" was too strong at module level. Each fix has a test that failed first. owner-api's reservation still matches its own diagram, 25 = 25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|



Closes #748.
I checked
cgis_module_graphagainst owner-api's own generated graph (docs/architecture/domain-modules.md, Ownima/owner-api#2317).core --> effectsandcore ==> effects.==>is drawn. The count is reported ascoveredin the JSON and as "Imports drawn as their inheritance: N." under the diagram.Tests
creation --> coreis now drawn ascreation ==> core;🤖 Generated with Claude Code