[PR #755] [CLOSED] fix(reference): resolve emitted extensions to TypeScript source #2217

Closed
opened 2026-10-16 21:15:48 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/755
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/rea-reference-runtime-source-extensions-20261006


📝 Commits (2)

  • abe5bb4 fix(reference): resolve emitted extensions to TypeScript source
  • bb640c7 test(reference): retain legitimate declaration import counterparts

📊 Changes

2 files changed (+113 additions, -0 deletions)

View changed files

📝 src/application/ReferenceSourceImportEntries.ts (+16 -0)
➕ tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts (+97 -0)

📄 Description

Summary

Resolve a TypeScript historical-source import's emitted .js, .jsx, .mjs or .cjs extension to its present source counterpart when the literal runtime file is absent. This repairs source-reference edges for ordinary NodeNext source trees.

Problem and expected behavior

main.ts exporting from ./dep.js, with dep.ts present, was reported as unresolved. The actual installed TypeScript 7.0.2 NodeNext compiler accepts this tree. The built public import-reference-source CLI reported all eight tested source counterparts as unresolved before the fix.

Change and scope

Add source-extension fallbacks for TypeScript callers after existing file candidates. Present runtime files retain precedence. Declaration files retain their actual source identity. JavaScript callers do not acquire TypeScript runtime fallbacks. Counterparts cover explicit filenames, not directory/index resolution. This does not implement full tsconfig or package resolution, nor establish runtime execution of declaration sources.

Contract and boundary impact

  • Semantic owner and earliest changed stage: filesystem source import relationship resolution, ReferenceSourceImportEntries.
  • CLI and MCP/tool-catalog contract: no schema or catalog change; CLI historical-source relationship output is corrected.
  • Provider, bridge, target-format, or platform compatibility: local filesystem importer; no Hopper/Ghidra bridge change.
  • Evidence, artifact, provenance, or reconstruction contract: actual present source paths and hashes retained; unsupported resolutions remain unresolved.
  • Process execution, authorization, cleanup, or containment impact: importer still does not execute source or perform network requests.
  • Generated metadata (docs/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: real filesystem imports for eight counterpart cases; existing runtime-file precedence and JavaScript negative controls. Maintainer follow-up adds three legitimate declaration-caller cases (.d.ts/.d.mts/.d.cts), verified with actual TypeScript NodeNext strict noEmit compilation.
  • Base reproduction or other evidence: 8 failures / 3 controls passed on base; 26 focused tests passed after, including existing import regressions. Actual TypeScript 7.0.2 NodeNext compiler accepts all eight owned fixtures.
  • User-visible CLI/MCP output: built CLI changed all eight fixture edges from unresolved emitted paths to internal present source paths.
  • Remaining proof gaps: no complete deterministic suite, Windows filesystem run or provider execution was performed.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts — 26 passed.
  • Actual TypeScript 7.0.2 tsc -p on owned NodeNext fixture tree — exit 0.
  • Built rea import-reference-source ... --json — all eight source counterparts internal; base had eight unresolved.
  • npm run check — all five tasks passed, 124 existing lint warnings and zero errors.
  • Oxfmt and git diff --check — pass.
  • npm run check:fast — pass (both cached tasks).

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: native macOS filesystem and actual TypeScript compiler only; no Hopper/Ghidra/browser claim.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no authorization/network/path containment change; owned public fixture data only. No related issue because this includes a self-contained regression. AI assisted implementation and tests; I reviewed and ran the checks.

Review checklist

  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Maintainer follow-up: signed bb640c7cb241cdb0fce6afd580b7a17fd352dc76 adds only the scope comment and declaration-caller controls; the existing valid caller gate is retained. New hosted checks pending, separate from the original all19 green head.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/755 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-reference-runtime-source-extensions-20261006` --- ### 📝 Commits (2) - [`abe5bb4`](https://github.com/morluto/rea/commit/abe5bb4097290883a65140936584bdffa7109c78) fix(reference): resolve emitted extensions to TypeScript source - [`bb640c7`](https://github.com/morluto/rea/commit/bb640c7cb241cdb0fce6afd580b7a17fd352dc76) test(reference): retain legitimate declaration import counterparts ### 📊 Changes **2 files changed** (+113 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ReferenceSourceImportEntries.ts` (+16 -0) ➕ `tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts` (+97 -0) </details> ### 📄 Description ## Summary Resolve a TypeScript historical-source import's emitted `.js`, `.jsx`, `.mjs` or `.cjs` extension to its present source counterpart when the literal runtime file is absent. This repairs source-reference edges for ordinary NodeNext source trees. ## Problem and expected behavior `main.ts` exporting from `./dep.js`, with `dep.ts` present, was reported as unresolved. The actual installed TypeScript 7.0.2 NodeNext compiler accepts this tree. The built public `import-reference-source` CLI reported all eight tested source counterparts as unresolved before the fix. ## Change and scope Add source-extension fallbacks for TypeScript callers after existing file candidates. Present runtime files retain precedence. Declaration files retain their actual source identity. JavaScript callers do not acquire TypeScript runtime fallbacks. Counterparts cover explicit filenames, not directory/index resolution. This does not implement full tsconfig or package resolution, nor establish runtime execution of declaration sources. ## Contract and boundary impact - Semantic owner and earliest changed stage: filesystem source import relationship resolution, `ReferenceSourceImportEntries`. - CLI and MCP/tool-catalog contract: no schema or catalog change; CLI historical-source relationship output is corrected. - Provider, bridge, target-format, or platform compatibility: local filesystem importer; no Hopper/Ghidra bridge change. - Evidence, artifact, provenance, or reconstruction contract: actual present source paths and hashes retained; unsupported resolutions remain unresolved. - Process execution, authorization, cleanup, or containment impact: importer still does not execute source or perform network requests. - Generated metadata (`docs/product-catalog.json`), package, or installation impact: none. ## Evidence and regression coverage - Tests added or updated: real filesystem imports for eight counterpart cases; existing runtime-file precedence and JavaScript negative controls. Maintainer follow-up adds three legitimate declaration-caller cases (.d.ts/.d.mts/.d.cts), verified with actual TypeScript NodeNext strict noEmit compilation. - Base reproduction or other evidence: **8 failures / 3 controls passed** on base; **26 focused tests passed** after, including existing import regressions. Actual TypeScript 7.0.2 NodeNext compiler accepts all eight owned fixtures. - User-visible CLI/MCP output: built CLI changed all eight fixture edges from unresolved emitted paths to internal present source paths. - Remaining proof gaps: no complete deterministic suite, Windows filesystem run or provider execution was performed. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts` — 26 passed. - Actual TypeScript 7.0.2 `tsc -p` on owned NodeNext fixture tree — exit 0. - Built `rea import-reference-source ... --json` — all eight source counterparts internal; base had eight unresolved. - `npm run check` — all five tasks passed, 124 existing lint warnings and zero errors. - Oxfmt and `git diff --check` — pass. - `npm run check:fast` — pass (both cached tasks). ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: native macOS filesystem and actual TypeScript compiler only; no Hopper/Ghidra/browser claim. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no authorization/network/path containment change; owned public fixture data only. No related issue because this includes a self-contained regression. AI assisted implementation and tests; I reviewed and ran the checks. ## Review checklist - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. Maintainer follow-up: signed `bb640c7cb241cdb0fce6afd580b7a17fd352dc76` adds only the scope comment and declaration-caller controls; the existing valid caller gate is retained. New hosted checks pending, separate from the original all19 green head. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:48 +00:00
Sign in to join this conversation.
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
morluto/rea#2217
No description provided.