S8 unread-away: Unread of a state and a view, the away answers, the start's phase

Builds: design 47 H2 H-A-708 (1) (2), H-A-717 (DQ-54, DQ-58)
This commit is contained in:
2026-11-25 17:09:15 +01:00
parent b4f9429115
commit f0bc6a3ceb
11 changed files with 294 additions and 6 deletions
+24
View File
@@ -203,6 +203,30 @@ func TestACallIsAskedAgainOnlyWhenItReachedNoOne(t *testing.T) {
t.Errorf("the holder read the ask %q, want %q, and none once its handler ended", read, ask)
}
}
// Design 47 H2 H-A-708 (2): a handler's `away` fault is answered as §776's `away` (error-kind, part, words) and read back
// by the caller as the transport fault; a plain refusal names no kind.
for _, row := range []struct {
err error
kind string
part string
fault bool
}{
{&busretry.Away{Part: "the trunk's revision 512", Words: "not read yet since 23:35:40"}, "away", "the trunk's revision 512", true},
{fmt.Errorf("reading: %w", &busretry.Away{Part: "the state seat-definitions", Words: "w"}), "away", "the state seat-definitions", true},
{errors.New("refused"), "", "", false},
} {
body := c.answerBody(askMsg("mesh.seat.mesh-catalog.tool.revision", []byte(`{}`), ""), "mesh.seat.mesh-catalog.tool.revision",
func(string, json.RawMessage, bool) (any, *approval.Held, error) { return nil, nil, row.err })
var got struct{ Kind, Part string }
var raw map[string]any
_ = json.Unmarshal(body, &raw)
got.Kind, _ = raw["error-kind"].(string)
got.Part, _ = raw["part"].(string)
away := busretry.AwayIn(body)
if got.Kind != row.kind || got.Part != row.part || (away != nil) != row.fault || (away != nil && busretry.Fault(away) != true) {
t.Errorf("%v answered %s", row.err, body)
}
}
// Design 47 H2 §775, H-A-405: a kept chunked call (CallChunksKept, CallFileKept) asks its verb through the kept-call
// form, carries its one ask id on every chunk's acknowledgement, and past its bound ends with the kept call's words.
send := buscalls.SeatChunks{Seat: "node-build-go", Verb: "output", Call: "c1"}