A-376: the bus keeper makes the catalog half's own holder before the first views
Before the catalog half's first views are in (a read refused, or none-yet), the keeper reads the manifest on the trunk of the holder of the seat mesh-catalog from the seat's states modules and manifests (the holder from the seat that places modules) and makes its kept data as any module's, each entry said as ever; every other module waits as A-367 says. Builds: design 47 G A-376 (G-22-lead-answers-2.md) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -575,6 +575,35 @@ func TestTheKeeperMakesWhatAVerdictAsksForAndSaysIt(t *testing.T) {
|
||||
t.Error("the first revision with entries is viewed and plans as before")
|
||||
}
|
||||
}},
|
||||
// A-376: before the first views are in (read refused, or none-yet) the holder of the seat mesh-catalog is made from its
|
||||
// trunk manifest, each entry said as ever; every other module waits.
|
||||
{"before the first views the catalog half's own holder is made and no other module", func(t *testing.T, k *Keeper, bus *fakeBus, out *said) {
|
||||
k.mu.Lock()
|
||||
k.viewed = false
|
||||
k.mu.Unlock()
|
||||
k.Heard(Accepted{Module: "other", Revision: 1, BusState: []catalogue.BusStateEntry{drafts}})
|
||||
k.Holder = func() (Accepted, error) {
|
||||
return Accepted{Module: "idx", BusState: []catalogue.BusStateEntry{drafts}}, nil
|
||||
}
|
||||
for _, view := range []func() (CatalogView, error){
|
||||
func() (CatalogView, error) { return CatalogView{}, errors.New("no first view yet") },
|
||||
func() (CatalogView, error) { return CatalogView{}, nil },
|
||||
} {
|
||||
k.Catalog = view
|
||||
k.PlanCatalog()
|
||||
if _, ok := k.planned("idx"); !ok || fmt.Sprint(out.events) != "[created idx drafts]" {
|
||||
t.Fatalf("planned idx %v, said %v: the holder's entry is made once", ok, out.events)
|
||||
}
|
||||
if _, ok := k.planned("other"); ok || k.Viewed() {
|
||||
t.Errorf("another module is planned or the keeper counts as viewed")
|
||||
}
|
||||
}
|
||||
k.Holder = func() (Accepted, error) { return Accepted{}, errors.New("not read") }
|
||||
k.PlanCatalog() // a holder not read plans nothing and says why in the status
|
||||
if fmt.Sprint(out.events) != "[created idx drafts]" {
|
||||
t.Errorf("said %v", out.events)
|
||||
}
|
||||
}},
|
||||
// §538: a module in no watched branch's newest revision has its plans key deleted, its entries then orphans.
|
||||
{"a module no watched branch lists loses its plan, its entries orphans", func(t *testing.T, k *Keeper, bus *fakeBus, out *said) {
|
||||
k.Catalog = func() (CatalogView, error) {
|
||||
|
||||
Reference in New Issue
Block a user