Land feature 57's controller work on its release branch

The controller plans config, templates and moved providers' provisions,
hands bus accounts to the vault and judges the new manifest words, on the
feature's SDK and node-engine validator (feature 57, config and provisioning).
This commit is contained in:
2026-10-15 21:27:33 +00:00
parent fcdecb4361
commit 97a2d841c7
349 changed files with 42440 additions and 786 deletions
+16 -1
View File
@@ -26,6 +26,12 @@ type Inventory struct {
store *store.Store
// acting is the gate a write that acts passes (ActsUnder, novox/hq to-be 45 §6); nil passes all.
acting func(ctx context.Context) (uint64, error)
// provisioningPlans composes the provisioner's plan of each assignment of a module handed to the provisioner, keyed
// `<node>.<module>` (ProvisioningPlans); nil hands none.
provisioningPlans func(ctx context.Context) (map[string]Provisioning, error)
// configValues reads a module's config values from mesh-config once the move of config has run (ReadsConfigFrom,
// issue 664); nil reads none.
configValues ConfigValues
}
// Open connects to the inventory store.
@@ -1142,6 +1148,10 @@ type SentDeclaration struct {
Digest string `json:"digest"`
Sequence int64 `json:"sequence,omitempty"`
At time.Time `json:"at,omitzero"`
// Provisioned is, for each module the send handed to the provisioner, the digest of the templates its plan
// named (novox/hq ADR 0349 §4, ADR 0362): the build the machine's provisioner client reports `prov.applied` on.
// The machine has applied the send of such a module only once both it and the client reported it.
Provisioned map[string]string `json:"provisioned,omitempty"`
}
// ReportsOn says a report is about this send: the declaration itself; one the same machine was sequenced
@@ -1161,7 +1171,9 @@ func (i *Inventory) SentTo(ctx context.Context, name string) (SentDeclaration, b
var digest *string
var seq *int64
var at *time.Time
err := i.store.Pool().QueryRow(ctx, `select sent, sequence, sent_at from node where name = $1`, name).Scan(&digest, &seq, &at)
var plans []byte
err := i.store.Pool().QueryRow(ctx, `select sent, sequence, sent_at, sent_provisioning from node where name = $1`,
name).Scan(&digest, &seq, &at, &plans)
if errors.Is(err, pgx.ErrNoRows) {
return SentDeclaration{}, false, fmt.Errorf("%w: %s", ErrNoSuchNode, name)
}
@@ -1175,6 +1187,9 @@ func (i *Inventory) SentTo(ctx context.Context, name string) (SentDeclaration, b
if at != nil {
s.At = at.UTC()
}
if s.Provisioned, err = provisionedBy(plans); err != nil {
return SentDeclaration{}, false, fmt.Errorf("what %s was sent of the provisioner's plans: %w", name, err)
}
return s, true, nil
}