Module state is hq ADR 0201 after all: the derived-value record moved to 0202 on hq main

This commit is contained in:
jochen
2026-10-04 11:02:45 +02:00
parent dd3ec8da73
commit a75add0d59
8 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ function startSession(): Session {
});
const ask = (method: string, params: unknown): Promise<unknown> => askAs(`bundle-${nextOut++}`, method, params);
// The module's state (ADR 0202): each watch's changes arrive as `mesh/state` requests naming the
// The module's state (ADR 0201): each watch's changes arrive as `mesh/state` requests naming the
// watch by the id it was asked with, so its handler is registered under that id before it is asked
// — the current values arrive before the watch itself is answered.
const watches = new Map<string, (change: StateChange<unknown>) => Promise<void>>();
@@ -176,7 +176,7 @@ function startSession(): Session {
return;
}
case "mesh/state": {
// One change to a state this bundle watches (ADR 0202), answered once its handler has taken
// One change to a state this bundle watches (ADR 0201), answered once its handler has taken
// it. The runtime delivers a watch's changes one at a time, in order.
const p = request.params as { watch?: string; change?: StateChange<unknown> } | undefined;
const deliver = p?.watch !== undefined ? watches.get(String(p.watch)) : undefined;