instar 1.3.397 → 1.3.399

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,64 @@
1
+ # Side-Effects Review — Pool dashboard streaming phase 2b (requesting side)
2
+
3
+ **Version / slug:** `dashboard-stream-phase2b-requesting`
4
+ **Date:** `2026-06-07`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ WebSocketManager routes a remote-machineId subscribe through a per-peer
11
+ PeerStreamProxy (phase 1) + a PoolStreamConnector (mint ticket via the phase-2a
12
+ mesh verb, open /pool-stream). Output fans back machine-tagged; input relayed;
13
+ honest error frames; transfer-staleness guard.
14
+
15
+ ## Decision-point inventory
16
+
17
+ (1) Is a subscribe remote? → machineId present, !== self, AND session not
18
+ running locally (stale-hint guard). (2) Input on a remote sub → relayed
19
+ upstream (serving machine gates), never local tmux.
20
+
21
+ ## 1. Over-block
22
+
23
+ A remote subscribe whose connector returns null (peer unreachable) surfaces
24
+ machine-unreachable — honest, not silent. A session that exists locally is
25
+ never routed remote (served locally) even with a remote hint.
26
+
27
+ ## 2. Under-block
28
+
29
+ The browser client is trusted to supply the correct machineId (it rendered the
30
+ tile from /sessions?scope=pool). A wrong machineId routes to the wrong peer;
31
+ the serving peer only streams sessions IT runs, so a bad hint yields no output
32
+ (and the connector/ticket fail), not cross-talk. Local-existence is re-checked
33
+ server-side regardless of the hint.
34
+
35
+ ## 3. Level-of-abstraction fit
36
+
37
+ Routing lives in WSManager.handleMessage beside the local path; the per-peer
38
+ link + reconnect/idle logic is the phase-1 PeerStreamProxy (reused, not
39
+ reimplemented); ticket-mint + ws-connect is the connector in server boot (it
40
+ owns meshClient + peerUrl). One streaming model; the remote path only swaps the
41
+ source.
42
+
43
+ ## 4. Signal vs authority compliance
44
+
45
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
46
+
47
+ No new authority on the requesting side — it consumes the serving side's
48
+ authority (ticket, input gate). Errors are honest frames, never silent.
49
+
50
+ ## 5. Interactions
51
+
52
+ - Local /ws path: unchanged for local sessions; only a machineId-tagged remote
53
+ subscribe diverges.
54
+ - PeerStreamProxy (phase 1): the per-peer multiplex/reconnect engine, reused.
55
+ - Serving side (phase 2a): the connector consumes its mesh verb + /pool-stream.
56
+ - Client close: drops all remote subs from their proxies (no leak).
57
+ - pool-stream-ticket verb: the connector mints with a sentinel session ('*') —
58
+ the ticket is per-connection, not session-bound.
59
+
60
+ ## 6. External surfaces
61
+
62
+ No new HTTP/WS endpoint on the requesting side (it's a CLIENT of the peer's
63
+ /pool-stream). No new config (allowRemoteInput is serving-side). New AgentServer
64
+ options: poolStreamConnector + selfMachineId.