Announce the controller's states, keep every module's word, and grant a read only where its owner announced the state readable; the copied list of the controller's mirrors goes (issue 1790, D1-D4, ADR 0495, ADR 0513 §3)

This commit is contained in:
2026-10-22 19:05:04 +02:00
parent b6ed18197b
commit d36e0ea278
25 changed files with 732 additions and 26 deletions
+8 -3
View File
@@ -28,6 +28,9 @@ var mayNameAMirror = []string{
// The grant of a machine's own keys of the assignments mirror to its provisioner client (design 57 P3).
"internal/broker/provisioner.go",
"internal/broker/writers.go",
// The controller's announcement of what it keeps, the mirrors readable (novox/hq ADR 0495, issue 1790): it names them
// to announce them, never reads them.
"internal/broker/announced.go",
}
// The packages whose names stand for a mirror, by import path, and the names in each.
@@ -38,7 +41,7 @@ const (
var mirrorNames = map[string][]string{
brokerPath: {"AssignmentsBucket", "DeclaredConfigBucket", "MirrorAssignments", "MirrorDeclaredConfig",
"ControllerMirrors"},
"controllerReadable"},
recordmirrorPath: {"Assignments", "DeclaredConfig", "Mirrors"},
}
@@ -54,8 +57,10 @@ var mirrorNames = map[string][]string{
// allowed file. Those are deliberate evasions rather than ordinary code; a reviewer judges them.
func TestOnlyTheAuditAndAMirrorsWriterReadAMirror(t *testing.T) {
var buckets []string
for _, m := range broker.ControllerMirrors() {
buckets = append(buckets, broker.BucketName(broker.ControllerSeat, m))
for _, s := range broker.ControllerAnnouncement("").States {
if s.Readable {
buckets = append(buckets, broker.BucketName(broker.ControllerSeat, s.Name))
}
}
root := filepath.Join("..", "..")
found := mirrorReaders(t, root, buckets)