C4: the build modules ask the steps state with its objects store in requires; outputs goes
Builds: design 47 G A-254, A-313, A-314, §58, §547 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -110,12 +110,12 @@ func TestManifestKeepsItsStatesClaimsItsBuildSeatAndDeclaresItsHealthTool(t *tes
|
||||
for _, s := range m.State {
|
||||
states = append(states, s.Name)
|
||||
// A step's key is per step and dropped after its age, so the bucket cannot fill; a pause has no age.
|
||||
if (s.Name == "steps") != (s.TTLSeconds > 0) {
|
||||
t.Errorf("state %s has ttl-seconds %d: only steps has an age", s.Name, s.TTLSeconds)
|
||||
if s.TTLSeconds > 0 {
|
||||
t.Errorf("state %s has ttl-seconds %d: steps, the one with an age, is asked in requires (A-314)", s.Name, s.TTLSeconds)
|
||||
}
|
||||
}
|
||||
slices.Sort(states)
|
||||
if want := []string{"keys", "pauses", "steps", "toolchains"}; !slices.Equal(states, want) {
|
||||
if want := []string{"keys", "pauses", "toolchains"}; !slices.Equal(states, want) {
|
||||
t.Errorf("state = %v, want %v", states, want)
|
||||
}
|
||||
if len(m.Claims) != 1 || m.Claims[0].Name != Seat || !slices.Equal(m.Claims[0].Serves, []string{"current", "drop", "pause", "resume", "steps", "kept-artifact", "output"}) {
|
||||
@@ -279,9 +279,9 @@ func TestTheModuleRequiresNodeToolsItPullsThrough(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Design 47 G A-254: the module keeps a run's answer over what step-ended carries inline in an object store of its own, asked for
|
||||
// in `requires` by the template objects, and serves it through the verb output.
|
||||
func TestManifestRequiresTheOutputsStore(t *testing.T) {
|
||||
// Design 47 G A-254, A-313, A-314: the module keeps a run's answer over what step-ended carries inline in the steps state's own
|
||||
// objects store, sized in `requires` by the state option objects-max-mib, and serves it through the verb output.
|
||||
func TestManifestRequiresTheStepsStateWithItsObjectsStore(t *testing.T) {
|
||||
raw, err := os.ReadFile(moduleDir + "/module.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -292,7 +292,7 @@ func TestManifestRequiresTheOutputsStore(t *testing.T) {
|
||||
if err := json.Unmarshal(raw, &doc); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := map[string]any{"name": "outputs", "storage": "object-store", "template": "objects", "options": map[string]any{"max-mib": float64(256)}}
|
||||
want := map[string]any{"name": "steps", "storage": "key-value", "template": "state", "options": map[string]any{"ttl-seconds": float64(172800), "objects-max-mib": float64(256)}}
|
||||
for _, r := range doc.Requires {
|
||||
if reflect.DeepEqual(r, want) {
|
||||
return
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"state": [
|
||||
"toolchains",
|
||||
"keys",
|
||||
{"name": "steps", "ttl-seconds": 172800}, "pauses"
|
||||
"pauses"
|
||||
],
|
||||
"claims": [
|
||||
{
|
||||
@@ -57,8 +57,8 @@
|
||||
"build_node_health"
|
||||
],
|
||||
"requires": [
|
||||
{"name": "steps", "storage": "key-value", "template": "state", "options": {"ttl-seconds": 172800, "objects-max-mib": 256}},
|
||||
{"name": "detected-steps", "storage": "key-value", "template": "state", "options": {"history": 1}},
|
||||
{"name": "outputs", "storage": "object-store", "template": "objects", "options": {"max-mib": 256}},
|
||||
"artifact-store",
|
||||
"forge-account",
|
||||
"npm-package-registry",
|
||||
|
||||
Reference in New Issue
Block a user