Merge branch 'feat/47-G-placement6' into feat/47-G-join8

This commit is contained in:
2026-11-12 00:11:50 +01:00
4 changed files with 92 additions and 1 deletions
+20 -1
View File
@@ -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
+52
View File
@@ -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
View File
@@ -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;
+1
View File
@@ -10,6 +10,7 @@ export const verbs = {
propose: "propose",
withdraw: "withdraw",
again: "again",
placement: "placement",
};
export const events = {