carlos / platform Public

grouproll: declare no fixed boxes explicitly with no_fixed_boxes

Ruling 8a3d302: a deployment with no fixed boxes could never drain
when an empty fixed_boxes refused. The config gains no_fixed_boxes, a
strict boolean. The floor needs exactly one of a non-empty fixed_boxes
and no_fixed_boxes true: neither (a missing or empty list with
no_fixed_boxes false or absent) is floor_fixed_boxes, both is
floor_fixed_both, each a floor error. A present file still counts
whatever the declaration. Spec §24 E14, §25.9, §25.11 and the verb
design say so; three new operator strings await copy review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4976e3867c0c08b461cbc05533071416b664b615 parent 45992c2
8 files changed, +85 −25
  • docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md +3 −3
  • docs/superpowers/specs/2026-11-09-group-roll-verb-design.md +6 −3
  • internal/grouproll/config.go +17 −4
  • internal/grouproll/config_test.go +8 −0
  • internal/grouproll/floor.go +11 −4
  • internal/grouproll/floor_test.go +33 −6
  • internal/grouproll/text.go +2 −1
  • internal/grouproll/text_test.go +5 −4
diff --git a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
index 07c999e04..d7f9622b1 100644
--- a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
+++ b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
@@ -1005,7 +1005,7 @@ the same rule for every box.
| E11 | Holder-cache drop (`notePeerDrained`, §25.4 step 4) | Blind: a file that says `ha_drained` drops this box's holder-cache entries naming that box, once per publication (its `ha_drain` id, else its generation), before the drained acknowledgement. From then until a later publication of that box no longer says `ha_drained`, neither cache installs or follows the box as a holder: a lock read that was in flight across the drop, and a delayed holder answer naming it, are not used (build ruling, 2026-11-09). A stale drained file drops nothing new. A box that is only `draining` stays a holder. |
| E12 | Drain acknowledgement receiver (`/.carlos/ha-drain`, `foldedDrain`, §25.4 step 1) | Blind: it reads the asker's own file by its exact key and answers whether its fold shows `draining` or `ha_drained` under the asked `ha_drain` transaction and id. A file that no longer matches, a stale one included, is answered as not seen. Each ask carries a fresh random nonce, covered by the ask's signature. The answer is signed under the mesh key over a separate domain, the answering box, the asking box, the transaction, the phase, the drain id, the nonce and the answer itself. |
| E13 | Take capability (`takeCapable`, `Edge.PeerTakes`; §25.7) | Blind: a box is asked to take only when its file says `ha_take` as the number 1. Absent, other numbers, strings and booleans mean no. A stale member file can still name a successor; the take then fails its dial, and the drain tries the next candidate or fails. `ha_handover` is not a take capability: a box that is not HA says `ha_handover: 1` and no `ha_take`, and is never asked to take. |
-| E14 | Held-requests floor (`ha_handover`, read by the group roll verb's `Engine.Floor`, `internal/grouproll/floor.go`; §25.9) | Blind: every edges file in the deployment's listing counts, member or fixed box, whatever its age. Each must say `ha_handover` as the number 1. Absent, other numbers, `1.0`, strings and booleans are a DR-4 reason naming the box; an unreadable file refuses the transaction. A box in the config's `fixed_boxes` with no file is a DR-4 reason naming it; `fixed_boxes` missing or empty refuses the transaction. The floor cannot tell a live box from a dead one. A terminated box's leftover file without the capability keeps the region on DR-4; one with the capability passes the floor and then fails the drain at E15, naming the box. Either way it counts until departure removes a member's file or the operator removes a fixed box's (runbook, "A fixed box has been terminated"). |
+| E14 | Held-requests floor (`ha_handover`, read by the group roll verb's `Engine.Floor`, `internal/grouproll/floor.go`; §25.9) | Blind: every edges file in the deployment's listing counts, member or fixed box, whatever its age. Each must say `ha_handover` as the number 1. Absent, other numbers, `1.0`, strings and booleans are a DR-4 reason naming the box; an unreadable file refuses the transaction. A box in the config's `fixed_boxes` with no file is a DR-4 reason naming it. The config must declare either a non-empty `fixed_boxes` or `"no_fixed_boxes": true`; neither, or both, refuses the transaction. The floor cannot tell a live box from a dead one. A terminated box's leftover file without the capability keeps the region on DR-4; one with the capability passes the floor and then fails the drain at E15, naming the box. Either way it counts until departure removes a member's file or the operator removes a fixed box's (runbook, "A fixed box has been terminated"). |
| E15 | Drain acknowledgement peers (`Edge.DrainAckPeers`, read by the drain driver's `publishAndAck`, `internal/host/hadrain.go`; §25.4 step 1) | Blind: every other box with an edges file in the asker's fold, named by its key, whatever the file's age, is asked and must acknowledge. The file is a hint and the live answer is the proof: only a binary with held requests can sign an answer for the ask (E12). Anything else is not an acknowledgement: an unsigned body, a bad signature, an answer to another ask (its nonce differs), a 404, or a tenant app's page behind an older binary. A box rolled back to an older binary keeps the newer binary's capable file but cannot answer, and a dead box's leftover file cannot answer, so the drain fails before any move, naming each box. A fold not read in full gives no peer list; it is retried within the 2 minute bound, then the drain fails. |
The drain state reuses the existing box-level `draining` field, so the
@@ -1202,7 +1202,7 @@ A drain is only safe when every box that may send A a request understands the ne
- The floor counts every edges file present in the deployment's `control/edges/` listing, whatever its age (E14). An age test would hide quiet live boxes: a box that is not HA publishes only on change, often hours apart, and could forward to the member on an old binary.
- The file is a hint, not proof of what the box runs now. A start does not always republish it: a writer that does not know `ha_handover` decodes the stored file into its own struct, drops the field, finds nothing changed and skips the write. So a box rolled back to an older binary keeps the newer binary's `ha_handover: 1`. The proof is the withdrawal's acknowledgement (§25.4 step 1, E15): every box with a file, capable or not, of any age, must answer it, and only a binary with held requests can. A box that cannot answer, rolled back or dead, fails the drain before any move, naming it, and the member returns as for any failed drain.
- A present file without the capability keeps DR-4, naming the box. A capable leftover file of a dead box passes the floor and fails the drain until departure removes a member's file or the operator removes a fixed box's (runbook, "A fixed box has been terminated").
-- A fixed box can serve and forward with no edges file: its publisher runs beside the edge, and a first write that fails does not stop it serving. So the verb's config lists every fixed box of the deployment that may forward, in any region, as `fixed_boxes`, and a listed box with no file keeps DR-4, naming it. `fixed_boxes` missing or empty refuses the transaction; it is never read as "no fixed boxes". No existing source gives the verb this set: the operator role reads only `control/edges/*` and no SSM parameter, and `CARLOS_HA_FIXED_BOX_IDENTITIES` lists only a region's fixed boxes, optionally, in host.env and SSM. Group members need no list: a member takes no traffic until it is admitted, and admission waits for its first booting publication to succeed (`internal/groupadmission/state.go:12`, `internal/host/group_admission.go:139-145, 170`).
+- A fixed box can serve and forward with no edges file: its publisher runs beside the edge, and a first write that fails does not stop it serving. So the verb's config lists every fixed box of the deployment that may forward, in any region, as `fixed_boxes`, and a listed box with no file keeps DR-4, naming it. A deployment with no fixed boxes says so with `"no_fixed_boxes": true`. The config must have exactly one of a non-empty `fixed_boxes` and `"no_fixed_boxes": true`; neither (a missing or empty list with `no_fixed_boxes` false or absent), or both, refuses the transaction. Silence is never read as "no fixed boxes". No existing source gives the verb this set: the operator role reads only `control/edges/*` and no SSM parameter, and `CARLOS_HA_FIXED_BOX_IDENTITIES` lists only a region's fixed boxes, optionally, in host.env and SSM. Group members need no list: a member takes no traffic until it is admitted, and admission waits for its first booting publication to succeed (`internal/groupadmission/state.go:12`, `internal/host/group_admission.go:139-145, 170`).
- `replace` also checks that the release the pinned launch template boots (`group_config.release`, `infra/modules/region-host/group.tf:50`) is at or above the floor. After the launch, it checks that the replacement publishes `ha_take: 1`.
- **First install.** Rolling a group onto the first release with §25 cannot drain. That roll uses today's DR-4 rule, replacing only lock-free members, and the tool says which rule it applied.
- A rollback below the floor brings DR-4 back. The tool checks the floor on every transaction.
@@ -1274,7 +1274,7 @@ W1 to W4 passing on a release at the floor is what retires the DR-4 rule.
- the nested layout;
- the region in group mode (`infra/modules/region-host`), with its NLB, launch hook, terminations queue and rule;
- `CARLOS_REGION_HA` and `CARLOS_GROUP_ADMISSION` on the members. Fixed boxes need no `CARLOS_REGION_HA` for the §25.9 floor, only a release at the floor: every box on such a release publishes `ha_handover: 1`, and answers the drain's acknowledgement. A fixed box whose edges file has no `ha_handover: 1` keeps the region on DR-4. A fixed box rolled back below the floor, or terminated with its file left behind, fails each drain, naming it, until it is updated or its file is removed;
- - the roll tool's config lists every fixed box of the deployment that may forward into the region in `fixed_boxes`, whatever its region;
+ - the roll tool's config lists every fixed box of the deployment that may forward into the region in `fixed_boxes`, whatever its region, or sets `"no_fixed_boxes": true` when the deployment has none;
- chrony, and SSM on the members for the roll tool.
- **Pool:** a named HA pool in `CONSOLE_HA_CAPACITY_CONFIG` (`ha_pools`), and `CONSOLE_HA_REGIONS` on the console (§23).
- **Which instances benefit:** only born-HA instances in that pool (N-HA7). Existing instances need the operator migration slice, which is not built. Until it is, they resize the old way.
diff --git a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
index bea9e7fbc..9f0de2041 100644
--- a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
+++ b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
@@ -109,9 +109,12 @@ flags-after-positionals trap of `cli-default-console-flagship` cannot arise.
- **The config file is the script's config file.** The same JSON keys, the same
validation (`validate_config`, `:506-545`, plus the `held-floor-sha-map`
keys `release_public_key`, `release_channels`, `release_platform`), so one file
- serves both tools during the overlap (§11). One key is added after the
- overlap: `fixed_boxes` (held floor capability, 2026-11-10, region HA spec
- §25.9), which the superseded script refuses.
+ serves both tools during the overlap (§11). Two keys are added after the
+ overlap (held floor capability, 2026-11-10, region HA spec §25.9), which
+ the superseded script refuses: `fixed_boxes`, a list of the fixed box
+ references that may forward to a member, and `no_fixed_boxes`, a
+ boolean. The floor needs exactly one of a non-empty `fixed_boxes` and
+ `"no_fixed_boxes": true`; neither or both refuses the transaction.
- **Exit codes and output** follow the script: 0 on success, 1 on a refusal with
`Refused: <reason>` on stderr, phase lines `phase: detail` on stdout, the JSON
drain summary line, and `status` printing the saved transaction as one JSON
diff --git a/internal/grouproll/config.go b/internal/grouproll/config.go
index 7b76ed4db..d47fa9f34 100644
--- a/internal/grouproll/config.go
+++ b/internal/grouproll/config.go
@@ -42,9 +42,12 @@ type Config struct {
// request to a member, by reference, whatever its region (held floor
// capability ruling, 2026-11-10). The floor refuses a drain unless each
// has an edges file: a fixed box whose first publication failed can
- // still serve and forward. nil is absent; the floor refuses absent and
- // empty alike. The Go verb's own key: the superseded script refuses it.
- FixedBoxes []string `json:"fixed_boxes,omitempty"`
+ // still serve and forward. nil is absent. NoFixedBoxes true says the
+ // deployment has none. The floor needs exactly one of a non-empty
+ // FixedBoxes and NoFixedBoxes true; anything else is a floor error.
+ // The Go verb's own keys: the superseded script refuses them.
+ FixedBoxes []string `json:"fixed_boxes,omitempty"`
+ NoFixedBoxes *bool `json:"no_fixed_boxes,omitempty"`
}
// The script's patterns (:242-266 and validate_config), anchored as
@@ -70,7 +73,7 @@ var requiredKeys = []string{"deployment", "account", "region", "group", "group_a
"target_groups", "bucket", "document", "state_dir", "profile", "min_release"}
var optionalKeys = []string{"ha_floor", "data_prefix", "data_bucket",
- "release_public_key", "release_channels", "release_platform", "fixed_boxes"}
+ "release_public_key", "release_channels", "release_platform", "fixed_boxes", "no_fixed_boxes"}
// boxRef is a box reference as an edges key names it (EdgesKey).
var boxRef = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$`)
@@ -161,6 +164,13 @@ func ValidateConfig(v any) (Config, error) {
out.FixedBoxes = append(out.FixedBoxes, s)
}
}
+ if raw, present := c["no_fixed_boxes"]; present {
+ b, ok := raw.(bool)
+ if !ok {
+ return Config{}, invalid
+ }
+ out.NoFixedBoxes = &b
+ }
if out.ReleasePlatform, ok = optional("release_platform", releasePlatform.MatchString); !ok {
return Config{}, invalid
}
@@ -285,6 +295,9 @@ func (c Config) Map() map[string]any {
}
m["fixed_boxes"] = boxes
}
+ if c.NoFixedBoxes != nil {
+ m["no_fixed_boxes"] = *c.NoFixedBoxes
+ }
return m
}
diff --git a/internal/grouproll/config_test.go b/internal/grouproll/config_test.go
index a06349032..31211261e 100644
--- a/internal/grouproll/config_test.go
+++ b/internal/grouproll/config_test.go
@@ -87,6 +87,10 @@ func TestConfigMatchesScriptValidation(t *testing.T) {
"fixed boxes": with(heldConfig(), "fixed_boxes", []any{"adi", "tito-1", "g.x_y"}),
// An empty list is a valid config; the floor refuses it.
"fixed boxes empty": with(heldConfig(), "fixed_boxes", []any{}),
+ // The floor judges the combinations; the config checks types.
+ "no fixed boxes true": with(heldConfig(), "no_fixed_boxes", true),
+ "no fixed boxes false": with(heldConfig(), "no_fixed_boxes", false),
+ "both": with(heldConfig(), "no_fixed_boxes", true, "fixed_boxes", []any{"adi"}),
}
for name, c := range accept {
t.Run("accept "+name, func(t *testing.T) {
@@ -165,6 +169,10 @@ func TestConfigMatchesScriptValidation(t *testing.T) {
"fixed boxes slash": with(heldConfig(), "fixed_boxes", []any{"a/b"}),
"fixed boxes json": with(heldConfig(), "fixed_boxes", []any{"adi.json"}),
"fixed boxes null": with(heldConfig(), "fixed_boxes", nil),
+ "no fixed boxes string": with(heldConfig(), "no_fixed_boxes", "true"),
+ "no fixed boxes number": with(heldConfig(), "no_fixed_boxes", int64(1)),
+ "no fixed boxes null": with(heldConfig(), "no_fixed_boxes", nil),
+ "no fixed boxes list": with(heldConfig(), "no_fixed_boxes", []any{}),
}
for name, c := range refuse {
t.Run("refuse "+name, func(t *testing.T) {
diff --git a/internal/grouproll/floor.go b/internal/grouproll/floor.go
index 6ded59499..9ca07c463 100644
--- a/internal/grouproll/floor.go
+++ b/internal/grouproll/floor.go
@@ -37,7 +37,8 @@ var (
// acknowledged at drain time (§25.4 step 1, Edge.DrainAckPeers), or the
// drain fails before any move. Every box in the config's fixed_boxes
// must have a file, or it is DR-4 naming the box: a fixed box can serve
-// with no file. fixed_boxes missing or empty is a floor error. ha_take is
+// with no file. The config must declare a non-empty fixed_boxes or
+// no_fixed_boxes true, not both; anything else is a floor error. ha_take is
// not read here: it says a box answers takes (region HA), which only take
// candidates need. The journaled live list is the boxes counted.
//
@@ -61,9 +62,15 @@ func (e *Engine) Floor(ctx context.Context, kind, version string) (rule string,
} else {
floor := *e.c.HAFloor
err := func() error {
- if len(e.c.FixedBoxes) == 0 {
- // Never read as "no fixed boxes": an unlisted forwarder
- // with no file would be invisible.
+ // The fixed-box declaration is explicit: a non-empty list, or
+ // no_fixed_boxes true, never both and never neither. Silence
+ // is never read as "no fixed boxes": an unlisted forwarder
+ // with no file would be invisible.
+ none := e.c.NoFixedBoxes != nil && *e.c.NoFixedBoxes
+ switch {
+ case len(e.c.FixedBoxes) > 0 && none:
+ errs = append(errs, Text("floor_fixed_both"))
+ case len(e.c.FixedBoxes) == 0 && !none:
errs = append(errs, Text("floor_fixed_boxes"))
}
keys, err := e.edgesList(ctx)
diff --git a/internal/grouproll/floor_test.go b/internal/grouproll/floor_test.go
index 7804f8f16..fc7479177 100644
--- a/internal/grouproll/floor_test.go
+++ b/internal/grouproll/floor_test.go
@@ -389,15 +389,42 @@ func TestFloorDeclaredFixedBoxWithoutAFile(t *testing.T) {
h.refused(t, h.floor("replace", ""), Text("floor_box", "box", "other"))
}
-// fixed_boxes missing or empty is a floor error, never "no fixed boxes".
-func TestFloorFixedBoxesRequired(t *testing.T) {
- for name, boxes := range map[string][]string{"missing": nil, "empty": {}} {
- t.Run(name, func(t *testing.T) {
+// The fixed-box declaration must be explicit: a non-empty fixed_boxes, or
+// no_fixed_boxes true, never both and never neither. Anything else is a
+// floor error, never read as "no fixed boxes".
+func TestFloorFixedBoxesDeclaration(t *testing.T) {
+ yes, no := true, false
+ for _, c := range []struct {
+ name string
+ boxes []string
+ none *bool
+ err string // "" drains
+ }{
+ {"list", []string{"adi"}, nil, ""},
+ {"list, none false", []string{"adi"}, &no, ""},
+ {"none true, list absent", nil, &yes, ""},
+ {"none true, list empty", []string{}, &yes, ""},
+ {"both", []string{"adi"}, &yes, "floor_fixed_both"},
+ {"neither", nil, nil, "floor_fixed_boxes"},
+ {"list empty", []string{}, nil, "floor_fixed_boxes"},
+ {"none false, list absent", nil, &no, "floor_fixed_boxes"},
+ {"none false, list empty", []string{}, &no, "floor_fixed_boxes"},
+ } {
+ t.Run(c.name, func(t *testing.T) {
h := newFloorHarness(t, false)
- h.c.FixedBoxes = boxes
- h.floorError(t, h.floor("replace", ""), Text("floor_fixed_boxes"))
+ h.c.FixedBoxes, h.c.NoFixedBoxes = c.boxes, c.none
+ if c.err == "" {
+ h.drained(t, h.floor("replace", ""))
+ return
+ }
+ h.floorError(t, h.floor("replace", ""), Text(c.err))
})
}
+ // no_fixed_boxes true does not excuse a present file: adi still counts.
+ h := newFloorHarness(t, false)
+ h.c.FixedBoxes, h.c.NoFixedBoxes = nil, &yes
+ h.f.fixed["adi"] = fixedEdges{age: time.Minute}
+ h.refused(t, h.floor("replace", ""), Text("floor_box", "box", "adi"))
}
func TestFloorOldPinnedTemplate(t *testing.T) {
diff --git a/internal/grouproll/text.go b/internal/grouproll/text.go
index a93353050..bad9eeb6d 100644
--- a/internal/grouproll/text.go
+++ b/internal/grouproll/text.go
@@ -93,7 +93,8 @@ var text = map[string]string{
"cancelled": "The drain was cancelled and the start fence removed.",
"floor_box": "Box {box} does not publish ha_handover: 1",
"floor_fixed_missing": "Fixed box {box} is in fixed_boxes but has no edges file",
- "floor_fixed_boxes": "The config's fixed_boxes is missing or empty, so a fixed box with no edges file could be missed",
+ "floor_fixed_boxes": "The config must list the deployment's fixed boxes in fixed_boxes, or set no_fixed_boxes to true if it has none",
+ "floor_fixed_both": "The config lists fixed_boxes and also sets no_fixed_boxes to true. Keep only one",
"floor_unreadable": "The edges file {key} cannot be read",
"floor_template": "The pinned launch template boots release {release}, below ha_floor",
"floor_version": "The roll's release {release} is below ha_floor",
diff --git a/internal/grouproll/text_test.go b/internal/grouproll/text_test.go
index 9aefee514..65a058f68 100644
--- a/internal/grouproll/text_test.go
+++ b/internal/grouproll/text_test.go
@@ -12,10 +12,11 @@ var placeholderPattern = regexp.MustCompile(`\{([a-z_]+)\}`)
// for every placeholder it names. A key whose text names a placeholder
// Text cannot fill, or leaves a brace behind, fails here.
func TestTextRendersEveryKey(t *testing.T) {
- // 139 approved, plus floor_fixed_missing and floor_fixed_boxes (held
- // floor capability, 2026-11-10), not yet copy-reviewed.
- if len(text) != 141 {
- t.Fatalf("text has %d keys, want the 139 approved plus 2", len(text))
+ // 139 approved, plus floor_fixed_missing, floor_fixed_boxes and
+ // floor_fixed_both (held floor capability, 2026-11-10), not yet
+ // copy-reviewed.
+ if len(text) != 142 {
+ t.Fatalf("text has %d keys, want the 139 approved plus 3", len(text))
}
for key, raw := range text {
var args []string