Repository navigation
fix(wasm): preserve original glue source locations - #2114
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bf8140788
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@greptileai review |
|
Source-reviewed changes. Tests, builds and check reruns were skipped at maintainer request.
* fix(comparison): preserve incomplete function call evidence Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty. Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls. * fix(comparison): recheck historical calls-only changes --------- Co-authored-by: morluto <[email protected]> (cherry picked from commit 688defc)
(cherry picked from commit 8cac51e)
(cherry picked from commit 1335bcd)
…2895) * fix: repair the static-check failures on the default branch The default branch fails its own required `Static checks` job three ways, so every pull request reports that job as failed regardless of its own change. - `npm run format:check` reports `src/domain/functionComparison.test.ts` and `src/ida/IdaOperationRunner.ts`. - `npm run lint` reports a duplicate `import { join } from "node:path"` in `tests/boundary/mcp/ghidraInventoryMcp.test.ts` (lines 4 and 17). - `npm run typecheck` reports `format: "devin"` missing from the client format union in `src/application/SupportedClients.ts`, and an unchecked index in `tests/boundary/cli/clientProfileLifecycle.test.ts`, whose pair array is inferred as `string[][]`. Apply the pinned formatter, drop the duplicate import, list the `"devin"` format that its own definition already uses, and mark the pair array `as const`. Validation: `npm run check:fast` and `npm run format:check` pass. * fix(setup): keep Devin on the JSON configuration dialect --------- Co-authored-by: 吴佳浩 <[email protected]> Co-authored-by: morluto <[email protected]> (cherry picked from commit df3d96d)
Summary
Preserve original JavaScript source locations when inspecting BOM-prefixed WASM glue files.
inspect-wasm-artifact/inspect_wasm_artifactpreviously reported first-line literal columns one character too early, even though their artifact hash and byte count described the original file.Problem and expected behavior
For
\uFEFFfetch("./module.wasm");, the string literal starts at zero-based column 7. The provider's default UTF-8 decoder removed U+FEFF before Babel parsed the source, so Evidence reported column 6. Locations must refer to the same original source whose digest is recorded. Newlines must reset columns normally; adding a downstream offset would incorrectly move later lines.This was found by tracing source decoding into glue reference evidence; no existing issue is linked. This is distinct from #2102, which handles WABT binary custom-section names: this change fixes JavaScript file decoding and source coordinates, with no changes to WAT/binary name parsing.
Change and scope
Preserve U+FEFF in the existing fatal UTF-8 decoder at
WabtArtifactProvider.inspect. Babel already accepts it as JavaScript whitespace and computes the original positions. For BOM-prefixed hashbangs,associateWasmGlueremoves only the BOM before parsing so Babel can recognize the interpreter directive; reference line/column coordinates remain unchanged because executable source follows the hashbang line. No generic offset adjustment is introduced.Extend the existing real-WABT verifier with plain, BOM-prefixed, BOM-plus-newline, plain hashbang, and BOM-prefixed hashbang source controls. Both local and URL literals are checked against positions derived from original source text; each glue file's path, hash, byte count, unchanged contents and candidate associations are verified.
Contract and boundary impact
WabtArtifactProvider.inspect, beforeassociateWasmGlueparses source.Evidence and regression coverage
Base
c22111eca2c4bc84a084f12711f405b3e7422a40, running the extended verifier against its built runtime: failed with first-line columns 6/32 instead of 7/33.Candidate with real WABT: all 42 verifier cases pass, including public CLI and stdio MCP, schema validation, equal Evidence, original artifact identity and cleanup.
Representative corrected output:
glue[].references[0]hasline: 1, column: 7for the BOM-prefixed source; plain source hasline: 1, column: 6, and BOM-plus-newline source hasline: 2, column: 6.Review regression: the expanded verifier fails on initial head
9bf8140788withparse_status: failedfor BOM-plus-hashbang source; the follow-up preserves references and exact later-line positions.Remaining proof gaps: executed on macOS with WABT 1.0.42; no claim of Linux/Windows execution or runtime execution of the glue/module.
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
npm run build:cached— passed.REA_WABT_BIN_DIRECTORY=<local WABT 1.0.42 bin> node scripts/verify-wasm-artifact.mjs --require-tools— 42 cases passed; the extended verifier fails on the unchanged base runtime.npm run test:focused -- src/wasm/WabtArtifactProvider.test.ts src/wasm/WabtOutput.test.ts src/application/wasm/WasmArtifactService.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts— 33 tests passed.npm run check— all six tasks and architecture guards passed.git diff --check— passed.Compatibility, safety, and release
Review checklist
type(scope): outcome.Hosted CI baseline
Initial-head test shard 1 failed in
promptCompletion.test.ts([]versus['App', 'AppTests']), matching exact base main. Both Darwin package jobs failed withpackaged MCP prompt completion lifecycle failed, matching base arm64 and base x64. These remain CI failures, not passes. Follow-up-head CI results are tracked separately.