From 2271b805bbd0b8a3af74e51d43957768c4fa20ef Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 22:30:36 +0100 Subject: [PATCH] D5 (sdk, indexer): the answer store is the steps state's own steps-objects; a state template takes objects-max-mib Builds: design 47 G A-313, A-314 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- modules/mesh-delivery-indexer/judge/busstate.go | 2 ++ modules/mesh-delivery-indexer/judge/g_words_test.go | 2 ++ modules/mesh-delivery-sdk/steprun/outputs.go | 6 ++++-- modules/mesh-delivery-sdk/steprun/outputs_test.go | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-indexer/judge/busstate.go b/modules/mesh-delivery-indexer/judge/busstate.go index edde8726..ef911ecd 100644 --- a/modules/mesh-delivery-indexer/judge/busstate.go +++ b/modules/mesh-delivery-indexer/judge/busstate.go @@ -52,6 +52,8 @@ var busTemplates = map[string]busTemplate{ catalogue.OptionPerMachine: {kind: optionFlag}, // A-277: a state's cap is an option of its template, read as the old state section reads it. catalogue.OptionCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: catalogue.ObjectsMostMiB}, + // A-314: the cap of the state's own objects store `-objects`, an integer above zero. + catalogue.OptionObjectsCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: catalogue.ObjectsMostMiB}, }, }, catalogue.TemplateEvents: { diff --git a/modules/mesh-delivery-indexer/judge/g_words_test.go b/modules/mesh-delivery-indexer/judge/g_words_test.go index 9fac4f0c..7e74fe5a 100644 --- a/modules/mesh-delivery-indexer/judge/g_words_test.go +++ b/modules/mesh-delivery-indexer/judge/g_words_test.go @@ -27,6 +27,8 @@ func TestTheJudgeReadsMilestoneGsWords(t *testing.T) { {name: "an old state section entry with max-mib in its bounds (§469, §695)", raw: `{"module":"a","version":"1.0","state":[{"name":"s","max-mib":128}]}`}, {name: "an old state section entry with max-mib at zero (§469)", raw: `{"module":"a","version":"1.0","state":[{"name":"s","max-mib":0}]}`, want: "max-mib"}, {name: "an old state section entry with max-mib past the bound (§469)", raw: `{"module":"a","version":"1.0","state":[{"name":"s","max-mib":9000}]}`, want: "max-mib"}, + {name: "a state's objects store cap in its template's options (A-314)", raw: `{"module":"a","version":"1.0","requires":[{"name":"steps","storage":"key-value","template":"state","options":{"objects-max-mib":256}}]}`}, + {name: "a state's objects store cap of zero (A-314)", raw: `{"module":"a","version":"1.0","requires":[{"name":"steps","storage":"key-value","template":"state","options":{"objects-max-mib":0}}]}`, want: "objects-max-mib"}, {name: "another part's old findings and stream (§529, §577)", raw: `{"module":"a","version":"1.0","state":["findings"],` + `"streams":[{"name":"a-findings","events":["finding-written"],"retention":"history"}],"consumes":["mesh-conditions.findings-asked"]}`, want: "old sections"}, {name: "another part's findings in its requires (§529)", raw: `{"module":"a","version":"1.0","consumes":["mesh-conditions.findings-asked"],"requires":[` + diff --git a/modules/mesh-delivery-sdk/steprun/outputs.go b/modules/mesh-delivery-sdk/steprun/outputs.go index b228cf89..f7e34988 100644 --- a/modules/mesh-delivery-sdk/steprun/outputs.go +++ b/modules/mesh-delivery-sdk/steprun/outputs.go @@ -4,11 +4,13 @@ import ( "fmt" "git.novox.be/novox/mesh-sdk/go/buscalls" + "git.novox.be/novox/mesh-sdk/go/catalogue" ) // OutputsStore is the local name of the object store a build seat's holder keeps a run's answer in when it is over what -// step-ended carries inline (design 47 G A-254), as the holder's manifest `requires` asks for it with the template objects. -const OutputsStore = "outputs" +// step-ended carries inline (design 47 G A-254): the steps state's own objects store, `steps-objects`, which the holder's manifest +// `requires` asks for with its steps state (design 47 G A-313). +var OutputsStore = catalogue.StateObjectsName("steps") // OutputObjects is the object store of OutputsStore as a holder uses it (mesh-sdk busstate.ObjectsOf(OutputsStore)). type OutputObjects interface { diff --git a/modules/mesh-delivery-sdk/steprun/outputs_test.go b/modules/mesh-delivery-sdk/steprun/outputs_test.go index 5013b04d..92c49d59 100644 --- a/modules/mesh-delivery-sdk/steprun/outputs_test.go +++ b/modules/mesh-delivery-sdk/steprun/outputs_test.go @@ -2,6 +2,7 @@ package steprun import ( "errors" + "strings" "testing" "git.novox.be/novox/mesh-sdk/go/buscalls" @@ -33,8 +34,8 @@ func TestOutputsKeptAreRead(t *testing.T) { if _, err := ReadOutputFrom(st)("output.none"); err == nil { t.Fatal("an absent answer was read") } - if KeepOutputIn(nil)("o", nil) == nil { - t.Fatal("no store kept an answer") + if err := KeepOutputIn(nil)("o", nil); err == nil || !strings.Contains(err.Error(), "steps-objects") { + t.Fatalf("no store kept an answer, or did not name the steps state's objects store: %v", err) } if _, err := ReadOutputFrom(nil)("o"); err == nil { t.Fatal("no store read an answer")