The tool records its hand act, writes the ask {module, version, by, why} into the state
delivered-again and answers that it is asked; the process's watch of that state wakes a pass at once,
which says version-delivered again when every present machine placing the module runs that version
healthy and takes the ask away, else keeps it with why, which assigner_waits lists.
Builds: design 47 G §376, A-250
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
80 lines
4.6 KiB
Go
80 lines
4.6 KiB
Go
// Package buckets holds the names of the bus buckets the assigner reads and the states it keeps beside the seats' own. A
|
|
// contract carries the local name of a state, not the module that holds it (ADR 0625 §4, §7), and the assigner opens
|
|
// buckets through grants its manifest declares, so the holder's name is kept here, in the assigner's own code, and held equal
|
|
// to the manifest by its test (ADR 0634 §1, finding F4).
|
|
package buckets
|
|
|
|
import (
|
|
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
|
|
|
catalog "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
|
wants "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-grants/grantsstate"
|
|
|
|
plc "mesh-delivery-assigner/internal/assignment"
|
|
)
|
|
|
|
// The states the assigner keeps: the wants seat's, and its own asks, puts and policies.
|
|
const (
|
|
Wants = plc.Module + "_" + wants.StateWants
|
|
Differences = plc.Module + "_" + wants.StateDifferences
|
|
Asks = plc.Module + "_asks"
|
|
Puts = plc.Module + "_puts"
|
|
// Waits holds the waits on an outside cause, one key `<node>.<module>.<fingerprint hex>` (design 47 G §706).
|
|
WaitsState = "waits"
|
|
Waits = plc.Module + "_" + WaitsState
|
|
// DeliveredAgain holds each ask of assigner_delivered_again, one key `<module>`, its value the version, who asked and why, and
|
|
// why it does not hold yet (design 47 G §376, A-250).
|
|
DeliveredAgainState = "delivered-again"
|
|
DeliveredAgain = plc.Module + "_" + DeliveredAgainState
|
|
// DeliveryWaits holds each dependent's delivery wait the assigner said, one key `<module>`, its value the wait-held said
|
|
// (design 47 G §376, §498, A-246).
|
|
DeliveryWaitsState = "delivery-waits"
|
|
DeliveryWaits = plc.Module + "_" + DeliveryWaitsState
|
|
// PutWaits holds each put wait the assigner said, one key `<node>.<module>`, its value the wait's id and the put as said
|
|
// (design 47 G A-204, A-211), so a put that ends while the assigner is stopped gets its wait-ended at the next start.
|
|
PutWaitsState = "put-waits"
|
|
PutWaits = plc.Module + "_" + PutWaitsState
|
|
// Inputs holds the inputs of the composition steps, `<time>.<digest>`, which the seat mesh-wants' verb input answers (design 47 G §354).
|
|
InputsState = "inputs"
|
|
Inputs = plc.Module + "_" + InputsState
|
|
// PoliciesState is the state of the policies a person set for a module's upgrade; Policies its bucket.
|
|
PoliciesState = "policies"
|
|
Policies = plc.Module + "_" + PoliciesState
|
|
)
|
|
|
|
// AsksHistory is the revisions the bucket of asks keeps per key.
|
|
const AsksHistory = 5
|
|
|
|
// The states of the other seats' holders that the assigner reads, named by the holder's module as every state is.
|
|
const (
|
|
// Have holds a module's have on a node, `<node>.<module>`, and the node's own facts, `<node>.node`.
|
|
Have = "node-engine_" + nodeengine.StateHave
|
|
// ComposedRead is the family of the node-engine's composed states, one bucket per node.
|
|
ComposedRead = "mesh-host." + nodeengine.StateComposed
|
|
// IndexerModule is the holder of the seat mesh-catalog, named from this module's manifest (`consumes` its views, `invokes`
|
|
// its tools; TestTheIndexerIsTheManifests), since no client names a holder (ADR 0625 §4).
|
|
IndexerModule = "mesh-delivery-indexer"
|
|
// Modules, Manifests and Graph are the indexer's buckets; ModulesRead and ManifestsRead the addresses of the states
|
|
// modules and manifests as a first view names them.
|
|
Modules = IndexerModule + "_" + catalog.StateModules
|
|
Manifests = IndexerModule + "_" + catalog.StateManifests
|
|
Graph = IndexerModule + "_graph"
|
|
ModulesRead = IndexerModule + "." + catalog.StateModules
|
|
ManifestsRead = IndexerModule + "." + catalog.StateManifests
|
|
// ProvisionerModule is the holder of the seat mesh-provisioner, named from this module's manifest (reads its provisions); Provisions
|
|
// is its state provisions.
|
|
ProvisionerModule = "mesh-provisioner"
|
|
Provisions = ProvisionerModule + "_provisions"
|
|
// TellerModule is the module whose hand the operator's answers pass: the one that holds each ask's answer, and the
|
|
// name the hand-act log records a warrant under. Held equal to the manifest's reads by its test.
|
|
TellerModule = "mesh-delivery-teller"
|
|
// AnswersState is the teller's state of its answer to each ask, followed through its first view by AnswersReadTool and its
|
|
// views family `views.answers` (design 47 G A-175, A-178), never its bucket; Answers is the picture's name, `<owner>_<state>`.
|
|
AnswersState = "answers"
|
|
AnswersReadTool = "teller_read_answers"
|
|
Answers = TellerModule + "_" + AnswersState
|
|
// Grants is the grants part's.
|
|
Grants = grantsstate.PartGrantsBucket
|
|
)
|