G seatdef: the definition reader takes a state's view and a verb's by-caller

Builds: design 47 G §699, §616, §656, §621
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 21:38:55 +01:00
parent adb0acdfae
commit effdc0936e
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -221,6 +221,9 @@ type Verb struct {
// NeedsApproval marks the verb for every holder: the operator approves a call of it first (design 46 *The approval
// mark* §2).
NeedsApproval bool `json:"needs-approval,omitempty"`
// ByCaller says the holder's process answers the verb itself and tells callers apart by the account the bus proved
// (design 47 G §554, §621, §656).
ByCaller bool `json:"by-caller,omitempty"`
}
// The streams an accepted kind may ride (design 47 G §415).
@@ -407,6 +410,8 @@ type State struct {
History int `json:"history,omitempty"`
MaxAgeDays int `json:"max-age-days,omitempty"`
Description string `json:"description,omitempty"`
// View is true when the seat offers the state as a view for a module to follow by `consumes` (design 47 G §699).
View bool `json:"view,omitempty"`
}
// KeyForm is one form a state's key takes: a pattern of named parts (`<asker>.<id>`, a part between angle brackets,
+3
View File
@@ -86,6 +86,9 @@ func TestADefinitionIsReadStrictlyNamingWhatIsWrong(t *testing.T) {
`"domain":"Core","decision":"ADR 1","records":[{"name":"asks"}],`, 1), "records: a field the format does not know"},
{"a state with a key form and a value", withState(whole, `{"name":"asks","template":"state","writer":"caller",
"history":3,"key-forms":[{"key":"<asker>.<id>","value":{"type":"object"}}]}`), ""},
{"a state offered as a view (design 47 G 699)", withState(whole, `{"name":"asks","template":"state","view":true,
"key-forms":[{"key":"<id>","value":{"type":"object"}}]}`), ""},
{"a verb answered by the holder's process by caller (design 47 G 656)", strings.Replace(whole, `"name":"list",`, `"name":"list","by-caller":true,`, 1), ""},
{"a stream state with an age", withState(whole, `{"name":"placement","template":"events","max-age-days":7,
"key-forms":[{"key":"changed.<node>","value":{"type":"object"}}]}`), ""},
{"a state of an unknown template", withState(whole, `{"name":"asks","template":"bucket",