RN25: the runner's stores declare their caps, its sent store, tools named runner_

The pipelines state is capped at 256 MiB and kept at 128 MiB in the old state
section, the sent store sent-objects is declared at 256 MiB, and the first-view
tools carry the runner's tool prefix.

Builds: design 47 G §469, §85, §477, §533, §539

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 05:34:01 +01:00
parent b4155cc5a2
commit fc4ce1cd79
4 changed files with 28 additions and 12 deletions
@@ -86,16 +86,16 @@ func Tools(r pipeline.Reads) []stdio.Tool {
return out
}
// Module and Slug are the runner's module and its tools' prefix, as its manifest names them.
// Module is the runner's module, and Prefix its tools' prefix (design 47 G §539: runner_first_views, runner_health).
const (
Module = "mesh-delivery-pipeline"
Slug = "pipeline"
Prefix = "runner"
)
// FirstViewTools are the runner's `<module>_first_views` and `<module>_first_view_again` over its state first-views
// (design 47 G §77, §200): each view it holds or waits for, since when, and asked again by hand, a hand act.
func FirstViewTools(st stdio.KeptState, acts views.HandActs, now func() time.Time) []stdio.Tool {
return views.StatusTools(Module, Slug+"_first_views", Slug+"_first_view_again", st, acts, now)
return views.StatusTools(Module, Prefix+"_first_views", Prefix+"_first_view_again", st, acts, now)
}
func main() {
@@ -17,7 +17,7 @@ func (none) Keys() ([]string, error) { return nil, nil }
func (none) Value(string) (json.RawMessage, error) { return nil, nil }
// TestTools: the bundle serves the five read verbs as <seat>.<verb> (§83, §306; RN15/AC1), and the first-view tools
// (§77, §200; RN2/AC4).
// (§77, §200; RN2/AC4), named with the prefix runner_ (§539; RN25).
func TestTools(t *testing.T) {
var names []string
for _, tl := range Tools(pipeline.Reads{Pipelines: none{}, Kept: none{}}) {
@@ -26,7 +26,7 @@ func TestTools(t *testing.T) {
for _, tl := range FirstViewTools(stdio.State(views.StatusState), nil, nil) {
names = append(names, tl.Name)
}
want := "mesh-pipeline-runner.show mesh-pipeline-runner.list mesh-pipeline-runner.stands mesh-pipeline-runner.why-carried mesh-pipeline-runner.kept pipeline_first_views pipeline_first_view_again"
want := "mesh-pipeline-runner.show mesh-pipeline-runner.list mesh-pipeline-runner.stands mesh-pipeline-runner.why-carried mesh-pipeline-runner.kept runner_first_views runner_first_view_again"
if got := strings.Join(names, " "); got != want {
t.Errorf("tools %q, want %q", got, want)
}
@@ -22,15 +22,19 @@ func TestManifest(t *testing.T) {
}
var states, streams, objects []string
keyTTL := map[string]bool{}
stateMiB := map[string]int{}
for _, s := range m.State {
states = append(states, s.Name)
keyTTL[s.Name] = s.KeyTTL
stateMiB[s.Name] = s.MaxMiB
}
objectMiB := map[string]int{}
for _, s := range m.Streams {
streams = append(streams, s.Name)
}
for _, o := range m.Objects {
objects = append(objects, o.Name)
objectMiB[o.Name] = o.MaxMiB
}
var program catalogue.Artifact
if m.Build == nil {
@@ -53,6 +57,9 @@ func TestManifest(t *testing.T) {
{"old state sections", equalSets(states, []string{seat.StatePipelines, seat.StateKept, "aged", "bounds", "toolchains", "findings", "first-views"})},
// §535, §647, A-77, A-104: an ask no holder takes is bound by a key with its own time to live.
{"bounds is key-ttl", keyTTL["bounds"]},
// RN25 (§469, §85): an old state section declares its cap, pipelines 256 MiB and kept 128 MiB.
{"pipelines 256 MiB", stateMiB[seat.StatePipelines] == 256},
{"kept 128 MiB", stateMiB[seat.StateKept] == 128},
// §470 (amending §27, §85): the step log is an old logs section kept 100 days, 128 MiB; RN24 (§383, §387): the finding
// stream its findings are said on is the one old stream.
{"old streams section", equalSets(streams, []string{"mesh-delivery-pipeline-findings"})},
@@ -62,8 +69,10 @@ func TestManifest(t *testing.T) {
equalSets(m.Streams[0].Events, []string{"finding-written.*", "finding-cleared.*", "findings-stated.*"})},
// RN24 (§368): the version as MAJOR.MINOR, 0.1 with none published.
{"version 0.1", m.Version == "0.1"},
{"old objects section", equalSets(objects, []string{seat.StateStepOutputs})},
{"step-outputs 1 GiB", len(m.Objects) == 1 && m.Objects[0].MaxMiB == 1024},
// RN25 (§477, §533, §59): a foundation part whose seat has verbs and events declares its sent store, 256 MiB.
{"old objects section", equalSets(objects, []string{seat.StateStepOutputs, catalogue.SentObjectsLocal})},
{"step-outputs 1 GiB", objectMiB[seat.StateStepOutputs] == 1024},
{"sent-objects 256 MiB", objectMiB[catalogue.SentObjectsLocal] == 256},
// §333, §54, §44, §53, §376, §24, §37, §4, §77: what the runner hears.
{"consumes", equalSets(m.Consumes, []string{
"mesh-delivery-indexer.take-in.taken", "mesh-builds.package-published", "mesh-builds.toolchain-agreed", "mesh-builds.step-ended",
@@ -81,7 +90,8 @@ func TestManifest(t *testing.T) {
"seat:mesh-builds.step", "seat:mesh-wants.step", "seat:node-build-go.check.step", "seat:node-build-node.check.step",
"seat:node-build-image.check.step"})},
{"uses operator-channel", equalSets(m.Uses, []string{"operator-channel"})},
{"first-view tools", equalSets(m.Tools, []string{"pipeline_first_views", "pipeline_first_view_again"})},
// RN25 (§539): the runner's tools carry the prefix runner_.
{"first-view tools", equalSets(m.Tools, []string{"runner_first_views", "runner_first_view_again"})},
// RN1/AC5 (§95, §130): the new assigner is delivered before the runner.
{"program needs the assigner's program", slices.Equal(program.Needs, []string{"mesh-delivery-assigner:program"})},
}
+10 -4
View File
@@ -23,8 +23,8 @@
}
],
"tools": [
"pipeline_first_views",
"pipeline_first_view_again"
"runner_first_views",
"runner_first_view_again"
],
"consumes": [
"mesh-delivery-indexer.take-in.taken",
@@ -61,11 +61,13 @@
"state": [
{
"name": "pipelines",
"history": 1
"history": 1,
"max-mib": 256
},
{
"name": "kept",
"history": 1
"history": 1,
"max-mib": 128
},
{
"name": "aged",
@@ -105,6 +107,10 @@
{
"name": "step-outputs",
"max-mib": 1024
},
{
"name": "sent-objects",
"max-mib": 256
}
],
"own-secrets": {