[PR #2796] [MERGED] fix(wasm): attribute invalid paths to their selected fields #5400

Closed
opened 2026-10-31 01:06:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2796
Author: @maxazure
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/wasm-secondary-path-attribution


📝 Commits (2)

  • c516f48 fix(wasm): attribute invalid paths to their selected fields
  • 7ba08c4 test(wasm): assert the exact rejected selection issues

📊 Changes

2 files changed (+115 additions, -16 deletions)

View changed files

📝 src/application/wasm/WasmArtifactService.ts (+24 -16)
📝 tests/boundary/mcp/wasmArtifactMcp.test.ts (+91 -0)

📄 Description

Summary

Fixes #2618. Relative WASM glue and candidate paths now identify their own field and array index in correction metadata, instead of blaming the primary path.

Problem and expected behavior

{path: "/artifacts/module.wasm", glue_paths: ["relative.js"]} was rejected with issues[0].path: ["path"]. The caller needs ["glue_paths", 0] to correct the selected input.

Change and scope

Keep each selected path's location while checking host absolute-path semantics in WasmArtifactService. Report every rejected selection before invoking the provider. This removes the location loss at the owning boundary; consumers continue using the shared typed error projection.

This is an ordinary fix within existing contribution boundaries. No advance maintainer scope decision applies.

Contract and boundary impact

  • Semantic owner and earliest changed stage: shared WASM service input validation.
  • Contribution scope fit and linked maintainer decision: not applicable; existing offline inspection.
  • CLI and MCP/tool-catalog contract: schemas unchanged; MCP receives accurate issue paths. CLI still resolves selected paths before validation.
  • Provider, bridge, target-format, or platform compatibility: provider calls and host path semantics unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged; rejected input does not reach inspection.
  • Target selection, authority, upstream behavior, and cleanup details: unchanged.
  • Generated metadata, package, or installation impact: none.

Expected effects of the existing valid inspection workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Change process memory, registers, files, or configuration.

The existing WABT provider launches local tools and writes private workspace files. This change adds no effects; invalid selections remain rejected before provider work. There is no target execution, instrumentation, memory mutation, network acquisition, or protection recovery.

Evidence and regression coverage

  • MCP regression covers the primary path, both secondary fields, index 1 after a valid entry, simultaneous invalid selections, no provider invocation, and exact forwarding of an all-absolute request with secondary selections. The final follow-up uses toEqual on the complete ordered issues list, enforcing exact entries and fields rather than a subset assertion. The service retains each location at the validation owner; no downstream repair or related cleanup remains.

  • Executed on base ec4f4ddc588a564b75d69249b4ebbe4d4051c792: the new MCP regression failed because ["glue_paths", 0] was projected as ["path"]; the other eight MCP tests passed.

  • Representative corrected MCP issue: {"path":["glue_paths",0],"reason":"invalid_format","message":"Expected an absolute filesystem path on this host."}.

  • Remaining proof gaps: WABT itself and Windows/Linux hosts were not exercised. The MCP harness uses a source-owned provider seam; no real-engine claim is made.

  • 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

macOS arm64, Node 24.18.0, npm 11.16.0, locked dependencies:

  • npm run test:focused -- src/application/wasm/WasmArtifactService.test.ts src/wasm/WabtOutput.test.ts src/wasm/WabtArtifactProvider.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts — 44 tests passed across four files; required runtime/skill build passed.
  • npm run check — passed typecheck, lint, format, knip, metadata and architecture/module boundaries. Lint reported 0 errors and 1052 warnings; runtime bundling reported two ineffective dynamic-import warnings.
  • npm run verify:test-discovery — all 1059 test files discovered exactly once.
  • git diff --check — passed.
  • Independent static review, including final test follow-up — no findings; reviewer did not independently execute tests. Final MCP file rerun: all nine tests passed, followed by a passing npm run check and normal pre-push gate.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; error paths now name the actual rejected selections, and simultaneous failures each receive an issue.
  • Real Hopper/Ghidra, browser, or OS coverage: no engine or browser changes; local macOS MCP harness coverage as described above.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new authority or effects. Existing schema limits bound secondary arrays to 16 entries each. No unrelated cleanup remains in the touched validation path.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.

🔄 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/2796 **Author:** [@maxazure](https://github.com/maxazure) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/wasm-secondary-path-attribution` --- ### 📝 Commits (2) - [`c516f48`](https://github.com/morluto/rea/commit/c516f482f8a26482b2629fa3e514f8e727a0bba8) fix(wasm): attribute invalid paths to their selected fields - [`7ba08c4`](https://github.com/morluto/rea/commit/7ba08c486eb410fcaaed491d6ec46bfb6a12883c) test(wasm): assert the exact rejected selection issues ### 📊 Changes **2 files changed** (+115 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/application/wasm/WasmArtifactService.ts` (+24 -16) 📝 `tests/boundary/mcp/wasmArtifactMcp.test.ts` (+91 -0) </details> ### 📄 Description ## Summary Fixes #2618. Relative WASM glue and candidate paths now identify their own field and array index in correction metadata, instead of blaming the primary `path`. ## Problem and expected behavior `{path: "/artifacts/module.wasm", glue_paths: ["relative.js"]}` was rejected with `issues[0].path: ["path"]`. The caller needs `["glue_paths", 0]` to correct the selected input. ## Change and scope Keep each selected path's location while checking host absolute-path semantics in `WasmArtifactService`. Report every rejected selection before invoking the provider. This removes the location loss at the owning boundary; consumers continue using the shared typed error projection. This is an ordinary fix within existing contribution boundaries. No advance maintainer scope decision applies. ## Contract and boundary impact - Semantic owner and earliest changed stage: shared WASM service input validation. - Contribution scope fit and linked maintainer decision: not applicable; existing offline inspection. - CLI and MCP/tool-catalog contract: schemas unchanged; MCP receives accurate issue paths. CLI still resolves selected paths before validation. - Provider, bridge, target-format, or platform compatibility: provider calls and host path semantics unchanged. - Evidence, artifact, provenance, or reconstruction contract: unchanged; rejected input does not reach inspection. - Target selection, authority, upstream behavior, and cleanup details: unchanged. - Generated metadata, package, or installation impact: none. Expected effects of the existing valid inspection workflow: - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [x] Change process memory, registers, files, or configuration. The existing WABT provider launches local tools and writes private workspace files. This change adds no effects; invalid selections remain rejected before provider work. There is no target execution, instrumentation, memory mutation, network acquisition, or protection recovery. ## Evidence and regression coverage - MCP regression covers the primary path, both secondary fields, index 1 after a valid entry, simultaneous invalid selections, no provider invocation, and exact forwarding of an all-absolute request with secondary selections. The final follow-up uses `toEqual` on the complete ordered issues list, enforcing exact entries and fields rather than a subset assertion. The service retains each location at the validation owner; no downstream repair or related cleanup remains. - Executed on base `ec4f4ddc588a564b75d69249b4ebbe4d4051c792`: the new MCP regression failed because `["glue_paths", 0]` was projected as `["path"]`; the other eight MCP tests passed. - Representative corrected MCP issue: `{"path":["glue_paths",0],"reason":"invalid_format","message":"Expected an absolute filesystem path on this host."}`. - Remaining proof gaps: WABT itself and Windows/Linux hosts were not exercised. The MCP harness uses a source-owned provider seam; no real-engine claim is made. - [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 macOS arm64, Node 24.18.0, npm 11.16.0, locked dependencies: - `npm run test:focused -- src/application/wasm/WasmArtifactService.test.ts src/wasm/WabtOutput.test.ts src/wasm/WabtArtifactProvider.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts` — 44 tests passed across four files; required runtime/skill build passed. - `npm run check` — passed typecheck, lint, format, knip, metadata and architecture/module boundaries. Lint reported 0 errors and 1052 warnings; runtime bundling reported two ineffective dynamic-import warnings. - `npm run verify:test-discovery` — all 1059 test files discovered exactly once. - `git diff --check` — passed. - Independent static review, including final test follow-up — no findings; reviewer did not independently execute tests. Final MCP file rerun: all nine tests passed, followed by a passing `npm run check` and normal pre-push gate. ## Compatibility, safety, and release - Breaking changes or migration steps: none; error paths now name the actual rejected selections, and simultaneous failures each receive an issue. - Real Hopper/Ghidra, browser, or OS coverage: no engine or browser changes; local macOS MCP harness coverage as described above. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new authority or effects. Existing schema limits bound secondary arrays to 16 entries each. No unrelated cleanup remains in the touched validation path. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:06:20 +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#5400
No description provided.