fix(wasm-worker): wire paramBindings, returnTypeMap, callAssignments through worker boundary#1352
Conversation
…through worker boundary These three ExtractorOutput fields were populated by the JS/TS extractor but never included in SerializedExtractorOutput, causing them to be silently dropped when results crossed the Worker thread boundary. The main thread always received undefined for these fields regardless of what the worker computed, breaking cross-file return-type propagation, param binding resolution, and call-assignment tracking in the WASM engine. Fixes #1348
|
Claude finished @carlos-alm's task —— View job PR Review
Root Cause AnalysisProblem Being Solved: Three fields populated by the JS/TS extractor ( Why This Approach: Correct and minimal. The serialization pattern for Risk Assessment: Low. The changes are purely additive. No existing deserialization path is modified; new fields are only wired in when present ( Backlog Compliance
Code QualityThe implementation is clean and consistent with existing patterns. A few observations:
One minor observation: The No test coverage for the new fields — there are no new tests specifically exercising that Critical ConcernsNone. The fix is correct and tightly scoped. Final Recommendation
|
Greptile SummaryThis PR fixes a silent data-loss bug where
Confidence Score: 5/5Safe to merge — the change is a targeted, symmetric addition to a well-established serialization/deserialization pair, and all three new fields carry only plain-primitive data. The serializer correctly uses No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant W as WASM Worker (wasm-worker-entry.ts)
participant P as Protocol (SerializedExtractorOutput)
participant M as Main Thread (wasm-worker-pool.ts)
W->>W: JS/TS extractor populates ExtractorOutput
W->>W: serializeExtractorOutput()
Note over W: typeMap → Array tuples
Note over W: returnTypeMap → Array tuples (if size>0)
Note over W: callAssignments passthrough (if length>0)
Note over W: paramBindings passthrough (if length>0)
W-->>P: postMessage(SerializedExtractorOutput)
Note over W,P: structured clone crosses worker boundary
P-->>M: message received
M->>M: deserializeResult()
Note over M: typeMap tuples → new Map()
Note over M: returnTypeMap tuples → new Map() (if length>0)
Note over M: callAssignments assigned directly
Note over M: paramBindings assigned directly
M->>M: returns ExtractorOutput with all fields populated
Reviews (1): Last reviewed commit: "fix(wasm-worker): wire paramBindings, re..." | Re-trigger Greptile |
Codegraph Impact Analysis5 functions changed → 3 callers affected across 2 files
|
Summary
SerializedExtractorOutputinwasm-worker-protocol.tswas missingparamBindings,returnTypeMap, andcallAssignments— three fields the JS/TS extractor populates but that were silently dropped at the Worker thread boundarySerializedExtractorOutput(withreturnTypeMapencoded asArray<[string, TypeMapEntry]>tuples, matching the existingtypeMappattern)serializeExtractorOutputinwasm-worker-entry.tsanddeserializeResultinwasm-worker-pool.tsCloses #1348