From 82c532c071f40efc8e9cdb26ec079186885af9a3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:06:01 +0100 Subject: [PATCH] C1 node-engine-word: directory-contents-owner joins the seat node-engine's ManifestReadWord, form stays The word names the engine's read of a declared directory's contents owner; a fixture row reads it back in a manifest-reads answer. Builds: design 47 H2 H-A-622, H-A-640 --- go/seats/nodeengine/contract.go | 5 +++-- go/seats/nodeengine/contract_test.go | 2 ++ seats/node-engine/fixtures/verbs.json | 13 +++++++++++++ seats/node-engine/seat.json | 5 +++-- ts/seats/nodeengine/index.d.ts | 4 ++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/go/seats/nodeengine/contract.go b/go/seats/nodeengine/contract.go index b76c3a6..0cecc9c 100644 --- a/go/seats/nodeengine/contract.go +++ b/go/seats/nodeengine/contract.go @@ -748,12 +748,13 @@ 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. +// ManifestReadWord is a word a node-engine states in manifest-reads: want:version when it reads a want by version and not by digests (design 47 H 772, H-A-45); directory-contents-owner when it sets the owner of a declared directory's contents (design 47 H2, H-A-622, H-A-640). The assigner holds a node whose engine does not state the word it needs. Other words in manifest-reads are free. type ManifestReadWord = string // The values of ManifestReadWord. const ( - ManifestReadWordWantVersion = "want:version" + ManifestReadWordWantVersion = "want:version" + ManifestReadWordDirectoryContentsOwner = "directory-contents-owner" ) // ManifestReadsChanged is what a node-engine says when what it reads changed or its node returned (ADR 0618 §4). diff --git a/go/seats/nodeengine/contract_test.go b/go/seats/nodeengine/contract_test.go index 8f92af0..fc5f56f 100644 --- a/go/seats/nodeengine/contract_test.go +++ b/go/seats/nodeengine/contract_test.go @@ -99,6 +99,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v BoundsByWhatIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "manifest-reads answers what the engine reads and when it stated it", subject: "", given: "{\"manifest-reads\":[\"form:seat-reference\",\"word:series\"],\"node\":\"ace\",\"stated-at\":\"2026-11-04T10:00:00Z\",\"v\":1}", wire: "{\"manifest-reads\":[\"form:seat-reference\",\"word:series\"],\"node\":\"ace\",\"stated-at\":\"2026-11-04T10:00:00Z\",\"v\":1}", decode: func(b []byte) (any, error) { var v ManifestReadsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "manifest-reads names the words want:version and directory-contents-owner", subject: "", given: "{\"manifest-reads\":[\"want:version\",\"directory-contents-owner\"],\"node\":\"ace\",\"stated-at\":\"2026-11-25T10:00:00Z\",\"v\":1}", wire: "{\"manifest-reads\":[\"want:version\",\"directory-contents-owner\"],\"node\":\"ace\",\"stated-at\":\"2026-11-25T10:00:00Z\",\"v\":1}", + decode: func(b []byte) (any, error) { var v ManifestReadsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "manifest-reads of an engine built before it said them is the baseline", subject: "", given: "{\"node\":\"g14\",\"stated-at\":\"2026-11-04T10:05:00Z\",\"v\":1}", wire: "{\"node\":\"g14\",\"stated-at\":\"2026-11-04T10:05:00Z\",\"v\":1}", decode: func(b []byte) (any, error) { var v ManifestReadsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "compose-candidate asks the candidate and, as a boolean, its composition input", subject: "", given: "{\"candidate\":\"mesh-host.0123abcd\",\"input\":true}", wire: "{\"candidate\":\"mesh-host.0123abcd\",\"input\":true}", diff --git a/seats/node-engine/fixtures/verbs.json b/seats/node-engine/fixtures/verbs.json index acf9e88..32bcb40 100644 --- a/seats/node-engine/fixtures/verbs.json +++ b/seats/node-engine/fixtures/verbs.json @@ -12,6 +12,19 @@ "stated-at": "2026-11-04T10:00:00Z" } }, + { + "name": "manifest-reads names the words want:version and directory-contents-owner", + "of": "verb:manifest-reads.answer", + "given": { + "v": 1, + "node": "ace", + "manifest-reads": [ + "want:version", + "directory-contents-owner" + ], + "stated-at": "2026-11-25T10:00:00Z" + } + }, { "name": "manifest-reads of an engine built before it said them is the baseline", "of": "verb:manifest-reads.answer", diff --git a/seats/node-engine/seat.json b/seats/node-engine/seat.json index bcac353..21024d0 100644 --- a/seats/node-engine/seat.json +++ b/seats/node-engine/seat.json @@ -2082,9 +2082,10 @@ "ManifestReadWord": { "type": "string", "enum": [ - "want:version" + "want:version", + "directory-contents-owner" ], - "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" + "description": "a word a node-engine states in manifest-reads: want:version when it reads a want by version and not by digests (design 47 H 772, H-A-45); directory-contents-owner when it sets the owner of a declared directory's contents (design 47 H2, H-A-622, H-A-640). The assigner holds a node whose engine does not state the word it needs. Other words in manifest-reads are free" }, "ManifestReadsChanged": { "type": "object", diff --git a/ts/seats/nodeengine/index.d.ts b/ts/seats/nodeengine/index.d.ts index 752b6f0..d1d1f56 100644 --- a/ts/seats/nodeengine/index.d.ts +++ b/ts/seats/nodeengine/index.d.ts @@ -409,8 +409,8 @@ 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"; +/** a word a node-engine states in manifest-reads: want:version when it reads a want by version and not by digests (design 47 H 772, H-A-45); directory-contents-owner when it sets the owner of a declared directory's contents (design 47 H2, H-A-622, H-A-640). The assigner holds a node whose engine does not state the word it needs. Other words in manifest-reads are free */ +export type ManifestReadWord = "want:version" | "directory-contents-owner"; /** what a node-engine says when what it reads changed or its node returned (ADR 0618 §4) */ export interface ManifestReadsChanged {