FB7, FB8: the forge bridge asks its findings state and finding stream in the template form
The manifest's requires gain findings (state, history 5) and finding-events (events, 7 days, 16 MiB) and its consumes mesh-conditions.findings-asked, as every part but a foundation part declares them; the bridge gains the finding branch-unprotected (next commit). Builds: design 47 G §387, §529, §383 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -32,7 +32,7 @@ type kept struct {
|
||||
Name string `json:"name"`
|
||||
Storage string `json:"storage"`
|
||||
Template string `json:"template"`
|
||||
Options map[string]int `json:"options"`
|
||||
Options map[string]any `json:"options"`
|
||||
}
|
||||
|
||||
type artifact struct {
|
||||
@@ -105,7 +105,7 @@ func TestManifestDeclarations(t *testing.T) { // 1235/AC1
|
||||
// recreated and dropped, and asked of its show (design 47 G §577).
|
||||
// Every move of a watched branch is heard on branch-moved, and the watched branches from the registrations, before the
|
||||
// first the gate's source (design 47 G §4, §11, §507).
|
||||
if want := []string{"git.branch-moved", "git.forge-delete", "git.pull-closed", "git.pull-merged", "git.pull-updated", "mesh-broker.dropped", "mesh-broker.recreated", "mesh-catalog.registration-changed", "mesh-delivery-checker.owed", "mesh-delivery.owed", "mesh-delivery.source-moved"}; !reflect.DeepEqual(sorted(m.Consumes), want) {
|
||||
if want := []string{"git.branch-moved", "git.forge-delete", "git.pull-closed", "git.pull-merged", "git.pull-updated", "mesh-broker.dropped", "mesh-broker.recreated", "mesh-catalog.registration-changed", "mesh-conditions.findings-asked", "mesh-delivery-checker.owed", "mesh-delivery.owed", "mesh-delivery.source-moved"}; !reflect.DeepEqual(sorted(m.Consumes), want) {
|
||||
t.Errorf("consumes = %v, want %v", m.Consumes, want)
|
||||
}
|
||||
// A group is read from the seat mesh-delivery's verb groups (design 47, acceptance 49): the bridge reads no state of
|
||||
@@ -130,8 +130,13 @@ func TestManifestDeclarations(t *testing.T) { // 1235/AC1
|
||||
if !reflect.DeepEqual(m.State, []state{{Name: "heads", History: 1}, {Name: "inputs", History: 1}, {Name: "end-asks", History: 1}, {Name: "owed-asks", History: 1}}) { // 1279/AC6, 1126, 1585
|
||||
t.Errorf("state = %+v, want the buckets heads, inputs, end-asks and owed-asks", m.State)
|
||||
}
|
||||
if want := []kept{{Name: "performed", Storage: "key-value", Template: "state", Options: map[string]int{"history": 1, "ttl-seconds": 604800}}}; !reflect.DeepEqual(m.Requires, want) {
|
||||
t.Errorf("requires = %+v, want performed as %+v", m.Requires, want)
|
||||
// Design 47 G §387, §529: the bridge gains the finding branch-unprotected, so it asks the findings state and the finding stream
|
||||
// by their templates (7 days, 16 MiB) as every part but a foundation part does.
|
||||
if want := []kept{{Name: "performed", Storage: "key-value", Template: "state", Options: map[string]any{"history": float64(1), "ttl-seconds": float64(604800)}},
|
||||
{Name: "findings", Storage: "key-value", Template: "state", Options: map[string]any{"history": float64(5)}},
|
||||
{Name: "finding-events", Storage: "stream", Template: "events", Options: map[string]any{
|
||||
"events": []any{"finding-written.*", "finding-cleared.*", "findings-stated.*"}, "max-age-days": float64(7), "max-mib": float64(16)}}}; !reflect.DeepEqual(m.Requires, want) {
|
||||
t.Errorf("requires = %+v, want performed, findings and finding-events as %+v", m.Requires, want)
|
||||
}
|
||||
// 1585/T18: the tools read the groups and ask the bridge to say a group's end again, through its state end-asks. The tool bridge_merged_message answers a merge's merged message again (issue 1585); bridge_tags reads a package's tags for the builder's floor (design 51).
|
||||
if want := []string{"bridge_group_end_again", "bridge_groups", "bridge_merged_message", "bridge_owed", "bridge_owed_again", "bridge_owed_drop", "bridge_tags"}; !reflect.DeepEqual(sorted(m.Tools), want) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"git.forge-delete",
|
||||
"git.branch-moved",
|
||||
"mesh-catalog.registration-changed",
|
||||
"mesh-conditions.findings-asked",
|
||||
"mesh-delivery.source-moved",
|
||||
"mesh-delivery.owed",
|
||||
"mesh-delivery-checker.owed",
|
||||
@@ -57,6 +58,22 @@
|
||||
"storage": "key-value",
|
||||
"template": "state",
|
||||
"options": { "history": 1, "ttl-seconds": 604800 }
|
||||
},
|
||||
{
|
||||
"name": "findings",
|
||||
"storage": "key-value",
|
||||
"template": "state",
|
||||
"options": { "history": 5 }
|
||||
},
|
||||
{
|
||||
"name": "finding-events",
|
||||
"storage": "stream",
|
||||
"template": "events",
|
||||
"options": {
|
||||
"events": ["finding-written.*", "finding-cleared.*", "findings-stated.*"],
|
||||
"max-age-days": 7,
|
||||
"max-mib": 16
|
||||
}
|
||||
}
|
||||
],
|
||||
"own-secrets": {
|
||||
|
||||
Reference in New Issue
Block a user