@moltzap/protocol 2026.501.5 → 2026.501.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dispatcher-concurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatcher-concurrency.d.ts","sourceRoot":"","sources":["../../../src/testing/conformance/dispatcher-concurrency.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Conformance — s2c dispatcher concurrency invariants.
3
+ *
4
+ * Spec: moltzap#356 §8 (test plan, file 4).
5
+ *
6
+ * Cross-implementation contract: any client that drains s2c request
7
+ * frames MUST run hooks for distinct `(sessionId, conversationId,
8
+ * hookKind)` tuples on independent fibers. A `before_dispatch` hook
9
+ * suspended on a `Deferred.await` MUST NOT delay a sibling
10
+ * `before_message_delivery` hook for the same conversation.
11
+ *
12
+ * The reproducer that exercised this (arena#246, arena#248):
13
+ *
14
+ * 1. Server sends `apps/onBeforeDispatch` for (S, C). Client handler
15
+ * suspends on `Deferred.await(release)` (lease-acquisition gate).
16
+ * 2. Server sends `apps/onBeforeMessageDelivery` for the SAME (S, C)
17
+ * whose response would resolve `release`.
18
+ * 3. Single-fiber dispatchers (the pre-#356 `Stream.runForEach`)
19
+ * queue (2) behind (1) — the release that would unblock (1) is
20
+ * itself blocked on (1). Self-deadlock.
21
+ * 4. A correct dispatcher resolves: (2) runs to completion; the
22
+ * `Deferred` fires; (1) resumes and replies.
23
+ *
24
+ * ─── Implementation status (impl-staff #356) ────────────────────────
25
+ *
26
+ * The properties P1-P4 below are the cross-implementation contract.
27
+ * They are NOT registered with the conformance property registry in
28
+ * this PR because cross-impl execution requires the conformance
29
+ * `TestServer` to emit s2c request frames — a surface addition the
30
+ * architect plan §6 ("No public-package-barrel change. No public
31
+ * surface change to pre-existing modules.") explicitly excluded
32
+ * from the spec's scope.
33
+ *
34
+ * Until that infrastructure lands, the same properties are exercised
35
+ * at lower layers against the reference client implementation
36
+ * (`@moltzap/client`):
37
+ *
38
+ * - **P1 (disjoint-key concurrency)** —
39
+ * `packages/client/src/internal/__tests__/s2c-partitioned-dispatcher.test.ts`
40
+ * `"two offers with different keys execute concurrently"`.
41
+ *
42
+ * - **P2 (arena#248 reproducer)** —
43
+ * `packages/client/src/internal/__tests__/s2c-partitioned-dispatcher.test.ts`
44
+ * `"before_dispatch suspended on Deferred.await does NOT block
45
+ * before_message_delivery for the same (sessionId, conversationId)"`
46
+ * and the real-WS integration test in
47
+ * `s2c-partitioned-dispatcher-real-ws.test.ts`.
48
+ *
49
+ * - **P3 (same-key FIFO)** —
50
+ * `s2c-partitioned-dispatcher.test.ts` `"two offers with the same
51
+ * key land on the same worker (FIFO preserved)"` and the per-tuple
52
+ * ordering assertion in `s2c-partition-worker.test.ts`.
53
+ *
54
+ * - **P4 (per-partition backpressure independence)** —
55
+ * `s2c-partitioned-dispatcher.test.ts` `"partitionQueueFull on
56
+ * partition A does not block partition B"`.
57
+ *
58
+ * The vitest stubs below remain as documentation for the future
59
+ * cross-implementation wiring; they are NOT executed (vitest's
60
+ * include glob is `*.test.ts`, this file is `*.ts`).
61
+ *
62
+ * Routing the deferred work: a follow-up issue should expand
63
+ * `TestServer` with `emitServerRequest` and register these as
64
+ * `dispatcher-concurrency` category properties via the conformance
65
+ * registry, parallel to `boundary` / `delivery`.
66
+ */
67
+ import { describe, it } from "vitest";
68
+ describe("conformance: s2c dispatcher concurrency", () => {
69
+ it.todo("P1: two s2c requests with disjoint (sessionId, conversationId, hookKind) " +
70
+ "keys complete concurrently when the first's handler suspends on a Deferred");
71
+ it.todo("P2 (arena#248 reproducer): suspended apps/onBeforeDispatch does NOT block " +
72
+ "apps/onBeforeMessageDelivery for the same (sessionId, conversationId); the " +
73
+ "release path resolves and the suspended fiber resumes");
74
+ it.todo("P3: two s2c requests with identical key are serialized — second handler " +
75
+ "starts only after first handler's Effect completes (FIFO within tuple)");
76
+ it.todo("P4: per-partition backpressure — flooding one (sessionId, conversationId, " +
77
+ "hookKind) does NOT delay handler dispatch for any other tuple");
78
+ });
79
+ //# sourceMappingURL=dispatcher-concurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatcher-concurrency.js","sourceRoot":"","sources":["../../../src/testing/conformance/dispatcher-concurrency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEtC,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,EAAE,CAAC,IAAI,CACL,2EAA2E;QACzE,4EAA4E,CAC/E,CAAC;IACF,EAAE,CAAC,IAAI,CACL,4EAA4E;QAC1E,6EAA6E;QAC7E,uDAAuD,CAC1D,CAAC;IACF,EAAE,CAAC,IAAI,CACL,0EAA0E;QACxE,wEAAwE,CAC3E,CAAC;IACF,EAAE,CAAC,IAAI,CACL,4EAA4E;QAC1E,+DAA+D,CAClE,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PROTOCOL_VERSION = "2026.501.5";
1
+ export declare const PROTOCOL_VERSION = "2026.501.6";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Auto-bumped by publish workflow
2
- export const PROTOCOL_VERSION = "2026.501.5";
2
+ export const PROTOCOL_VERSION = "2026.501.6";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltzap/protocol",
3
- "version": "2026.501.5",
3
+ "version": "2026.501.6",
4
4
  "description": "Protocol types and validators for MoltZap messaging",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {