From b654b320a18a1b882805f61c2227649dfa67fbbb Mon Sep 17 00:00:00 2001 From: mesh-admin Date: Tue, 13 Oct 2026 11:52:17 +0000 Subject: [PATCH] catalogue: say in the comments that a package may be declared by several modules (issue 628) The resolver follows ADR 0303, but four comments still stated ADR 0210's retired rule that two modules declaring one package collide, and an agent took them as the rule. What stays exclusive is what a module owns: a path, a unit, a name, and a package declared present by one module and absent by another. --- cmd/mesh-controller/acts.go | 5 +++-- internal/catalogue/declaration.go | 4 ++-- internal/catalogue/generated_collision_test.go | 3 ++- internal/catalogue/seat_dependencies.go | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/mesh-controller/acts.go b/cmd/mesh-controller/acts.go index 98088518..54703d8e 100644 --- a/cmd/mesh-controller/acts.go +++ b/cmd/mesh-controller/acts.go @@ -203,8 +203,9 @@ func seatDependenciesOnAssign(ctx context.Context, open *stores, node string, mo if _, err := catalogue.AssignRefusal(shelf, node, assigned, adding); err != nil { return nil, nil, err } - // Two modules declaring one package, path or unit is refused before anything is recorded - // (novox/hq ADR 0210, 04-ISSUES/235): kept, the node would not resolve until one came off again. + // Two modules declaring one path or unit, or one package present and absent, is refused before anything + // is recorded (novox/hq ADR 0210, ADR 0303, 04-ISSUES/235): kept, the node would not resolve until one came + // off again. Two modules declaring one package present is not a collision (ADR 0303, issue 628). if err := catalogue.CollisionRefusal(shelf, node, assigned, adding); err != nil { return nil, nil, err } diff --git a/internal/catalogue/declaration.go b/internal/catalogue/declaration.go index f452d4a2..9da018fe 100644 --- a/internal/catalogue/declaration.go +++ b/internal/catalogue/declaration.go @@ -2551,8 +2551,8 @@ func onlyGroups(r map[string]any) bool { // generatedHere is what each computed module's generator answers for this machine, by module — // absent for a module whose machine is not yet part of what it generates — held to the rule every -// module is held to: no two modules on a machine declare one path, unit, name or package (novox/hq -// issue 190, step 5; ADR 0222). +// module is held to: no two modules on a machine declare one path, unit or name, nor one package present +// and absent (novox/hq issue 190, step 5; ADR 0222, ADR 0303). // // Resolution checks the catalogue's manifests, and a computed module's manifest has none of the // resources it will declare — they exist only once its generator has answered for this machine, diff --git a/internal/catalogue/generated_collision_test.go b/internal/catalogue/generated_collision_test.go index e843853e..45fcabe8 100644 --- a/internal/catalogue/generated_collision_test.go +++ b/internal/catalogue/generated_collision_test.go @@ -6,7 +6,8 @@ import ( ) // novox/hq issue 190, step 5 (ADR 0222): what the mesh computes for a module is held to the rule -// every module is — no two modules on a machine declare one path, unit, name or package. The +// every module is — no two modules on a machine declare one path, unit or name (a package may be declared by +// several, novox/hq ADR 0303). The // private network once declared the container runtime's file and service beside the runtime's own // module, and nothing refused it, because the collision check only ever saw catalogue manifests. diff --git a/internal/catalogue/seat_dependencies.go b/internal/catalogue/seat_dependencies.go index 088d83fb..08e30a3e 100644 --- a/internal/catalogue/seat_dependencies.go +++ b/internal/catalogue/seat_dependencies.go @@ -331,12 +331,13 @@ func UnassignRefusal(catalogue map[string]Manifest, node string, assigned, remov } // CollisionRefusal is why assigning `adding` beside `assigned` is refused for what two modules -// would both declare, or nothing (novox/hq ADR 0210 §1, 04-ISSUES/235). +// would both declare, or nothing (novox/hq ADR 0210 §1, 04-ISSUES/235): one path, unit or name, or a package one +// declares present and another absent. A package several modules declare present is no collision (ADR 0303). // // **Refused, not kept like an unresolved provision.** An assignment is otherwise kept when the // node does not resolve, because assignment is not an ordering: a consumer's provider can follow. // A collision is not an order anything can complete — no further assignment makes two owners of one -// package one owner — and kept, it leaves the node unresolvable, so the next push of anything drops +// file one owner — and kept, it leaves the node unresolvable, so the next push of anything drops // it from the mesh. Only collisions involving a module being added are refused; one already on the // node is `status`'s, and refusing an unrelated assignment for it would block its own remedy. func CollisionRefusal(catalogue map[string]Manifest, node string, assigned, adding []string) error { -- 2.54.0