[PR #694] [MERGED] fix(reference): bound Dockerfile language detection #2174

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/694
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/dockerfile-language-boundary


📝 Commits (1)

  • 53fa559 fix(reference): bound Dockerfile language detection

📊 Changes

3 files changed (+170 additions, -3 deletions)

View changed files

📝 src/domain/referenceSourceClassification.ts (+2 -3)
➕ src/domain/referenceSourceDockerfileLanguage.test.ts (+51 -0)
➕ tests/boundary/filesystem/referenceSourceDockerfileLanguage.test.ts (+117 -0)

📄 Description

Summary

Let ordinary source files whose names start with Dockerfile reach the existing extension-based language detector.

No separate issue: this is a reproduced language-detection and source-import defect.

Problem and expected behavior

DockerfileGuide.ts is currently labeled Dockerfile rather than TypeScript. The importer consequently skips Babel: its real imports disappear, and malformed TypeScript produces no parse failure. The same source in ordinary.ts is parsed normally.

The detector already has an exact/Dockerfile. branch, but a second case-insensitive arbitrary-prefix check admits unrelated filenames.

Change and scope

Use one case-insensitive exact-or-dotted Dockerfile check. Preserve recognition of Dockerfile, dockerfile, Dockerfile.dev, Dockerfile.dev.ts, and their case variants. Unrelated prefixes fall through to the existing extension logic.

No new filename conventions or parsers are added. This is independent of #665 and #692; all three patches were also tested together.

Contract and boundary impact

  • Semantic owner: reference-source language detection before parser admission.
  • CLI/MCP: affected inventory languages and recovered imports/parse failures become accurate; no schema or tool changes.
  • Provider/platform: unchanged; existing POSIX basename handling remains.
  • Evidence/provenance: file paths, bytes, SHA-256, sizes, classifications, unresolved references and computed-import uncertainty are preserved. Derived graph identifiers can change with corrected evidence.
  • Process/authorization/cleanup: source is parsed as data and never executed; no new network or process behavior.
  • Generated metadata/package: unchanged.

Evidence and regression coverage

On unchanged main b6c21b1, 12 new tests fail and 18 controls pass. Public filesystem import suppresses all three expected relationships for DockerfileGuide.ts and drops its malformed-TypeScript failure; ordinary.ts provides the paired control.

Tests cover unrelated prefixes, nested paths, case, declaration extensions, unknown extensions, genuine exact/dotted names, literal internal/unresolved imports, computed imports and malformed syntax.

Validation performed

After fast-forwarding to current main e60aa11:

  • Six focused detector, parser, graph and filesystem import suites: 57 tests passed.
  • Build and npm run check: passed; all five check tasks succeeded (93 existing warnings, no errors).
  • npm run jscpd, npm run scan:todos, and git diff --check: passed.
  • Combined #665 + #692 + this patch: 89 tests passed in a separate tree.
  • Independent review: no blocking findings; additional filename/path and classification probes passed.

Node.js 24.19.0, npm 11.9.0, exact current locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed.

Compatibility, safety, and release

No schema, packaging, provider, or execution-authority changes. Package-install and real Hopper/Ghidra lanes were not rerun for this language-detection correction.

Prepared with AI assistance.


🔄 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/694 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/dockerfile-language-boundary` --- ### 📝 Commits (1) - [`53fa559`](https://github.com/morluto/rea/commit/53fa55937f241fc9ef3091eb22314cc370c749b9) fix(reference): bound Dockerfile language detection ### 📊 Changes **3 files changed** (+170 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/referenceSourceClassification.ts` (+2 -3) ➕ `src/domain/referenceSourceDockerfileLanguage.test.ts` (+51 -0) ➕ `tests/boundary/filesystem/referenceSourceDockerfileLanguage.test.ts` (+117 -0) </details> ### 📄 Description ## Summary Let ordinary source files whose names start with `Dockerfile` reach the existing extension-based language detector. No separate issue: this is a reproduced language-detection and source-import defect. ## Problem and expected behavior `DockerfileGuide.ts` is currently labeled `Dockerfile` rather than `TypeScript`. The importer consequently skips Babel: its real imports disappear, and malformed TypeScript produces no parse failure. The same source in `ordinary.ts` is parsed normally. The detector already has an exact/`Dockerfile.` branch, but a second case-insensitive arbitrary-prefix check admits unrelated filenames. ## Change and scope Use one case-insensitive exact-or-dotted Dockerfile check. Preserve recognition of `Dockerfile`, `dockerfile`, `Dockerfile.dev`, `Dockerfile.dev.ts`, and their case variants. Unrelated prefixes fall through to the existing extension logic. No new filename conventions or parsers are added. This is independent of #665 and #692; all three patches were also tested together. ## Contract and boundary impact - Semantic owner: reference-source language detection before parser admission. - CLI/MCP: affected inventory languages and recovered imports/parse failures become accurate; no schema or tool changes. - Provider/platform: unchanged; existing POSIX basename handling remains. - Evidence/provenance: file paths, bytes, SHA-256, sizes, classifications, unresolved references and computed-import uncertainty are preserved. Derived graph identifiers can change with corrected evidence. - Process/authorization/cleanup: source is parsed as data and never executed; no new network or process behavior. - Generated metadata/package: unchanged. ## Evidence and regression coverage On unchanged main `b6c21b1`, 12 new tests fail and 18 controls pass. Public filesystem import suppresses all three expected relationships for `DockerfileGuide.ts` and drops its malformed-TypeScript failure; `ordinary.ts` provides the paired control. Tests cover unrelated prefixes, nested paths, case, declaration extensions, unknown extensions, genuine exact/dotted names, literal internal/unresolved imports, computed imports and malformed syntax. ## Validation performed After fast-forwarding to current main `e60aa11`: - Six focused detector, parser, graph and filesystem import suites: 57 tests passed. - Build and `npm run check`: passed; all five check tasks succeeded (93 existing warnings, no errors). - `npm run jscpd`, `npm run scan:todos`, and `git diff --check`: passed. - Combined #665 + #692 + this patch: 89 tests passed in a separate tree. - Independent review: no blocking findings; additional filename/path and classification probes passed. Node.js 24.19.0, npm 11.9.0, exact current locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed. ## Compatibility, safety, and release No schema, packaging, provider, or execution-authority changes. Package-install and real Hopper/Ghidra lanes were not rerun for this language-detection correction. Prepared with AI assistance. --- <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:13 +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#2174
No description provided.