Detect circular dependencies #26

Merged
pdurlej merged 1 commit from codex/wave2-circular-dependencies into codex/wave2-unresolved-internal-import 2026-05-17 00:38:06 +02:00
Collaborator

Canary Context Pack

Product story

Agents need a compact project-shape signal before editing. Import cycles are one of the first graph-level risks that can be detected deterministically without framework knowledge.

What changed

  • Added graph.cycles as deterministic module-path cycles.
  • Added circular-dependency findings with severity, confidence, location, and evidence path.
  • Covered simple two-node and multi-node cycles in tests.
  • Updated schema docs, README, and golden JSON.

Why it changed

This implements Wave 2 issue #10 on top of the resolved internal graph.

Files touched

  • src/analyze.ts
  • src/types.ts
  • src/index.ts
  • tests/analyze.test.mjs
  • tests/golden/basic-report.json
  • docs/report-schema-v0.md
  • README.md

Relevant context

Stacked on PR #25 / branch codex/wave2-unresolved-internal-import.

Runtime evidence

  • npm run build
  • npm test
  • node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json produced findings: 0 and cycles: [] for this repo.
  • git diff --check

Known constraints

The regex parser does not distinguish type-only imports yet, so type-only edges are included in cycle detection. This is documented as a v0 limitation.

Explicit out-of-scope

No baseline/fail-on behavior, no classification buckets, no unused export analysis, no MCP server.

Requested decision

Review and approve as Wave 2 PR 4.

Merge blockers

Nondeterministic cycle output, duplicate cycle reporting, or docs implying type-only import precision that does not exist yet.

Closes #10.

## Canary Context Pack ### Product story Agents need a compact project-shape signal before editing. Import cycles are one of the first graph-level risks that can be detected deterministically without framework knowledge. ### What changed - Added `graph.cycles` as deterministic module-path cycles. - Added `circular-dependency` findings with severity, confidence, location, and evidence path. - Covered simple two-node and multi-node cycles in tests. - Updated schema docs, README, and golden JSON. ### Why it changed This implements Wave 2 issue #10 on top of the resolved internal graph. ### Files touched - `src/analyze.ts` - `src/types.ts` - `src/index.ts` - `tests/analyze.test.mjs` - `tests/golden/basic-report.json` - `docs/report-schema-v0.md` - `README.md` ### Relevant context Stacked on PR #25 / branch `codex/wave2-unresolved-internal-import`. ### Runtime evidence - `npm run build` - `npm test` - `node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json` produced `findings: 0` and `cycles: []` for this repo. - `git diff --check` ### Known constraints The regex parser does not distinguish type-only imports yet, so type-only edges are included in cycle detection. This is documented as a v0 limitation. ### Explicit out-of-scope No baseline/fail-on behavior, no classification buckets, no unused export analysis, no MCP server. ### Requested decision Review and approve as Wave 2 PR 4. ### Merge blockers Nondeterministic cycle output, duplicate cycle reporting, or docs implying type-only import precision that does not exist yet. Closes #10.
Detect circular dependencies
Some checks failed
CI / test (push) Failing after 13s
CI / test (pull_request) Failing after 13s
434d41bc47
Closes #10.

Verified:

- npm run build

- npm test

- node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json

- git diff --check
codex requested review from claude 2026-05-17 00:35:32 +02:00
pdurlej merged commit afa2b06411 into codex/wave2-unresolved-internal-import 2026-05-17 00:38:06 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/fallow-ts!26
No description provided.