Repository navigation
feat(wasm): compare retained core-module interfaces - #2464
Conversation
Resolve producer-owned typed interface facts and compare authenticated Evidence with explicit scope, provenance and unknown coverage. Bound repeated signature expansion and preserve partial observations. Fixes #2356
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@greptileai review |
|
Address review findings at their producing boundaries and preserve directly affected consumers. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request.
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. The absence branches ran before validating the present entry’s admitted semantics. Comparison now checks every present entry’s signature/issue/kind before added/removed/changed classification, so one-sided unsupported types remain unknown and coverage partial. Removed superseded downstream signature checks and redundant inventory tests. Added both comparison directions for an unsupported signature. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request. Commit: 01c8eb0 |
Summary
Fixes #2356. Adds
compare_wasm_interfaces/rea compare-wasm-interfacesto compare declared core-module imports and exports from two authenticatedinspect_wasm_artifactEvidence records. Results preserve original artifact identities and distinguish added, removed, changed, unchanged and unknown observations.Problem and expected behavior
Inspection previously retained exact WAT forms without a typed interface comparison. Byte differences or changed type indices cannot establish whether a function signature changed. The WABT producer now resolves typed interface facts once; comparison consumes those facts without rereading files or reparsing retained display text.
The input requires
scope: imports | exports | bothand accepts portable inline Evidence or exact current-session references. For example, two differently encoded modules can report unchanged interfaces despite different original SHA-256 digests; a changed parameter type reports changed. Duplicate names and incomplete inventories remain unknown.Change and scope
interfacefacts with exact decoded names, kinds, resolved function/tag signatures, table/memory limits, memory page size and global type/mutability. Original WAT forms remain intact; historical Evidence can omit the facet.docs/specs/2356-wasm-interface-comparison/.This is core-module comparison. #2406 separately adds component decoding; this patch neither depends on nor duplicates its component parser. No component ABI comparison, module instantiation or runtime-compatibility inference is added.
Contract and boundary impact
Expected effects:
Evidence and regression coverage
For evidence-bearing changes:
Validation performed
On main base
a2d8b94dd50dab8d966239dd63ab84718aa8b4b4:npm run check: passed, including typecheck, lint, formatting, knip and architecture guards; lint warnings remain.npm run docs:generateandnpm run docs:check: passed.npm run verify:test-discovery: 1011 files, each discovered exactly once.node scripts/verify-wasm-interface-comparison.mjswith WABT 1.0.42: passed through compiled CLI and stdio MCP.node scripts/verify-wasm-artifact.mjs --require-tools: 42 real-tool cases passed.Compatibility, safety, and release
No breaking change, migration, new dependency or release metadata change. Comparison reads only explicitly supplied Evidence; source acquisition and execution are not performed. Static equality is not runtime/ABI compatibility or successful linking. Real-tool verification covers macOS arm64; native Linux/Windows lanes remain unverified. Token usage and concurrent process-family peak memory are unmeasured. CI remains separate from local verification.
Before merge