From e1499f0617a321c18ef93907a93af88309daff49 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 12:21:56 +0100 Subject: [PATCH] CT4: a wait names its clock and its kind: clock-from, step of the acting steps, a put's fingerprint, a delivery wait's machines; regenerated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-wants' Wait gains clock-from, the step enum of section 203 with put, delivery, kept-build and backup, fingerprint and machines, and requires step, module and since only (a put's wait has no part); the runner's wait body gains clock-from. The runner's `step` already names pipeline steps: see the report. Builds: design 47 G §498, §266, §269 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../go/seats/meshpipelinerunner/contract.go | 2 ++ contracts/go/seats/meshwants/contract.go | 31 +++++++++++++--- contracts/go/seats/meshwants/contract_test.go | 4 +++ .../seats/mesh-pipeline-runner/seat.json | 5 +++ .../seats/mesh-wants/fixtures/events.json | 32 +++++++++++++++++ contracts/seats/mesh-wants/seat.json | 35 +++++++++++++++++-- .../ts/seats/meshpipelinerunner/index.d.ts | 2 ++ contracts/ts/seats/meshwants/index.d.ts | 13 +++++-- 8 files changed, 114 insertions(+), 10 deletions(-) diff --git a/contracts/go/seats/meshpipelinerunner/contract.go b/contracts/go/seats/meshpipelinerunner/contract.go index 39817255..7c17dd91 100644 --- a/contracts/go/seats/meshpipelinerunner/contract.go +++ b/contracts/go/seats/meshpipelinerunner/contract.go @@ -675,6 +675,8 @@ type Wait struct { Artifact string `json:"artifact,omitempty"` // the watched branch, or the branch of a run on request Branch string `json:"branch"` + // the time the bound counts from (design 47 G section 266, section 269, section 498) + ClockFrom *time.Time `json:"clock-from,omitempty"` // the commit the module's entry was last changed at Commit string `json:"commit,omitempty"` // the module's build-input fingerprint at the commit diff --git a/contracts/go/seats/meshwants/contract.go b/contracts/go/seats/meshwants/contract.go index 9b9f4754..ad44c028 100644 --- a/contracts/go/seats/meshwants/contract.go +++ b/contracts/go/seats/meshwants/contract.go @@ -659,20 +659,43 @@ type Wait struct { Bound string `json:"bound,omitempty"` // on a release, who released it and why By string `json:"by,omitempty"` - Fp string `json:"fp,omitempty"` + // the time the bound counts from (design 47 G section 266, section 269, section 498) + ClockFrom *time.Time `json:"clock-from,omitempty"` + // 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 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"` Node string `json:"node,omitempty"` // the acting part waited for - Part string `json:"part"` + Part string `json:"part,omitempty"` Since time.Time `json:"since"` - Step string `json:"step"` + // which wait: an acting step of section 203 or put, delivery, kept-build, backup (design 47 G section 498) + Step string `json:"step"` // its new version's fingerprint - Version string `json:"version"` + Version string `json:"version,omitempty"` } +// The values of Wait's step. +const ( + WaitStepTakeIn = "take-in" + WaitStepValidate = "validate" + WaitStepCheck = "check" + WaitStepBuild = "build" + WaitStepCompose = "compose" + WaitStepGrant = "grant" + WaitStepPlace = "place" + WaitStepPipeline = "pipeline" + WaitStepPut = "put" + WaitStepDelivery = "delivery" + WaitStepKeptBuild = "kept-build" + WaitStepBackup = "backup" +) + // UpgradeInput is what upgrade takes. type UpgradeInput struct { // "true": each node's own composition, by its digest, and the assigner's findings diff --git a/contracts/go/seats/meshwants/contract_test.go b/contracts/go/seats/meshwants/contract_test.go index 6a6825e6..b0624c3e 100644 --- a/contracts/go/seats/meshwants/contract_test.go +++ b/contracts/go/seats/meshwants/contract_test.go @@ -45,6 +45,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionDeliveredEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.version-delivered$")}, {name: "a composition step's progress", subject: "mesh.seat.mesh-wants.event.step-progress.ace", given: "{\"ask\":\"a1b2\",\"asker\":\"assigner\",\"at\":\"2026-11-11T10:01:00Z\",\"phase\":\"build\"}", wire: "{\"ask\":\"a1b2\",\"asker\":\"assigner\",\"at\":\"2026-11-11T10:01:00Z\",\"phase\":\"build\"}", decode: func(b []byte) (any, error) { var v StepProgressEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.step-progress\\.[^.*> ]+$")}, + {name: "a put without hold waits, counted from its start", subject: "mesh.seat.mesh-wants.event.wait-held", given: "{\"bound\":\"30m\",\"clock-from\":\"2026-11-11T10:00:00Z\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"ace\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"put\"}", wire: "{\"bound\":\"30m\",\"clock-from\":\"2026-11-11T10:00:00Z\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"ace\",\"since\":\"2026-11-11T10:00:00Z\",\"step\":\"put\"}", + 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: "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-pipeline-runner/seat.json b/contracts/seats/mesh-pipeline-runner/seat.json index 5d972333..29d7b274 100644 --- a/contracts/seats/mesh-pipeline-runner/seat.json +++ b/contracts/seats/mesh-pipeline-runner/seat.json @@ -1483,6 +1483,11 @@ "how": { "type": "string", "description": "for its end, how it ended: answered, ran, released, superseded" + }, + "clock-from": { + "type": "string", + "format": "date-time", + "description": "the time the bound counts from (design 47 G section 266, section 269, section 498)" } }, "description": "a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283)", diff --git a/contracts/seats/mesh-wants/fixtures/events.json b/contracts/seats/mesh-wants/fixtures/events.json index 7c00e058..550c6c38 100644 --- a/contracts/seats/mesh-wants/fixtures/events.json +++ b/contracts/seats/mesh-wants/fixtures/events.json @@ -177,5 +177,37 @@ "phase": "build", "at": "2026-11-11T10:01:00Z" } + }, + { + "name": "a put without hold waits, counted from its start", + "of": "event:wait-held", + "subject": "mesh.seat.mesh-wants.event.wait-held", + "given": { + "step": "put", + "node": "ace", + "module": "nats", + "fingerprint": "fp-0123", + "since": "2026-11-11T10:00:00Z", + "clock-from": "2026-11-11T10:00:00Z", + "bound": "30m" + } + }, + { + "name": "a dependent's delivery waits for a dependency's version", + "of": "event:wait-held", + "subject": "mesh.seat.mesh-wants.event.wait-held", + "given": { + "step": "delivery", + "part": "mesh-sdk", + "version": "0.1.4", + "machines": [ + "ace", + "g14" + ], + "module": "nats", + "since": "2026-11-11T10:00:00Z", + "clock-from": "2026-11-11T09:58:00Z", + "bound": "60m" + } } ] diff --git a/contracts/seats/mesh-wants/seat.json b/contracts/seats/mesh-wants/seat.json index aca8f3b9..6e41ad9f 100644 --- a/contracts/seats/mesh-wants/seat.json +++ b/contracts/seats/mesh-wants/seat.json @@ -1025,7 +1025,22 @@ "description": "a step's wait the assigner holds: placing, wanting or composing until an acting part's new version runs", "properties": { "step": { - "type": "string" + "type": "string", + "enum": [ + "take-in", + "validate", + "check", + "build", + "compose", + "grant", + "place", + "pipeline", + "put", + "delivery", + "kept-build", + "backup" + ], + "description": "which wait: an acting step of section 203 or put, delivery, kept-build, backup (design 47 G section 498)" }, "part": { "type": "string", @@ -1060,12 +1075,26 @@ "by": { "type": "string", "description": "on a release, who released it and why" + }, + "clock-from": { + "type": "string", + "format": "date-time", + "description": "the time the bound counts from (design 47 G section 266, section 269, section 498)" + }, + "fingerprint": { + "type": "string", + "description": "a put's wait: the fingerprint of the build put" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "a dependent's delivery wait: the machines the dependency's version has yet to reach" } }, "required": [ "step", - "part", - "version", "module", "since" ] diff --git a/contracts/ts/seats/meshpipelinerunner/index.d.ts b/contracts/ts/seats/meshpipelinerunner/index.d.ts index cf1d8263..abcd517c 100644 --- a/contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -364,6 +364,8 @@ export interface Wait { "artifact"?: string; /** the watched branch, or the branch of a run on request */ "branch": string; + /** the time the bound counts from (design 47 G section 266, section 269, section 498) */ + "clock-from"?: string; /** the commit the module's entry was last changed at */ "commit"?: string; /** the module's build-input fingerprint at the commit */ diff --git a/contracts/ts/seats/meshwants/index.d.ts b/contracts/ts/seats/meshwants/index.d.ts index a2760e6c..91a28584 100644 --- a/contracts/ts/seats/meshwants/index.d.ts +++ b/contracts/ts/seats/meshwants/index.d.ts @@ -311,18 +311,25 @@ export interface Wait { "bound"?: string; /** on a release, who released it and why */ "by"?: string; + /** the time the bound counts from (design 47 G section 266, section 269, section 498) */ + "clock-from"?: string; + /** a put's wait: the fingerprint of the build put */ + "fingerprint"?: string; "fp"?: string; /** on wait-ended: ran or released */ "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; "node"?: string; /** the acting part waited for */ - "part": string; + "part"?: string; "since": string; - "step": string; + /** which wait: an acting step of section 203 or put, delivery, kept-build, backup (design 47 G section 498) */ + "step": "take-in" | "validate" | "check" | "build" | "compose" | "grant" | "place" | "pipeline" | "put" | "delivery" | "kept-build" | "backup"; /** its new version's fingerprint */ - "version": string; + "version"?: string; } /** is what upgrade takes. */