From b74c371ed62677384b5510ae6309c26287653c0a Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 1 Nov 2026 03:26:59 +0100 Subject: [PATCH] The builder asks the artifact sweep's seat for held and no longer the controller (ADR 0571 clause 2, issue 1955) Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL --- .../cmd/mesh-delivery-builder/stored.go | 14 ++++---------- .../mesh-delivery-builder/internal/build/claim.go | 4 ++-- .../mesh-delivery-builder/internal/build/run.go | 2 +- modules/mesh-delivery-builder/manifest_test.go | 4 ++-- modules/mesh-delivery-builder/module.json | 3 +-- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/stored.go b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/stored.go index 2b0edb1..dfad767 100644 --- a/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/stored.go +++ b/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/stored.go @@ -11,7 +11,6 @@ import ( "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/delivery" - "git.novox.be/novox/mesh-sdk/go/handacts" "mesh-delivery-builder/internal/build" ) @@ -26,19 +25,14 @@ const SeatHeld = "seat:" + catalogue.ArtifactSweepSeat + ".held" // toolCaller calls a tool or a seat verb as the builder's own account (mesh-sdk process.Conn.Call). type toolCaller func(key string, body any) (json.RawMessage, error) -// storedVia is build.Builder's Stored: it asks the controller's verb held (mesh-sdk delivery.HeldVerb; novox/hq issue -// 1937) and answers the references the store no longer holds. One it could not ask about, with none gone, is an error: -// the key is then left done, and the controller's take-in still refuses a gone blob. -// -// It asks the seat mesh-artifact-sweep's `held` (novox/hq ADR 0571 §2), and the controller's while that seat has no holder that -// answers (a named exception of clause 10, until the lease write). +// storedVia is build.Builder's Stored: it asks the seat mesh-artifact-sweep's `held` (novox/hq ADR 0571 §2, issue 1937) +// and answers the references the store no longer holds. One it could not ask about, with none gone, is an error: the key +// is then left done, and the controller's take-in still refuses a gone blob. The controller's `held` is not asked: it +// is no longer a fallback (issue 1955). func storedVia(call toolCaller) func(ctx context.Context, references []string) ([]string, error) { return func(_ context.Context, references []string) ([]string, error) { body := map[string]any{"references": references} raw, err := call(SeatHeld, body) - if handacts.NoResponder(err) { - raw, err = call(delivery.HeldVerb, body) - } if err != nil { return nil, fmt.Errorf("asking held: %w", err) } diff --git a/modules/mesh-delivery-builder/internal/build/claim.go b/modules/mesh-delivery-builder/internal/build/claim.go index 406a62c..d58be02 100644 --- a/modules/mesh-delivery-builder/internal/build/claim.go +++ b/modules/mesh-delivery-builder/internal/build/claim.go @@ -61,8 +61,8 @@ type ClaimOptions struct { // a package's reference. A key queued waiting for a version (BuilderBuild.Waits) is taken only once it is (ADR 0500 // clause 6). Nil means none is. Published func(ref string) bool - // Stored answers which of the references given the artifact store no longer holds (the controller's verb held, - // mesh-sdk delivery.HeldVerb; novox/hq issue 1937). A done key of the trunk's fingerprint is asked before it is left + // Stored answers which of the references given the artifact store no longer holds (the seat mesh-artifact-sweep's verb held, + // novox/hq ADR 0571 §2, issue 1937). A done key of the trunk's fingerprint is asked before it is left // done: the store's nightly collector deletes a blob nothing holds, and a key the controller never took in holds // nothing, so a key whose blob is gone is claimed building as a new revision and built again. Nil asks nothing. Stored func(ctx context.Context, references []string) (gone []string, err error) diff --git a/modules/mesh-delivery-builder/internal/build/run.go b/modules/mesh-delivery-builder/internal/build/run.go index e4906ba..fd8fc69 100644 --- a/modules/mesh-delivery-builder/internal/build/run.go +++ b/modules/mesh-delivery-builder/internal/build/run.go @@ -51,7 +51,7 @@ type Builder struct { // Answered is told the build module whose step answered a reference (issue 1886): what the builder says it writes // rests on it. Nil tells nobody. Answered func(buildModule string) - // Stored answers which references the artifact store no longer holds (the controller's verb held; issue 1937): a done + // Stored answers which references the artifact store no longer holds (the seat mesh-artifact-sweep's verb held; issue 1937): a done // key of the trunk's fingerprint is asked before it is left done (ClaimOptions.Stored). Nil asks nothing. Stored func(ctx context.Context, references []string) (gone []string, err error) // Trunk answers the head of a repository in the gate's source revision rev (source.main at that revision): the trunk a diff --git a/modules/mesh-delivery-builder/manifest_test.go b/modules/mesh-delivery-builder/manifest_test.go index ce7f764..9839cd0 100644 --- a/modules/mesh-delivery-builder/manifest_test.go +++ b/modules/mesh-delivery-builder/manifest_test.go @@ -107,8 +107,8 @@ func TestManifestDeclarations(t *testing.T) { // 1607/AC1 } // 1937/AC3: the builder asks the controller whether the artifact store still holds a done key's blobs (held), and no // other tool; it holds no capacity. - // 1955/L7 (ADR 0571 §2): the seat mesh-artifact-sweep's held, the controller's only while the seat has no holder (clause 10). - if want := []string{"seat:mesh-artifact-sweep.held", "seat:mesh-controller.held"}; !reflect.DeepEqual(sorted(m.Invokes), want) || len(m.Config) != 0 { + // 1955/L7 (ADR 0571 §2): the seat mesh-artifact-sweep's held, the controller's `held` is no longer asked (issue 1955). + if want := []string{"seat:mesh-artifact-sweep.held"}; !reflect.DeepEqual(sorted(m.Invokes), want) || len(m.Config) != 0 { t.Errorf("invokes = %v, config = %v, want %v and no config", m.Invokes, m.Config, want) } // The builder is woken by a build module's report of a toolchain, as the indexer is: the bucket may not exist when it diff --git a/modules/mesh-delivery-builder/module.json b/modules/mesh-delivery-builder/module.json index 1631df0..3145361 100644 --- a/modules/mesh-delivery-builder/module.json +++ b/modules/mesh-delivery-builder/module.json @@ -20,8 +20,7 @@ "mesh-controller.artifacts-gone" ], "invokes": [ - "seat:mesh-artifact-sweep.held", - "seat:mesh-controller.held" + "seat:mesh-artifact-sweep.held" ], "state": [ { "name": "builds", "history": 5 },