Deliver authority-bound WebSocket Main ingress #116

Merged
kakashi-forgejo-writer merged 3 commits from delivery/websocket-main into main 2026-11-17 18:21:25 +00:00
Owner

Adds generic persistent WebSocket transport with owner-scoped connections/listeners, Decision/Basic routing, socket-only Dispatcher events and bound real Main ingress via Core capability. Missing/revoked/uncertain Main adapters fail closed without chat fallback. Tests13/13 PASS. Core counterpart harness/core delivery/websocket-main.

Adds generic persistent WebSocket transport with owner-scoped connections/listeners, Decision/Basic routing, socket-only Dispatcher events and bound real Main ingress via Core capability. Missing/revoked/uncertain Main adapters fail closed without chat fallback. Tests13/13 PASS. Core counterpart harness/core delivery/websocket-main.
Collaborator

Kakashi review — head d7fa41e752c19f1b0a1b95481c60463f6d691e24, base f8ea0eb278519bf51fa97aa76c0e06ec45536b49

review_clear

P2 [confirmed] F1: websocket/service.mjs:85-86: Remote socket closure neither aborts the controller nor marks the row closed, so a pending Decision can still dispatch work after disconnect; reconnecting clients can also send an old frame's delayed reply through the replacement socket.
websocket/service.mjs:84-86 handles socket closure only by conditionally deleting the connection map entry; it neither sets row.closed nor aborts row.controller. In contrast, explicit close does both at service.mjs:150. A pending gate decision can therefore finish after remote disconnect and pass the abort check before routing in websocket/ingress.mjs:53-58, including invoking Dispatcher at websocket/index.mjs:29-34. For reconnecting clients, service.mjs:35-38 replaces row.socket while retaining the same row, controller and ID. The send callback captured for an old frame (service.mjs:78) resolves the connection by that ID and uses its current socket (service.mjs:134-143), so a delayed reply can be sent through the replacement connection. packet.target_changes is empty, so no target-side change alters these paths.

P2 [confirmed] F2: websocket/service.mjs:83: Delivery failure only calls socket.close() and resolves the queue tail, so already-queued frames continue into route adapters after an earlier frame fails, potentially admitting additional Dispatcher work on a failed connection.
websocket/service.mjs:70-83 chains received frames through row.tail, but its catch handler only calls socket.close(1011, 'Event delivery failed'); it consumes the rejection without setting row.closed or aborting row.controller. Consequently, the next queued callback can pass the row.closed/this.stopped guard at service.mjs:71 and invoke ingress processing at service.mjs:76-80. Even if the socket close event has already occurred, service.mjs:84-86 only removes the map entry, leaving these guards unchanged. The subsequent frame can therefore reach a route adapter, including binding.dispatch at websocket/index.mjs:29-34, after the earlier delivery failed; removal from the connection map prevents sends but does not prevent dispatch admission. packet.target_changes is empty, so the merged-result code retains this behavior.

Kakashi review — head `d7fa41e752c19f1b0a1b95481c60463f6d691e24`, base `f8ea0eb278519bf51fa97aa76c0e06ec45536b49` review_clear P2 [confirmed] F1: websocket/service.mjs:85-86: Remote socket closure neither aborts the controller nor marks the row closed, so a pending Decision can still dispatch work after disconnect; reconnecting clients can also send an old frame's delayed reply through the replacement socket. websocket/service.mjs:84-86 handles socket closure only by conditionally deleting the connection map entry; it neither sets row.closed nor aborts row.controller. In contrast, explicit close does both at service.mjs:150. A pending gate decision can therefore finish after remote disconnect and pass the abort check before routing in websocket/ingress.mjs:53-58, including invoking Dispatcher at websocket/index.mjs:29-34. For reconnecting clients, service.mjs:35-38 replaces row.socket while retaining the same row, controller and ID. The send callback captured for an old frame (service.mjs:78) resolves the connection by that ID and uses its current socket (service.mjs:134-143), so a delayed reply can be sent through the replacement connection. packet.target_changes is empty, so no target-side change alters these paths. P2 [confirmed] F2: websocket/service.mjs:83: Delivery failure only calls socket.close() and resolves the queue tail, so already-queued frames continue into route adapters after an earlier frame fails, potentially admitting additional Dispatcher work on a failed connection. websocket/service.mjs:70-83 chains received frames through row.tail, but its catch handler only calls socket.close(1011, 'Event delivery failed'); it consumes the rejection without setting row.closed or aborting row.controller. Consequently, the next queued callback can pass the row.closed/this.stopped guard at service.mjs:71 and invoke ingress processing at service.mjs:76-80. Even if the socket close event has already occurred, service.mjs:84-86 only removes the map entry, leaving these guards unchanged. The subsequent frame can therefore reach a route adapter, including binding.dispatch at websocket/index.mjs:29-34, after the earlier delivery failed; removal from the connection map prevents sends but does not prevent dispatch admission. packet.target_changes is empty, so the merged-result code retains this behavior. <!-- kakashi-review:e6e9da1161dabafd3a3ba388a1fa99c17ac4a6a4768d1caabbdbf11839808e63 -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
harness/plugins!116
No description provided.