You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rpc-ts): align RPC wire layer with .NET V5/ExceptionInfo contracts
Batch "rpcwire" fixes from docs/plans/ts-port-audit.md:
- R1: parse V5/V5Compact headers AFTER the argument data (per
RpcByteMessageSerializerV5), reading argData right after the 4-byte
length prefix and counting header bytes in bytesRead.
- R2 (D3): send JS errors to .NET peers as RemoteException — TypeRef
'ActualLab.Serialization.RemoteException, ActualLab.Core' with
Message "{name}: {message}" from $sys.Error and stream $sys.End.
- R6: unregister mempack6/mempack6c; the resolver now throws a clear
"MemoryPack formats are not supported by the TS client" error.
- R7 (partial): export readPolymorphismMarker (\0\0 fast path, NullValue,
derived-type markers throw) as a building block — it is NOT wired into
arg decoding because TS has no per-argument polymorphism signal (in
.NET, needsPolymorphism comes from method metadata, not the wire).
Instead, $sys.Ok/I/B handlers guard on value arity (these calls carry
a fixed count; marker bytes decode as extra msgpack values), so a
polymorphic payload now rejects the call / errors the stream with a
clear "polymorphic payloads are not supported" error instead of
silently resolving marker bytes as the result.
- R15: key $sys.End error detection on TypeRef presence (fallback to
Message), carrying the TypeRef's type name into the Error's name.
Adds regression tests for R1 (V5 + V5Compact + headerless + two headers
in a multi-message frame), R2, R6, R7 (marker parsing + arity guards),
R15; removes the temporary ts-port-audit-repro suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDiBQM5rnhyBG1asuP1kDi
Copy file name to clipboardExpand all lines: docs/plans/ts-port-audit.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -414,6 +414,8 @@ Confidence: confirmed. Every failure is pushed to a plain array; only manual `di
414
414
415
415
### R1. V5/V5C binary format: header block parsed at the wrong position
416
416
417
+
Status: **closed** — fixed 2026-07-15 (batch rpcwire; byte-level parity re-verified against the .NET writer, incl. multi-header and multi-message frames).
418
+
417
419
Confidence: confirmed (byte-level; re-verified).
418
420
419
421
- TS: `rpc-serialization.ts:293-321` (`deserializeBinaryMessage`) reads the 4-byte argLen, then skips headers, then reads argData. Same in the compact variant at `:473-495`.
- TS: `rpc-serialization-format.ts:239-242, 249-252` — `MemoryPackV6`/`MemoryPackV6C` are constructed as msgpack formats and resolvable via `f=` URL keys.
@@ -479,6 +485,8 @@ Confidence: confirmed.
479
485
480
486
### R7. Binary polymorphism markers (`msgpack6`) not implemented
481
487
488
+
Status: **closed (partial)** — 2026-07-15 (batch rpcwire). Polymorphic payloads now fail loudly ("polymorphic payloads are not supported") via an arity guard on `$sys.Ok`/`I`/`B` value counts, and `readPolymorphismMarker` ships as a verified building block. Actual decoding of polymorphic payloads stays unsupported until TS method metadata gains a polymorphism flag — there is no wire signal to key on (`needsPolymorphism` is .NET-side method metadata).
489
+
482
490
Confidence: confirmed in code; triggers only for polymorphic types.
483
491
484
492
- TS: args are encoded/decoded as bare concatenated msgpack values (`rpc-serialization.ts:209-257, 309-321`), no type-marker handling.
Confidence: confirmed. TS: `rpc-system-call-handler.ts:146-163` — `error = msg ? new Error(msg) : null`. C#: `error.IsNone` = empty `TypeRef` (`RpcSystemCalls.cs:180-187`, `ExceptionInfo.cs:32`). A stream terminated by an exception with an empty `Message` looks like clean completion.
563
573
564
574
-**Recommended:** key error detection on `TypeRef` presence (fall back to `Message`), and carry the `TypeRef` into the constructed `Error`'s name for fidelity.
0 commit comments