Skip to content

feat: resolve transitive imports and detect dependency cycles#18

Open
om-deshmukh-dev wants to merge 3 commits into
mainfrom
om/ats-graph-feature
Open

feat: resolve transitive imports and detect dependency cycles#18
om-deshmukh-dev wants to merge 3 commits into
mainfrom
om/ats-graph-feature

Conversation

@om-deshmukh-dev
Copy link
Copy Markdown
Contributor

@om-deshmukh-dev om-deshmukh-dev commented Mar 27, 2026

Summary

  • Implements recursive transitive dependency resolution via BFS, violations are now detected even when the forbidden import happens indirectly through an intermediate layer

  • Transitive violations report the full dependency path so the output explains why the violation exists

  • Adds cycle detection using DFS with three-color marking; cycles are surfaced as CIRCULAR_DEPENDENCY parser diagnostics and don't block analysis

    • Fixes reporter to render individual parser diagnostic details in human output instead of just a category count summary
    • Removes debug fetch() telemetry left in importExtractor.ts
    • Removes dist/ from .gitignore and adds a prepare script so npm install auto-rebuilds it

    Test plan

    • npm test passes
    • transitive-violation-repo fixture confirms transitive violation is detected with full path in both human and JSON output
    • cycle-repo fixture confirms cycle detection terminates cleanly with deterministic output across multiple runs
    • Existing snapshots for clean, violations, suppressed, and config-error repos are unchanged

- Remove debug fetch() telemetry from importExtractor
- Remove dist/ from .gitignore and add prepare script
- Update resolveTransitiveEdges to track and emit full dependency paths
  (transitive: A → B → C) instead of just "(transitive)"
- Fix reporter to render individual parser diagnostics in human output
  instead of just category counts
- Add transitive-violation-repo and cycle-repo fixtures with snapshots
- Add tests for transitive violation detection and cycle termination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant