HEAL2 (the healers' findings in requires): the manifest test holds the state and the stream asked by their templates
The healers' manifest already asks findings (template state) and finding-events (template events, the three finding events,
7 days, 16 MiB) and declares no old stream or findings state, and their writer reaches the state by its local name (built in
76be864b and the join); this adds the test that holds it.
Builds: design 47 G §529, §577, A-30
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -22,6 +22,12 @@ type manifest struct {
|
||||
Invokes []string `json:"invokes"`
|
||||
Reads []string `json:"reads"`
|
||||
State []json.RawMessage `json:"state"`
|
||||
Streams []json.RawMessage `json:"streams"`
|
||||
Requires []struct {
|
||||
Name string `json:"name"`
|
||||
Template string `json:"template"`
|
||||
Options map[string]any `json:"options"`
|
||||
} `json:"requires"`
|
||||
}
|
||||
|
||||
// The manifest says what the code does: it claims the seat mesh-healers once for the mesh with its verbs (ADR 0564 §1,
|
||||
@@ -72,6 +78,19 @@ func TestTheManifestSaysWhatTheCodeDoes(t *testing.T) {
|
||||
if !states[AttemptsState] || !states[WouldState] || !states[WakesState] || states[FindingsState] {
|
||||
t.Errorf("the states take a key's own time to live as %v, want attempts, would and wakes alone", states)
|
||||
}
|
||||
// Design 47 G §529: the healers are no foundation part, so the state `findings` and the finding stream are asked in
|
||||
// `requires` (the templates `state` and `events`, the stream named `finding-events`), and the old stream
|
||||
// `mesh-healers-findings` is declared no more.
|
||||
got := map[string]string{}
|
||||
for _, r := range m.Requires {
|
||||
got[r.Name] = r.Template
|
||||
if r.Name == "finding-events" && (len(r.Options["events"].([]any)) != 3 || r.Options["max-age-days"] != 7.0 || r.Options["max-mib"] != 16.0) {
|
||||
t.Errorf("the finding stream's options are %v, want the three finding events, 7 days and 16 MiB", r.Options)
|
||||
}
|
||||
}
|
||||
if got[FindingsState] != "state" || got["finding-events"] != "events" || len(m.Streams) != 0 {
|
||||
t.Errorf("requires %v and %d old streams, want findings by state, finding-events by events and no old stream", got, len(m.Streams))
|
||||
}
|
||||
readBy := map[string]string{AttemptsState: HealersTool, WouldState: WouldTool, FindingsState: FindingsTool,
|
||||
WakesState: WakesTool, "a settle's end": HealTool,
|
||||
"an act on an event": HealTool, "S15's count": HealersTool + " recount=true"}
|
||||
|
||||
Reference in New Issue
Block a user