From 7bf15a3dc4db3d1b1da820d76f6ba20432e68600 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 7 Nov 2026 03:15:18 +0100 Subject: [PATCH] The unread-ask test and the ReadManifest note follow the delivery domain SDK's names and the ask to the indexer (issue 1921, issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- modules/mesh-build-go/buildstep/pull_test.go | 18 +++++++++--------- .../mesh-build-go/cmd/mesh-build-go/module.go | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/mesh-build-go/buildstep/pull_test.go b/modules/mesh-build-go/buildstep/pull_test.go index c50301b46..b538dccba 100644 --- a/modules/mesh-build-go/buildstep/pull_test.go +++ b/modules/mesh-build-go/buildstep/pull_test.go @@ -524,8 +524,8 @@ func TestAPoisonedAskIsSaidAndRunNoMore(t *testing.T) { // (a dropped ask leaves its asker waiting to its bound); one with no id is still dropped. func TestPullAnswersAnAskItCannotRead(t *testing.T) { src, st := NewFakeAsks(), newSteps() - good := testAsk(delivery.AskCheck) - raw, err := delivery.EncodeStepAsk(good) + good := testAsk(sdkstep.AskCheck) + raw, err := sdkstep.EncodeStepAsk(good) if err != nil { t.Fatal(err) } @@ -535,13 +535,13 @@ func TestPullAnswersAnAskItCannotRead(t *testing.T) { m["frobnicate"] = map[string]any{"program": "x"} odd, _ := json.Marshal(m) // The job is not one this reader holds, so the ask carries none it knows: decode refuses it. - if _, err := delivery.DecodeStepAsk(odd); err == nil { + if _, err := sdkstep.DecodeStepAsk(odd); err == nil { t.Fatal("the fixture ask decodes") } - src.Publish(delivery.AskCheck, odd) - src.Publish(delivery.AskCheck, []byte(`{"v":1}`)) - p := &Puller{Source: src, Language: delivery.AskGo, Node: "ace", Put: st.put, Capacity: func() int { return 1 }, - PullWait: 10 * time.Millisecond, Run: func(ctx context.Context, a delivery.StepAsk) (any, error) { + src.Publish(sdkstep.AskCheck, odd) + src.Publish(sdkstep.AskCheck, []byte(`{"v":1}`)) + p := &Puller{Source: src, Language: sdkstep.AskGo, Node: "ace", Put: st.put, Capacity: func() int { return 1 }, + PullWait: 10 * time.Millisecond, Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) { t.Error("an unread ask ran") return nil, nil }} @@ -549,9 +549,9 @@ func TestPullAnswersAnAskItCannotRead(t *testing.T) { defer cancel() go p.Pull(ctx) waitFor(t, "both termed", func() bool { _, tm, _ := src.Fates(); return len(tm) == 2 }) - key, _ := delivery.AskStepKey("ace", good.ID) + key, _ := sdkstep.AskStepKey("ace", good.ID) s, ok := st.get(key) - if !ok || s.State != delivery.StepRefused || !strings.Contains(s.Reason, "cannot read the ask") || !strings.Contains(s.Reason, "exactly one") { + if !ok || s.State != sdkstep.StepRefused || !strings.Contains(s.Reason, "cannot read the ask") || !strings.Contains(s.Reason, "exactly one") { t.Fatalf("the unread ask's step = %+v (%v)", s, ok) } } diff --git a/modules/mesh-build-go/cmd/mesh-build-go/module.go b/modules/mesh-build-go/cmd/mesh-build-go/module.go index 44423c7a6..57b041b24 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/module.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/module.go @@ -95,8 +95,8 @@ type Module struct { Settings string Capacity func() int ReadKept func(key string) (json.RawMessage, error) - // ReadManifest reads a key of the delivery indexer's manifests state (ManifestsState), which a compose ask's request - // names its manifests by (compose.go); GoModCache, when set, is the Go module cache in place of Cache's (a test). + // ReadManifest asks the delivery indexer's read tool (ManifestsTool) for one manifest by its key, which a compose ask's + // request names its manifests by (compose.go); it reads none of the indexer's state (ADR 0596); GoModCache, when set, is the Go module cache in place of Cache's (a test). ReadManifest func(key string) (json.RawMessage, error) // AskInput asks a seat verb the module invokes (module.json) as the runtime calls it (stdio.Ask): the verb a run ask's // input names, answering the input by its digest (meshdeliverycheckerclient.ReadInput).