diff --git a/go/catalogue/controller_dependence.go b/go/catalogue/controller_dependence.go index 6bd22fa..298b8ba 100644 --- a/go/catalogue/controller_dependence.go +++ b/go/catalogue/controller_dependence.go @@ -55,38 +55,15 @@ type KeptDependency struct { ToTheWrite bool } -// KeepList is the named list. Each entry names the clause that keeps it; a dependency not on it fails the check. The -// third entry kept to the write, the bus node agent's following of the controller's user list (ADR 0571 §8, ADR 0547 -// §8), is no manifest's declaration but the node-engine's own, so no manifest matches it; it stays named here so the -// list reads as the record has it. +// KeepList is the named list. Each entry names the clause that keeps it; a dependency not on it fails the check. It +// holds the three kept to the write itself and nothing else: the lease write's own delivery dropped every other entry +// (ADR 0571 §13; issue 774), so its check runs with these alone in either phase. The third, the bus node agent's +// following of the controller's user list (ADR 0571 §8, ADR 0547 §8), is no manifest's declaration but the +// node-engine's own, so no manifest matches it; it stays named here so the list reads as the record has it. var KeepList = []KeptDependency{ - // Kept to the write itself (ADR 0571 §4, §8, §13). {Module: "mesh-delivery-builder", Kind: DependsConsume, What: "mesh-controller.artifacts-gone", Record: "ADR 0571 §4, §13", ToTheWrite: true}, {Module: "artifact-store-tools", Kind: DependsInvoke, What: "seat:mesh-controller.collect", Record: "ADR 0571 §4, §13", ToTheWrite: true}, {Module: "node-engine", Kind: DependsRead, What: "the controller's user list of the bus module's composition", Record: "ADR 0571 §8, §13; ADR 0547 §8", ToTheWrite: true}, - // Kept until the lease write's own delivery. - {Module: "mesh-delivery-assigner", Kind: DependsInvoke, What: "seat:mesh-controller.placement-export", Record: "ADR 0567 §7"}, - {Module: "mesh-delivery-assigner", Kind: DependsInvoke, What: "seat:mesh-controller.assign", Record: "ADR 0567 §8"}, - {Module: "mesh-delivery-assigner", Kind: DependsInvoke, What: "seat:mesh-controller.unassign", Record: "ADR 0567 §8"}, - {Module: "mesh-delivery-assigner", Kind: DependsInvoke, What: "seat:mesh-controller.pin", Record: "ADR 0567 §8"}, - {Module: "mesh-delivery-assigner", Kind: DependsInvoke, What: "seat:mesh-controller.unpin", Record: "ADR 0567 §8"}, - {Module: "mesh-delivery-assigner", Kind: DependsRead, What: "mesh-controller.assignments", Record: "ADR 0567 §8"}, - {Module: "mesh-delivery-assigner", Kind: DependsRead, What: "mesh-controller.composed", Record: "ADR 0571 §8"}, - {Module: "mesh-grants", Kind: DependsRead, What: "mesh-controller.assignments", Record: "ADR 0549 §5"}, - {Module: "mesh-grants", Kind: DependsConsume, What: "mesh-controller.condition-raised", Record: "ADR 0564 §9"}, - {Module: "mesh-grants", Kind: DependsConsume, What: "mesh-controller.condition-cleared", Record: "ADR 0564 §9"}, - {Module: "messenger", Kind: DependsConsume, What: "mesh-controller.condition-raised", Record: "ADR 0564 §9"}, - {Module: "messenger", Kind: DependsConsume, What: "mesh-controller.condition-cleared", Record: "ADR 0564 §9"}, - {Module: "messenger", Kind: DependsConsume, What: "mesh-controller.condition-changed", Record: "ADR 0564 §9"}, - {Module: "messenger", Kind: DependsInvoke, What: "seat:mesh-controller.conditions", Record: "ADR 0564 §9"}, - {Module: "mesh-watcher", Kind: DependsConsume, What: "mesh-controller.doctor-heartbeat", Record: "ADR 0564 §9"}, - {Module: "mesh-conditions", Kind: DependsRead, What: "mesh-controller.conditions", Record: "ADR 0564 §9"}, - {Module: "mesh-config", Kind: DependsRead, What: "mesh-controller.declared-config", Record: "ADR 0565 §4"}, - {Module: "mesh-config", Kind: DependsRead, What: "mesh-controller.predefined", Record: "ADR 0565 §4"}, - {Module: "mesh-healers", Kind: DependsRead, What: "mesh-controller.hand-acts", Record: "ADR 0565 §11"}, - {Module: "mesh-hand-acts", Kind: DependsRead, What: "mesh-controller.hand-acts", Record: "ADR 0565 §11"}, - // pacman's fallback for a node whose engine has not written its own packages yet. - {Module: "pacman", Kind: DependsRead, What: "mesh-controller.declared-packages", Record: "ADR 0565 §6"}, } // EndedBy names, for a declaration no entry keeps, the record that already ended it, so a refusal says where it moved. diff --git a/go/catalogue/controller_dependence_test.go b/go/catalogue/controller_dependence_test.go index 09f7604..410e27f 100644 --- a/go/catalogue/controller_dependence_test.go +++ b/go/catalogue/controller_dependence_test.go @@ -21,8 +21,8 @@ func TestTheLeaseWritesCheckJudgesEveryDependencyOnTheController(t *testing.T) { toTheWrite++ } } - if toTheWrite != 3 { - t.Errorf("%d entries kept to the write itself, ADR 0571 §13 names three", toTheWrite) + if toTheWrite != 3 || len(KeepList) != 3 { + t.Errorf("%d entries, %d kept to the write itself: ADR 0571 §13 keeps the three alone from the write's delivery", len(KeepList), toTheWrite) } type want struct { @@ -40,11 +40,17 @@ func TestTheLeaseWritesCheckJudgesEveryDependencyOnTheController(t *testing.T) { map[string]string{"mod-l": `{"module":"mod-l","version":"1","reads":["mesh-controller.lease"]}`, "mesh-controller": `{"module":"mesh-controller","version":"1","invokes":["seat:mesh-controller.status"]}`}, want{}}, - // 774/S4/AC1. - {"the keeper's read of the controller's conditions is kept before the write's delivery and refused at the write", + // 774/S4/AC1, 774/S30/AC1: the keeper's read of the controller's conditions put back is refused in either phase, + // since the lease write's delivery dropped its entry (it was kept by ADR 0564 §9 before). + {"the keeper's read of the controller's conditions, put back, is refused", map[string]string{"mesh-conditions": `{"module":"mesh-conditions","version":"1","reads":["mesh-controller.conditions","mesh-controller.lease"]}`}, - want{deps: []string{"mesh-conditions read mesh-controller.conditions kept by ADR 0564 §9"}, - write: "mesh-conditions declares read mesh-controller.conditions, kept by ADR 0564 §9 only until the lease write's own delivery"}}, + want{deps: []string{"mesh-conditions read mesh-controller.conditions unkept"}, + write: "mesh-conditions declares read mesh-controller.conditions, which no record keeps until the lease write", + before: "mesh-conditions declares read mesh-controller.conditions, which no record keeps until the lease write"}}, + // 774/S30/AC1: the three kept to the write pass in either phase. + {"the artifact sweep's collect is kept to the write itself", + map[string]string{"artifact-store-tools": `{"module":"artifact-store-tools","version":"1","invokes":["seat:mesh-controller.collect"]}`}, + want{deps: []string{"artifact-store-tools invoke seat:mesh-controller.collect kept by ADR 0571 §4, §13"}}}, {"the builder's consume of artifacts-gone is kept to the write itself", map[string]string{"mesh-delivery-builder": `{"module":"mesh-delivery-builder","version":"1","consumes":["mesh-controller.artifacts-gone"]}`}, want{deps: []string{"mesh-delivery-builder consume mesh-controller.artifacts-gone kept by ADR 0571 §4, §13"}}},