[PR #1102] [MERGED] fix(javascript): parse plain TypeScript artifact dialects #2650

Closed
opened 2026-10-17 21:08:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1102
Author: @rudycelekli
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @N0zoM1z0

Base: main ← Head: validation/typescript-artifact-dialect-20261008


📝 Commits (6)

  • 58d089c test(javascript): reproduce TypeScript source dialect loss
  • 93d6faf test(javascript): admit isolated native compiler inputs
  • 9e81c22 Merge branch 'main' into validation/typescript-artifact-dialect-20261008
  • 7fe72ad fix(javascript): parse plain TypeScript artifacts without JSX
  • 702994e Merge branch 'main' into validation/typescript-artifact-dialect-20261008
  • 1e3e156 Merge branch 'main' into validation/typescript-artifact-dialect-20261008

📊 Changes

6 files changed (+264 additions, -2 deletions)

View changed files

📝 docs/javascript-artifact-reconstruction.md (+3 -0)
📝 src/application/javascript/JavaScriptArtifactAnalysis.ts (+1 -1)
📝 src/domain/javascript/javascriptSourceParser.ts (+7 -1)
➕ tests/boundary/cli/javascriptArtifactTypeScriptDialect.test.ts (+38 -0)
➕ tests/boundary/filesystem/javascriptArtifactTypeScriptDialect.test.ts (+39 -0)
➕ tests/fixtures/javascriptArtifactTypeScriptDialect.ts (+176 -0)

📄 Description

Plain .ts artifacts were always parsed with JSX enabled. Valid TypeScript angle-bracket assertions then failed inert parsing and lost syntax-derived reference facts from the file. Pass the known artifact path into the shared parser and disable JSX only for plain .ts. Preserve the existing parser flags, decorators support, unknown-path default and all other suffixes. Document the artifact dialect contract.

Native evidence:

  • Qualified tests-only BEFORE, verified 93d6faffe6a5573f7995f606fb3733745928121a: exactly eight product failures (four directory/real-ASAR .ts assertion/require cases and four built public CLI cases), twelve controls passed, zero retries. Native compiler syntax/emit checks complete before product calls; no other failures occurred in those owning shards.
  • Current accepted-main AFTER, verified 1e3e1568f6683b03b7fd17e6fc117572379e86d9: all twenty frozen owners pass with zero retries, alongside 335 neighboring parser/static/semantic/source-map controls. Complete aggregate: 5,132 passed, zero failed, 48 skipped (5,180 total). Static/docs/build, all four shards, aggregate, native Windows capability, real Apple and Linux package/runtime checks pass. All twenty-two native CI jobs now pass on this exact head, including both Darwin package jobs. The separate real JavaScript recovery run also passes. New upstream integration checks are not claimed green.
  • Signed source commits and verified accepted-main merges preserve the reviewed production parent 7fe72ad1a7deebdc0668571f21994935c9471f1f and all three frozen test blobs. Accepted #1087/#1092/#1093 changes and their owners are included in native integration without duplication in this diff. Current publication main ae0630a619ee2c98a68e65ca44bf0b93424e2f8e adds receiver-classification behavior in the owning analysis file and a semantic allocation-bound documentation paragraph after the qualification base c1b370ce. Those accepted changes occupy separate hunks from this path-forwarding/dialect fix; the current six-file PR diff retains this reviewed scope. Fresh policies and parser source remain unchanged. The complete 22-job proof above is bound to the exact fork head; current upstream integration checks will run separately.

The first tests-only CI attempt was unqualified because native TypeScript TS5112 requested --ignoreConfig before compiler admission. That raw error and immutable artifacts are preserved; no product proof comes from it. The corrected producer uses the actually installed locked TypeScript native CLI with --noCheck, then parses emitted syntax with Babel. This establishes syntax/emit eligibility, not broad type validity. The independent original-source oracle reads direct per-dialect Babel locations, raw digests and resolved dep.js facts.

Both built public artifact CLI routes and actual directory/ASAR forms are covered. .mts/.cts cases here qualify only valid producer grammar; artifact selection is independently owned by #1087. The Windows curated lane does not collect these new owner files, so no Windows-specific owner proof is claimed. Other shared-parser callers retain their defaults; a path-known source-map caller is an unqualified same-cause follow-up and is unchanged. No dependencies or workflows changed. Synthetic fixtures only; no private data or credentials. Analysis remains inert; Hopper/Ghidra verification was not run because their providers are unaffected. AI assistance was used for investigation, implementation and verification.

Signed-off-by: Rudy Celekli rudy@gradiahq.com


🔄 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/1102 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `validation/typescript-artifact-dialect-20261008` --- ### 📝 Commits (6) - [`58d089c`](https://github.com/morluto/rea/commit/58d089cb1e6134b056e4a914852a5f34a86da644) test(javascript): reproduce TypeScript source dialect loss - [`93d6faf`](https://github.com/morluto/rea/commit/93d6faffe6a5573f7995f606fb3733745928121a) test(javascript): admit isolated native compiler inputs - [`9e81c22`](https://github.com/morluto/rea/commit/9e81c22686f9e81a7f0e8989121708d2e0cac52e) Merge branch 'main' into validation/typescript-artifact-dialect-20261008 - [`7fe72ad`](https://github.com/morluto/rea/commit/7fe72ad1a7deebdc0668571f21994935c9471f1f) fix(javascript): parse plain TypeScript artifacts without JSX - [`702994e`](https://github.com/morluto/rea/commit/702994e2727d4cfcdba5cfadde61599440744fb7) Merge branch 'main' into validation/typescript-artifact-dialect-20261008 - [`1e3e156`](https://github.com/morluto/rea/commit/1e3e1568f6683b03b7fd17e6fc117572379e86d9) Merge branch 'main' into validation/typescript-artifact-dialect-20261008 ### 📊 Changes **6 files changed** (+264 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-artifact-reconstruction.md` (+3 -0) 📝 `src/application/javascript/JavaScriptArtifactAnalysis.ts` (+1 -1) 📝 `src/domain/javascript/javascriptSourceParser.ts` (+7 -1) ➕ `tests/boundary/cli/javascriptArtifactTypeScriptDialect.test.ts` (+38 -0) ➕ `tests/boundary/filesystem/javascriptArtifactTypeScriptDialect.test.ts` (+39 -0) ➕ `tests/fixtures/javascriptArtifactTypeScriptDialect.ts` (+176 -0) </details> ### 📄 Description Plain `.ts` artifacts were always parsed with JSX enabled. Valid TypeScript angle-bracket assertions then failed inert parsing and lost syntax-derived reference facts from the file. Pass the known artifact path into the shared parser and disable JSX only for plain `.ts`. Preserve the existing parser flags, decorators support, unknown-path default and all other suffixes. Document the artifact dialect contract. Native evidence: - [Qualified tests-only BEFORE](https://github.com/rudycelekli/rea/actions/runs/37804197008), verified `93d6faffe6a5573f7995f606fb3733745928121a`: exactly eight product failures (four directory/real-ASAR `.ts` assertion/require cases and four built public CLI cases), twelve controls passed, zero retries. Native compiler syntax/emit checks complete before product calls; no other failures occurred in those owning shards. - [Current accepted-main AFTER](https://github.com/rudycelekli/rea/actions/runs/37810960631), verified `1e3e1568f6683b03b7fd17e6fc117572379e86d9`: all twenty frozen owners pass with zero retries, alongside 335 neighboring parser/static/semantic/source-map controls. Complete aggregate: 5,132 passed, zero failed, 48 skipped (5,180 total). Static/docs/build, all four shards, aggregate, native Windows capability, real Apple and Linux package/runtime checks pass. All twenty-two native CI jobs now pass on this exact head, including both Darwin package jobs. The separate [real JavaScript recovery run](https://github.com/rudycelekli/rea/actions/runs/37810960605) also passes. New upstream integration checks are not claimed green. - Signed source commits and verified accepted-main merges preserve the reviewed production parent `7fe72ad1a7deebdc0668571f21994935c9471f1f` and all three frozen test blobs. Accepted #1087/#1092/#1093 changes and their owners are included in native integration without duplication in this diff. Current publication main `ae0630a619ee2c98a68e65ca44bf0b93424e2f8e` adds receiver-classification behavior in the owning analysis file and a semantic allocation-bound documentation paragraph after the qualification base `c1b370ce`. Those accepted changes occupy separate hunks from this path-forwarding/dialect fix; the current six-file PR diff retains this reviewed scope. Fresh policies and parser source remain unchanged. The complete 22-job proof above is bound to the exact fork head; current upstream integration checks will run separately. The first tests-only CI attempt was unqualified because native TypeScript TS5112 requested --ignoreConfig before compiler admission. That raw error and immutable artifacts are preserved; no product proof comes from it. The corrected producer uses the actually installed locked TypeScript native CLI with --noCheck, then parses emitted syntax with Babel. This establishes syntax/emit eligibility, not broad type validity. The independent original-source oracle reads direct per-dialect Babel locations, raw digests and resolved dep.js facts. Both built public artifact CLI routes and actual directory/ASAR forms are covered. `.mts`/`.cts` cases here qualify only valid producer grammar; artifact selection is independently owned by #1087. The Windows curated lane does not collect these new owner files, so no Windows-specific owner proof is claimed. Other shared-parser callers retain their defaults; a path-known source-map caller is an unqualified same-cause follow-up and is unchanged. No dependencies or workflows changed. Synthetic fixtures only; no private data or credentials. Analysis remains inert; Hopper/Ghidra verification was not run because their providers are unaffected. AI assistance was used for investigation, implementation and verification. Signed-off-by: Rudy Celekli <rudy@gradiahq.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:39 +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#2650
No description provided.