From b81d338e58b1a26af54365061de36d97d99f0968 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:38:52 +0100 Subject: [PATCH] O-4: the call that reads a sent object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 G §347, §407 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- go/buscalls/buscalls.go | 13 +++++++++++++ go/packages_list_test.go | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/go/buscalls/buscalls.go b/go/buscalls/buscalls.go index 44e007d4..b39dada2 100644 --- a/go/buscalls/buscalls.go +++ b/go/buscalls/buscalls.go @@ -28,6 +28,10 @@ const ( ObjectsDelete = "mesh/objects.delete" ObjectsInfo = "mesh/objects.info" ObjectsWatch = "mesh/objects.watch" + // ObjectsSentGet reads an object of a sender's store of sent objects by the reference a reply or an event carried + // (design 47 G §347, §407), served under the standing grant the grants part derives from the manifests; the answer is + // ObjectData. + ObjectsSentGet = "mesh/objects.sent-get" StreamRead = "mesh/stream.read" StreamFill = "mesh/stream.fill" @@ -103,6 +107,15 @@ type ObjectInfo struct { Deleted bool `json:"deleted,omitempty"` } +// ObjectsSentGetRequest names one sent object by the reference that carried it (stateobjects.Ref's fields, which this +// package does not import): the sender's store, the object's name, and its size and digest, which the reader checks. +type ObjectsSentGetRequest struct { + Store string `json:"store"` + Object string `json:"object"` + Size int64 `json:"size"` + Digest string `json:"sha256"` +} + // ObjectData is get's answer: the object's info and its bytes. type ObjectData struct { Info ObjectInfo `json:"info"` diff --git a/go/packages_list_test.go b/go/packages_list_test.go index a861aee3..35dfb78d 100644 --- a/go/packages_list_test.go +++ b/go/packages_list_test.go @@ -311,6 +311,12 @@ func TestMeshSDKHoldsOnlyWhatEveryModuleShares(t *testing.T) { t.Errorf("%s: unwrapped %s, %q, %v; want %s, %q, %v", c.name, answer, said, ok, c.answer, c.said, c.ok) } } + // design 47 G §347: a sent object is asked by its reference's fields. + sentAsk := buscalls.ObjectsSentGetRequest{Store: "m_sent-objects", Object: "o", Size: 3 << 20, Digest: strings.Repeat("b", 64)} + if raw, err := json.Marshal(sentAsk); err != nil || buscalls.ObjectsSentGet != "mesh/objects.sent-get" || + string(raw) != `{"store":"m_sent-objects","object":"o","size":3145728,"sha256":"`+strings.Repeat("b", 64)+`"}` { + t.Errorf("the sent-get request is %s, %v", raw, err) + } // 1966/AC5: an apply naming the tool call it serves, and its answer with the state behind, round-trip. for _, c := range []struct { name string