From b96e709d7c0560128cf17a60cae0125e408eeadd Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 19 Nov 2026 22:50:57 +0100 Subject: [PATCH 1/7] =?UTF-8?q?mesh-config=20seat:=20drop=20the=20state=20?= =?UTF-8?q?kept=20and=20the=20meshconfigclient=20(issue=201982;=20ADR=2006?= =?UTF-8?q?81=20=C2=A71,=20=C2=A76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mesh knows no pull request (design 47 G, G-1 §38-39), so mesh-config keeps no value held for one. The seat definition loses the state kept, its fixtures and generated Go and TypeScript (seatgen), and the generated client package, which held only the held values' key and decoder, goes with its artifact in module.json. Builds: ADR 0681 §1 (nothing mesh-config records is a held value), §6 (no check reads a held value, so the seat keeps none and its generated client goes). Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy --- go/clients/meshconfigclient/client.go | 83 --------------------- go/clients/meshconfigclient/client_test.go | 45 ----------- go/clients/meshconfigclient/go.mod | 5 -- go/seats/meshconfig/contract.go | 86 ---------------------- go/seats/meshconfig/contract_test.go | 6 -- module.json | 8 -- seats/mesh-config/fixtures/states.json | 20 ----- seats/mesh-config/seat.json | 74 ------------------- ts/seats/meshconfig/index.d.ts | 33 --------- ts/seats/meshconfig/index.js | 36 --------- 10 files changed, 396 deletions(-) delete mode 100644 go/clients/meshconfigclient/client.go delete mode 100644 go/clients/meshconfigclient/client_test.go delete mode 100644 go/clients/meshconfigclient/go.mod diff --git a/go/clients/meshconfigclient/client.go b/go/clients/meshconfigclient/client.go deleted file mode 100644 index 9f99ddb..0000000 --- a/go/clients/meshconfigclient/client.go +++ /dev/null @@ -1,83 +0,0 @@ -// Package meshconfigclient is the logic every reader of the seat mesh-config's state kept shares (novox/hq ADR 0565 -// clause 5, ADR 0634 §4): the checker and the assigner's composition check lay a pull request's own held values over its -// modules' values. The layout of a value is the seat's contract's; this holds what the readers share over it: a pull -// request's key, a held value's key and the rule that a value is the one its key names. -package meshconfigclient - -import ( - "encoding/json" - "fmt" - "strings" - - seat "git.novox.be/novox/mesh-contracts/go/seats/meshconfig" -) - -// PullKey is a pull request's key, `owner/repository#number` with `/` and `#` as dots, the form the seat keeps a pull -// request's values under. The three parts hold no dot, star, angle bracket or space. -func PullKey(pull string) (string, error) { - owner, repository, number, err := splitPull(pull) - if err != nil { - return "", err - } - return owner + "." + repository + "." + number, nil -} - -func splitPull(pull string) (owner, repository, number string, err error) { - owner, rest, ok := strings.Cut(strings.TrimSpace(pull), "/") - repository, number, ok2 := strings.Cut(rest, "#") - if !ok || !ok2 || owner == "" || repository == "" || number == "" || strings.ContainsAny(owner+repository+number, ".*> ") { - return "", "", "", fmt.Errorf("meshconfig: %q is not a pull request, owner/repository#number", pull) - } - return owner, repository, number, nil -} - -// HeldValueKey is a held value's key in the state kept: the pull request's key, the node, the module and the config key, -// joined by dots. -func HeldValueKey(pull, node, module, key string) (string, error) { - owner, repository, number, err := splitPull(pull) - if err != nil { - return "", err - } - if node == "" || module == "" || key == "" { - return "", fmt.Errorf("meshconfig: a held value names a node, a module and a key") - } - return seat.KeptByOwnerRepositoryNumberNodeModuleKeyKey(owner, repository, number, node, module, key), nil -} - -// Kept is one held value, as the seat types it. -type Kept = seat.KeptByOwnerRepositoryNumberNodeModuleKeyValue - -// CheckKept refuses a held value that names no pull request, head, declaration, node, module or key. -func CheckKept(v Kept) error { - if _, err := PullKey(v.Pull); err != nil { - return err - } - if v.Head == "" || v.Declaration == "" || v.Node == "" || v.Module == "" || v.Key == "" { - return fmt.Errorf("meshconfig: a held value of %s names a head, a declaration, a node, a module and a key", v.Pull) - } - return nil -} - -// DecodeKept reads a value of the state kept under its key: the value the seat types, checked, and the one its key -// names. A value kept under another key than its own fields make is refused, so a reader never lays a value over the -// wrong pull request or module. -func DecodeKept(key string, raw []byte) (Kept, error) { - v, err := seat.DecodeKeptByOwnerRepositoryNumberNodeModuleKeyValue(raw) - if err != nil { - return Kept{}, fmt.Errorf("meshconfig: the held value %s is not one: %w", key, err) - } - if err := CheckKept(v); err != nil { - return Kept{}, err - } - want, err := HeldValueKey(v.Pull, v.Node, v.Module, v.Key) - if err != nil { - return Kept{}, err - } - if want != key { - return Kept{}, fmt.Errorf("meshconfig: the held value kept under %s names %s", key, want) - } - return v, nil -} - -// ValueOf is the value held, as the operator approved it, in its JSON form. -func ValueOf(v Kept) (json.RawMessage, error) { return json.Marshal(v.Value) } diff --git a/go/clients/meshconfigclient/client_test.go b/go/clients/meshconfigclient/client_test.go deleted file mode 100644 index ede862f..0000000 --- a/go/clients/meshconfigclient/client_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package meshconfigclient - -import ( - "strings" - "testing" -) - -// The keys are the earlier form of go/delivery's HeldValueKey and ConfigCandidateKey (golden), which the holder writes. -func TestKeysAreTheEarlierForm(t *testing.T) { - if k, err := HeldValueKey("novox/mesh-catalog#42", "novox", "mail", "quota"); k != "novox.mesh-catalog.42.novox.mail.quota" || err != nil { - t.Errorf("a held value's key is %q, %v", k, err) - } - for pull, want := range map[string]string{"novox/mesh-catalog#42": "novox.mesh-catalog.42", "x#1": "", "a/b": "", "a/b.c#1": ""} { - if got, err := PullKey(pull); got != want || (want == "") != (err != nil) { - t.Errorf("%s keyed %q, %v", pull, got, err) - } - } - if _, err := HeldValueKey("novox/mesh-catalog#42", "", "mail", "quota"); err == nil { - t.Error("a held value without a node was keyed") - } -} - -const held = `{"pull":"novox/mesh-catalog#434","head":"abc1234def","declaration":"sha256:3a7b","node":"ace","module":"n8n","key":"media-gid","value":2000,"by":"the operator","approved":"operator@telegram","at":"2026-11-05T12:30:00Z"}` - -func TestAHeldValueIsTheOneItsKeyNames(t *testing.T) { - key := "novox.mesh-catalog.434.ace.n8n.media-gid" - v, err := DecodeKept(key, []byte(held)) - if err != nil || v.Node != "ace" || v.Value != float64(2000) { - t.Fatalf("read %+v, %v", v, err) - } - if raw, err := ValueOf(v); err != nil || string(raw) != "2000" { - t.Errorf("the value is %s, %v", raw, err) - } - for name, c := range map[string]struct{ key, raw string }{ - "another pull request's key": {"novox.mesh-catalog.435.ace.n8n.media-gid", held}, - "another module's key": {"novox.mesh-catalog.434.ace.plex.media-gid", held}, - "no head": {key, strings.Replace(held, `"head":"abc1234def",`, "", 1)}, - "a field it does not know": {key, strings.Replace(held, `"by"`, `"extra":1,"by"`, 1)}, - "a pull that is not one": {key, strings.Replace(held, "novox/mesh-catalog#434", "novox", 1)}, - } { - if _, err := DecodeKept(c.key, []byte(c.raw)); err == nil { - t.Errorf("%s was read", name) - } - } -} diff --git a/go/clients/meshconfigclient/go.mod b/go/clients/meshconfigclient/go.mod deleted file mode 100644 index 69546e4..0000000 --- a/go/clients/meshconfigclient/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module git.novox.be/novox/mesh-contracts/go/clients/meshconfigclient - -go 1.26.0 - -require git.novox.be/novox/mesh-contracts/go/seats/meshconfig v0.0.0-00010101000000-000000000000 diff --git a/go/seats/meshconfig/contract.go b/go/seats/meshconfig/contract.go index f7107e2..3c126d1 100644 --- a/go/seats/meshconfig/contract.go +++ b/go/seats/meshconfig/contract.go @@ -8,7 +8,6 @@ import ( "encoding/json" "errors" "strings" - "time" ) // Seat is the seat's name. @@ -48,7 +47,6 @@ func HolderSubjectRetired(holder string) string { return "mesh.stream." + holder const ( StateResolved = "resolved" - StateKept = "kept" ) // ResolvedByNodeModuleKeyKey is the key of one value of the state resolved under the form "..". @@ -94,64 +92,6 @@ func DecodeResolvedByNodeModuleKeyValue(raw []byte) (ResolvedByNodeModuleKeyValu return v, nil } -// KeptByOwnerRepositoryNumberNodeModuleKeyKey is the key of one value of the state kept under the form ".....". -func KeptByOwnerRepositoryNumberNodeModuleKeyKey(owner, repository, number, node, module, key string) string { - return owner + "." + repository + "." + number + "." + node + "." + module + "." + key -} - -// ParseKeptByOwnerRepositoryNumberNodeModuleKeyKey reads the parts of a key of the form ".....", in the order of the form; the last result is false for a key of another form. -func ParseKeptByOwnerRepositoryNumberNodeModuleKeyKey(key string) (string, string, string, string, string, string, bool) { - rest := key - v0, after0, found0 := strings.Cut(rest, ".") - if !found0 || v0 == "" { - return "", "", "", "", "", "", false - } - rest = after0 - v2, after2, found2 := strings.Cut(rest, ".") - if !found2 || v2 == "" { - return "", "", "", "", "", "", false - } - rest = after2 - v4, after4, found4 := strings.Cut(rest, ".") - if !found4 || v4 == "" { - return "", "", "", "", "", "", false - } - rest = after4 - v6, after6, found6 := strings.Cut(rest, ".") - if !found6 || v6 == "" { - return "", "", "", "", "", "", false - } - rest = after6 - v8, after8, found8 := strings.Cut(rest, ".") - if !found8 || v8 == "" { - return "", "", "", "", "", "", false - } - rest = after8 - if rest == "" { - return "", "", "", "", "", "", false - } - v10 := rest - rest = "" - if rest != "" { - return "", "", "", "", "", "", false - } - return v0, v2, v4, v6, v8, v10, true -} - -// DecodeKeptByOwnerRepositoryNumberNodeModuleKeyValue reads one value of the state kept under the form ".....", refusing a field KeptByOwnerRepositoryNumberNodeModuleKeyValue does not know and any text after the value. -func DecodeKeptByOwnerRepositoryNumberNodeModuleKeyValue(raw []byte) (KeptByOwnerRepositoryNumberNodeModuleKeyValue, error) { - var v KeptByOwnerRepositoryNumberNodeModuleKeyValue - dec := json.NewDecoder(bytes.NewReader(raw)) - dec.DisallowUnknownFields() - if err := dec.Decode(&v); err != nil { - return v, err - } - if dec.More() { - return v, errors.New("text after the value") - } - return v, nil -} - // ConfigInput is what config takes. type ConfigInput struct { // list (when not given), set, clear or history @@ -257,29 +197,3 @@ type ResolvedByNodeModuleKeyValue struct { Trusted bool `json:"trusted,omitempty"` Value any `json:"value,omitempty"` } - -// KeptByOwnerRepositoryNumberNodeModuleKeyValue is one value of the state kept under the key ...... -type KeptByOwnerRepositoryNumberNodeModuleKeyValue struct { - // who approved it, as the proposal kept it - Approved string `json:"approved,omitempty"` - // when it was kept - At *time.Time `json:"at,omitempty"` - By string `json:"by,omitempty"` - // the digest of what the declaration holds the value to; the value stays only while it is the same - Declaration string `json:"declaration"` - // the head the declaration was read at - Head string `json:"head"` - // the config key - Key string `json:"key"` - Module string `json:"module"` - Node string `json:"node"` - // the proposal's id - Proposal string `json:"proposal,omitempty"` - // the pull request, owner/repository#number - Pull string `json:"pull"` - // the value held, as the operator approved it - Value any `json:"value"` - // where the value was proposed from - Via string `json:"via,omitempty"` - Why string `json:"why,omitempty"` -} diff --git a/go/seats/meshconfig/contract_test.go b/go/seats/meshconfig/contract_test.go index fed1bff..7a994e6 100644 --- a/go/seats/meshconfig/contract_test.go +++ b/go/seats/meshconfig/contract_test.go @@ -37,12 +37,6 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, - {name: "a held value, as mesh-config writes it (the holder's own test values)", subject: "", given: "{\"approved\":\"operator@telegram\",\"at\":\"2026-11-05T12:30:00Z\",\"by\":\"the operator\",\"declaration\":\"sha256:3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b\",\"head\":\"abc1234def\",\"key\":\"media-gid\",\"module\":\"n8n\",\"node\":\"ace\",\"proposal\":\"p-1\",\"pull\":\"novox/mesh-catalog#434\",\"value\":2000,\"via\":\"telegram\",\"why\":\"the group the media share is owned by\"}", wire: "{\"approved\":\"operator@telegram\",\"at\":\"2026-11-05T12:30:00Z\",\"by\":\"the operator\",\"declaration\":\"sha256:3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b\",\"head\":\"abc1234def\",\"key\":\"media-gid\",\"module\":\"n8n\",\"node\":\"ace\",\"proposal\":\"p-1\",\"pull\":\"novox/mesh-catalog#434\",\"value\":2000,\"via\":\"telegram\",\"why\":\"the group the media share is owned by\"}", - decode: func(b []byte) (any, error) { - var v KeptByOwnerRepositoryNumberNodeModuleKeyValue - err := json.Unmarshal(b, &v) - return v, err - }, subjectIs: nil}, {name: "renames answers the open windows", subject: "", given: "{\"renames\":[{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"open\":[\"g14\"],\"to\":\"new-key\"}]}", wire: "{\"renames\":[{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"open\":[\"g14\"],\"to\":\"new-key\"}]}", decode: func(b []byte) (any, error) { var v RenamesAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } diff --git a/module.json b/module.json index 4631d72..2c3b559 100644 --- a/module.json +++ b/module.json @@ -4,14 +4,6 @@ "slug": "contracts", "build": { "artifacts": [ - { - "name": "go-meshconfigclient", - "kind": "package", - "language": "go", - "paths": [ - "go/clients/meshconfigclient" - ] - }, { "name": "go-nodeengineclient", "kind": "package", diff --git a/seats/mesh-config/fixtures/states.json b/seats/mesh-config/fixtures/states.json index edc2be3..ad3d582 100644 --- a/seats/mesh-config/fixtures/states.json +++ b/seats/mesh-config/fixtures/states.json @@ -21,25 +21,5 @@ "source": "module", "value": 500 } - }, - { - "name": "a held value, as mesh-config writes it (the holder's own test values)", - "of": "state:kept/.....", - "why": "no tool reads the state kept; the values are the holder's test (modules/mesh-config pulls_test.go): key novox.mesh-catalog.434.ace.n8n.media-gid", - "given": { - "pull": "novox/mesh-catalog#434", - "head": "abc1234def", - "declaration": "sha256:3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b", - "node": "ace", - "module": "n8n", - "key": "media-gid", - "value": 2000, - "by": "the operator", - "via": "telegram", - "why": "the group the media share is owned by", - "approved": "operator@telegram", - "proposal": "p-1", - "at": "2026-11-05T12:30:00Z" - } } ] diff --git a/seats/mesh-config/seat.json b/seats/mesh-config/seat.json index 9054314..cee64ed 100644 --- a/seats/mesh-config/seat.json +++ b/seats/mesh-config/seat.json @@ -266,80 +266,6 @@ } ], "description": "the value each module on each node takes for each config key, built from the sources alone" - }, - { - "name": "kept", - "template": "state", - "key-forms": [ - { - "key": ".....", - "value": { - "type": "object", - "description": "an approved held value, kept apart from the values mesh-config resolves, laid only over the composition of its own pull request at its head (ADR 0565 clause 5)", - "properties": { - "pull": { - "type": "string", - "description": "the pull request, owner/repository#number" - }, - "head": { - "type": "string", - "description": "the head the declaration was read at" - }, - "declaration": { - "type": "string", - "description": "the digest of what the declaration holds the value to; the value stays only while it is the same" - }, - "node": { - "type": "string" - }, - "module": { - "type": "string" - }, - "key": { - "type": "string", - "description": "the config key" - }, - "value": { - "description": "the value held, as the operator approved it" - }, - "by": { - "type": "string" - }, - "via": { - "type": "string", - "description": "where the value was proposed from" - }, - "why": { - "type": "string" - }, - "approved": { - "type": "string", - "description": "who approved it, as the proposal kept it" - }, - "proposal": { - "type": "string", - "description": "the proposal's id" - }, - "at": { - "type": "string", - "format": "date-time", - "description": "when it was kept" - } - }, - "required": [ - "pull", - "head", - "declaration", - "node", - "module", - "key", - "value" - ] - }, - "description": "one held value: the pull request (owner, repository and number, none holding a dot), the node, the module and the config key, which may hold dots" - } - ], - "description": "the approved held values of open pull requests, read by the checker and the assigner's composition check" } ] } diff --git a/ts/seats/meshconfig/index.d.ts b/ts/seats/meshconfig/index.d.ts index 3188b8f..5f94352 100644 --- a/ts/seats/meshconfig/index.d.ts +++ b/ts/seats/meshconfig/index.d.ts @@ -26,7 +26,6 @@ export declare function retiredHolderSubject(holder: string): string; export declare const states: { readonly resolved: "resolved"; - readonly kept: "kept"; }; /** The key of one value of the state resolved under the form "..". */ @@ -35,12 +34,6 @@ export declare function resolvedByNodeModuleKeyKey(node: string, module: string, /** The parts of a key of the form "..", or undefined for a key of another form. */ export declare function parseResolvedByNodeModuleKeyKey(_key: string): { node: string; module: string; key: string } | undefined; -/** The key of one value of the state kept under the form ".....". */ -export declare function keptByOwnerRepositoryNumberNodeModuleKeyKey(owner: string, repository: string, number: string, node: string, module: string, key: string): string; - -/** The parts of a key of the form ".....", or undefined for a key of another form. */ -export declare function parseKeptByOwnerRepositoryNumberNodeModuleKeyKey(_key: string): { owner: string; repository: string; number: string; node: string; module: string; key: string } | undefined; - /** is what config takes. */ export interface ConfigInput { /** list (when not given), set, clear or history */ @@ -140,29 +133,3 @@ export interface ResolvedByNodeModuleKeyValue { "value"?: unknown; } -/** is one value of the state kept under the key ...... */ -export interface KeptByOwnerRepositoryNumberNodeModuleKeyValue { - /** who approved it, as the proposal kept it */ - "approved"?: string; - /** when it was kept */ - "at"?: string; - "by"?: string; - /** the digest of what the declaration holds the value to; the value stays only while it is the same */ - "declaration": string; - /** the head the declaration was read at */ - "head": string; - /** the config key */ - "key": string; - "module": string; - "node": string; - /** the proposal's id */ - "proposal"?: string; - /** the pull request, owner/repository#number */ - "pull": string; - /** the value held, as the operator approved it */ - "value": unknown; - /** where the value was proposed from */ - "via"?: string; - "why"?: string; -} - diff --git a/ts/seats/meshconfig/index.js b/ts/seats/meshconfig/index.js index aeb7b3b..b210b05 100644 --- a/ts/seats/meshconfig/index.js +++ b/ts/seats/meshconfig/index.js @@ -34,7 +34,6 @@ export function retiredHolderSubject(holder) { export const states = { resolved: "resolved", - kept: "kept", }; /** The key of one value of the state resolved under the form "..". */ @@ -60,38 +59,3 @@ export function parseResolvedByNodeModuleKeyKey(_key) { return { node, module, key }; } -/** The key of one value of the state kept under the form ".....". */ -export function keptByOwnerRepositoryNumberNodeModuleKeyKey(owner, repository, number, node, module, key) { - return owner + "." + repository + "." + number + "." + node + "." + module + "." + key; -} - -/** The parts of a key of the form ".....", or undefined for a key of another form. */ -export function parseKeptByOwnerRepositoryNumberNodeModuleKeyKey(_key) { - let _rest = _key; - const _at0 = _rest.indexOf("."); - if (_at0 <= 0) return undefined; - const owner = _rest.slice(0, _at0); - _rest = _rest.slice(_at0 + 1); - const _at2 = _rest.indexOf("."); - if (_at2 <= 0) return undefined; - const repository = _rest.slice(0, _at2); - _rest = _rest.slice(_at2 + 1); - const _at4 = _rest.indexOf("."); - if (_at4 <= 0) return undefined; - const number = _rest.slice(0, _at4); - _rest = _rest.slice(_at4 + 1); - const _at6 = _rest.indexOf("."); - if (_at6 <= 0) return undefined; - const node = _rest.slice(0, _at6); - _rest = _rest.slice(_at6 + 1); - const _at8 = _rest.indexOf("."); - if (_at8 <= 0) return undefined; - const module = _rest.slice(0, _at8); - _rest = _rest.slice(_at8 + 1); - if (_rest === "") return undefined; - const key = _rest; - _rest = ""; - if (_rest !== "") return undefined; - return { owner, repository, number, node, module, key }; -} - -- 2.54.0 From f026a208a587f985aee2d16e906174d29145613f Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:28:45 +0100 Subject: [PATCH 2/7] contracts-no-callers: the seat mesh-grants' verb withheld names no callers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §752, §764 (Every seat contract (H1)) --- identity-and-access/seats/mesh-grants/seat.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/identity-and-access/seats/mesh-grants/seat.json b/identity-and-access/seats/mesh-grants/seat.json index 49e5cd8..779bb1a 100644 --- a/identity-and-access/seats/mesh-grants/seat.json +++ b/identity-and-access/seats/mesh-grants/seat.json @@ -46,11 +46,6 @@ "name": "withheld", "description": "The marked subjects withheld from each module a node's runtime carries, and why: where its tool runner does not state approval-mark/1, or its reading is not the running runner's (design 46 approval mark 6).", "class": "read", - "callers": [ - "seat:node-engine", - "persons", - "operator" - ], "input": { "type": "object", "properties": { -- 2.54.0 From 226a0978116c7d0d638a10fff722198316a30dc0 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:29:04 +0100 Subject: [PATCH 3/7] contracts-placement-build: the verb placement shows each row's build beside its branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §750, H-A-39 --- go/seats/meshmoduleassigner/contract.go | 8 ++++--- go/seats/meshmoduleassigner/contract_test.go | 2 ++ .../mesh-module-assigner/fixtures/verbs.json | 23 +++++++++++++++++++ seats/mesh-module-assigner/seat.json | 6 ++++- ts/seats/meshmoduleassigner/index.d.ts | 4 +++- 5 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 seats/mesh-module-assigner/fixtures/verbs.json diff --git a/go/seats/meshmoduleassigner/contract.go b/go/seats/meshmoduleassigner/contract.go index c260a03..5a4e6c1 100644 --- a/go/seats/meshmoduleassigner/contract.go +++ b/go/seats/meshmoduleassigner/contract.go @@ -412,8 +412,10 @@ type Holding struct { // ModulePlacement is the nodes that run a module from one watched branch. type ModulePlacement struct { - Branch string `json:"branch"` - Nodes []string `json:"nodes"` + Branch string `json:"branch"` + // the fingerprint of the build these nodes run from the branch; absent, the newest delivered of the branch (design 47 H 750, H-A-39): one row per branch and build + Build string `json:"build,omitempty"` + Nodes []string `json:"nodes"` } // NodeDecided is what a person decides of a node; no secret and no key material. @@ -647,7 +649,7 @@ type PlacementInput struct { // PlacementAnswer is what placement answers. type PlacementAnswer struct { - // one per branch, the nodes that run the module from it + // one per branch and build, the nodes that run the module from it Placements []ModulePlacement `json:"placements"` } diff --git a/go/seats/meshmoduleassigner/contract_test.go b/go/seats/meshmoduleassigner/contract_test.go index b083e81..45a0fd4 100644 --- a/go/seats/meshmoduleassigner/contract_test.go +++ b/go/seats/meshmoduleassigner/contract_test.go @@ -79,6 +79,8 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, + {name: "placement answers a row per branch and build, the build beside the branch", subject: "", given: "{\"placements\":[{\"branch\":\"main\",\"build\":\"0123456789ab\",\"nodes\":[\"workstation\"]},{\"branch\":\"main\",\"nodes\":[\"laptop\"]}]}", wire: "{\"placements\":[{\"branch\":\"main\",\"build\":\"0123456789ab\",\"nodes\":[\"workstation\"]},{\"branch\":\"main\",\"nodes\":[\"laptop\"]}]}", + decode: func(b []byte) (any, error) { var v PlacementAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/seats/mesh-module-assigner/fixtures/verbs.json b/seats/mesh-module-assigner/fixtures/verbs.json new file mode 100644 index 0000000..245cb44 --- /dev/null +++ b/seats/mesh-module-assigner/fixtures/verbs.json @@ -0,0 +1,23 @@ +[ + { + "name": "placement answers a row per branch and build, the build beside the branch", + "of": "verb:placement.answer", + "given": { + "placements": [ + { + "branch": "main", + "build": "0123456789ab", + "nodes": [ + "workstation" + ] + }, + { + "branch": "main", + "nodes": [ + "laptop" + ] + } + ] + } + } +] diff --git a/seats/mesh-module-assigner/seat.json b/seats/mesh-module-assigner/seat.json index 9529223..cd98e02 100644 --- a/seats/mesh-module-assigner/seat.json +++ b/seats/mesh-module-assigner/seat.json @@ -178,7 +178,7 @@ "items": { "$ref": "#/defs/ModulePlacement" }, - "description": "one per branch, the nodes that run the module from it" + "description": "one per branch and build, the nodes that run the module from it" } }, "required": [ @@ -1057,6 +1057,10 @@ "branch": { "type": "string" }, + "build": { + "type": "string", + "description": "the fingerprint of the build these nodes run from the branch; absent, the newest delivered of the branch (design 47 H 750, H-A-39): one row per branch and build" + }, "nodes": { "type": "array", "items": { diff --git a/ts/seats/meshmoduleassigner/index.d.ts b/ts/seats/meshmoduleassigner/index.d.ts index fb8994b..0246651 100644 --- a/ts/seats/meshmoduleassigner/index.d.ts +++ b/ts/seats/meshmoduleassigner/index.d.ts @@ -155,6 +155,8 @@ export interface Holding { /** the nodes that run a module from one watched branch */ export interface ModulePlacement { "branch": string; + /** the fingerprint of the build these nodes run from the branch; absent, the newest delivered of the branch (design 47 H 750, H-A-39): one row per branch and build */ + "build"?: string; "nodes": string[]; } @@ -376,7 +378,7 @@ export interface PlacementInput { /** is what placement answers. */ export interface PlacementAnswer { - /** one per branch, the nodes that run the module from it */ + /** one per branch and build, the nodes that run the module from it */ "placements": ModulePlacement[]; } -- 2.54.0 From 9db2e1d08ce76ec9b3b8023d371aaace7b986282 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:30:03 +0100 Subject: [PATCH 4/7] contracts-every-ask-offered: the seat operator-channel loses held-back and ask-again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §764 (The operator channel's limit), H-A-57 --- .../go/seats/operatorchannel/contract.go | 36 ++++----------- .../go/seats/operatorchannel/contract_test.go | 2 - .../operator-channel/fixtures/states.json | 13 ------ .../seats/operator-channel/seat.json | 45 ++----------------- .../ts/seats/operatorchannel/index.d.ts | 24 ++-------- .../ts/seats/operatorchannel/index.js | 1 - 6 files changed, 15 insertions(+), 106 deletions(-) diff --git a/operator-and-conversation/go/seats/operatorchannel/contract.go b/operator-and-conversation/go/seats/operatorchannel/contract.go index f936017..5a47633 100644 --- a/operator-and-conversation/go/seats/operatorchannel/contract.go +++ b/operator-and-conversation/go/seats/operatorchannel/contract.go @@ -15,12 +15,11 @@ import ( const Seat = "operator-channel" const ( - VerbOpen = "open" - VerbHistory = "history" - VerbNotify = "notify" - VerbTell = "tell" - VerbAsks = "asks" - VerbAskAgain = "ask-again" + VerbOpen = "open" + VerbHistory = "history" + VerbNotify = "notify" + VerbTell = "tell" + VerbAsks = "asks" ) const ( @@ -35,7 +34,7 @@ const ( // Verbs is every verb the seat serves, in its definition's order: a new copy each call. func Verbs() []string { - return []string{VerbOpen, VerbHistory, VerbNotify, VerbTell, VerbAsks, VerbAskAgain} + return []string{VerbOpen, VerbHistory, VerbNotify, VerbTell, VerbAsks} } // Events is every event published on the seat's subject: a new copy each call. @@ -436,17 +435,15 @@ type AsksInput struct { Key string `json:"key,omitempty"` // only the asks opened at or after this time, RFC 3339 Since string `json:"since,omitempty"` - // open (open, held and held-back), ended or all; none is open when no key or since is given, else all + // open (open and held), ended or all; none is open when no key or since is given, else all State string `json:"state,omitempty"` } // AsksAnswerAsksItem is a type of the contract. type AsksAnswerAsksItem struct { - // when the ask was held back, RFC 3339; present while its state is held-back - HeldSince string `json:"held-since,omitempty"` // . Key string `json:"key"` - // how the ask stands: open, held (no ready channel), held-back (kept open behind the asker's newer asks, ADR 0666 §12), or how it ended (answered, expired, cancelled) + // how the ask stands: open, held (no ready channel), or how it ended (answered, expired, cancelled) State string `json:"state"` } @@ -460,19 +457,6 @@ type AsksAnswer struct { Matched int64 `json:"matched,omitempty"` } -// AskAgainInput is what ask-again takes. -type AskAgainInput struct { - // . of the held-back ask - Key string `json:"key"` -} - -// AskAgainAnswer is what ask-again answers. -type AskAgainAnswer struct { - // why it was not offered; set alone - Error string `json:"error,omitempty"` - State string `json:"state,omitempty"` -} - // AskAccept is the body of ask. type AskAccept = Ask @@ -532,15 +516,13 @@ type AsksByAskerIDValue struct { Expires string `json:"expires"` // its headline Headline string `json:"headline"` - // when the ask was held back, RFC 3339; present while its state is held-back - HeldSince string `json:"held-since,omitempty"` // . Key string `json:"key"` // the channels it was offered on OfferedOn []string `json:"offered_on,omitempty"` // when it was opened, RFC 3339 Opened string `json:"opened"` - // how it stands: open, held-back (kept open behind the asker's newer asks, ADR 0666 §12), chosen, expired, cancelled, replaced or refused + // how it stands: open, chosen, expired, cancelled, replaced or refused State string `json:"state"` Warrant *Warrant `json:"warrant,omitempty"` } diff --git a/operator-and-conversation/go/seats/operatorchannel/contract_test.go b/operator-and-conversation/go/seats/operatorchannel/contract_test.go index 7a2e7bd..de1a0c6 100644 --- a/operator-and-conversation/go/seats/operatorchannel/contract_test.go +++ b/operator-and-conversation/go/seats/operatorchannel/contract_test.go @@ -35,8 +35,6 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v AsksByAskerIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "an ask its asker took back (captured)", subject: "", given: "{\"answer\":\"cancelled: its asker took it back\",\"asker\":\"mesh-delivery-teller\",\"asker_told\":true,\"expires\":\"2026-11-06T10:04:01Z\",\"headline\":\"Check failed - merge into main\",\"key\":\"mesh-delivery-teller.merge-feat_registry_milestone-3a038b9f8b4d-4-4da6ee3cd9d5\",\"offered_on\":[\"telegram\"],\"opened\":\"2026-11-05T10:14:04Z\",\"state\":\"cancelled\"}", wire: "{\"answer\":\"cancelled: its asker took it back\",\"asker\":\"mesh-delivery-teller\",\"asker_told\":true,\"expires\":\"2026-11-06T10:04:01Z\",\"headline\":\"Check failed - merge into main\",\"key\":\"mesh-delivery-teller.merge-feat_registry_milestone-3a038b9f8b4d-4-4da6ee3cd9d5\",\"offered_on\":[\"telegram\"],\"opened\":\"2026-11-05T10:14:04Z\",\"state\":\"cancelled\"}", decode: func(b []byte) (any, error) { var v AsksByAskerIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "a fourth ask, the asker's oldest held back behind newer ones", subject: "", given: "{\"asker\":\"mesh-delivery-teller\",\"expires\":\"2026-11-11T10:00:00Z\",\"headline\":\"Check failed - merge into main\",\"held-since\":\"2026-11-10T10:30:00Z\",\"key\":\"mesh-delivery-teller.b-1\",\"opened\":\"2026-11-10T10:00:00Z\",\"state\":\"held-back\"}", wire: "{\"asker\":\"mesh-delivery-teller\",\"expires\":\"2026-11-11T10:00:00Z\",\"headline\":\"Check failed - merge into main\",\"held-since\":\"2026-11-10T10:30:00Z\",\"key\":\"mesh-delivery-teller.b-1\",\"opened\":\"2026-11-10T10:00:00Z\",\"state\":\"held-back\"}", - decode: func(b []byte) (any, error) { var v AsksByAskerIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "an ask the router refused at take-in, closed (design 47 G 570)", subject: "", given: "{\"answer\":\"refused: its expiry passes the bound of its highest option level\",\"asker\":\"nats\",\"asker_told\":true,\"at\":\"2026-11-11T10:00:01Z\",\"expires\":\"2026-11-12T10:00:00Z\",\"headline\":\"Recreate a bus entry\",\"key\":\"nats.r-1\",\"opened\":\"2026-11-11T10:00:00Z\",\"state\":\"refused\"}", wire: "{\"answer\":\"refused: its expiry passes the bound of its highest option level\",\"asker\":\"nats\",\"asker_told\":true,\"at\":\"2026-11-11T10:00:01Z\",\"expires\":\"2026-11-12T10:00:00Z\",\"headline\":\"Recreate a bus entry\",\"key\":\"nats.r-1\",\"opened\":\"2026-11-11T10:00:00Z\",\"state\":\"refused\"}", decode: func(b []byte) (any, error) { var v AsksByAskerIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "an ask chosen, with its warrant in the router's record (design 47 G 700, A-91)", subject: "", given: "{\"asker\":\"mesh-delivery-pipeline\",\"expires\":\"2026-11-12T10:00:00Z\",\"headline\":\"Deliver a module?\",\"key\":\"mesh-delivery-pipeline.approval-1\",\"opened\":\"2026-11-11T10:00:00Z\",\"state\":\"chosen\",\"warrant\":{\"about\":\"mod.main\",\"ask\":\"approval-1\",\"ask-digest\":\"sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-11T10:05:00Z\",\"option\":\"approve\",\"outcome\":\"chosen\"}}", wire: "{\"asker\":\"mesh-delivery-pipeline\",\"expires\":\"2026-11-12T10:00:00Z\",\"headline\":\"Deliver a module?\",\"key\":\"mesh-delivery-pipeline.approval-1\",\"opened\":\"2026-11-11T10:00:00Z\",\"state\":\"chosen\",\"warrant\":{\"about\":\"mod.main\",\"ask\":\"approval-1\",\"ask-digest\":\"sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-11T10:05:00Z\",\"option\":\"approve\",\"outcome\":\"chosen\"}}", diff --git a/operator-and-conversation/seats/operator-channel/fixtures/states.json b/operator-and-conversation/seats/operator-channel/fixtures/states.json index f9c9f15..d085554 100644 --- a/operator-and-conversation/seats/operator-channel/fixtures/states.json +++ b/operator-and-conversation/seats/operator-channel/fixtures/states.json @@ -33,19 +33,6 @@ "state": "cancelled" } }, - { - "name": "a fourth ask, the asker's oldest held back behind newer ones", - "of": "state:asks/.", - "given": { - "asker": "mesh-delivery-teller", - "expires": "2026-11-11T10:00:00Z", - "headline": "Check failed - merge into main", - "held-since": "2026-11-10T10:30:00Z", - "key": "mesh-delivery-teller.b-1", - "opened": "2026-11-10T10:00:00Z", - "state": "held-back" - } - }, { "name": "an ask the router refused at take-in, closed (design 47 G 570)", "of": "state:asks/.", diff --git a/operator-and-conversation/seats/operator-channel/seat.json b/operator-and-conversation/seats/operator-channel/seat.json index 3c44a1b..42c1482 100644 --- a/operator-and-conversation/seats/operator-channel/seat.json +++ b/operator-and-conversation/seats/operator-channel/seat.json @@ -130,7 +130,7 @@ }, "state": { "type": "string", - "description": "open (open, held and held-back), ended or all; none is open when no key or since is given, else all" + "description": "open (open and held), ended or all; none is open when no key or since is given, else all" }, "since": { "type": "string", @@ -158,11 +158,7 @@ }, "state": { "type": "string", - "description": "how the ask stands: open, held (no ready channel), held-back (kept open behind the asker's newer asks, ADR 0666 §12), or how it ended (answered, expired, cancelled)" - }, - "held-since": { - "type": "string", - "description": "when the ask was held back, RFC 3339; present while its state is held-back" + "description": "how the ask stands: open, held (no ready channel), or how it ended (answered, expired, cancelled)" } }, "required": [ @@ -184,37 +180,6 @@ "asks" ] } - }, - { - "name": "ask-again", - "description": "Offer a held-back ask now, on a channel that is ready: the asker's ask kept open behind its newer asks (design 47 G 83, 394).", - "class": "act", - "input": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": ". of the held-back ask" - } - }, - "required": [ - "key" - ], - "additionalProperties": false - }, - "answer": { - "type": "object", - "description": "where the ask stands after it was offered", - "properties": { - "state": { - "type": "string" - }, - "error": { - "type": "string", - "description": "why it was not offered; set alone" - } - } - } } ], "accepts": [ @@ -287,7 +252,7 @@ }, "state": { "type": "string", - "description": "how it stands: open, held-back (kept open behind the asker's newer asks, ADR 0666 §12), chosen, expired, cancelled, replaced or refused" + "description": "how it stands: open, chosen, expired, cancelled, replaced or refused" }, "opened": { "type": "string", @@ -308,10 +273,6 @@ "type": "boolean", "description": "its asker has been told how it ended" }, - "held-since": { - "type": "string", - "description": "when the ask was held back, RFC 3339; present while its state is held-back" - }, "warrant": { "$ref": "#/defs/Warrant" }, diff --git a/operator-and-conversation/ts/seats/operatorchannel/index.d.ts b/operator-and-conversation/ts/seats/operatorchannel/index.d.ts index 735429f..7e79cf5 100644 --- a/operator-and-conversation/ts/seats/operatorchannel/index.d.ts +++ b/operator-and-conversation/ts/seats/operatorchannel/index.d.ts @@ -10,7 +10,6 @@ export declare const verbs: { readonly notify: "notify"; readonly tell: "tell"; readonly asks: "asks"; - readonly askAgain: "ask-again"; }; export declare const accepts: { @@ -346,16 +345,14 @@ export interface AsksInput { "key"?: string; /** only the asks opened at or after this time, RFC 3339 */ "since"?: string; - /** open (open, held and held-back), ended or all; none is open when no key or since is given, else all */ + /** open (open and held), ended or all; none is open when no key or since is given, else all */ "state"?: string; } export interface AsksAnswerAsksItem { - /** when the ask was held back, RFC 3339; present while its state is held-back */ - "held-since"?: string; /** . */ "key": string; - /** how the ask stands: open, held (no ready channel), held-back (kept open behind the asker's newer asks, ADR 0666 §12), or how it ended (answered, expired, cancelled) */ + /** how the ask stands: open, held (no ready channel), or how it ended (answered, expired, cancelled) */ "state": string; } @@ -369,19 +366,6 @@ export interface AsksAnswer { "matched"?: number; } -/** is what ask-again takes. */ -export interface AskAgainInput { - /** . of the held-back ask */ - "key": string; -} - -/** is what ask-again answers. */ -export interface AskAgainAnswer { - /** why it was not offered; set alone */ - "error"?: string; - "state"?: string; -} - /** is the body of ask. */ export type AskAccept = Ask; @@ -432,15 +416,13 @@ export interface AsksByAskerIDValue { "expires": string; /** its headline */ "headline": string; - /** when the ask was held back, RFC 3339; present while its state is held-back */ - "held-since"?: string; /** . */ "key": string; /** the channels it was offered on */ "offered_on"?: string[]; /** when it was opened, RFC 3339 */ "opened": string; - /** how it stands: open, held-back (kept open behind the asker's newer asks, ADR 0666 §12), chosen, expired, cancelled, replaced or refused */ + /** how it stands: open, chosen, expired, cancelled, replaced or refused */ "state": string; "warrant"?: Warrant; } diff --git a/operator-and-conversation/ts/seats/operatorchannel/index.js b/operator-and-conversation/ts/seats/operatorchannel/index.js index 927f895..e1f795c 100644 --- a/operator-and-conversation/ts/seats/operatorchannel/index.js +++ b/operator-and-conversation/ts/seats/operatorchannel/index.js @@ -10,7 +10,6 @@ export const verbs = { notify: "notify", tell: "tell", asks: "asks", - askAgain: "ask-again", }; export const accepts = { -- 2.54.0 From abf8b7d525655bb1f9bc12fe3de1f74ea103f9f2 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:30:19 +0100 Subject: [PATCH 5/7] contracts-verb-timeout: the format's verb takes a timeout of whole seconds, 1 to 600 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §760, H-A-43 --- format/seat-definition.schema.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/format/seat-definition.schema.json b/format/seat-definition.schema.json index cc9aa31..761c35b 100644 --- a/format/seat-definition.schema.json +++ b/format/seat-definition.schema.json @@ -358,6 +358,12 @@ "chunks": { "type": "boolean", "description": "the holder's process sends the answer's file in chunks on mesh.seat..chunk..., each acknowledged by the caller on mesh.seat..ack...; only with by-caller (design 47 G 681)" + }, + "timeout": { + "type": "integer", + "minimum": 1, + "maximum": 600, + "description": "the most whole seconds a caller and the serving tool runner wait for the verb's answer; absent, the tool runner's own call-timeout (design 47 H 760, H-A-43)" } } }, -- 2.54.0 From 1c910e9d10a04e6ecabd1760a0f1a943e24a70d8 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:31:20 +0100 Subject: [PATCH 6/7] contracts-node-engine-apply-order-and-word: the verb apply-order and the constant want:version on the seat node-engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated with seatgen whose identifier function splits on ':' (H-A-64, the contracts-indexer-bridge developer's change in mesh-delivery-sdk/seatgen); seatgen -check passes only with it. Builds: design 47 H §771, §772, H-A-45, H-A-46, H-A-63, H-A-64 --- go/seats/nodeengine/contract.go | 37 ++++++++++++++- go/seats/nodeengine/contract_test.go | 2 + seats/node-engine/fixtures/verbs.json | 24 ++++++++++ seats/node-engine/seat.json | 68 +++++++++++++++++++++++++++ ts/seats/nodeengine/index.d.ts | 29 ++++++++++++ ts/seats/nodeengine/index.js | 1 + 6 files changed, 160 insertions(+), 1 deletion(-) diff --git a/go/seats/nodeengine/contract.go b/go/seats/nodeengine/contract.go index 4bd7cdd..ff3feac 100644 --- a/go/seats/nodeengine/contract.go +++ b/go/seats/nodeengine/contract.go @@ -26,6 +26,7 @@ const ( VerbCompose = "compose" VerbComposeCandidate = "compose-candidate" VerbManifestReads = "manifest-reads" + VerbApplyOrder = "apply-order" VerbSeatList = "seat-list" VerbSeatListAgain = "seat-list-again" VerbFirstViews = "first-views" @@ -47,7 +48,7 @@ const ( // Verbs is every verb the seat serves, in its definition's order: a new copy each call. func Verbs() []string { - return []string{VerbHandOver, VerbAccessAct, VerbJudgeDirectories, VerbSetuidSearch, VerbRootFree, VerbActs, VerbPackages, VerbComposition, VerbCompose, VerbComposeCandidate, VerbManifestReads, VerbSeatList, VerbSeatListAgain, VerbFirstViews, VerbFirstViewAgain, VerbEntryAgain, VerbProcessBuilds} + return []string{VerbHandOver, VerbAccessAct, VerbJudgeDirectories, VerbSetuidSearch, VerbRootFree, VerbActs, VerbPackages, VerbComposition, VerbCompose, VerbComposeCandidate, VerbManifestReads, VerbApplyOrder, VerbSeatList, VerbSeatListAgain, VerbFirstViews, VerbFirstViewAgain, VerbEntryAgain, VerbProcessBuilds} } // Events is every event published on the seat's subject: a new copy each call. @@ -705,6 +706,14 @@ type LoginFallback struct { Why string `json:"why"` } +// ManifestReadWord is the word a node-engine states in manifest-reads when it reads a want by version and not by digests (design 47 H 772, H-A-45); the assigner holds a node whose engine does not state it. Other words in manifest-reads are free. +type ManifestReadWord = string + +// The values of ManifestReadWord. +const ( + ManifestReadWordWantVersion = "want:version" +) + // ManifestReadsChanged is what a node-engine says when what it reads changed or its node returned (ADR 0618 §4). type ManifestReadsChanged struct { // when it says it, RFC 3339 @@ -1404,6 +1413,32 @@ type ManifestReadsAnswer struct { V int64 `json:"v"` } +// ApplyOrderInput is what apply-order takes. +type ApplyOrderInput struct { +} + +// ApplyOrderAnswerOrderItem is a type of the contract. +type ApplyOrderAnswerOrderItem struct { + // the module whose want waits to be applied + Module string `json:"module"` + // the want's pipeline (its key); absent for a want in none + Pipeline string `json:"pipeline,omitempty"` + // its place in the order, the first applied being 1 + Position int64 `json:"position"` + // the mover's tier in its pipeline; absent for a want in none + Rank int64 `json:"rank,omitempty"` + // the modules it waits on; empty when it waits for nothing + Waits []string `json:"waits"` + // why it stands there, in one sentence + Why string `json:"why"` +} + +// ApplyOrderAnswer is what apply-order answers. +type ApplyOrderAnswer struct { + // one row per unapplied changed want, in the order it will be applied + Order []ApplyOrderAnswerOrderItem `json:"order"` +} + // SeatListInput is what seat-list takes. type SeatListInput struct { } diff --git a/go/seats/nodeengine/contract_test.go b/go/seats/nodeengine/contract_test.go index 4ebf1aa..58b58e7 100644 --- a/go/seats/nodeengine/contract_test.go +++ b/go/seats/nodeengine/contract_test.go @@ -127,6 +127,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "composition says withheld unknown when the grants part does not answer", subject: "", given: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"zsh\",\"node\":\"workstation\",\"started\":false,\"withheld-unknown\":\"withheld unknown: the grants part does not answer\"}", wire: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"zsh\",\"node\":\"workstation\",\"started\":false,\"withheld-unknown\":\"withheld unknown: the grants part does not answer\"}", decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "apply-order answers the changed wants in the order they are applied, with why and what each waits on", subject: "", given: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}", wire: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}", + decode: func(b []byte) (any, error) { var v ApplyOrderAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/seats/node-engine/fixtures/verbs.json b/seats/node-engine/fixtures/verbs.json index 94914a3..9deecc3 100644 --- a/seats/node-engine/fixtures/verbs.json +++ b/seats/node-engine/fixtures/verbs.json @@ -259,5 +259,29 @@ }, "withheld-unknown": "withheld unknown: the grants part does not answer" } + }, + { + "name": "apply-order answers the changed wants in the order they are applied, with why and what each waits on", + "of": "verb:apply-order.answer", + "given": { + "order": [ + { + "module": "mesh-broker", + "position": 1, + "why": "the bus module is applied first", + "waits": [] + }, + { + "module": "mesh-delivery-view", + "pipeline": "main.2", + "rank": 2, + "position": 2, + "why": "rank 2 of main.2, after rank 1", + "waits": [ + "mesh-delivery-indexer" + ] + } + ] + } } ] diff --git a/seats/node-engine/seat.json b/seats/node-engine/seat.json index 748fbd0..0752123 100644 --- a/seats/node-engine/seat.json +++ b/seats/node-engine/seat.json @@ -724,6 +724,67 @@ }, "class": "read" }, + { + "name": "apply-order", + "optional": true, + "description": "The order this machine's engine will apply its changed wants in, with why: one row per unapplied changed want, the bus module and the backup holder first, then each pipeline's wants by rank, then the rest by name, its own want last, a reverted module first (design 47 H 771, H-A-46). Read-only. Answered by this machine's engine alone.", + "input": { + "type": "object", + "properties": {} + }, + "answer": { + "type": "object", + "properties": { + "order": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "the module whose want waits to be applied" + }, + "pipeline": { + "type": "string", + "description": "the want's pipeline (its key); absent for a want in none" + }, + "rank": { + "type": "integer", + "description": "the mover's tier in its pipeline; absent for a want in none" + }, + "position": { + "type": "integer", + "description": "its place in the order, the first applied being 1" + }, + "why": { + "type": "string", + "description": "why it stands there, in one sentence" + }, + "waits": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the modules it waits on; empty when it waits for nothing" + } + }, + "required": [ + "module", + "position", + "why", + "waits" + ] + }, + "description": "one row per unapplied changed want, in the order it will be applied" + } + }, + "required": [ + "order" + ], + "description": "the order this machine's engine applies its changed wants in" + }, + "class": "read" + }, { "name": "seat-list", "description": "The seat list this engine holds and what it waits for (novox/hq ADR 0636 §7): each seat's source (trunk or bootstrap) and digest, the seats held from the bootstrap alone, the definitions refused, the last error and whether the seat mesh-catalog has answered. Read-only.", @@ -1855,6 +1916,13 @@ ], "description": "the answer of an act the operator is asked" }, + "ManifestReadWord": { + "type": "string", + "enum": [ + "want:version" + ], + "description": "the word a node-engine states in manifest-reads when it reads a want by version and not by digests (design 47 H 772, H-A-45); the assigner holds a node whose engine does not state it. Other words in manifest-reads are free" + }, "ManifestReadsChanged": { "type": "object", "properties": { diff --git a/ts/seats/nodeengine/index.d.ts b/ts/seats/nodeengine/index.d.ts index 3c87dec..4a0f14f 100644 --- a/ts/seats/nodeengine/index.d.ts +++ b/ts/seats/nodeengine/index.d.ts @@ -16,6 +16,7 @@ export declare const verbs: { readonly compose: "compose"; readonly composeCandidate: "compose-candidate"; readonly manifestReads: "manifest-reads"; + readonly applyOrder: "apply-order"; readonly seatList: "seat-list"; readonly seatListAgain: "seat-list-again"; readonly firstViews: "first-views"; @@ -378,6 +379,9 @@ export interface LoginFallback { "why": string; } +/** the word a node-engine states in manifest-reads when it reads a want by version and not by digests (design 47 H 772, H-A-45); the assigner holds a node whose engine does not state it. Other words in manifest-reads are free */ +export type ManifestReadWord = "want:version"; + /** what a node-engine says when what it reads changed or its node returned (ADR 0618 §4) */ export interface ManifestReadsChanged { /** when it says it, RFC 3339 */ @@ -1028,6 +1032,31 @@ export interface ManifestReadsAnswer { "v": number; } +/** is what apply-order takes. */ +export interface ApplyOrderInput { +} + +export interface ApplyOrderAnswerOrderItem { + /** the module whose want waits to be applied */ + "module": string; + /** the want's pipeline (its key); absent for a want in none */ + "pipeline"?: string; + /** its place in the order, the first applied being 1 */ + "position": number; + /** the mover's tier in its pipeline; absent for a want in none */ + "rank"?: number; + /** the modules it waits on; empty when it waits for nothing */ + "waits": string[]; + /** why it stands there, in one sentence */ + "why": string; +} + +/** is what apply-order answers. */ +export interface ApplyOrderAnswer { + /** one row per unapplied changed want, in the order it will be applied */ + "order": ApplyOrderAnswerOrderItem[]; +} + /** is what seat-list takes. */ export interface SeatListInput { } diff --git a/ts/seats/nodeengine/index.js b/ts/seats/nodeengine/index.js index 1ce11bb..f5d9135 100644 --- a/ts/seats/nodeengine/index.js +++ b/ts/seats/nodeengine/index.js @@ -16,6 +16,7 @@ export const verbs = { compose: "compose", composeCandidate: "compose-candidate", manifestReads: "manifest-reads", + applyOrder: "apply-order", seatList: "seat-list", seatListAgain: "seat-list-again", firstViews: "first-views", -- 2.54.0 From dca9ce0245595cce2ff75ff155833ecc50a99bc0 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:36:04 +0100 Subject: [PATCH 7/7] contracts-wait-step-placing: the seat node-engine's Wait.step names placing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 H §771, H-A-67 --- go/seats/nodeengine/contract.go | 3 ++- seats/node-engine/seat.json | 5 +++-- ts/seats/nodeengine/index.d.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go/seats/nodeengine/contract.go b/go/seats/nodeengine/contract.go index ff3feac..6034142 100644 --- a/go/seats/nodeengine/contract.go +++ b/go/seats/nodeengine/contract.go @@ -1064,7 +1064,7 @@ type Wait struct { // why it holds, such as restore point missing, entry-missing, parts-differ, node away or build no longer kept (design 47 G 541, 499) Reason string `json:"reason,omitempty"` Since time.Time `json:"since"` - // compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541) + // compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541); placing: a want of a higher rank held behind a lower one (design 47 H 771, H-A-67) Step string `json:"step"` // the wait said in words Words string `json:"words,omitempty"` @@ -1074,6 +1074,7 @@ type Wait struct { const ( WaitStepCompose = "compose" WaitStepKeptBuild = "kept-build" + WaitStepPlacing = "placing" ) // HandOverInput is what hand-over takes. diff --git a/seats/node-engine/seat.json b/seats/node-engine/seat.json index 0752123..f33b6cb 100644 --- a/seats/node-engine/seat.json +++ b/seats/node-engine/seat.json @@ -3283,9 +3283,10 @@ "type": "string", "enum": [ "compose", - "kept-build" + "kept-build", + "placing" ], - "description": "compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541)" + "description": "compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541); placing: a want of a higher rank held behind a lower one (design 47 H 771, H-A-67)" }, "node": { "type": "string", diff --git a/ts/seats/nodeengine/index.d.ts b/ts/seats/nodeengine/index.d.ts index 4a0f14f..f8f0b8a 100644 --- a/ts/seats/nodeengine/index.d.ts +++ b/ts/seats/nodeengine/index.d.ts @@ -705,8 +705,8 @@ export interface Wait { /** why it holds, such as restore point missing, entry-missing, parts-differ, node away or build no longer kept (design 47 G 541, 499) */ "reason"?: string; "since": string; - /** compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541) */ - "step": "compose" | "kept-build"; + /** compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541); placing: a want of a higher rank held behind a lower one (design 47 H 771, H-A-67) */ + "step": "compose" | "kept-build" | "placing"; /** the wait said in words */ "words"?: string; } -- 2.54.0