Module state is hq ADR 0202: 0201 landed first for a provider's derivations

This commit is contained in:
jochen
2026-10-04 03:44:56 +02:00
parent 0677cebb9b
commit d937c7bc2f
8 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import (
)
// State — the current value of something a module keeps on the bus, which every machine sees,
// including one that joins later (novox/hq ADR 0201). Not history: that is an event. Never a secret,
// including one that joins later (novox/hq ADR 0202). Not history: that is an event. Never a secret,
// sealed or not. A module declares what it keeps (`state`) and what it reads (`reads`, as
// `<module>.<name>`) and names each here as it named it there; the runtime refuses, with the reason,
// what it did not declare.
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"time"
)
// A Go bundle keeps and watches its state through the runtime (novox/hq ADR 0201): the watch's
// A Go bundle keeps and watches its state through the runtime (novox/hq ADR 0202): the watch's
// current values are handled before it returns, its changes are named by the watch's id, a change for
// no watch of this bundle is refused, and put, get and keys are asked of the runtime as the module.
func TestABundleKeepsAndWatchesStateThroughTheRuntime(t *testing.T) {
+2 -2
View File
@@ -60,7 +60,7 @@ type channel struct {
next int
waiting map[string]chan message
listeners []listener
// watches are this bundle's state watches by the id each was asked with (ADR 0201).
// watches are this bundle's state watches by the id each was asked with (ADR 0202).
watches map[string]func(StateChange) error
}
@@ -247,7 +247,7 @@ func ServeOn(name string, tools []Tool, in io.Reader, out io.Writer) error {
c.say(map[string]any{"id": id, "result": map[string]any{}})
}(id, *p.Envelope, matching)
case "mesh/state":
// One change to a state this bundle watches (ADR 0201), named by the watch's id, answered
// One change to a state this bundle watches (ADR 0202), named by the watch's id, answered
// once its handler has taken it. Beside the loop, like a tool call.
var p struct {
Watch string `json:"watch"`