Report conservative likely unused exports #30

Merged
pdurlej merged 1 commit from codex/wave3-likely-unused-export-v0 into codex/wave3-classification-buckets 2026-05-17 01:11:56 +02:00
Collaborator

Canary Context Pack

Product story

Agents need cleanup candidates, but fallow-ts must not pretend static JS/TS analysis proves deletion safety. This PR adds a narrow likely-unused-export signal with explicit caveats.

What changed

  • Adds likely-unused-export findings with medium confidence.
  • Reports only runtime exports in non-public modules with no incoming internal edges.
  • Excludes package public entrypoints, modules with incoming internal imports, type/interface exports, and obvious framework/application surfaces.
  • Classifies the new finding as decision_needed with product-language trade-offs.
  • Adds fixture coverage for public API protection and framework-ish src/app/page.tsx avoidance.
  • Fixes export line-number parsing so finding locations do not drift when a file starts with blank lines.

Why it changed

Wave 3 needs one conservative review-oriented cleanup finding before baseline and CI gates become useful.

Files touched

  • src/analyze.ts
  • src/types.ts
  • src/classify.ts
  • src/index.ts
  • tests/analyze.test.mjs
  • tests/fixtures/module-syntax/package.json
  • tests/golden/basic-report.json
  • tests/golden/basic-agent-context.md
  • docs/report-schema-v0.md
  • README.md

Runtime evidence

  • npm run build
  • npm test
  • node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json
  • git diff --check

Known constraints

This is a cleanup candidate signal only. It explicitly does not claim exports are safe to delete.

Explicit out-of-scope

No reachability engine, no TypeScript AST, no framework plugin system, no auto-fix.

Requested decision

Approve if the signal is conservative enough for v0 and the docs make the limitation clear.

Merge blockers

  • Claims or wording implying deletion safety.
  • Public entrypoint or re-exported public surfaces being flagged.
  • Missing behavioral tests for false-positive surfaces.

Closes #14.

## Canary Context Pack ### Product story Agents need cleanup candidates, but fallow-ts must not pretend static JS/TS analysis proves deletion safety. This PR adds a narrow likely-unused-export signal with explicit caveats. ### What changed - Adds `likely-unused-export` findings with `medium` confidence. - Reports only runtime exports in non-public modules with no incoming internal edges. - Excludes package public entrypoints, modules with incoming internal imports, type/interface exports, and obvious framework/application surfaces. - Classifies the new finding as `decision_needed` with product-language trade-offs. - Adds fixture coverage for public API protection and framework-ish `src/app/page.tsx` avoidance. - Fixes export line-number parsing so finding locations do not drift when a file starts with blank lines. ### Why it changed Wave 3 needs one conservative review-oriented cleanup finding before baseline and CI gates become useful. ### Files touched - `src/analyze.ts` - `src/types.ts` - `src/classify.ts` - `src/index.ts` - `tests/analyze.test.mjs` - `tests/fixtures/module-syntax/package.json` - `tests/golden/basic-report.json` - `tests/golden/basic-agent-context.md` - `docs/report-schema-v0.md` - `README.md` ### Runtime evidence - `npm run build` - `npm test` - `node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json` - `git diff --check` ### Known constraints This is a cleanup candidate signal only. It explicitly does not claim exports are safe to delete. ### Explicit out-of-scope No reachability engine, no TypeScript AST, no framework plugin system, no auto-fix. ### Requested decision Approve if the signal is conservative enough for v0 and the docs make the limitation clear. ### Merge blockers - Claims or wording implying deletion safety. - Public entrypoint or re-exported public surfaces being flagged. - Missing behavioral tests for false-positive surfaces. Closes #14.
Report conservative likely unused exports
Some checks failed
CI / test (push) Failing after 13s
CI / test (pull_request) Failing after 13s
1dace9a568
Closes #14.

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:52:08 +02:00
pdurlej merged commit fae16c870f into codex/wave3-classification-buckets 2026-05-17 01:11:56 +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!30
No description provided.