Contract: the seat mesh-module-assigner gains the read verb placement
Builds: design 47 G A-62 (§704, §402) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -20,6 +20,7 @@ const (
|
||||
VerbPropose = "propose"
|
||||
VerbWithdraw = "withdraw"
|
||||
VerbAgain = "again"
|
||||
VerbPlacement = "placement"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -31,7 +32,7 @@ const (
|
||||
|
||||
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
|
||||
func Verbs() []string {
|
||||
return []string{VerbAssignments, VerbProposals, VerbPropose, VerbWithdraw, VerbAgain}
|
||||
return []string{VerbAssignments, VerbProposals, VerbPropose, VerbWithdraw, VerbAgain, VerbPlacement}
|
||||
}
|
||||
|
||||
// Events is every event published on the seat's subject: a new copy each call.
|
||||
@@ -401,6 +402,12 @@ type Holding struct {
|
||||
Site string `json:"site,omitempty"`
|
||||
}
|
||||
|
||||
// ModulePlacement is the nodes that run a module from one watched branch.
|
||||
type ModulePlacement struct {
|
||||
Branch string `json:"branch"`
|
||||
Nodes []string `json:"nodes"`
|
||||
}
|
||||
|
||||
// NodeDecided is what a person decides of a node; no secret and no key material.
|
||||
type NodeDecided struct {
|
||||
Account string `json:"account,omitempty"`
|
||||
@@ -624,6 +631,18 @@ type AgainInput struct {
|
||||
// AgainAnswer is what again answers.
|
||||
type AgainAnswer = map[string]any
|
||||
|
||||
// PlacementInput is what placement takes.
|
||||
type PlacementInput struct {
|
||||
// the module
|
||||
Module string `json:"module"`
|
||||
}
|
||||
|
||||
// PlacementAnswer is what placement answers.
|
||||
type PlacementAnswer struct {
|
||||
// one per branch, the nodes that run the module from it
|
||||
Placements []ModulePlacement `json:"placements"`
|
||||
}
|
||||
|
||||
// AssignmentsProposedEvent is the body of the event assignments-proposed.
|
||||
type AssignmentsProposedEvent = AssignmentsEvent
|
||||
|
||||
|
||||
@@ -154,6 +154,39 @@
|
||||
"type": "object",
|
||||
"description": "what was judged or asked again"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "placement",
|
||||
"description": "Read the placements of one module as the assignments rows hold them: for each watched branch a node runs it from, the nodes that run it from there.",
|
||||
"optional": true,
|
||||
"input": {
|
||||
"properties": {
|
||||
"module": {
|
||||
"description": "the module",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"module"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"placements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/defs/ModulePlacement"
|
||||
},
|
||||
"description": "one per branch, the nodes that run the module from it"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"placements"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"class": "read"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
@@ -1009,6 +1042,25 @@
|
||||
"scope",
|
||||
"holders"
|
||||
]
|
||||
},
|
||||
"ModulePlacement": {
|
||||
"type": "object",
|
||||
"description": "the nodes that run a module from one watched branch",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"nodes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"nodes"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
@@ -10,6 +10,7 @@ export declare const verbs: {
|
||||
readonly propose: "propose";
|
||||
readonly withdraw: "withdraw";
|
||||
readonly again: "again";
|
||||
readonly placement: "placement";
|
||||
};
|
||||
|
||||
export declare const events: {
|
||||
@@ -143,6 +144,12 @@ export interface Holding {
|
||||
"site"?: string;
|
||||
}
|
||||
|
||||
/** the nodes that run a module from one watched branch */
|
||||
export interface ModulePlacement {
|
||||
"branch": string;
|
||||
"nodes": string[];
|
||||
}
|
||||
|
||||
/** what a person decides of a node; no secret and no key material */
|
||||
export interface NodeDecided {
|
||||
"account"?: string;
|
||||
@@ -353,6 +360,18 @@ export interface AgainInput {
|
||||
/** is what again answers. */
|
||||
export type AgainAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what placement takes. */
|
||||
export interface PlacementInput {
|
||||
/** the module */
|
||||
"module": string;
|
||||
}
|
||||
|
||||
/** is what placement answers. */
|
||||
export interface PlacementAnswer {
|
||||
/** one per branch, the nodes that run the module from it */
|
||||
"placements": ModulePlacement[];
|
||||
}
|
||||
|
||||
/** is the body of the event assignments-proposed. */
|
||||
export type AssignmentsProposedEvent = AssignmentsEvent;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ export const verbs = {
|
||||
propose: "propose",
|
||||
withdraw: "withdraw",
|
||||
again: "again",
|
||||
placement: "placement",
|
||||
};
|
||||
|
||||
export const events = {
|
||||
|
||||
Reference in New Issue
Block a user