Resolve relative internal imports #23

Merged
pdurlej merged 1 commit from codex/wave2-relative-resolver into codex/prewave-deterministic-contract 2026-05-17 00:37:46 +02:00
Collaborator

Canary Context Pack

Product story

Wave 2 starts the conservative graph. Agents need to know which relative imports point to local files and which relative imports are unresolved, without pretending to emulate bundlers or frameworks.

What changed

  • Added graph.internalEdges and graph.unresolvedInternalEdges to the report.
  • Resolved relative imports for explicit extensions, extensionless files, and directory index.* files.
  • Added conservative TypeScript source mapping for explicit .js/.mjs/.cjs imports to same-basename TS source files when present.
  • Updated schema docs, README example, golden JSON, and behavior tests.

Why it changed

This implements Wave 2 issue #7 and gives later Wave 2 work a deterministic graph foundation.

Files touched

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

Relevant context

Roadmap: docs/roadmap.md Wave 2. Stacked on the Wave 1 integration branch codex/prewave-deterministic-contract.

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

The graph resolves only relative internal imports. It does not handle package imports, TypeScript paths, package exports, bundler aliases, framework virtual modules, or reachability.

Explicit out-of-scope

No new findings, no dependency policy, no cycle detection, no agent-context format, no MCP server.

Requested decision

Review and approve as Wave 2 PR 1.

Merge blockers

Any false claim that this emulates bundler/package resolution, or a case where a supported relative import form is nondeterministic.

Closes #7.

## Canary Context Pack ### Product story Wave 2 starts the conservative graph. Agents need to know which relative imports point to local files and which relative imports are unresolved, without pretending to emulate bundlers or frameworks. ### What changed - Added `graph.internalEdges` and `graph.unresolvedInternalEdges` to the report. - Resolved relative imports for explicit extensions, extensionless files, and directory `index.*` files. - Added conservative TypeScript source mapping for explicit `.js`/`.mjs`/`.cjs` imports to same-basename TS source files when present. - Updated schema docs, README example, golden JSON, and behavior tests. ### Why it changed This implements Wave 2 issue #7 and gives later Wave 2 work a deterministic graph foundation. ### Files touched - `src/analyze.ts` - `src/types.ts` - `src/index.ts` - `tests/analyze.test.mjs` - `tests/golden/basic-report.json` - `tests/fixtures/module-syntax/src/lazy.ts` - `docs/report-schema-v0.md` - `README.md` ### Relevant context Roadmap: `docs/roadmap.md` Wave 2. Stacked on the Wave 1 integration branch `codex/prewave-deterministic-contract`. ### 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 The graph resolves only relative internal imports. It does not handle package imports, TypeScript `paths`, package `exports`, bundler aliases, framework virtual modules, or reachability. ### Explicit out-of-scope No new findings, no dependency policy, no cycle detection, no agent-context format, no MCP server. ### Requested decision Review and approve as Wave 2 PR 1. ### Merge blockers Any false claim that this emulates bundler/package resolution, or a case where a supported relative import form is nondeterministic. Closes #7.
Resolve relative internal imports
Some checks failed
CI / test (push) Failing after 14s
CI / test (pull_request) Failing after 13s
cfc49b356d
Closes #7.

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:13 +02:00
pdurlej merged commit c4a490b772 into codex/prewave-deterministic-contract 2026-05-17 00:37:46 +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!23
No description provided.