feat(I203/M2): InvocationContext + streaming parity (post-I198/I199) #1

Merged
buildagent merged 2 commits from feat/i203-m2-invocation-streaming into main 2026-05-29 17:03:24 +02:00
Member

Mission I203 / M2 — Node.js SDK parity with Rust for InvocationContext (spec 21) + streaming (spec 23). Nested ixt-public eaf4205117319c.

  • Phase A: typed InvocationContext (invocation.js: ActorIdentity/ActorSubject/MessageTarget/MetadataKeys); _handleMessage decodes HandlePayload.context. Schemas consumed via hand-written capnp-ts Struct subclasses (the SDK doesn't run capnpc) — new schema-context.capnp.js + schema-streaming.capnp.js with layouts derived from capnp compile. Fixed a pre-existing stale serialization test (JSON→Cap'n Proto since I140).
  • Phase B: streaming.js — StreamId/StreamData/StreamError, 6-variant StreamFrame union (encode+decode), StreamSender (sendData/close/cancel/error + credit/backpressure), StreamHandle (fromOpen + InvocationContext decode), 4 InteractionKinds, 13-variant StreamErrorCode. No gold-plating.

Tests: npm test green — 62 (serialization 17, services 15, streaming 30). Byte-identical golden wire vectors with the Python/Rust SDKs (all 8 StreamFrame + 2 InvocationContext). Lockstep pin bump follows.

🤖 Generated with Claude Code

Mission I203 / M2 — Node.js SDK parity with Rust for InvocationContext (spec 21) + streaming (spec 23). Nested `ixt-public` `eaf4205`→`117319c`. - **Phase A**: typed `InvocationContext` (`invocation.js`: ActorIdentity/ActorSubject/MessageTarget/MetadataKeys); `_handleMessage` decodes `HandlePayload.context`. Schemas consumed via hand-written `capnp-ts` Struct subclasses (the SDK doesn't run capnpc) — new `schema-context.capnp.js` + `schema-streaming.capnp.js` with layouts derived from `capnp compile`. Fixed a pre-existing stale serialization test (JSON→Cap'n Proto since I140). - **Phase B**: `streaming.js` — StreamId/StreamData/StreamError, 6-variant StreamFrame union (encode+decode), StreamSender (sendData/close/cancel/error + credit/backpressure), StreamHandle (`fromOpen` + InvocationContext decode), 4 InteractionKinds, 13-variant StreamErrorCode. No gold-plating. **Tests:** `npm test` green — 62 (serialization 17, services 15, streaming 30). **Byte-identical golden wire vectors** with the Python/Rust SDKs (all 8 StreamFrame + 2 InvocationContext). Lockstep pin bump follows. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Bump nested ixt-public eaf4205 -> 117319c (post-I198 schemas: streaming
wire, InvocationContext spec-21 rework, ipc additions).

Migrate the handle() context surface off the deleted pre-spec-21
RequestContext/SecurityContext/SecurityLevel to the canonical
InvocationContext (actor identity + capabilities + metadata, no
security.level). Mirrors the Rust oracle (types.rs) and the Python/Go
siblings.

- invocation.js: InvocationContext / ActorIdentity / ActorSubject /
  MessageTarget / MetadataKeys, with byte-identical Cap'n Proto wire
  round-trip against module.capnp.
- schema-context.capnp.js: hand-written capnp-ts struct classes
  (layouts taken verbatim from `capnp compile -ocapnp module.capnp`).
- ixt-process-module.js: _handleMessage now decodes the HandlePayload
  context bytes into a typed InvocationContext (anonymous fallback),
  backfilling envelope identifiers; exports the new types.
- examples/services-demo.js: context.trace_id -> context.traceId,
  context.source_module -> context.sourceModule.
- test-serialization.js: fixed stale post-I140 "JSON wire format" test
  (the SDK is Cap'n Proto, not JSON) to assert the Cap'n Proto wire form.

Existing suites green: serialization 17/17, services 15/15.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author the spec-23 streaming surface for the Node SDK, mirroring the Rust
oracle (streaming.rs + stream_wire.rs) and the Python/Go siblings:
StreamHandle, StreamSender (sendData/close/cancel/error with credit-based
backpressure), StreamFrame tagged union (open/data/error/close/cancel/
credit), StreamId/StreamData/StreamError, the 4 InteractionKinds, and the
Close/Cancel/13-variant StreamError enums.

- streaming.js: idiomatic async/Promise StreamSender; StreamHandle.fromOpen
  for the callee/accept path; StreamFrame Cap'n Proto encode/decode.
- schema-streaming.capnp.js: hand-written capnp-ts struct classes (layouts
  from `capnp compile -ocapnp ipc_streaming.capnp`).
- test-streaming.js: StreamFrame + InvocationContext round-trips, credit/
  backpressure, and byte-identical golden vectors shared with the
  Rust/Python/Go SDKs (canonical single-segment Cap'n Proto).
- ixt-process-module.js: export the streaming primitives.

Full suite green: serialization 17/17, services 15/15, streaming 30/30.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
h-dv/ixt-sdk-nodejs!1
No description provided.