From 7f3b712a1f0087295a2d7237eb38feb482f225fb Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 03:11:33 +0100 Subject: [PATCH] motion: a want carries no composed digest, so a have at the wanted fingerprint is applied; the test copy of mesh-wants at C-W MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §750, H-A-37, H-A-78 --- go/motion/motion.go | 9 +- go/motion/motion_test.go | 6 +- .../seatlisttest/seats/mesh-wants.json | 723 +++++++++++++++--- 3 files changed, 643 insertions(+), 95 deletions(-) diff --git a/go/motion/motion.go b/go/motion/motion.go index 22f22b86..7fb7a489 100644 --- a/go/motion/motion.go +++ b/go/motion/motion.go @@ -13,11 +13,10 @@ import "time" // findings while it is delivered there and raises what still stands when the delivery ends. Before, it lived in the view // alone (mesh-delivery-view internal/view motionOf), and a second reader would have judged a delivery its own way. -// Want is what the derivation reads of a module's want on a node: its fingerprint and composition, and whether it is removed. +// Want is what the derivation reads of a module's want on a node: its fingerprint, and whether it is removed. A want carries no composed digest, so a have at the wanted fingerprint is the want applied (design 47 H, H-A-78). type Want struct { - FP string - Composed string - Removed bool + FP string + Removed bool } // Have is what it reads of the module's have on that node: the fingerprint and composition it runs, its phase and health @@ -90,7 +89,7 @@ func MotionOf(w Want, wanted bool, h Have, has bool, stuckWords string, stuck bo } m := Motion{Delivering: !has || h.FP != w.FP || h.Phase == PhaseApplying, Failed: has && (h.Phase == PhaseFailed || (h.FP == w.FP && h.Health == HealthFailed))} - applied := has && h.FP == w.FP && (h.Composed == "" || h.Composed == w.Composed) + applied := has && h.FP == w.FP switch { case applied && h.Phase == PhaseRunning && h.Health == HealthOK: m.State, m.Outcome = MotionSettled, OutcomeRunning diff --git a/go/motion/motion_test.go b/go/motion/motion_test.go index 42b4d1d0..4bf849a5 100644 --- a/go/motion/motion_test.go +++ b/go/motion/motion_test.go @@ -6,7 +6,7 @@ import "testing" // delivered on a node, read by the view (moving, settled, stuck, as its motionOf said them) and by the condition keeper // (delivering, failed, ended). Wants and haves as the assigner and the node-engine write them (a refusal is written as phase failed at the prior fingerprint). func TestMotionOf(t *testing.T) { - want := Want{FP: "fp-new", Composed: "sha256:new"} + want := Want{FP: "fp-new"} at := func(fp, composed string, phase, health string, detail string) Have { return Have{FP: fp, Composed: composed, Phase: phase, Health: health, Detail: detail} } @@ -34,8 +34,8 @@ func TestMotionOf(t *testing.T) { h: at("fp-new", "sha256:new", "checking", "unknown", ""), has: true, state: MotionMoving}, {name: "running healthy at the want", w: want, wanted: true, h: at("fp-new", "sha256:new", PhaseRunning, HealthOK, ""), has: true, state: MotionSettled, outcome: OutcomeRunning, ended: true}, - {name: "running healthy at another composition", w: want, wanted: true, h: at("fp-new", "sha256:other", PhaseRunning, HealthOK, ""), has: true, - state: MotionMoving}, + {name: "running healthy at the want, whatever composition the have names (H-A-78)", w: want, wanted: true, + h: at("fp-new", "sha256:other", PhaseRunning, HealthOK, ""), has: true, state: MotionSettled, outcome: OutcomeRunning, ended: true}, {name: "unhealthy at the want", w: want, wanted: true, h: at("fp-new", "sha256:new", PhaseRunning, HealthFailed, "exit 1"), has: true, state: MotionStuck, outcome: OutcomeFailed, failed: true, ended: true}, {name: "its apply failed at the want", w: want, wanted: true, h: at("fp-new", "sha256:new", PhaseFailed, "unknown", "no image"), has: true, diff --git a/go/seatlist/seatlisttest/seats/mesh-wants.json b/go/seatlist/seatlisttest/seats/mesh-wants.json index cb1ef5dc..09488de3 100644 --- a/go/seatlist/seatlisttest/seats/mesh-wants.json +++ b/go/seatlist/seatlisttest/seats/mesh-wants.json @@ -54,7 +54,7 @@ }, { "name": "revision", - "description": "The assignment half of the revision view (ADR 0656 \u00a76): one assignment graph revision, named by its own number and naming its inputs, with its entries' digests; the trunk's newest when none is named, or a candidate's for its group and heads. Reads only.", + "description": "The assignment half of the revision view (ADR 0656 §6): one assignment graph revision, named by its own number and naming its inputs, with its entries' digests; the trunk's newest when none is named, or a candidate's for its group and heads. Reads only.", "input": { "type": "object", "properties": { @@ -159,17 +159,23 @@ { "name": "input", "class": "read", - "description": "A step's input by its digest, as the assigner keeps it for the composition step it asked a build seat to run (design 47 G section 354).", + "description": "A step's input by its digest, as the assigner keeps it for the composition step it asked a build seat to run (design 47 G section 354): its fields, then the bytes in chunks of at most 512 KiB on the chunk subject of the call, each acknowledged by the caller on the ack subject within 30 seconds; the input is of any size.", "input": { "type": "object", "properties": { "digest": { "type": "string", "description": "the input's sha256" + }, + "call": { + "type": "string", + "description": "128 random bits the caller chooses: the subject token of this send's chunks and acknowledgements", + "minLength": 1 } }, "required": [ - "digest" + "digest", + "call" ] }, "answer": { @@ -179,14 +185,96 @@ "type": "string", "description": "the input's sha256" }, - "input": { - "type": "string", - "description": "the input's exact bytes, base64" + "chunks": { + "type": "integer", + "minimum": 0, + "description": "how many chunks are sent; 0 when there is no input of that digest" } }, "required": [ "digest", - "input" + "chunks" + ] + }, + "chunks": true + }, + { + "name": "compositions", + "class": "read", + "description": "Each composition run the assigner keeps (design 47 G §728): its program, input digest, ask, readers, outcome and verdict, and the state's fill against its cap; with candidate or machine, only those.", + "input": { + "type": "object", + "properties": { + "candidate": { + "type": "string", + "description": "the candidate's key" + }, + "machine": { + "type": "string" + } + } + }, + "answer": { + "type": "object", + "properties": { + "runs": { + "type": "array", + "items": { + "$ref": "#/defs/CompositionRun" + } + }, + "fill": { + "$ref": "#/defs/Fill" + } + }, + "required": [ + "runs", + "fill" + ] + } + }, + { + "name": "compositions-drop", + "class": "act", + "description": "Drop one composition run by hand (design 47 G §728): the act and why are written in the hand-act log first, then the run's ask is dropped, each reader ended could not run naming the drop, and the key deleted.", + "input": { + "type": "object", + "properties": { + "candidate": { + "type": "string", + "description": "the candidate's key" + }, + "machine": { + "type": "string" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "candidate", + "machine", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "run": { + "$ref": "#/defs/CompositionRun", + "description": "the entry deleted" + }, + "ended": { + "type": "array", + "items": { + "$ref": "#/defs/CompositionReader" + }, + "description": "the readers it ended" + } + }, + "required": [ + "run" ] } } @@ -295,6 +383,11 @@ }, { "name": "wanted", + "subject": "wanted..", + "keep": { + "last-per-subject": true, + "max-age-days": 0 + }, "body": { "type": "object", "description": "an entry written as a want, from a trunk revision only", @@ -311,12 +404,20 @@ "fp": { "type": "string" }, + "pipeline": { + "type": "string", + "description": "the pipeline whose passed end the want was written from, its key .; absent for a placement's build (design 47 H-A-56)" + }, "revision": { "type": "integer" }, "source": { "type": "integer" }, + "removed": { + "type": "boolean", + "description": "true when the assigner removes the want of that node and module (the node left, or the module was unplaced); fp is then the fingerprint last wanted there (design 47 G section 693)" + }, "at": { "type": "string", "format": "date-time" @@ -331,6 +432,17 @@ ] } }, + { + "name": "pipeline-wanted", + "subject": "pipeline-wanted..", + "keep": { + "max-age-days": 30, + "max-mib": 64 + }, + "body": { + "$ref": "#/defs/PipelineWanted" + } + }, { "name": "wait-held", "body": { @@ -373,50 +485,44 @@ } }, { - "name": "version-delivered", - "keep": { - "max-age-days": 90, - "max-mib": 64 - }, + "name": "step-progress", + "subject": "step-progress.", "body": { "type": "object", - "description": "a version delivered to every present machine that places it, and healthy (design 47 G section 376)", + "description": "a composition step's progress, said once a minute while the assigner runs it (design 47 G section 496)", "properties": { - "v": { - "type": "integer" + "asker": { + "type": "string" }, - "module": { + "ask": { + "type": "string" + }, + "phase": { "type": "string", - "description": "the module" - }, - "version": { - "type": "string", - "description": "MAJOR.MINOR.PATCH" - }, - "parts": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "the digest of each of its parts, by artifact reference" - }, - "away": { - "type": "array", - "items": { - "type": "string" - }, - "description": "the machines away when it was said" + "enum": [ + "fetch", + "build", + "run", + "report" + ] }, "at": { "type": "string", "format": "date-time" + }, + "shared": { + "type": "array", + "items": { + "$ref": "#/defs/Shared" + }, + "description": "the composition runs the step waits on, by machine, each with its ask (design 47 G §723, §729)" } }, "required": [ - "v", - "module", - "version", - "parts" + "asker", + "ask", + "phase", + "at" ] } } @@ -429,12 +535,13 @@ { "name": "wants", "template": "state", + "view": true, "key-forms": [ { "key": "want..", "value": { "type": "object", - "description": "a node's want for a module", + "description": "a node's want for a module: the build it should run by its fingerprint and released version, with the pipeline and rank it was written from (design 47 H §750)", "properties": { "v": { "type": "integer" @@ -442,19 +549,9 @@ "fp": { "type": "string" }, - "composed": { - "type": "string" - }, "removed": { "type": "boolean" }, - "newest": { - "type": "string" - }, - "rule": { - "type": "integer", - "description": "the rule that holds the node back, 1 to 10" - }, "backup": { "type": "string", "description": "again or skip", @@ -463,6 +560,13 @@ "skip" ] }, + "revert": { + "type": "string", + "description": "live: the operator's answer to a held revert, to start the reverted build on the live data as it is, with nothing restored (design 47 G section 710)", + "enum": [ + "live" + ] + }, "words": { "type": "string" }, @@ -483,14 +587,16 @@ }, "version": { "type": "string", - "description": "the module's released version, for people; none for a build of another watched branch (design 47 G section 379)" + "description": "the version released at the build the want names: the newest released on the placement's branch whose pipeline passed, or the placement's build's (design 47 H §750)" }, - "parts": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "the digest of each of the module's parts, by artifact reference; the node-engine fetches and checks each part by it (design 47 G section 379)" + "pipeline": { + "type": "string", + "description": "the pipeline whose passed end released the version, its key .; absent for a placement's build (design 47 H §750, H-A-37)" + }, + "rank": { + "type": "integer", + "minimum": 1, + "description": "the mover's tier in that pipeline's delivery order, from 1; the node-engine applies one pipeline's wants by it; absent with pipeline (design 47 H §750, §771, H-A-37)" } } }, @@ -547,6 +653,64 @@ "history": 20, "description": "what each node should run, and the fingerprints held back" }, + { + "name": "asks", + "template": "state", + "view": true, + "history": 5, + "description": "the asks the assigner puts to a person about what a node runs, one key per ask, each the ask as the assigner composes it (design 47 G section 717)", + "key-forms": [ + { + "key": "hold..", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a module's held fingerprint whose health check failed: release it or keep it held" + }, + { + "key": "restore...", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a data module set back on a node: restore and lose newer writes, or leave it stopped (ADR 0429 section 6)" + }, + { + "key": "backup...", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a backup that failed before a node applies a fingerprint: back up again, or go on without one (ADR 0539 section 16)" + }, + { + "key": "record...", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a move a person must allow for a module of policy record, naming the composition's digest (ADR 0539 section 14)" + }, + { + "key": "outside...", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a moved module whose failing health check waited past its bound on an outside cause (design 47 G section 706)" + }, + { + "key": "revert...", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the ask about a held revert with no restore point, the reverted build's fingerprint (design 47 G section 710)" + }, + { + "key": "assignments.", + "value": { + "$ref": "#/defs/Ask" + }, + "description": "the authorising ask about a proposal of assignments (ADR 0567 section 5)" + } + ] + }, { "name": "differences", "template": "state", @@ -678,22 +842,6 @@ "description": "an entry, written once, removed when no kept revision lists it" } ] - }, - { - "name": "inputs", - "template": "state", - "history": 1, - "description": "a step's input, named by its write time and its sha256 (design 47 G section 354)", - "key-forms": [ - { - "key": "