[PR #6802] [MERGED] fix(wasm): retain glue query and fragment across line terminators #7417

Closed
opened 2026-11-01 21:47:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6802
Author: @gongfpp
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/wasm-glue-url-separators-6639


📝 Commits (2)

  • 8db2065 fix(wasm): retain multiline glue query and fragment literals
  • 74a59dd Merge branch 'main' into fix/wasm-glue-url-separators-6639

📊 Changes

3 files changed (+90 additions, -26 deletions)

View changed files

📝 scripts/verify-wasm-artifact.mjs (+38 -12)
📝 src/wasm/WabtOutput.test.ts (+48 -1)
📝 src/wasm/WasmGlueAdapter.ts (+4 -13)

📄 Description

Summary

Fixes #6639. WASM glue inspection dropped .wasm string literals when a query or fragment contained LF, CR, CRLF, U+2028 or U+2029, while still reporting the source parse complete. The same literal values, UTF-16 coordinates and candidate associations now remain visible across those terminators. Bare paths with a trailing terminator remain rejected.

Approach and scope

endsWithWasmReference tests the complete cooked value with dotAll instead of slicing to the last physical line. Existing association logic continues to own local-path versus basename matching and preserves uncertainty. The change touches the predicate, its regressions and the existing real-WABT verifier; there are no schema, dependency, cache or provider-authority changes. Static glue parsing uses the existing WABT analysis workflow; runtime_execution and network_fetch semantics are unchanged. This is an ordinary correctness fix within existing boundaries; a separate maintainer scope decision is not applicable.

Current validation

Updated head 74a59dd8, integrated onto main f2db494b; Linux, Node 24.22.1/npm 11.16.0:

  • npm run test:focused -- src/wasm/WabtOutput.test.ts src/wasm/WabtArtifactProvider.test.ts: 69 passed, including hostile long literals and lifecycle regressions.
  • npm run check: passed.
  • Official WABT 1.0.42 archive verified against its GitHub asset SHA-256; node scripts/verify-wasm-artifact.mjs --require-tools: 61 cases passed, covering real provider CLI/MCP schemas, output, warnings and cleanup.
  • Real source-map mappings.wasm (48,526 unchanged bytes) plus its shipped loader and three explicitly added query/fragment variants: clean main retained only the original reference; this head retained all four exact values/coordinates and expected candidate classifications. The added glue is a controlled derivative, not a claim about shipped source-map URLs. Filtered compiled CLI output agreed with MCP summary plus retained-Evidence glue pages. Original digests and access to the complete parent Evidence were preserved.
  • Fresh-process/warm-filesystem application workflow, main/PR: elapsed 6.56/6.29 s, CPU 11.71/11.57 s, sampled family peak 517/517 MiB. The real verifier peaked at 1,573 MiB under a 2 GiB stop threshold. These small shared-host observations establish no speedup; no OS-cold run or actual whole-model token measurement was made. Selected-delivery tokenx estimates were 8,734/9,895, excluding initialization/framing/prompts/preknown schemas. Independent review and evidence scope.

CI run 40020767003 failed with 15 test failures, all reproduced on clean CI base f2db494b; seven remaining shards were cancelled. Static/build/native-package checks, title/readiness and Greptile passed; latest Codex review reports no actionable findings. Main then advanced to d29ae43a: this unchanged PR was re-integrated there, and 42 producer/MCP tests, full check and the real application workflow passed again. Final baseline and latest-main evidence.

Author readiness

Human owner: @gongfpp

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/6802 **Author:** [@gongfpp](https://github.com/gongfpp) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/wasm-glue-url-separators-6639` --- ### 📝 Commits (2) - [`8db2065`](https://github.com/morluto/rea/commit/8db20658b015d0155020a7391cf6cef181bc9b1f) fix(wasm): retain multiline glue query and fragment literals - [`74a59dd`](https://github.com/morluto/rea/commit/74a59dd8225f99438734d05350e63b91bb0c4c2c) Merge branch 'main' into fix/wasm-glue-url-separators-6639 ### 📊 Changes **3 files changed** (+90 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-wasm-artifact.mjs` (+38 -12) 📝 `src/wasm/WabtOutput.test.ts` (+48 -1) 📝 `src/wasm/WasmGlueAdapter.ts` (+4 -13) </details> ### 📄 Description ## Summary Fixes #6639. WASM glue inspection dropped `.wasm` string literals when a query or fragment contained LF, CR, CRLF, U+2028 or U+2029, while still reporting the source parse complete. The same literal values, UTF-16 coordinates and candidate associations now remain visible across those terminators. Bare paths with a trailing terminator remain rejected. ## Approach and scope `endsWithWasmReference` tests the complete cooked value with dotAll instead of slicing to the last physical line. Existing association logic continues to own local-path versus basename matching and preserves uncertainty. The change touches the predicate, its regressions and the existing real-WABT verifier; there are no schema, dependency, cache or provider-authority changes. Static glue parsing uses the existing WABT analysis workflow; `runtime_execution` and `network_fetch` semantics are unchanged. This is an ordinary correctness fix within existing boundaries; a separate maintainer scope decision is not applicable. ## Current validation Updated head `74a59dd8`, integrated onto main `f2db494b`; Linux, Node 24.22.1/npm 11.16.0: - `npm run test:focused -- src/wasm/WabtOutput.test.ts src/wasm/WabtArtifactProvider.test.ts`: **69 passed**, including hostile long literals and lifecycle regressions. - `npm run check`: passed. - Official WABT 1.0.42 archive verified against its GitHub asset SHA-256; `node scripts/verify-wasm-artifact.mjs --require-tools`: **61 cases passed**, covering real provider CLI/MCP schemas, output, warnings and cleanup. - Real source-map `mappings.wasm` (48,526 unchanged bytes) plus its shipped loader and three explicitly added query/fragment variants: clean main retained only the original reference; this head retained all four exact values/coordinates and expected candidate classifications. The added glue is a controlled derivative, not a claim about shipped source-map URLs. Filtered compiled CLI output agreed with MCP summary plus retained-Evidence glue pages. Original digests and access to the complete parent Evidence were preserved. - Fresh-process/warm-filesystem application workflow, main/PR: elapsed 6.56/6.29 s, CPU 11.71/11.57 s, sampled family peak 517/517 MiB. The real verifier peaked at 1,573 MiB under a 2 GiB stop threshold. These small shared-host observations establish no speedup; no OS-cold run or actual whole-model token measurement was made. Selected-delivery tokenx estimates were 8,734/9,895, excluding initialization/framing/prompts/preknown schemas. [Independent review and evidence scope](https://github.com/morluto/rea/pull/6802#pullrequestreview-5634258584). CI run [40020767003](https://github.com/morluto/rea/actions/runs/40020767003) failed with 15 test failures, all reproduced on clean CI base `f2db494b`; seven remaining shards were cancelled. Static/build/native-package checks, title/readiness and Greptile passed; latest Codex review reports no actionable findings. Main then advanced to `d29ae43a`: this unchanged PR was re-integrated there, and 42 producer/MCP tests, full check and the real application workflow passed again. [Final baseline and latest-main evidence](https://github.com/morluto/rea/pull/6802#issuecomment-6374631499). ## Author readiness Human owner: @gongfpp - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:42 +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#7417
No description provided.