Repository navigation
feat(wasm): inspect local artifacts with WABT - #1533
Merged
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Owner
|
Thank you @thangldw for adding local WebAssembly inspection with WABT! The shared CLI/MCP workflow, artifact and tool provenance, explicit JavaScript glue selection, and verification fixtures make this a useful addition to REA. I reviewed it and pushed the custom-name parsing, diagnostic, and cleanup fixes, along with the main-branch conflict resolution. Really appreciate the feature and the test coverage. |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #884.
Add
inspect-wasm-artifact/inspect_wasm_artifactfor explicitly selected local WebAssembly files using caller-supplied WABT 1.0.42. CLI and MCP return identical Evidence with selected artifact and executable digests, validation, section ranges, exact upstream import/export WAT forms, decoded WAT and optional JavaScript glue candidate associations.Problem and expected behavior
REA previously had no target-free WABT workflow for inspecting a saved website's WASM artifact. Operators should be able to inspect selected bytes, correlate static glue literals with explicit local candidates and read the same Evidence back through MCP, while preserving URL/path ambiguity and the distinction between decoded WAT, original source and runtime behavior.
Change and scope
WasmArtifactPort, shared input/output validation service and composition for the optional WABT adapter.wasm-validate,wasm-objdumpandwasm2wat; no WASM binary parser or target interpreter is introduced.Contract and boundary impact
REA_WABT_BIN_DIRECTORY; unsupported/missing profiles return actionable unavailable outcomes. Other providers are unchanged.Evidence and regression coverage
Tests added or updated: producer framing and escaped WAT names; glue ambiguity; provider cancellation/deadline propagation, malformed output, snapshot mutation and cleanup uncertainty; application identity validation; actual MCP SDK schemas and session recording. Register the new adapter tests in the existing Vitest project.
Base reproduction or other evidence: [Feature] Integrate WABT for WebAssembly artifact inspection and website glue evidence #884 describes the missing integration; real WABT generates and validates the source-owned fixtures before inspection.
User-visible CLI/MCP output: the custom-section fixture reports 76 selected bytes, SHA-256
fc147439b4861e92c2f3f203818dd7a05a0b3c31c76c4096c85fe8dc2b5743c8, atestcustom section, decoded@custom "test" "payload", and exact escaped import/export forms. Invalid/truncated inputs return typed errors with captured upstream diagnostics and partial Evidence.Remaining proof gaps: real-tool execution was verified on macOS arm64 with the official release archive digest checked. Linux/Windows need their own real-tool verification; dynamic/computed JS data flow and runtime behavior remain unproven.
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 check— passed typecheck, lint, formatting, knip, metadata and architecture guards; lint has warnings and no errors.npm run docs:check— passed generated catalog/skill/error metadata and documentation checks.npm run verify:test-discovery— all 729 test files discovered exactly once.REA_WABT_BIN_DIRECTORY=... npm run verify:wasm:artifact -- --require-tools— 18 real CLI/MCP cases passed, including exact output, Evidence IDs/readback, invalid/truncated bytes, custom sections and escaped names; verified empty remaining verifier descendants.REA_WABT_BIN_DIRECTORY=... npm run verify:wasm:package— the same 18 real cases passed against a freshly packed package installed into an isolated temporary prefix with lifecycle scripts disabled.npm run verify:package— general packaging, installed CLI/MCP, schemas/catalog, Evidence, skill and startup checks passed.npm run jscpd,npm run scan:todos,git diff --check— passed.Compatibility, safety, and release
Review checklist
type(scope): outcome.