carlos / platform Public

group verb: throttle retries on reads, group help, clearer refusals

Reads (describes, caller identity, HeadBucket, S3 GET and list) retry
while AWS throttles them: four calls, about 1/2/4 s jittered; writes and
sessions never retry; fail closed after the budget (step-3 W4). Bare
carlos system group, -h and unknown verbs print the group help (approved
help_group, each verb's line, role), before the refusals. plan says
observation for a missing provider observation. A member verb's own
refusal line is carried (remote_said). remove_minimum's stray backtick
fixed. Spec V15-V17; CLI golden re-recorded; census approved on #280.
Astra r1 P1/P2 fixed, r2 clean. remote_said and remove_minimum texts
await copy review; runbook prose lands after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from group-verb-followups into main.
claude c60889d6c0260f6995f02703c3839b6dedbd0ae9 parent 4fe1230
18 files changed, +391 −32
  • docs/superpowers/notes/census-proposal-group-verb-followups.md +23 −0
  • docs/superpowers/specs/2026-11-09-group-roll-verb-design.md +3 −0
  • internal/grouproll/box.go +33 −0
  • internal/grouproll/box_test.go +55 −2
  • internal/grouproll/plan.go +3 −1
  • internal/grouproll/plan_test.go +3 −3
  • internal/grouproll/text.go +2 −1
  • internal/grouproll/text_test.go +4 −3
  • internal/grouprollaws/group.go +62 −9
  • internal/grouprollaws/objects.go +4 −3
  • internal/grouprollaws/session_test.go +4 −3
  • internal/grouprollaws/throttle_test.go +98 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-group-verb-followups.tsv +11 −0
  • system_group.go +38 −0
  • system_group_test.go +40 −0
  • system_roles.go +1 −1
  • testdata/clireg-golden.jsonl +6 −6

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-group-verb-followups.md b/docs/superpowers/notes/census-proposal-group-verb-followups.md
new file mode 100644
index 000000000..79b1cfe71
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-group-verb-followups.md
@@ -0,0 +1,23 @@
+# Census approval: group-verb-followups
+
+Ruling `census-ruling-group-verb-followups`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/grouproll/plan.go` `Engine.Plan` | body | unchanged (1) | a missing or unreadable provider-observation.json is refused as observation instead of passing the read error through (same file, same read) |
+| `internal/grouprollaws/group.go` `Adapter.TemplateRelease` | body | unchanged (1) | the DescribeLaunchTemplateVersions read goes through readCall, which retries the same request while AWS throttles it (no new read) |
+| `system_group.go` `runSystemGroup` | body | unchanged (1) | an empty verb (the group fallback: bare, -h, unknown verb) prints the group help first, before the root and box refusals: it reads no file, flag, environment or provider and changes nothing (Astra r1 P1); every other verb is unchanged |
+
+Envelopes re-pinned: `.`, `internal/grouproll`, `internal/grouprollaws`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/grouproll/plan.go` `Engine.Plan`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads provider-observation.json from the operator's own 0700 state directory
+- `internal/grouprollaws/group.go` `Adapter.TemplateRelease`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads the launch template's user data from the EC2 answer (in memory, 4 MiB cap)
+- `system_group.go` `runSystemGroup`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats /etc/carlos/host.env to refuse running on a carlos box (euid 0 is refused first); routes the roll, replace, remove, cancel-drain and probe verbs to the engine after refusing missing arguments
+
+Seal: `0c649af234a7b89a75479e59e705307e3293a59439b7b251dd4558bd46ef2100` → `9c74b9876a13a3a3802860fe44406898c8bcbfd3bd22e8172a59a02674c3b4af`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-group-verb-followups.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
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 5367bc3e4..6e80d8697 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
@@ -375,6 +375,9 @@ build to it.
| V12 | `refuse_while_moving` is skipped once any `exit-intent` exists (`:1828`), though that row is written before dispatch and dispatch can be refused or cut | Before every ExitStandby of a failed drain's member the drain check runs on the status the request acts on, whatever earlier intents exist | Branch review round 1 (Astra P1, 2026-11-10): the r2 cut must hold on resume |
| V13 | Under DR-4, `roll` prints the rule ("Replace only lock-free members") and goes on: Standby, then apply, which restarts the edge with no drain | Under DR-4, `roll` refuses up front when a lock names the member: it runs the lock sweep (`locks_naming_member`) immediately before the first group write and closes `floor-refused` with no group write (`floor_refused`, then `lock_held`; `floor_config` without `data_bucket` or `data_prefix`; a sweep that cannot read refuses too). A resumed process sweeps again before the next write that leads to Standby, whatever intents the journal holds (an intent is written before dispatch); a finding then restores a lowered minimum and closes `lock-refused`. It re-checks immediately before the mutation, after Standby and the permit: a lock or a failed sweep returns the member unchanged, revokes the permit and closes `lock-refused` | Dev W2 2026-11-10 restarted a lease-holding member without a drain (8a3d302 P1) |
| V14 | `aws s3api` follows S3's 301 to the bucket's region, so a deployment bucket in another region than the group reads normally | Each bucket is read through a client on its own region's endpoint, resolved once per process by an unsigned HeadBucket (`x-amz-bucket-region`); an unresolved region, or a 301 after resolution, is Uncertain(`bucket_region`) naming the bucket. A required flag left out prints the verb's usage, status 2 (argparse); given empty, it is refused as before | Flagship step 4 2026-11-10: the US group (us-east-1) reads the eu-west-1 deployment bucket; plan refused every edges read |
+| V15 | A box verb that exits non-zero is `remote` ("returned no complete result"), whatever it printed | The verb's last printable line is carried as `remote_said` ("The command on the member failed: <detail>"), non-printables made spaces, at most 512 characters; with nothing printable it stays `remote`. drain keeps its own report parsing | Dev W slot 2026-11-10: prepare's "pointer artifact does not match requested digest" reached the operator as "no complete result" |
+| V16 | `plan` reports a missing provider observation as `record` (FileNotFoundError reached check()) | `plan` says `observation`, as preflight does | REPORT follow-up 3; flagship step 4 2026-11-11 |
+| V17 | Every provider call is made once (`--cli-read-timeout`, retries 1) | Reads (the describes, caller identity, HeadBucket, S3 GET and list) are retried while AWS throttles them: four calls at most, about 1, 2 and 4 s apart, jittered; any other failure and the last throttle fail closed as before. Writes and box sessions are never retried. Bare `carlos system group`, its -h and an unknown verb print the group's help | Step-3 dev W4 2026-11-10: the group describe refused under ASG throttling (8a3d302) |
Not deviations, recorded so nobody "fixes" them in the port: the drain-rerun
backoff and the TakeHost `wake_timeout` follow-ups from the held build stay
diff --git a/internal/grouproll/box.go b/internal/grouproll/box.go
index 679f1315f..84daef2ae 100644
--- a/internal/grouproll/box.go
+++ b/internal/grouproll/box.go
@@ -21,6 +21,7 @@ import (
"sort"
"strconv"
"strings"
+ "unicode"
"unicode/utf8"
)
@@ -521,6 +522,12 @@ func ParseFramed(text, nonce, verb string) (BoxResult, error) {
return BoxResult{Verb: verb, Value: map[string]any{"exit": int64(1), "detail": d}, Exit: 1, Detail: d}, nil
}
if code != "0" {
+ // The verb's own refusal (prepare's "pointer artifact does not
+ // match requested digest", say) is the operator's best clue: carry
+ // its last line, printable characters only.
+ if d := remoteDetail(body); d != "" {
+ return BoxResult{}, Refusal{Key: "remote_said", Args: map[string]string{"detail": d}}
+ }
return BoxResult{}, Refusal{Key: "remote"}
}
switch verb {
@@ -539,6 +546,32 @@ func ParseFramed(text, nonce, verb string) (BoxResult, error) {
return BoxResult{Verb: verb, Value: map[string]any{}}, nil
}
+// remoteDetail is the tail of a failed verb's output for the operator: its
+// last non-empty line, with every non-printable character replaced by a
+// space and cut to its last cancelDetail characters. Empty when the
+// output has no printable text.
+func remoteDetail(body string) string {
+ lines := pythonSplitLines(body)
+ for i := len(lines) - 1; i >= 0; i-- {
+ clean := strings.Map(func(r rune) rune {
+ if unicode.IsPrint(r) {
+ return r
+ }
+ return ' '
+ }, lines[i])
+ clean = strings.Join(strings.Fields(clean), " ")
+ if clean == "" {
+ continue
+ }
+ detail := []rune(clean)
+ if len(detail) > cancelDetail {
+ detail = detail[len(detail)-cancelDetail:]
+ }
+ return string(detail)
+ }
+ return ""
+}
+
// drainOutput is AWS.drain_output. The verb prints its report as one JSON
// line and exits 0 only when the report's result is ok; a refusal prints
// no report. 124 is the remote timeout's: the verb was killed, the agent's
diff --git a/internal/grouproll/box_test.go b/internal/grouproll/box_test.go
index 735ca714a..95ca06eeb 100644
--- a/internal/grouproll/box_test.go
+++ b/internal/grouproll/box_test.go
@@ -298,9 +298,21 @@ func TestParseFramed(t *testing.T) {
t.Fatal("an uncertain outcome is also a refusal")
}
case c.Refusal != "":
+ // V15: where the script said "remote" for a verb that exited
+ // non-zero (drain keeps its own report parsing), the verb's last
+ // printable line is carried
+ // (remote_said), when there is one.
+ want, detail := c.Refusal, ""
+ if want == "remote" && c.Verb != "drain" {
+ if m := framedBody(c.Text, c.Nonce); m != nil && m[2] != "0" {
+ if detail = remoteDetail(m[1]); detail != "" {
+ want = "remote_said"
+ }
+ }
+ }
var r Refusal
- if !errors.As(err, &r) || r.Key != c.Refusal {
- t.Fatalf("got %+v, %v; want refusal %s", got, err, c.Refusal)
+ if !errors.As(err, &r) || r.Key != want || (want == "remote_said" && r.Args["detail"] != detail) {
+ t.Fatalf("got %+v, %v; want refusal %s %q", got, err, want, detail)
}
default:
if err != nil {
@@ -508,3 +520,44 @@ func TestRemoteCommandDrainPeers(t *testing.T) {
t.Errorf("%d peers: %v", MaxDrainPeers, err)
}
}
+
+// framedBody is ParseFramed's single frame match (body, exit code), or nil.
+func framedBody(text, nonce string) []string {
+ frame := regexp.MustCompile(`(?s)` + regexp.QuoteMeta(nonce) + `:BEGIN\r?\n(.*?)\r?\n` +
+ regexp.QuoteMeta(nonce) + `:END:([0-9]+)(?:\r?\n|$)`)
+ m := frame.FindAllStringSubmatch(text, -1)
+ if len(m) != 1 {
+ return nil
+ }
+ return m[0]
+}
+
+// The member's own refusal reaches the operator: the last non-empty line,
+// non-printable characters (an escape sequence, a bell) made
+// spaces, cut to cancelDetail characters; nothing printable keeps "remote".
+func TestRemoteDetail(t *testing.T) {
+ nonce := strings.Repeat("a", 32)
+ frame := func(body, code string) string {
+ return "noise\n" + nonce + ":BEGIN\n" + body + "\n" + nonce + ":END:" + code + "\n"
+ }
+ _, err := ParseFramed(frame("staging\nprepare: pointer artifact does not match requested digest", "1"), nonce, "prepare")
+ var r Refusal
+ if !errors.As(err, &r) || r.Key != "remote_said" || r.Args["detail"] != "prepare: pointer artifact does not match requested digest" {
+ t.Fatalf("prepare refusal: %v", err)
+ }
+ if got := r.Error(); got != "The command on the member failed: prepare: pointer artifact does not match requested digest" {
+ t.Fatalf("text %q", got)
+ }
+ _, err = ParseFramed(frame("\x1b[31mred\x1b[0m\x07 bad", "1"), nonce, "apply")
+ if !errors.As(err, &r) || r.Args["detail"] != "[31mred [0m bad" {
+ t.Fatalf("escapes: %q", r.Args["detail"])
+ }
+ _, err = ParseFramed(frame(strings.Repeat("x", cancelDetail+10)+"END", "1"), nonce, "apply")
+ if !errors.As(err, &r) || len([]rune(r.Args["detail"])) != cancelDetail || !strings.HasSuffix(r.Args["detail"], "END") {
+ t.Fatalf("long: %d", len(r.Args["detail"]))
+ }
+ _, err = ParseFramed(frame(" \t\x00", "1"), nonce, "apply")
+ if !errors.As(err, &r) || r.Key != "remote" {
+ t.Fatalf("blank: %v", err)
+ }
+}
diff --git a/internal/grouproll/plan.go b/internal/grouproll/plan.go
index a9ffe7881..fc30c23e7 100644
--- a/internal/grouproll/plan.go
+++ b/internal/grouproll/plan.go
@@ -111,9 +111,11 @@ func (e *Engine) Plan(ctx context.Context, iid, sha string) (ok bool, err error)
if snapped {
check(require(shapeOK(snap.View, iid), "shape"))
check(func() error {
+ // A missing or unreadable observation is the observation's
+ // refusal, as preflight says it (the script said "record").
obs, err := e.s.Read(e.s.ObservationPath())
if err != nil {
- return err
+ return refuse("observation")
}
return require(e.observationOK(obs, snap.View.Template), "observation")()
})
diff --git a/internal/grouproll/plan_test.go b/internal/grouproll/plan_test.go
index 6c9051e46..37c3832d8 100644
--- a/internal/grouproll/plan_test.go
+++ b/internal/grouproll/plan_test.go
@@ -150,13 +150,13 @@ func TestPlanRefusals(t *testing.T) {
}
})
}, []string{"blocked"}},
- // The script's plan reads the observation without catching a
- // missing file: FileNotFoundError reaches check() as record.
+ // The script's plan reported a missing observation as record; the
+ // verb says observation, as its preflight does.
{"no observation", fakeIID, newSHA, func(h *harness) {
if err := os.Remove(h.state.ObservationPath()); err != nil {
h.t.Fatal(err)
}
- }, []string{"record"}},
+ }, []string{"observation"}},
{"other observation", fakeIID, newSHA, func(h *harness) {
h.withLock(func() {
if err := h.state.Write(h.state.ObservationPath(), map[string]any{"v": 1, "group_arn": h.c.GroupARN,
diff --git a/internal/grouproll/text.go b/internal/grouproll/text.go
index 73f35af1e..0164a7842 100644
--- a/internal/grouproll/text.go
+++ b/internal/grouproll/text.go
@@ -72,6 +72,7 @@ var text = map[string]string{
"unknown_phase": "The member's return phase is unknown. Probe failed.",
"hook": "The immutable launch hook must have a 900-second ABANDON default",
"remote": "The command on the member returned no complete result",
+ "remote_said": "The command on the member failed: {detail}",
"api": "An AWS response is unavailable or invalid",
"bucket_region": "The AWS region of bucket {bucket} is unknown or has changed",
"rollback_refused": "Rollback requires this transaction's consumed apply in Standby",
@@ -127,7 +128,7 @@ var text = map[string]string{
"edge_running": "carlos-edge.service` is still running after the stop. The member is held in Standby.",
"h4": "Only the member's EnterStandby with decrement may lower desired capacity.",
"desired_changed": "Desired capacity or membership changed when the member was terminated",
- "remove_minimum": "remove` must leave at least 2 members.",
+ "remove_minimum": "A remove must leave at least 2 members.",
"remove_pools": "The survivors would leave pool {pool} with no server",
"remove_pools_unknown": "The member's served_pools are unknown",
"watch_timeout": "The replacement or the departure did not finish in time",
diff --git a/internal/grouproll/text_test.go b/internal/grouproll/text_test.go
index 389429b8d..5990d811a 100644
--- a/internal/grouproll/text_test.go
+++ b/internal/grouproll/text_test.go
@@ -15,9 +15,10 @@ func TestTextRendersEveryKey(t *testing.T) {
// 139 approved, plus floor_fixed_missing, floor_fixed_boxes,
// floor_fixed_both, drain_peers_many, floor_legacy and floor_population
// (held floor capability, 2026-11-10), and bucket_region (a bucket in
- // another region than the group, 2026-11-10), not yet copy-reviewed.
- if len(text) != 146 {
- t.Fatalf("text has %d keys, want the 139 approved plus 7", len(text))
+ // another region than the group, 2026-11-10), and remote_said (the
+ // member's own refusal, 2026-11-11), not yet copy-reviewed.
+ if len(text) != 147 {
+ t.Fatalf("text has %d keys, want the 139 approved plus 8", len(text))
}
for key, raw := range text {
var args []string
diff --git a/internal/grouprollaws/group.go b/internal/grouprollaws/group.go
index 78c6791b5..159425c02 100644
--- a/internal/grouprollaws/group.go
+++ b/internal/grouprollaws/group.go
@@ -8,6 +8,7 @@ import (
"errors"
"io"
"math"
+ "math/rand/v2"
"net"
"regexp"
"strconv"
@@ -17,6 +18,7 @@ import (
"unicode/utf8"
"github.com/aws/aws-sdk-go-v2/aws"
+ "github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/service/autoscaling"
astypes "github.com/aws/aws-sdk-go-v2/service/autoscaling/types"
"github.com/aws/aws-sdk-go-v2/service/ec2"
@@ -176,6 +178,57 @@ func call[T any](parent context.Context, fn func(context.Context) (T, error)) (T
return zero, grouproll.Uncertain{Key: "api"}
}
+// readCall is call for a read, retried while AWS throttles it: up to
+// throttleAttempts calls, each under call's own bound, with a jittered
+// backoff of about 1, 2 and 4 seconds between them (capped by the caller's
+// context). Only a throttling answer is retried; any other failure, and a
+// throttle on the last attempt, is call's answer as before, so the verb
+// still fails closed. Writes and box sessions never come through here: a
+// write's outcome after a failure is unknown, and retrying it is the
+// engine's decision, not the adapter's.
+func readCall[T any](parent context.Context, fn func(context.Context) (T, error)) (T, error) {
+ for attempt := 1; ; attempt++ {
+ var raw error
+ out, err := call(parent, func(ctx context.Context) (T, error) {
+ o, e := fn(ctx)
+ raw = e
+ return o, e
+ })
+ if err == nil || attempt >= throttleAttempts || parent.Err() != nil || !throttled(raw) {
+ return out, err
+ }
+ if werr := throttleWait(parent, attempt); werr != nil {
+ var zero T
+ return zero, werr
+ }
+ }
+}
+
+// throttleAttempts bounds readCall: the first call and three retries.
+const throttleAttempts = 4
+
+// throttled is the SDK's own throttle classification (error codes such as
+// Throttling, ThrottlingException, RequestLimitExceeded, SlowDown, and an
+// HTTP 429), the errors its standard retryer backs off on.
+func throttled(err error) bool {
+ return err != nil && retry.IsErrorThrottles(retry.DefaultThrottles).IsErrorThrottle(err) == aws.TrueTernary
+}
+
+// throttleWait sleeps before retry number attempt (1-based): 2^(attempt-1)
+// seconds, jittered to between half and all of it. A test replaces it.
+var throttleWait = func(ctx context.Context, attempt int) error {
+ base := time.Second << (attempt - 1)
+ d := base/2 + time.Duration(rand.Int64N(int64(base/2)+1))
+ t := time.NewTimer(d)
+ defer t.Stop()
+ select {
+ case <-ctx.Done():
+ return ctx.Err()
+ case <-t.C:
+ return nil
+ }
+}
+
// malformed is a response missing a field the script read with [] (a
// KeyError there): the call's answer is unusable, as a failed call is.
func malformed() error { return grouproll.Uncertain{Key: "api"} }
@@ -214,7 +267,7 @@ func intOf(p *int32) (int, bool) {
// Describe is the script's "group": DescribeAutoScalingGroups for the
// configured group, exactly one group or scope.
func (a *Adapter) Describe(ctx context.Context) (grouproll.GroupView, error) {
- out, err := call(ctx, func(ctx context.Context) (*autoscaling.DescribeAutoScalingGroupsOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*autoscaling.DescribeAutoScalingGroupsOutput, error) {
return a.autoscaling.DescribeAutoScalingGroups(ctx, &autoscaling.DescribeAutoScalingGroupsInput{
AutoScalingGroupNames: []string{a.c.Group},
})
@@ -269,7 +322,7 @@ func (a *Adapter) Describe(ctx context.Context) (grouproll.GroupView, error) {
// registered twice (another port) with different states is "unknown", so a
// duplicate registration cannot hide draining.
func (a *Adapter) Targets(ctx context.Context, arn string) (map[string]string, error) {
- out, err := call(ctx, func(ctx context.Context) (*elbv2.DescribeTargetHealthOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*elbv2.DescribeTargetHealthOutput, error) {
return a.elb.DescribeTargetHealth(ctx, &elbv2.DescribeTargetHealthInput{TargetGroupArn: aws.String(arn)})
})
if err != nil {
@@ -294,7 +347,7 @@ func (a *Adapter) Targets(ctx context.Context, arn string) (map[string]string, e
// Hook is the script's "hooks": exactly one configured hook, else hook.
func (a *Adapter) Hook(ctx context.Context) (grouproll.Hook, error) {
- out, err := call(ctx, func(ctx context.Context) (*autoscaling.DescribeLifecycleHooksOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*autoscaling.DescribeLifecycleHooksOutput, error) {
return a.autoscaling.DescribeLifecycleHooks(ctx, &autoscaling.DescribeLifecycleHooksInput{
AutoScalingGroupName: aws.String(a.c.Group),
LifecycleHookNames: []string{a.c.Hook},
@@ -321,7 +374,7 @@ func (a *Adapter) Hook(ctx context.Context) (grouproll.Hook, error) {
// Online is the script's "online": the member is the one Session Manager
// instance listed for its id, and its ping status is Online.
func (a *Adapter) Online(ctx context.Context, iid string) (bool, error) {
- out, err := call(ctx, func(ctx context.Context) (*ssm.DescribeInstanceInformationOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*ssm.DescribeInstanceInformationOutput, error) {
return a.ssm.DescribeInstanceInformation(ctx, &ssm.DescribeInstanceInformationInput{
Filters: []ssmtypes.InstanceInformationStringFilter{{Key: aws.String("InstanceIds"), Values: []string{iid}}},
})
@@ -360,7 +413,7 @@ func activityKind(description string) string {
// whose description names iid as a whole word, classified enter, exit or
// terminate; the rest are ignored.
func (a *Adapter) Activities(ctx context.Context, iid string) ([]grouproll.Activity, error) {
- out, err := call(ctx, func(ctx context.Context) (*autoscaling.DescribeScalingActivitiesOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*autoscaling.DescribeScalingActivitiesOutput, error) {
return a.autoscaling.DescribeScalingActivities(ctx, &autoscaling.DescribeScalingActivitiesInput{
AutoScalingGroupName: aws.String(a.c.Group),
})
@@ -391,7 +444,7 @@ func (a *Adapter) Activities(ctx context.Context, iid string) ([]grouproll.Activ
// Membership is the script's "instance" as the probe reads it: the
// member's own DescribeAutoScalingInstances row. More than one row is api.
func (a *Adapter) Membership(ctx context.Context, iid string) (grouproll.MemberRow, bool, error) {
- out, err := call(ctx, func(ctx context.Context) (*autoscaling.DescribeAutoScalingInstancesOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*autoscaling.DescribeAutoScalingInstancesOutput, error) {
return a.autoscaling.DescribeAutoScalingInstances(ctx, &autoscaling.DescribeAutoScalingInstancesInput{
InstanceIds: []string{iid},
})
@@ -430,7 +483,7 @@ func (a *Adapter) Instance(ctx context.Context, iid string) (grouproll.InstanceS
if err := requireIID(iid, "record"); err != nil {
return grouproll.InstanceState{}, err
}
- out, err := call(ctx, func(ctx context.Context) (*ec2.DescribeInstancesOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*ec2.DescribeInstancesOutput, error) {
return a.ec2.DescribeInstances(ctx, &ec2.DescribeInstancesInput{
Filters: []ec2types.Filter{{Name: aws.String("instance-id"), Values: []string{iid}}},
})
@@ -492,7 +545,7 @@ func (a *Adapter) TemplateRelease(ctx context.Context, tpl map[string]any) (stri
name, _ := tpl["LaunchTemplateName"].(string)
in.LaunchTemplateName = aws.String(name)
}
- out, err := call(ctx, func(ctx context.Context) (*ec2.DescribeLaunchTemplateVersionsOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*ec2.DescribeLaunchTemplateVersionsOutput, error) {
return a.ec2.DescribeLaunchTemplateVersions(ctx, in)
})
if err != nil {
@@ -695,7 +748,7 @@ func (a *Adapter) Terminate(ctx context.Context, iid string) (grouproll.WriteRes
// CallerIdentity is sts:GetCallerIdentity; the engine journals the UserId.
func (a *Adapter) CallerIdentity(ctx context.Context) (userID, arn string, err error) {
- out, err := call(ctx, func(ctx context.Context) (*sts.GetCallerIdentityOutput, error) {
+ out, err := readCall(ctx, func(ctx context.Context) (*sts.GetCallerIdentityOutput, error) {
return a.sts.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{})
})
if err != nil {
diff --git a/internal/grouprollaws/objects.go b/internal/grouprollaws/objects.go
index 80a880e8c..8d017a701 100644
--- a/internal/grouprollaws/objects.go
+++ b/internal/grouprollaws/objects.go
@@ -60,7 +60,7 @@ func (a *Adapter) bucketClient(ctx context.Context, bucket string) (*s3.Client,
defer a.bucketsMu.Unlock()
region, ok := a.bucketRegion[bucket]
if !ok {
- got, err := call(ctx, func(ctx context.Context) (string, error) { return headBucketRegion(ctx, a.s3, bucket) })
+ got, err := readCall(ctx, func(ctx context.Context) (string, error) { return headBucketRegion(ctx, a.s3, bucket) })
if err != nil {
var u grouproll.Uncertain
if ctx.Err() != nil || (errors.As(err, &u) && (u.Timeout || u.OutputTooLarge)) {
@@ -140,7 +140,8 @@ type object struct {
etag string
}
-// read runs fn on bucket's regional store, as one bounded provider call.
+// read runs fn on bucket's regional store, as one bounded provider read
+// (retried while S3 throttles it, readCall).
func read[T any](ctx context.Context, r readStore, fn func(context.Context, *release.S3Store) (T, error)) (T, error) {
var zero T
c, err := r.a.bucketClient(ctx, r.bucket)
@@ -148,7 +149,7 @@ func read[T any](ctx context.Context, r readStore, fn func(context.Context, *rel
return zero, err
}
store := &release.S3Store{Client: c, Bucket: r.bucket}
- return call(ctx, func(ctx context.Context) (T, error) {
+ return readCall(ctx, func(ctx context.Context) (T, error) {
out, err := fn(ctx, store)
// A 301 whose body stalled or overran the cap keeps call's
// timeout or cap answer: only a whole 301 is a wrong region.
diff --git a/internal/grouprollaws/session_test.go b/internal/grouprollaws/session_test.go
index b6be23c4f..e9885c4d6 100644
--- a/internal/grouprollaws/session_test.go
+++ b/internal/grouprollaws/session_test.go
@@ -331,12 +331,13 @@ func TestSessionPluginExitNonzero(t *testing.T) {
}
func TestSessionFrameParsed(t *testing.T) {
- // The verb's own refusal (frame code 3) is ParseFramed's remote.
+ // The verb's own refusal (frame code 3) is ParseFramed's remote_said,
+ // carrying the verb's last line (V15).
withFakePlugin(t, fakeControl{Body: statusBody, Code: "3"})
a, _ := sessionAdapter(t, "eu-west-1")
_, err := a.Run(ctx, testIID, "status", grouproll.BoxArgs{}, func(string) {})
- if k := refusalKey(t, err); k != "remote" {
- t.Fatalf("refusal %q, want remote", k)
+ if k := refusalKey(t, err); k != "remote_said" {
+ t.Fatalf("refusal %q, want remote_said", k)
}
}
diff --git a/internal/grouprollaws/throttle_test.go b/internal/grouprollaws/throttle_test.go
new file mode 100644
index 000000000..b2029f056
--- /dev/null
+++ b/internal/grouprollaws/throttle_test.go
@@ -0,0 +1,98 @@
+package grouprollaws
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+)
+
+const throttleXML = `<ErrorResponse><Error><Type>Sender</Type><Code>Throttling</Code><Message>Rate exceeded</Message></Error><RequestId>r</RequestId></ErrorResponse>`
+
+// stubThrottleWait records readCall's backoffs instead of sleeping.
+func stubThrottleWait(t *testing.T) *[]int {
+ t.Helper()
+ var waits []int
+ prev := throttleWait
+ throttleWait = func(ctx context.Context, attempt int) error {
+ waits = append(waits, attempt)
+ return ctx.Err()
+ }
+ t.Cleanup(func() { throttleWait = prev })
+ return &waits
+}
+
+// A throttled read is retried with backoff and succeeds when AWS answers
+// (the step-3 W4 refusal at the group describe); the budget is four calls,
+// after which the verb fails closed with the api answer it gave before.
+func TestReadsRetryThrottling(t *testing.T) {
+ ok := groupXML(2, 2, 3, [][2]string{{testIID, "InService"}})
+ waits := stubThrottleWait(t)
+ rec := newRecorder().onStatus("DescribeAutoScalingGroups", 400, throttleXML).
+ onStatus("DescribeAutoScalingGroups", 400, throttleXML).on("DescribeAutoScalingGroups", ok)
+ if _, err := testAdapter(t, rec).Describe(ctx); err != nil {
+ t.Fatalf("throttled twice, then answered: %v", err)
+ }
+ if n := len(rec.requests()); n != 3 || !reflect.DeepEqual(*waits, []int{1, 2}) {
+ t.Fatalf("requests %d, waits %v", n, *waits)
+ }
+
+ waits = stubThrottleWait(t)
+ rec = newRecorder().onStatus("DescribeAutoScalingGroups", 400, throttleXML)
+ _, err := testAdapter(t, rec).Describe(ctx)
+ if u := uncertainKey(t, err); u.Key != "api" || u.Timeout {
+ t.Fatalf("throttled throughout: %+v", u)
+ }
+ if n := len(rec.requests()); n != throttleAttempts || !reflect.DeepEqual(*waits, []int{1, 2, 3}) {
+ t.Fatalf("requests %d, waits %v", n, *waits)
+ }
+
+ // Any other failure is not retried.
+ waits = stubThrottleWait(t)
+ rec = newRecorder()
+ if _, err := testAdapter(t, rec).Describe(ctx); uncertainKey(t, err).Key != "api" || len(rec.requests()) != 1 || len(*waits) != 0 {
+ t.Fatalf("500: %v, %d requests, waits %v", err, len(rec.requests()), *waits)
+ }
+
+ // A write is never retried, throttled or not.
+ waits = stubThrottleWait(t)
+ rec = newRecorder().onStatus("UpdateAutoScalingGroup", 400, throttleXML)
+ if _, err := testAdapter(t, rec).SetMinimum(ctx, 1); err == nil || len(rec.requests()) != 1 || len(*waits) != 0 {
+ t.Fatalf("throttled write: %v, %d requests, waits %v", err, len(rec.requests()), *waits)
+ }
+
+ // Ctrl-C during a backoff ends the read with the context's error.
+ prev := throttleWait
+ cctx, cancel := context.WithCancel(ctx)
+ throttleWait = func(context.Context, int) error { cancel(); return context.Canceled }
+ t.Cleanup(func() { throttleWait = prev })
+ rec = newRecorder().onStatus("DescribeAutoScalingGroups", 400, throttleXML)
+ if _, err := testAdapter(t, rec).Describe(cctx); err != context.Canceled || len(rec.requests()) != 1 {
+ t.Fatalf("cancelled backoff: %v, %d requests", err, len(rec.requests()))
+ }
+}
+
+// S3's SlowDown is a throttle too: an edges or lock read is retried.
+func TestBucketReadsRetrySlowDown(t *testing.T) {
+ waits := stubThrottleWait(t)
+ rec := &s3Recorder{status: 503, body: `<Error><Code>SlowDown</Code><Message>x</Message></Error>`}
+ _, _, err := testAdapterWith(t, rec).Bucket("carlos-dev-store").Get(ctx, "control/edges/g-1.json")
+ if uncertainKey(t, err).Key != "api" || len(rec.reqs) != throttleAttempts || len(*waits) != throttleAttempts-1 {
+ t.Fatalf("SlowDown: %v, %d GETs, waits %v", err, len(rec.reqs), *waits)
+ }
+ for _, q := range rec.reqs {
+ if !strings.HasPrefix(q.URL.Host, "carlos-dev-store.s3.eu-west-1.amazonaws.com") {
+ t.Fatalf("read went to %s", q.URL.Host)
+ }
+ }
+}
+
+// The real backoff waits about 2^(n-1) seconds, jittered to half or more,
+// and ends at once when the context does.
+func TestThrottleWaitBounds(t *testing.T) {
+ cctx, cancel := context.WithCancel(ctx)
+ cancel()
+ if err := throttleWait(cctx, 3); err != context.Canceled {
+ t.Fatalf("cancelled wait = %v", err)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 61c01f0cc..5bd6fdb67 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -166,3 +166,4 @@ plan14-root-reads-fix-silent-start-kill-861.tsv 733204d61bea49fe418d8ff0f1bfa20d
plan14-root-reads-group-bucket-region.tsv 733204d61bea49fe418d8ff0f1bfa20d77bdffb1f08a216d9de92923eea22557
plan14-root-reads-w6-ingress-drain.tsv 43260792034a1a20791d14c4e4476e762b40d7bcca64257ef2e9899da6af5df0
plan14-root-reads-group-capacity-damping.tsv 0c649af234a7b89a75479e59e705307e3293a59439b7b251dd4558bd46ef2100
+plan14-root-reads-group-verb-followups.tsv 9c74b9876a13a3a3802860fe44406898c8bcbfd3bd22e8172a59a02674c3b4af
diff --git a/internal/provision/testdata/plan14-root-reads-group-verb-followups.tsv b/internal/provision/testdata/plan14-root-reads-group-verb-followups.tsv
new file mode 100644
index 000000000..af7aada8d
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-group-verb-followups.tsv
@@ -0,0 +1,11 @@
+# Census overlay group-verb-followups, written by census-propose (#369). census-ruling-group-verb-followups, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-group-verb-followups.md.
+# 3 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 9c530988d2bca9a4191d94ff750147713395b6eea9039910e42c48fb68951198 internal/grouproll/plan.go Engine.Plan legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads provider-observation.json from the operator's own 0700 state directory;rev3=census-ruling-group-verb-followups;basis=a missing or unreadable provider-observation.json is refused as observation instead of passing the read error through (same file, same read) file:Read@2300 d5af13dbf8f6c1e41ddda5a0a764e54064f7319dd61a11cee1499ad0180d5197
+@legacy 1f6ebe3fc5c4052f3e6287ed84760c0e462429f4c8a9fad8d1e9aee6e8b6e0ba internal/grouprollaws/group.go Adapter.TemplateRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads the launch template's user data from the EC2 answer (in memory, 4 MiB cap);rev3=census-ruling-group-verb-followups;basis=the DescribeLaunchTemplateVersions read goes through readCall, which retries the same request while AWS throttles it (no new read) file:ReadAll@1478 56a2ef9fac5343e9293b8756ca83d2df7eb06622bd6a5fcdfe7444b93a8ebfe2
+@legacy c3dda1ec61f3b43ea77f89972dcbb86fa8074f217b5980048e251c692c4b7750 system_group.go runSystemGroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats /etc/carlos/host.env to refuse running on a carlos box (euid 0 is refused first); routes the roll, replace, remove, cancel-drain and probe verbs to the engine after refusing missing arguments;rev3=census-ruling-group-verb-followups;basis=an empty verb (the group fallback: bare, -h, unknown verb) prints the group help first, before the root and box refusals: it reads no file, flag, environment or provider and changes nothing (Astra r1 P1); every other verb is unchanged file:Lstat@475 1594657edc9c96d5867dd5c300406e0f36eb4f4b5db7e84431c52afc768870f8
+internal/grouproll/plan.go Engine.Plan legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads provider-observation.json from the operator's own 0700 state directory;rev3=census-ruling-group-verb-followups;basis=a missing or unreadable provider-observation.json is refused as observation instead of passing the read error through (same file, same read) file:Read@2300 d5af13dbf8f6c1e41ddda5a0a764e54064f7319dd61a11cee1499ad0180d5197
+internal/grouprollaws/group.go Adapter.TemplateRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads the launch template's user data from the EC2 answer (in memory, 4 MiB cap);rev3=census-ruling-group-verb-followups;basis=the DescribeLaunchTemplateVersions read goes through readCall, which retries the same request while AWS throttles it (no new read) file:ReadAll@1478 56a2ef9fac5343e9293b8756ca83d2df7eb06622bd6a5fcdfe7444b93a8ebfe2
+system_group.go runSystemGroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats /etc/carlos/host.env to refuse running on a carlos box (euid 0 is refused first); routes the roll, replace, remove, cancel-drain and probe verbs to the engine after refusing missing arguments;rev3=census-ruling-group-verb-followups;basis=an empty verb (the group fallback: bare, -h, unknown verb) prints the group help first, before the root and box refusals: it reads no file, flag, environment or provider and changes nothing (Astra r1 P1); every other verb is unchanged file:Lstat@475 1594657edc9c96d5867dd5c300406e0f36eb4f4b5db7e84431c52afc768870f8
+@coverage . f4324baa2bd966fbeaa2ce6d1ca03a665ce52650336818480e7cbbefc7cdf356
+@coverage internal/grouproll 5ce096c6ea44070bebce2efa18e1ffa366ab7f593dfa3514d76d471fa9566daa
+@coverage internal/grouprollaws e196214c4b5801a003f21d4f0eeef483bb8b2d0dd14c83a7b711b27ab99f120b
diff --git a/system_group.go b/system_group.go
index 99ee4f914..74a68efae 100644
--- a/system_group.go
+++ b/system_group.go
@@ -110,6 +110,38 @@ func groupProbeHelp(args []string) int {
return 2
}
+// systemGroupFallback is bare `carlos system group`, its -h, and a verb it
+// does not have: the group's own help.
+func systemGroupFallback(args, _ []string) { os.Exit(runSystemGroup("", args)) }
+
+// groupVerbsHelp is the verb list groupHelp prints, in the order an
+// operator meets them.
+var groupVerbsHelp = []struct{ verb, key string }{
+ {"plan", "plan"}, {"roll", "roll"}, {"replace", "replace"}, {"remove", "remove"},
+ {"rollback", "rollback"}, {"resume", "resume"}, {"return", "return"}, {"status", "status"},
+ {"abandon", "abandon"}, {"close-lost", "close-lost"}, {"cancel-drain", "cancel_drain"},
+ {"probe", "probe_help"},
+}
+
+// groupHelp is the group's help: on stdout for -h, else on stderr with the
+// usage status, as groupProbeHelp.
+func groupHelp(args []string) int {
+ var b strings.Builder
+ b.WriteString(grouproll.Text("help_group") + "\n\n")
+ for _, v := range groupVerbsHelp {
+ fmt.Fprintf(&b, " %-13s %s\n", v.verb, grouproll.Text(v.key))
+ }
+ // role goes through the console, not the group config; its line is
+ // the one carlos system's own help prints.
+ b.WriteString(" role <region> <default|legacy>\n")
+ if len(args) == 1 && (args[0] == "-h" || args[0] == "-help" || args[0] == "--help") {
+ fmt.Fprint(groupEnv.stdout, b.String())
+ return 0
+ }
+ fmt.Fprint(groupEnv.stderr, b.String())
+ return 2
+}
+
// groupFlags are one verb's flags, as the script's argparse declares them.
type groupFlags struct {
config, attendedBy, member, sha, transaction string
@@ -281,6 +313,12 @@ func attendedBy(flagValue string) string {
// files from the environment; load the config; isolate the environment
// for its profile (before any goroutine starts); then the verb.
func runSystemGroup(verb string, args []string) int {
+ // The group's help reads nothing and changes nothing, so it prints
+ // anywhere, as root and on a box too: the CLI golden must not depend
+ // on the machine it runs on (Astra r1 P1).
+ if verb == "" {
+ return groupHelp(args)
+ }
if !groupSupported {
return groupRefused(grouproll.Refusal{Key: "windows"})
}
diff --git a/system_group_test.go b/system_group_test.go
index 35b97cde9..718b97fed 100644
--- a/system_group_test.go
+++ b/system_group_test.go
@@ -538,6 +538,46 @@ func TestCLIProbeLeaves(t *testing.T) {
}
}
+// Bare carlos system group, its -h and an unknown verb print the group's
+// help (every verb with its line), on any machine.
+func TestCLIGroupHelp(t *testing.T) {
+ h := newGroupHarness(t)
+ if rc := h.run("", "-h"); rc != 0 || h.stderr.Len() != 0 {
+ t.Fatalf("-h: rc %d stderr %q", rc, h.stderr.String())
+ }
+ out := h.stdout.String()
+ if !strings.HasPrefix(out, grouproll.Text("help_group")+"\n\n") {
+ t.Fatalf("-h: %q", out)
+ }
+ for _, v := range groupVerbsHelp {
+ if !strings.Contains(out, " "+v.verb+" ") || !strings.Contains(out, grouproll.Text(v.key)+"\n") {
+ t.Errorf("-h lacks %s: %q", v.verb, out)
+ }
+ }
+ for _, args := range [][]string{nil, {"zz-unknown"}} {
+ h = newGroupHarness(t)
+ if rc := h.run("", args...); rc != 2 || h.stdout.Len() != 0 || h.stderr.String() != out || len(h.steps) != 0 {
+ t.Errorf("%v: rc %d stderr %q", args, rc, h.stderr.String())
+ }
+ }
+ if !strings.Contains(out, " role <region> <default|legacy>\n") {
+ t.Errorf("-h lacks role: %q", out)
+ }
+ // Every registered child is in the help.
+ for _, c := range systemGroupCommand().Children {
+ if !strings.Contains(out, " "+c.Name+" ") {
+ t.Errorf("-h lacks registered %s", c.Name)
+ }
+ }
+ // Help reads and changes nothing, so it prints as root too: the CLI
+ // golden does not depend on the machine.
+ h = newGroupHarness(t)
+ groupEnv.geteuid = func() int { return 0 }
+ if rc := h.run("", "-h"); rc != 0 || h.stdout.String() != out {
+ t.Fatalf("as root: rc %d stdout %q stderr %q", rc, h.stdout.String(), h.stderr.String())
+ }
+}
+
// The registry routes system group probe's five leaves.
func TestCLIProbeRegistry(t *testing.T) {
var probe *clireg.Node
diff --git a/system_roles.go b/system_roles.go
index 7a2c9128c..e98b70831 100644
--- a/system_roles.go
+++ b/system_roles.go
@@ -145,7 +145,7 @@ func systemGroupCommand() *clireg.Node {
noHint(skipGolden(raw("cancel-drain", clireg.Operator, runSystemGroupCancelDrain), groupVerbGolden)),
systemGroupProbeCommand(),
},
- Fallback: systemRolesFallback,
+ Fallback: systemGroupFallback,
}
}
diff --git a/testdata/clireg-golden.jsonl b/testdata/clireg-golden.jsonl
index 84216a605..26ec8d6a6 100644
--- a/testdata/clireg-golden.jsonl
+++ b/testdata/clireg-golden.jsonl
@@ -819,12 +819,12 @@
{"case":"system group roll | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"}
{"case":"system group rollback | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"}
{"case":"system group status | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"}
-{"case":"system group | --help","argv":["system","group","--help"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
-{"case":"system group | --zz-unknown-flag","argv":["system","group","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
-{"case":"system group | -h","argv":["system","group","-h"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
-{"case":"system group | bare","argv":["system","group"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
-{"case":"system group | help","argv":["system","group","help"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
-{"case":"system group | zz-unknown","argv":["system","group","zz-unknown"],"exit":2,"stdout":"","stderr":"usage: carlos system <verb> [flags]\n carlos system router <verb> [flags]\n carlos system demos <status|serving on|serving off|takedown|takedown-status>\n carlos system managed-fleets <show|set --file f.json>\n carlos system antivirus <status|enable|disable|rotate-webhook-key> [flags]\n carlos system pdf status\n carlos system geoip <publish|status|off> [flags]\n carlos system seeds-floor publish --min-release <release>\n carlos system legacy-routes assign --name <name> --to <account>/<app>\n carlos system lifetimes cutover [--no-wait]\n carlos system hosts-used status\n carlos system named-units install <file>\n carlos system box role <box> <default|legacy|platform>\n carlos system box publish-record\n carlos system group role <region> <default|legacy>\n carlos system host-env <write|seed> --deployment <name> --region <code> [flags]\n\nThe platform's own binary (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n update promote a platform release to a channel; every box on it rolls itself\n status every box: platform, channel, running build, channel target, last apply outcome\n rollback point a channel back at the release before this one\n cancel-activation\n release a channel's activation reservation that was never\n published, so promote and rollback work again\n apply (root oneshot behind carlos-system-update.service; not for operators)\n layout migrate|revert|status: move every instance into its own directory\n and namespace, or back; see carlos system layout help\n seeds-floor publish --min-release <release>\n the first release whose boxes can place a seed, such as v0.27.0\n legacy-routes assign --name <name> --to <account>/<app>\n say which account and app the routes an operator filed by hand belong to\n lifetimes cutover [--no-wait]\n switch a console without host claims onto instance lifetimes,\n once, after the old console has stopped. Waits until they are on\n hosts-used status\n the hostname history: its mode, how many hostnames it has\n recorded, its closed fleets and its floor\n box role <box> <default|legacy|platform>\n whether new instances may be placed on a box. A legacy or\n platform box keeps the instances it has and takes no new ones\n group role <region> <default|legacy>\n the same for every box a region's group has enrolled, and for\n every box it enrolls later\n box publish-record\n run on a box as the agent user, with systemd-run -p User=carlos:\n publish its AWS-signed identity record to the deployment\n bucket, once. It never replaces or deletes a record\n\nA box a region's group launches (region HA):\n\n host-env write build host.env from the deployment's parameters (root)\n host-env seed copy a box's host.env into the deployment's parameters\n install-channel install the release this box's channel names (root)\n\nDeployment-wide settings (CARLOS_STORE_OPERATORS):\n\n pdf status\n\n antivirus status is object scanning wired, switched on, and answering?\n Reports wiring and policy separately, because they fail\n separately.\n antivirus enable turn object scanning on for this deployment. Refused if\n no engine is wired: a record claiming enabled with\n nothing behind it would report health where no scan can\n run.\n antivirus disable turn it off. Takes effect on the next tick — no restart,\n which is the point of the switch living in a record\n rather than in the unit file.\n antivirus rotate-webhook-key\n deliver the current master-derived callback secret to\n every scanning-enabled app, one bounded batch at a\n time. Skips apps already on that key, restarts the\n rest, and is safe to run again.\n\nPlatform GeoIP (ops account owners and CARLOS_SYSTEM_OPERATORS):\n\n geoip publish <file.mmdb> publish a MaxMind-format database (DB-IP Lite or\n GeoLite2) to every edge. -force skips the shrink check\n geoip status the published database, and whether every box\n strips forged headers and has it\n geoip off stop: edges drop the database and send no geo headers\n\nEnabling antivirus scans nothing by itself: a member still requests scanning\nfor their app, and an operator still grants it per store.\n\nThe platform is not an app: the console is updated with carlos deploy --app console.\n"}
+{"case":"system group | --help","argv":["system","group","--help"],"exit":0,"stdout":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n","stderr":""}
+{"case":"system group | --zz-unknown-flag","argv":["system","group","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n"}
+{"case":"system group | -h","argv":["system","group","-h"],"exit":0,"stdout":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n","stderr":""}
+{"case":"system group | bare","argv":["system","group"],"exit":2,"stdout":"","stderr":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n"}
+{"case":"system group | help","argv":["system","group","help"],"exit":2,"stdout":"","stderr":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n"}
+{"case":"system group | zz-unknown","argv":["system","group","zz-unknown"],"exit":2,"stdout":"","stderr":"Attended maintenance of one member of a region's Auto Scaling group: roll it to a new release, replace it, or remove it, one transaction at a time. Run it from the deployment's operator account.\n\n plan Read readiness and list refusals. It changes no group or box state.\n roll Roll one member to the named artifact.\n replace Drain one member, terminate it and let the group launch its replacement.\n remove Drain one member and terminate it without a replacement (scale-in).\n rollback Restore this transaction's old artifact while in Standby.\n resume Resume from the durable journal and current provider state.\n return Return an already restarted and admitted member.\n status Read the saved journal without contacting AWS.\n abandon Close a transaction that has no group write intent.\n close-lost Close an active transaction after confirming that its member is gone. Record failure.\n cancel-drain End a failed drain of this member: drain --cancel on the box, which lifts the fence.\n probe Probe an unchanged member through Auto Scaling Standby under the group lock.\n role <region> <default|legacy>\n"}
{"case":"system group-maintenance | --zz-unknown-flag","argv":["system","group-maintenance","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"Usage: carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback|drain|fence-clear}\nRoot only, on a group member. Use through the attended Session Manager operator.\n prepare --sha256 <digest>\n Verify the configured signed pointer, cache its artifact and write a request.\n Check local restart configuration. No staging, repoint or restart.\n Makes cloud GETs only when attended and operator-invoked, never on a timer.\n The total prepare timeout is five minutes.\n previous_result reports the last outcome for this exact promotion.\n An applied, rolled-back or rollback-failed result leaves request_written false.\n apply Run the normal permit-gated apply using the checked local host.env.\n On a group member use carlos system group-maintenance apply, never bare\n carlos system apply.\n rollback Restore this member's previous artifact using an explicit rollback permit.\n Use the same transaction and old/new digests after revoking the apply permit.\n Local only. A consumed rollback permit cannot be replayed.\n permit Read at most 4096 bytes of permit JSON from stdin and install it.\n revoke Remove the permit. Keep all consumed-action records.\n drain --peers=<box,...> <transaction>\n Drain this member for a planned handover: withdraw it and wait for every\n listed box, and any other box with an edges file, to acknowledge, install\n the start fence for the transaction, then move every awake host away and\n drain the connections. --peers lists every other box the operator's\n floor counted (empty when it counted none). Print the agent's JSON\n report. Exit 0 only when the report's result is ok.\n drain --cancel <transaction>\n End the drain of the transaction and remove its start fence.\n fence-clear <transaction>\n Remove the start fence of the transaction. Another transaction's fence\n is refused.\n status Print one v1 JSON object, at most 8192 bytes. Make one local health GET.\nStatus includes edge.started_at in UTC at second precision, derived from kernel boot time and clock ticks.\nIt is a lower bound, up to two seconds early; compare with a generation at least two seconds later and check the edge identity has not changed.\nClock errors are in edge.started_at_error; edge.error describes the process.\naccepted means the guard's validators accept this permit now; it is not readiness: check the action and its consumed flag too.\nStatus is local evidence, not proof of fresh admission or role publication.\nPresent and accepted is still not authorization for the operator.\nThe cloud facts are the operator's.\nThe operator must also check the published edges object for this process.\nExit codes: 0 success or help, 1 refused or failed, 2 invalid arguments.\nErrors go to stderr, prefixed with \"group-maintenance:\". A held apply lock\nrefuses the command. Unknown status fields are null or state \"unknown\".\n"}
{"case":"system group-maintenance | -h","argv":["system","group-maintenance","-h"],"exit":0,"stdout":"Usage: carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback|drain|fence-clear}\nRoot only, on a group member. Use through the attended Session Manager operator.\n prepare --sha256 <digest>\n Verify the configured signed pointer, cache its artifact and write a request.\n Check local restart configuration. No staging, repoint or restart.\n Makes cloud GETs only when attended and operator-invoked, never on a timer.\n The total prepare timeout is five minutes.\n previous_result reports the last outcome for this exact promotion.\n An applied, rolled-back or rollback-failed result leaves request_written false.\n apply Run the normal permit-gated apply using the checked local host.env.\n On a group member use carlos system group-maintenance apply, never bare\n carlos system apply.\n rollback Restore this member's previous artifact using an explicit rollback permit.\n Use the same transaction and old/new digests after revoking the apply permit.\n Local only. A consumed rollback permit cannot be replayed.\n permit Read at most 4096 bytes of permit JSON from stdin and install it.\n revoke Remove the permit. Keep all consumed-action records.\n drain --peers=<box,...> <transaction>\n Drain this member for a planned handover: withdraw it and wait for every\n listed box, and any other box with an edges file, to acknowledge, install\n the start fence for the transaction, then move every awake host away and\n drain the connections. --peers lists every other box the operator's\n floor counted (empty when it counted none). Print the agent's JSON\n report. Exit 0 only when the report's result is ok.\n drain --cancel <transaction>\n End the drain of the transaction and remove its start fence.\n fence-clear <transaction>\n Remove the start fence of the transaction. Another transaction's fence\n is refused.\n status Print one v1 JSON object, at most 8192 bytes. Make one local health GET.\nStatus includes edge.started_at in UTC at second precision, derived from kernel boot time and clock ticks.\nIt is a lower bound, up to two seconds early; compare with a generation at least two seconds later and check the edge identity has not changed.\nClock errors are in edge.started_at_error; edge.error describes the process.\naccepted means the guard's validators accept this permit now; it is not readiness: check the action and its consumed flag too.\nStatus is local evidence, not proof of fresh admission or role publication.\nPresent and accepted is still not authorization for the operator.\nThe cloud facts are the operator's.\nThe operator must also check the published edges object for this process.\nExit codes: 0 success or help, 1 refused or failed, 2 invalid arguments.\nErrors go to stderr, prefixed with \"group-maintenance:\". A held apply lock\nrefuses the command. Unknown status fields are null or state \"unknown\".\n","stderr":""}
{"case":"system guard-arm | --zz-unknown-flag","argv":["system","guard-arm","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nUsage of system guard-arm:\n -console string\n \t\n -enrollment string\n \t\n -identity string\n \t\n -policy string\n \t\n"}