[GH-ISSUE #3350] [Bug] Harmony projection omits JavaScript runtime hints for supported source extensions #1217

Closed
opened 2026-10-16 21:02:55 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/3350

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

project-harmony-application-graph returns a JavaScript component with authenticated format javascript-bundle but omits javascript from runtime_families when its name ends in .jsx, .ts, .tsx, .mts, or .cts. The result reports complete coverage despite the disagreement between the component inventory and runtime summary. Both inspect-artifact and the projection command exit with code 0. The public CLI mismatch and extension controls were reproduced, and the reproduction is complete.

The .js, .mjs, and .cjs controls return runtime_families: ["javascript"]. The other tested source extensions retain the same JavaScript component format and omit that hint.

Reproduction

  1. Create a clean checkout and build the baseline runtime. The original reproduction used dependencies and compiled runtime that were already present.
git clone https://github.com/morluto/rea.git rea-harmony-repro
cd rea-harmony-repro
git checkout 8dde6370d0809ad04cda3342d4e6f290f48aa063
npm ci
npm run build:cached
  1. From the repository root, create a HAP containing one JavaScript source file and run the documented inventory-to-projection workflow. This creates the archive, isolated configuration directory, inventory Evidence, projection input, and result file inline.
case_dir=$(mktemp -d)
mkdir "$case_dir/home"
python3 - "$case_dir/sample.hap" <<'PYTHON'
import sys, zipfile
with zipfile.ZipFile(sys.argv[1], "w") as archive:
    archive.writestr("assets/js/index.jsx", "export const value = 1;")
PYTHON
HOME="$case_dir/home" TMPDIR="$case_dir" \
  node scripts/rea.mjs inspect-artifact "$case_dir/sample.hap" \
  --format json > "$case_dir/inspection.json"
python3 - "$case_dir/inspection.json" "$case_dir/projection-input.json" <<'PYTHON'
import json, sys
with open(sys.argv[2], "w") as output:
    json.dump({"inventory_evidence": [json.load(open(sys.argv[1]))]}, output)
PYTHON
HOME="$case_dir/home" TMPDIR="$case_dir" \
  node scripts/rea.mjs project-harmony-application-graph \
  "$case_dir/projection-input.json" --format json > "$case_dir/result.json"
python3 - "$case_dir/result.json" <<'PYTHON'
import json, sys
result = json.load(open(sys.argv[1]))["normalized_result"]
print(json.dumps({
    "javascript": [{"path": row["path"], "format": row["format"]}
                   for row in result["components"]["javascript"]],
    "runtime_families": result["runtime_families"],
    "coverage": result["coverage"]
}, indent=2))
PYTHON
  1. Repeat step 2 with the same source content, changing only assets/js/index.jsx in archive.writestr to assets/js/index.ts, assets/js/index.tsx, assets/js/index.mts, and assets/js/index.cts, one case at a time. Each extension individually reproduced the omitted hint.

  2. Repeat step 2 with assets/js/index.js, assets/js/index.mjs, and assets/js/index.cjs, one case at a time, as the successful controls. The source content remains export const value = 1; in every case.

Expected behavior

The runtime-family hints should use authenticated inventory formats as well as paths. A returned javascript-bundle component should retain a javascript runtime hint independently of which supported source extension supplied the format. This remains an inventory inference and does not claim target execution.

docs/harmony-analysis.md:44 promises runtime-family hints from paths and formats. src/domain/javascript/javascriptArtifactFiles.ts:4 lists the supported source extensions used by inventory classification.

Impact and scope

Impact level: P2. Assessment status: supported. The runtime summary omits a family that the same authenticated result identifies in its component array, which can misdirect subsequent analysis selected from runtime_families. The complete JavaScript component rows and identities remain available.

Workaround status: available. Callers can inspect components.javascript directly. That collection retains the paths and authenticated JavaScript formats in every executed case.

REA version

6.4.0 (main at 8dde6370d0)

Runtime and platform

Node.js v26.10.0, macOS 27.0.1 arm64. The reproduction used the built source runtime with dependencies and compiled runtime already present.

Target and artifact context

A locally created HAP ZIP containing one entry, assets/js/index.jsx, with source content export const value = 1;. The extension variants use the same content. The input to projection is authenticated inventory Evidence from inspect-artifact.

Interface

CLI

Earliest failure stage

Transport or result projection

Relevant output or evidence

Both public commands exit with code 0. The selected observed projection fields for the .jsx case are:

{
  "javascript": [
    {"path": "assets/js/index.jsx", "format": "javascript-bundle"}
  ],
  "runtime_families": [],
  "coverage": {
    "status": "complete-within-inventory",
    "inventory_complete": true
  }
}

The .ts, .tsx, .mts, and .cts cases retain the same JavaScript component format and omit the hint. The .js, .mjs, and .cjs controls return runtime_families: ["javascript"].

Typed outcome or recovery expected

Repeat the fixture workflow. The .jsx result must retain its existing component identity and javascript in runtime_families. Check the individually reproduced .ts, .tsx, .mts, and .cts cases and the already successful .js, .mjs, and .cjs controls. A package with no JavaScript component or JavaScript path should still omit that family.

Analysis or suspected cause

Source-derived reasoning: src/domain/harmony/harmonyApplication.ts:186 accepts the JavaScript artifact format in components, while src/domain/harmony/harmonyApplication.ts:203 derives the JavaScript runtime family only from a narrower set of filename suffixes. This accounts for the disagreement between the retained component and the runtime summary. The executed inventory and projection outputs and extension controls establish the failure; the source locators identify the differing classification rules.

Additional context

  • Related completed issue #1234 loses JavaScript path classifications when files share byte identity; this report retains the authenticated JavaScript component and loses only its Harmony runtime hint for supported extensions.
  • Related completed issue #1489 concerns false framework runtime and bridge conventions from path substrings in Android and Apple projections; this report concerns a missing JavaScript runtime hint in the Harmony projection.
  • Related open proposal #1431 tracks Harmony package and Ark bytecode capabilities; this report concerns incorrect runtime hints in the existing inventory projection.
  • Related completed issue #2454 corrects Harmony archive formats in MCP session output validation; the CLI inventory and projection here both succeed but return inconsistent component and runtime-family fields.
Originally created by @coygeek on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/3350 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior `project-harmony-application-graph` returns a JavaScript component with authenticated format `javascript-bundle` but omits `javascript` from `runtime_families` when its name ends in `.jsx`, `.ts`, `.tsx`, `.mts`, or `.cts`. The result reports complete coverage despite the disagreement between the component inventory and runtime summary. Both `inspect-artifact` and the projection command exit with code 0. The public CLI mismatch and extension controls were reproduced, and the reproduction is complete. The `.js`, `.mjs`, and `.cjs` controls return `runtime_families: ["javascript"]`. The other tested source extensions retain the same JavaScript component format and omit that hint. ### Reproduction 1. Create a clean checkout and build the baseline runtime. The original reproduction used dependencies and compiled runtime that were already present. ```sh git clone https://github.com/morluto/rea.git rea-harmony-repro cd rea-harmony-repro git checkout 8dde6370d0809ad04cda3342d4e6f290f48aa063 npm ci npm run build:cached ``` 2. From the repository root, create a HAP containing one JavaScript source file and run the documented inventory-to-projection workflow. This creates the archive, isolated configuration directory, inventory Evidence, projection input, and result file inline. ```sh case_dir=$(mktemp -d) mkdir "$case_dir/home" python3 - "$case_dir/sample.hap" <<'PYTHON' import sys, zipfile with zipfile.ZipFile(sys.argv[1], "w") as archive: archive.writestr("assets/js/index.jsx", "export const value = 1;") PYTHON HOME="$case_dir/home" TMPDIR="$case_dir" \ node scripts/rea.mjs inspect-artifact "$case_dir/sample.hap" \ --format json > "$case_dir/inspection.json" python3 - "$case_dir/inspection.json" "$case_dir/projection-input.json" <<'PYTHON' import json, sys with open(sys.argv[2], "w") as output: json.dump({"inventory_evidence": [json.load(open(sys.argv[1]))]}, output) PYTHON HOME="$case_dir/home" TMPDIR="$case_dir" \ node scripts/rea.mjs project-harmony-application-graph \ "$case_dir/projection-input.json" --format json > "$case_dir/result.json" python3 - "$case_dir/result.json" <<'PYTHON' import json, sys result = json.load(open(sys.argv[1]))["normalized_result"] print(json.dumps({ "javascript": [{"path": row["path"], "format": row["format"]} for row in result["components"]["javascript"]], "runtime_families": result["runtime_families"], "coverage": result["coverage"] }, indent=2)) PYTHON ``` 3. Repeat step 2 with the same source content, changing only `assets/js/index.jsx` in `archive.writestr` to `assets/js/index.ts`, `assets/js/index.tsx`, `assets/js/index.mts`, and `assets/js/index.cts`, one case at a time. Each extension individually reproduced the omitted hint. 4. Repeat step 2 with `assets/js/index.js`, `assets/js/index.mjs`, and `assets/js/index.cjs`, one case at a time, as the successful controls. The source content remains `export const value = 1;` in every case. ### Expected behavior The runtime-family hints should use authenticated inventory formats as well as paths. A returned `javascript-bundle` component should retain a `javascript` runtime hint independently of which supported source extension supplied the format. This remains an inventory inference and does not claim target execution. `docs/harmony-analysis.md:44` promises runtime-family hints from paths and formats. `src/domain/javascript/javascriptArtifactFiles.ts:4` lists the supported source extensions used by inventory classification. ### Impact and scope Impact level: P2. Assessment status: supported. The runtime summary omits a family that the same authenticated result identifies in its component array, which can misdirect subsequent analysis selected from `runtime_families`. The complete JavaScript component rows and identities remain available. Workaround status: available. Callers can inspect `components.javascript` directly. That collection retains the paths and authenticated JavaScript formats in every executed case. ### REA version 6.4.0 (main at 8dde6370d0809ad04cda3342d4e6f290f48aa063) ### Runtime and platform Node.js v26.10.0, macOS 27.0.1 arm64. The reproduction used the built source runtime with dependencies and compiled runtime already present. ### Target and artifact context A locally created HAP ZIP containing one entry, `assets/js/index.jsx`, with source content `export const value = 1;`. The extension variants use the same content. The input to projection is authenticated inventory Evidence from `inspect-artifact`. ### Interface CLI ### Earliest failure stage Transport or result projection ### Relevant output or evidence Both public commands exit with code 0. The selected observed projection fields for the `.jsx` case are: ```text { "javascript": [ {"path": "assets/js/index.jsx", "format": "javascript-bundle"} ], "runtime_families": [], "coverage": { "status": "complete-within-inventory", "inventory_complete": true } } ``` The `.ts`, `.tsx`, `.mts`, and `.cts` cases retain the same JavaScript component format and omit the hint. The `.js`, `.mjs`, and `.cjs` controls return `runtime_families: ["javascript"]`. ### Typed outcome or recovery expected Repeat the fixture workflow. The `.jsx` result must retain its existing component identity and `javascript` in `runtime_families`. Check the individually reproduced `.ts`, `.tsx`, `.mts`, and `.cts` cases and the already successful `.js`, `.mjs`, and `.cjs` controls. A package with no JavaScript component or JavaScript path should still omit that family. ### Analysis or suspected cause Source-derived reasoning: `src/domain/harmony/harmonyApplication.ts:186` accepts the JavaScript artifact format in components, while `src/domain/harmony/harmonyApplication.ts:203` derives the JavaScript runtime family only from a narrower set of filename suffixes. This accounts for the disagreement between the retained component and the runtime summary. The executed inventory and projection outputs and extension controls establish the failure; the source locators identify the differing classification rules. ### Additional context - Related completed issue [#1234](https://github.com/morluto/rea/issues/1234) loses JavaScript path classifications when files share byte identity; this report retains the authenticated JavaScript component and loses only its Harmony runtime hint for supported extensions. - Related completed issue [#1489](https://github.com/morluto/rea/issues/1489) concerns false framework runtime and bridge conventions from path substrings in Android and Apple projections; this report concerns a missing JavaScript runtime hint in the Harmony projection. - Related open proposal [#1431](https://github.com/morluto/rea/issues/1431) tracks Harmony package and Ark bytecode capabilities; this report concerns incorrect runtime hints in the existing inventory projection. - Related completed issue [#2454](https://github.com/morluto/rea/issues/2454) corrects Harmony archive formats in MCP session output validation; the CLI inventory and projection here both succeed but return inconsistent component and runtime-family fields.
Author
Owner

@morluto commented on GitHub (Oct 17, 2026):

Fixed on main by fc935d0df. Adapted @eco-null's proposal and regressions from #3627 and completed the related Android consumer cleanup (#4782). This is not a PR merge/readiness attestation.

Harmony's Ark/JavaScript and Android's DEX/JVM summaries now consume their classified component lists. The independent filename checks and Harmony's copied/lowercased path array were removed. Native byte-format and framework path-convention rules retain their existing semantics.

Before the fix, six Harmony assertions fail (five additional source extensions plus the public journey), and the Android built CLI reports two runtime hints with empty bytecode lists. The fix passes all eight JavaScript-extension controls, unrelated content, Android dot-name and normal-name controls, HAP/HSP/App Pack public session lifecycles, and equivalent CLI/MCP projections. Final combined validation at fc935d0df:91focused checks in9files; build,check:fast/typecheck/lint,docs:check (5README checks) and hooks pass. Two read-only reviews found no blocker.

36 completed actual built public CLI projection tasks compared an isolated baseline at a425b3e52 with the candidate using6 genuine tiny authored inventories. First processes were separated from2alternating repeats. Repeated-process medians:

Task Full reply tokens Elapsed ms CPU ms OS peak MB
harmony-jsx 1131→1134 365.79→363.27 562.03→559.96 353.88→353.26
harmony-js 1130→1130 362.28→356.24 530.91→548.86 343.72→353.39
harmony-none 1043→1043 365.92→366.22 563.17→555.34 354.05→349.92
harmony-ark 1109→1109 364.47→365.48 554.86→558.29 350.21→353.15
android-dot 891→884 369.94→363.21 562.75→568.81 354.07→353.26
android-named 1077→1077 363.68→360.51 551.37→560.42 349.05→353.09

Four ordinary control replies, including Evidence/projection IDs, are byte-identical. Tokens are full stdout cl100k_base estimates. CPU uses OSwait4; both sampled process-family RSS and OSprocess peak were recorded. These projection workflows launch no target/provider, and no descendants were observed. Sampled peaks can miss brief peaks; no statistical speed improvement or true-cold claim. Whole-agent/catalog/MCP, inventorygeneration, large-input and failure costs remain unmeasured. The owned baseline worktree was removed normally. No heavy profiling or published npm verification.

<!-- gh-comment-id:6233662724 --> @morluto commented on GitHub (Oct 17, 2026): Fixed on main by fc935d0df. Adapted @eco-null's proposal and regressions from #3627 and completed the related Android consumer cleanup (#4782). This is not a PR merge/readiness attestation. Harmony's Ark/JavaScript and Android's DEX/JVM summaries now consume their classified component lists. The independent filename checks and Harmony's copied/lowercased path array were removed. Native byte-format and framework path-convention rules retain their existing semantics. Before the fix, six Harmony assertions fail (five additional source extensions plus the public journey), and the Android built CLI reports two runtime hints with empty bytecode lists. The fix passes all eight JavaScript-extension controls, unrelated content, Android dot-name and normal-name controls, HAP/HSP/App Pack public session lifecycles, and equivalent CLI/MCP projections. Final combined validation at fc935d0df:91focused checks in9files; build,check:fast/typecheck/lint,docs:check (5README checks) and hooks pass. Two read-only reviews found no blocker. 36 completed actual built public CLI projection tasks compared an isolated baseline at a425b3e52 with the candidate using6 genuine tiny authored inventories. First processes were separated from2alternating repeats. Repeated-process medians: | Task | Full reply tokens | Elapsed ms | CPU ms | OS peak MB | | --- | --- | --- | --- | --- | | harmony-jsx | 1131→1134 | 365.79→363.27 | 562.03→559.96 | 353.88→353.26 | | harmony-js | 1130→1130 | 362.28→356.24 | 530.91→548.86 | 343.72→353.39 | | harmony-none | 1043→1043 | 365.92→366.22 | 563.17→555.34 | 354.05→349.92 | | harmony-ark | 1109→1109 | 364.47→365.48 | 554.86→558.29 | 350.21→353.15 | | android-dot | 891→884 | 369.94→363.21 | 562.75→568.81 | 354.07→353.26 | | android-named | 1077→1077 | 363.68→360.51 | 551.37→560.42 | 349.05→353.09 | Four ordinary control replies, including Evidence/projection IDs, are byte-identical. Tokens are full stdout cl100k_base estimates. CPU uses OSwait4; both sampled process-family RSS and OSprocess peak were recorded. These projection workflows launch no target/provider, and no descendants were observed. Sampled peaks can miss brief peaks; no statistical speed improvement or true-cold claim. Whole-agent/catalog/MCP, inventorygeneration, large-input and failure costs remain unmeasured. The owned baseline worktree was removed normally. No heavy profiling or published npm verification.
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#1217
No description provided.