C5: the operator-channel seat declares its verb asks' input (key, state, since, bound) and answer (asks with key and state, cut, matched), as the router serves it (issue 1966, ADR 0668 §4; review round 1, finding 5)

The assigner's read at its consumer's bind calls the verb with them; regenerated with seatgen, whose -check passes.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-10 04:20:04 +01:00
parent c6689bfdb3
commit 0ae7cb7a76
3 changed files with 101 additions and 6 deletions
@@ -427,10 +427,33 @@ type TellAnswer = map[string]any
// AsksInput is what asks takes.
type AsksInput struct {
// the most bytes of the asks in the answer; said when it cuts the answer short
Bound int64 `json:"bound,omitempty"`
// one ask, by its key (<asker>.<id>); none for the open asks
Key string `json:"key,omitempty"`
// only the asks opened at or after this time, RFC 3339
Since string `json:"since,omitempty"`
// 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 {
// <asker>.<id>
Key string `json:"key"`
// how the ask stands: open, held, or how it ended (answered, expired, cancelled)
State string `json:"state"`
}
// AsksAnswer is what asks answers.
type AsksAnswer = map[string]any
type AsksAnswer struct {
// each ask the router holds, as its state asks holds it
Asks []AsksAnswerAsksItem `json:"asks"`
// what the bound cut, and how to ask for more; empty when nothing was cut
Cut string `json:"cut,omitempty"`
// how many asks the arguments matched
Matched int64 `json:"matched,omitempty"`
}
// AskAccept is the body of ask.
type AskAccept = Ask
@@ -116,15 +116,65 @@
},
{
"name": "asks",
"description": "The asks the router holds: open first, then the last month's, each with how it ended.",
"description": "The asks the router holds: open first, then the last month's, each with how it ended. With no argument only the open asks, within its default bound; key for one ask, state, since and bound narrow or widen it, and the answer says what it cut.",
"input": {
"type": "object",
"properties": {},
"description": "no arguments"
"properties": {
"key": {
"type": "string",
"description": "one ask, by its key (<asker>.<id>); none for the open asks"
},
"state": {
"type": "string",
"description": "open (open and held), ended or all; none is open when no key or since is given, else all"
},
"since": {
"type": "string",
"description": "only the asks opened at or after this time, RFC 3339"
},
"bound": {
"type": "integer",
"description": "the most bytes of the asks in the answer; said when it cuts the answer short"
}
}
},
"answer": {
"type": "object",
"description": "the asks"
"description": "the asks, open first",
"properties": {
"asks": {
"type": "array",
"description": "each ask the router holds, as its state asks holds it",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "<asker>.<id>"
},
"state": {
"type": "string",
"description": "how the ask stands: open, held, or how it ended (answered, expired, cancelled)"
}
},
"required": [
"key",
"state"
]
}
},
"cut": {
"type": "string",
"description": "what the bound cut, and how to ask for more; empty when nothing was cut"
},
"matched": {
"type": "integer",
"description": "how many asks the arguments matched"
}
},
"required": [
"asks"
]
}
}
],
@@ -364,10 +364,32 @@ export type TellAnswer = Record<string, unknown>;
/** is what asks takes. */
export interface AsksInput {
/** the most bytes of the asks in the answer; said when it cuts the answer short */
"bound"?: number;
/** one ask, by its key (<asker>.<id>); none for the open asks */
"key"?: string;
/** only the asks opened at or after this time, RFC 3339 */
"since"?: string;
/** open (open and held), ended or all; none is open when no key or since is given, else all */
"state"?: string;
}
export interface AsksAnswerAsksItem {
/** <asker>.<id> */
"key": string;
/** how the ask stands: open, held, or how it ended (answered, expired, cancelled) */
"state": string;
}
/** is what asks answers. */
export type AsksAnswer = Record<string, unknown>;
export interface AsksAnswer {
/** each ask the router holds, as its state asks holds it */
"asks": AsksAnswerAsksItem[];
/** what the bound cut, and how to ask for more; empty when nothing was cut */
"cut"?: string;
/** how many asks the arguments matched */
"matched"?: number;
}
/** is the body of ask. */
export type AskAccept = Ask;