A3c item 2: the gate's whole test on the real bus; the act's key escapes its digest

Design 46 7-approval-mark §22's integration test: the runner's gate wired as main wires it, on a
real bus with stand-ins of the operator channel's router and the hand-act seat: a marked call
asked, approved, run once, recorded, listed; a restart between the run and warranted's answer
recorded once; a Decline runs nothing; no state bound or no holder of operator-channel runs
nothing. It failed first on the act's key: `<node>.act.sha256:<hex>` is a key the bus refuses,
so every marked call was refused on the live bus. The digest is now escaped with
keys.EscapeName (lead answer A-209). The runner's two start tests are one, so the module gains
no test (design 47 G §419, §626).

Builds: design 46 7-approval-mark §13, §22; design 47 G §419, §626; lead answer A-209

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 06:02:17 +01:00
parent e7e20e3d13
commit 7b37e7e1d6
4 changed files with 304 additions and 6 deletions
@@ -246,8 +246,8 @@ func TestTheRefusalsAndAnswers(t *testing.T) {
}
var k operatorchannelclient.Kept
_ = json.Unmarshal(w.state.Vals["n1.ask."+a.ID], &k)
if k.Act["arg.dir"] != "scratch" || string(k.Arguments) != `{"dir":"scratch"}` || string(w.state.Vals["n1.act."+d]) != `"`+a.ID+`"` {
t.Errorf("kept %+v, act key %s", k, w.state.Vals["n1.act."+d])
if k.Act["arg.dir"] != "scratch" || string(k.Arguments) != `{"dir":"scratch"}` || string(w.state.Vals["n1.act."+keys.EscapeName(d)]) != `"`+a.ID+`"` {
t.Errorf("kept %+v, act key %s", k, w.state.Vals["n1.act."+keys.EscapeName(d)])
}
}},
{"§12: with no record within 5 seconds, Not run, asked; not yet taken by the router", func(t *testing.T, w *world) {
+3 -2
View File
@@ -11,6 +11,7 @@ import (
"git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient"
seat "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/keys"
)
// StateName is the runner's own state its asks and claims are kept in, per machine (§13).
@@ -50,8 +51,8 @@ func (g *Gate) client(module string) *operatorchannelclient.Client {
Record: func(id string) (*stdio.StateEntry, error) { return g.d.Record(module, id) }}
}
// actKey is the key naming the newest ask of an act (§13).
func (g *Gate) actKey(digest string) string { return g.d.Node + ".act." + digest }
// actKey is the key naming the newest ask of an act (§13), its digest escaped as a key's name is, since the bus holds no `:` in a key (lead answer A-209).
func (g *Gate) actKey(digest string) string { return g.d.Node + ".act." + keys.EscapeName(digest) }
// askKey is the key the client keeps an ask under (§13).
func (g *Gate) askKey(id string) string { return g.d.Node + ".ask." + id }