From 7574848c5f72eb0840be9bc498518502ced444b3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 21:31:18 +0100 Subject: [PATCH] =?UTF-8?q?=C2=A7702=20the=20seat=20mesh-wants'=20wait=20g?= =?UTF-8?q?ains=20owner,=20on=20and=20words,=20and=20its=20module=20is=20o?= =?UTF-8?q?ptional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder's toolchain wait is said with this type, step build; how may be superseded. Fixtures and generated code follow. Builds: design 47 G §702, §629, §512 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- contracts/go/seats/meshwants/contract.go | 12 ++++++-- contracts/go/seats/meshwants/contract_test.go | 4 +++ .../seats/mesh-wants/fixtures/events.json | 30 +++++++++++++++++++ contracts/seats/mesh-wants/seat.json | 17 +++++++++-- contracts/ts/seats/meshwants/index.d.ts | 12 ++++++-- 5 files changed, 66 insertions(+), 9 deletions(-) diff --git a/contracts/go/seats/meshwants/contract.go b/contracts/go/seats/meshwants/contract.go index f4cb11ff..2f1c5dec 100644 --- a/contracts/go/seats/meshwants/contract.go +++ b/contracts/go/seats/meshwants/contract.go @@ -650,7 +650,7 @@ const ( StepRunStepComposition = "composition" ) -// Wait is a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs. +// Wait is a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs; the builder's toolchain wait is of this type too, with step build (design 47 G section 702). type Wait struct { // a duration such as 30m Bound string `json:"bound,omitempty"` @@ -661,13 +661,17 @@ type Wait struct { // a put's wait: the fingerprint of the build put Fingerprint string `json:"fingerprint,omitempty"` Fp string `json:"fp,omitempty"` - // on wait-ended: ran or released + // on wait-ended: ran, released or superseded How string `json:"how,omitempty"` // a dependent's delivery wait: the machines the dependency's version has yet to reach Machines []string `json:"machines,omitempty"` // the entry that waits - Module string `json:"module"` + Module string `json:"module,omitempty"` Node string `json:"node,omitempty"` + // what it waits on (design 47 G section 512, section 629) + On string `json:"on,omitempty"` + // the seat holding the wait (design 47 G section 512, section 629) + Owner string `json:"owner,omitempty"` // the acting part waited for Part string `json:"part,omitempty"` Since time.Time `json:"since"` @@ -675,6 +679,8 @@ type Wait struct { Step string `json:"step"` // its new version's fingerprint Version string `json:"version,omitempty"` + // the wait in plain words (design 47 G section 512, section 629) + Words string `json:"words,omitempty"` } // The values of Wait's step. diff --git a/contracts/go/seats/meshwants/contract_test.go b/contracts/go/seats/meshwants/contract_test.go index b0624c3e..1e2da9e6 100644 --- a/contracts/go/seats/meshwants/contract_test.go +++ b/contracts/go/seats/meshwants/contract_test.go @@ -49,6 +49,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wait-held$")}, {name: "a dependent's delivery waits for a dependency's version", subject: "mesh.seat.mesh-wants.event.wait-held", given: "{\"bound\":\"60m\",\"clock-from\":\"2026-11-11T09:58:00Z\",\"machines\":[\"ace\",\"g14\"],\"module\":\"nats\",\"part\":\"mesh-sdk\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"delivery\",\"version\":\"0.1.4\"}", wire: "{\"bound\":\"60m\",\"clock-from\":\"2026-11-11T09:58:00Z\",\"machines\":[\"ace\",\"g14\"],\"module\":\"nats\",\"part\":\"mesh-sdk\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"delivery\",\"version\":\"0.1.4\"}", decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wait-held$")}, + {name: "the builder's toolchain wait held, in the contract's words", subject: "mesh.seat.mesh-wants.event.wait-held", given: "{\"bound\":\"30m\",\"clock-from\":\"2026-11-11T10:00:00Z\",\"fingerprint\":\"src2:aaaa\",\"module\":\"mesh-sdk\",\"on\":\"toolchain\",\"owner\":\"mesh-delivery-builder\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"build\",\"words\":\"waits for the Go build seat to report its toolchain\"}", wire: "{\"bound\":\"30m\",\"clock-from\":\"2026-11-11T10:00:00Z\",\"fingerprint\":\"src2:aaaa\",\"module\":\"mesh-sdk\",\"on\":\"toolchain\",\"owner\":\"mesh-delivery-builder\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"build\",\"words\":\"waits for the Go build seat to report its toolchain\"}", + decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wait-held$")}, + {name: "the builder's toolchain wait ended by a newer fingerprint", subject: "mesh.seat.mesh-wants.event.wait-ended", given: "{\"fingerprint\":\"src2:aaaa\",\"how\":\"superseded\",\"module\":\"mesh-sdk\",\"on\":\"toolchain\",\"owner\":\"mesh-delivery-builder\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"build\"}", wire: "{\"fingerprint\":\"src2:aaaa\",\"how\":\"superseded\",\"module\":\"mesh-sdk\",\"on\":\"toolchain\",\"owner\":\"mesh-delivery-builder\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"build\"}", + decode: func(b []byte) (any, error) { var v WaitEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wait-ended$")}, {name: "a want", subject: "", given: "{\"fp\":\"ab12\",\"rule\":3,\"v\":1}", wire: "{\"fp\":\"ab12\",\"rule\":3,\"v\":1}", decode: func(b []byte) (any, error) { var v WantsByWantNodeModuleValue diff --git a/contracts/seats/mesh-wants/fixtures/events.json b/contracts/seats/mesh-wants/fixtures/events.json index 550c6c38..f9bdf4ab 100644 --- a/contracts/seats/mesh-wants/fixtures/events.json +++ b/contracts/seats/mesh-wants/fixtures/events.json @@ -209,5 +209,35 @@ "clock-from": "2026-11-11T09:58:00Z", "bound": "60m" } + }, + { + "name": "the builder's toolchain wait held, in the contract's words", + "of": "event:wait-held", + "subject": "mesh.seat.mesh-wants.event.wait-held", + "given": { + "owner": "mesh-delivery-builder", + "step": "build", + "on": "toolchain", + "module": "mesh-sdk", + "fingerprint": "src2:aaaa", + "since": "2026-11-11T10:00:00Z", + "clock-from": "2026-11-11T10:00:00Z", + "bound": "30m", + "words": "waits for the Go build seat to report its toolchain" + } + }, + { + "name": "the builder's toolchain wait ended by a newer fingerprint", + "of": "event:wait-ended", + "subject": "mesh.seat.mesh-wants.event.wait-ended", + "given": { + "owner": "mesh-delivery-builder", + "step": "build", + "on": "toolchain", + "module": "mesh-sdk", + "fingerprint": "src2:aaaa", + "since": "2026-11-11T10:00:00Z", + "how": "superseded" + } } ] diff --git a/contracts/seats/mesh-wants/seat.json b/contracts/seats/mesh-wants/seat.json index b2ce7f21..d9d6d32a 100644 --- a/contracts/seats/mesh-wants/seat.json +++ b/contracts/seats/mesh-wants/seat.json @@ -1018,7 +1018,7 @@ }, "Wait": { "type": "object", - "description": "a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs", + "description": "a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs; the builder's toolchain wait is of this type too, with step build (design 47 G section 702)", "properties": { "step": { "type": "string", @@ -1066,7 +1066,7 @@ }, "how": { "type": "string", - "description": "on wait-ended: ran or released" + "description": "on wait-ended: ran, released or superseded" }, "by": { "type": "string", @@ -1087,11 +1087,22 @@ "type": "string" }, "description": "a dependent's delivery wait: the machines the dependency's version has yet to reach" + }, + "owner": { + "type": "string", + "description": "the seat holding the wait (design 47 G section 512, section 629)" + }, + "on": { + "type": "string", + "description": "what it waits on (design 47 G section 512, section 629)" + }, + "words": { + "type": "string", + "description": "the wait in plain words (design 47 G section 512, section 629)" } }, "required": [ "step", - "module", "since" ] }, diff --git a/contracts/ts/seats/meshwants/index.d.ts b/contracts/ts/seats/meshwants/index.d.ts index b2b00598..876d399c 100644 --- a/contracts/ts/seats/meshwants/index.d.ts +++ b/contracts/ts/seats/meshwants/index.d.ts @@ -303,7 +303,7 @@ export interface StepRun { "step": "composition"; } -/** a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs */ +/** a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs; the builder's toolchain wait is of this type too, with step build (design 47 G section 702) */ export interface Wait { /** a duration such as 30m */ "bound"?: string; @@ -314,13 +314,17 @@ export interface Wait { /** a put's wait: the fingerprint of the build put */ "fingerprint"?: string; "fp"?: string; - /** on wait-ended: ran or released */ + /** on wait-ended: ran, released or superseded */ "how"?: string; /** a dependent's delivery wait: the machines the dependency's version has yet to reach */ "machines"?: string[]; /** the entry that waits */ - "module": string; + "module"?: string; "node"?: string; + /** what it waits on (design 47 G section 512, section 629) */ + "on"?: string; + /** the seat holding the wait (design 47 G section 512, section 629) */ + "owner"?: string; /** the acting part waited for */ "part"?: string; "since": string; @@ -328,6 +332,8 @@ export interface Wait { "step": "take-in" | "validate" | "check" | "build" | "compose" | "grant" | "place" | "pipeline" | "put" | "delivery" | "kept-build" | "backup"; /** its new version's fingerprint */ "version"?: string; + /** the wait in plain words (design 47 G section 512, section 629) */ + "words"?: string; } /** is what upgrade takes. */