carlos system group: replace, remove and cancel-drain
The three leaves go through runSystemGroup. replace and remove take --member and an optional --transaction, refused as record when the box verbs could not take it; cancel-drain needs both. Parity rows and parity-doc updated; the census re-proposed with Engine.Depart (the same Lstat and Create as Engine.Roll) and the changed runSystemGroup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 files changed,
+69
−17
docs/parity.md+1 −1docs/superpowers/notes/census-proposal-group-roll-verb.md+3 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv+7 −5parity/cli.tsv+3 −0parity/parity.tsv+1 −1system_group.go+23 −7system_group_test.go+24 −0system_roles.go+3 −0testdata/clireg-golden.jsonl+3 −0
Intent
Attributed to this commit: 3.79 g CO₂e (474,501 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on group-roll-verb, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/parity.md b/docs/parity.md| index 09f474d93..eedba86fc 100644 |
| --- a/docs/parity.md |
| +++ b/docs/parity.md |
| @@ -409,7 +409,7 @@ Discussion #742. |
| | op-system-geoip | operator | `system geoip publish`<br>`system geoip status`<br>`system geoip off` | | The platform GeoIP database. | |
| | op-system-cutovers | operator | `system seeds-floor publish`<br>`system legacy-routes assign`<br>`system lifetimes cutover`<br>`system hosts-used status` | | One-off cutovers and floors. | |
| | op-system-roles | operator | `system box role`<br>`system group role` | | Box and group roles. | |
| -| op-system-group-roll | operator | `system group plan`<br>`system group status`<br>`system group roll`<br>`system group resume`<br>`system group rollback`<br>`system group return`<br>`system group abandon`<br>`system group close-lost` | | Group maintenance from an operator machine. | |
| +| op-system-group-roll | operator | `system group plan`<br>`system group status`<br>`system group roll`<br>`system group resume`<br>`system group rollback`<br>`system group return`<br>`system group abandon`<br>`system group close-lost`<br>`system group replace`<br>`system group remove`<br>`system group cancel-drain` | | Group maintenance from an operator machine. | |
| | op-system-demos | operator | `system demos status`<br>`system demos serving`<br>`system demos takedown`<br>`system demos takedown-status`<br>`system demos reports`<br>`system demos reports resolve` | | Demo serving, takedowns and reports. | |
| | op-system-managed-fleets | operator | `system managed-fleets show`<br>`system managed-fleets set` | | The managed-fleet catalog. | |
diff --git a/docs/superpowers/notes/census-proposal-group-roll-verb.md b/docs/superpowers/notes/census-proposal-group-roll-verb.md| index 61f4ca276..e5e6eaf8b 100644 |
| --- a/docs/superpowers/notes/census-proposal-group-roll-verb.md |
| +++ b/docs/superpowers/notes/census-proposal-group-roll-verb.md |
| @@ -1,6 +1,6 @@ |
| # Census approval: group-roll-verb |
| -Ruling `census-ruling-group-roll-verb`. The independent reviewer approves or rejects every change below, 22 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| +Ruling `census-ruling-group-roll-verb`. The independent reviewer approves or rejects every change below, 23 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| Envelopes re-pinned: `.`, `internal/grouproll`, `internal/grouprollaws`, `internal/release`. |
| @@ -9,6 +9,7 @@ Review: a model from the other family than the author reads the branch's diff ag |
| New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| - new `internal/grouproll/config.go:LoadConfig`: reads +file:ReadFile; written legacy, accepted-legacy, frozen |
| +- new `internal/grouproll/depart.go:Engine.Depart`: reads +file:Create, +file:Lstat; written legacy, accepted-legacy, frozen |
| - new `internal/grouproll/engine.go:Engine.blocked`: reads +file:Lstat; written legacy, accepted-legacy, frozen |
| - new `internal/grouproll/engine.go:Engine.preflight`: reads +file:Read; written legacy, accepted-legacy, frozen |
| - new `internal/grouproll/journal.go:Journal.read`: reads +file:ReadAll; written legacy, accepted-legacy, frozen |
| @@ -31,6 +32,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - new `internal/grouprollaws/transport.go:boundedBody.Read`: reads +file:Read ×2; written legacy, accepted-legacy, frozen |
| - new `system_group.go:runSystemGroup`: reads +file:Lstat; written legacy, accepted-legacy, frozen |
| -Seal: `8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6` → `2579fa41b5ffb428ec177525ecba843e03772390783499ccd3b9933e6e7a2cce`. |
| +Seal: `8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6` → `430e9b4958b72e1498b118b6b8cd16514534f0766ca6392f27c141c227076e7b`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 6f1ec6ab1..49e1b0539 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -146,4 +146,4 @@ plan14-root-reads-security-review-mitigations.tsv a6f3f9eec4aac5ea88f20d0e52eaa0 |
| plan14-root-reads-cli-registry-words.tsv 8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6 |
| plan14-root-reads-billing-dashboard-1.tsv 8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6 |
| plan14-root-reads-billing-dash-3-cost.tsv 8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6 |
| -plan14-root-reads-group-roll-verb.tsv 2579fa41b5ffb428ec177525ecba843e03772390783499ccd3b9933e6e7a2cce |
| +plan14-root-reads-group-roll-verb.tsv 430e9b4958b72e1498b118b6b8cd16514534f0766ca6392f27c141c227076e7b |
diff --git a/internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv b/internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv| index 84bb5e3c9..4fd93a99d 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-group-roll-verb.tsv |
| @@ -1,7 +1,8 @@ |
| # Census overlay group-roll-verb, written by census-propose (#369). census-ruling-group-roll-verb, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-group-roll-verb.md. |
| # 0 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| -# 22 new dispositions: 0 reads re-frozen at their disposition with the claim, 22 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +# 23 new dispositions: 0 reads re-frozen at their disposition with the claim, 23 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| @legacy 4777f6d8b9e2da6def3258060eaab9340548a61f595e62e67e410df1cd040fd5 internal/grouproll/config.go LoadConfig legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads the operator's group config file named by --config (operator CLI only; refuses root) file:ReadFile@60 104fe171b8ce675aec5b764f43b1151bc9e9fba27d47c11b51b0bc7ea4065661 |
| +@legacy 1031512d2c0d690dbb2d3a9a96358b25efbb7f443876a2b5eef38c4fe92c50de internal/grouproll/depart.go Engine.Depart legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats a chosen replace or remove transaction's journal name in the operator's own 0700 state directory (an existing one refuses before any call), then creates the journal through State.Create (O_NOFOLLOW, 0600); the same reads as Engine.Roll file:Create@803,file:Lstat@529 c66f4bc96c6ffbb424a847297a8179867fac14442ae104ba5fd9e3ab42fed4cd |
| @legacy 9a38d288a899bddbd997d70ef2d5f1c710f0cda9f7c2282e68653e49800a9e99 internal/grouproll/engine.go Engine.blocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats provider-divergence.json in the operator's own 0700 state directory (no symlink follow); any answer but not-found refuses as a damaged record file:Lstat@54 5eab2f9c41b12a03746b294a25a18a7fa5c4d6abc2196b59f05ba055daca0583 |
| @legacy 5c4850672a60472a3ecde4bd0975d4f9f49986b4a062564bd3a1d02cf53f84a2 internal/grouproll/engine.go Engine.preflight legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads provider-observation.json from the operator's own 0700 state directory file:Read@713 20d6aa0e018217e8354c2f0dcf8ff82db2701b76ab22e669ccb692d714ccce7a |
| @legacy bddcf0d42f620aeb6ae7c83250f0018e7b06955458196f0495039a1283c72e42 internal/grouproll/journal.go Journal.read legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads a format 2 journal from the operator's own 0700 state directory, capped at 64 MiB file:ReadAll@57 adb440d005959966ae0182557065f55ad8f4c3d223828f9ac290bda6e584e87f |
| @@ -22,8 +23,9 @@ |
| @legacy 04fe12d1b6361d680ee74f64c9aaab1a3861f158be69c2e60aeecb944c1912da internal/grouprollaws/session.go newNonce legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads crypto/rand for the frame nonce file:Read@49 7bba200ea8c254001d09c73841b2b454d95ea5015fb75840187c4612f28edb6e |
| @legacy 4dc65f2a87ac20b4bbfb3b57bcdcd630e5e648ddee3571ac78981f4a76248fb1 internal/grouprollaws/transport.go boundBody.HandleDeserialize legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads an AWS API answer body under the 4 MiB cap file:ReadAll@436 020d98263efa2c56f212b20f4d3e3d9497ebc1a86d737c0ffc481cb1c48d38e8 |
| @legacy 50ca60690b026dffe9bfdce05939612f8ea2fc96361639106943a5756e354601 internal/grouprollaws/transport.go boundedBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads an AWS API answer body under the 4 MiB cap and the read timeout file:Read@22,file:Read@448 7ff90cef635efcf75d046d9113cb6a0dcddd8dfb3570c73984bc5565b637e872 |
| -@legacy c307c31f57453dd5b80d525e90eec251923afbdd09d37785575d3ece702cedc6 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 verbs to the engine after refusing missing arguments file:Lstat@245 5ae37b736d72a8f6c04fcc5e04750d4ec59fc9f69cbf2c5aaa3c9ac72dbf2330 |
| +@legacy a27e903ddd9b191f27e9501f35e586a5b6abb8c4a8c622ee34ffe070ba12a132 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 and cancel-drain verbs to the engine after refusing missing arguments file:Lstat@245 4582ac431a27dcd463bb78496dad6311dd9c487b75dfc759d067c286bb10d79c |
| internal/grouproll/config.go LoadConfig legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads the operator's group config file named by --config (operator CLI only; refuses root) file:ReadFile@60 104fe171b8ce675aec5b764f43b1151bc9e9fba27d47c11b51b0bc7ea4065661 |
| +internal/grouproll/depart.go Engine.Depart legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats a chosen replace or remove transaction's journal name in the operator's own 0700 state directory (an existing one refuses before any call), then creates the journal through State.Create (O_NOFOLLOW, 0600); the same reads as Engine.Roll file:Create@803,file:Lstat@529 c66f4bc96c6ffbb424a847297a8179867fac14442ae104ba5fd9e3ab42fed4cd |
| internal/grouproll/engine.go Engine.blocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=lstats provider-divergence.json in the operator's own 0700 state directory (no symlink follow); any answer but not-found refuses as a damaged record file:Lstat@54 5eab2f9c41b12a03746b294a25a18a7fa5c4d6abc2196b59f05ba055daca0583 |
| internal/grouproll/engine.go Engine.preflight legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads provider-observation.json from the operator's own 0700 state directory file:Read@713 20d6aa0e018217e8354c2f0dcf8ff82db2701b76ab22e669ccb692d714ccce7a |
| internal/grouproll/journal.go Journal.read legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads a format 2 journal from the operator's own 0700 state directory, capped at 64 MiB file:ReadAll@57 adb440d005959966ae0182557065f55ad8f4c3d223828f9ac290bda6e584e87f |
| @@ -44,8 +46,8 @@ internal/grouprollaws/pty_unix.go runVersion legacy accepted-legacy accepted-leg |
| internal/grouprollaws/session.go newNonce legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads crypto/rand for the frame nonce file:Read@49 7bba200ea8c254001d09c73841b2b454d95ea5015fb75840187c4612f28edb6e |
| internal/grouprollaws/transport.go boundBody.HandleDeserialize legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads an AWS API answer body under the 4 MiB cap file:ReadAll@436 020d98263efa2c56f212b20f4d3e3d9497ebc1a86d737c0ffc481cb1c48d38e8 |
| internal/grouprollaws/transport.go boundedBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-group-roll-verb;basis=reads an AWS API answer body under the 4 MiB cap and the read timeout file:Read@22,file:Read@448 7ff90cef635efcf75d046d9113cb6a0dcddd8dfb3570c73984bc5565b637e872 |
| -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 verbs to the engine after refusing missing arguments file:Lstat@245 5ae37b736d72a8f6c04fcc5e04750d4ec59fc9f69cbf2c5aaa3c9ac72dbf2330 |
| -@coverage . d2b3e214d46199707d7f13503cff9be94bb0da41638983a350ec51a6de81d91c |
| -@coverage internal/grouproll 57dba69c114c9f4a7ba03c154c42c5a7e30edf590676f28c9b6b54e36dc22650 |
| +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 and cancel-drain verbs to the engine after refusing missing arguments file:Lstat@245 4582ac431a27dcd463bb78496dad6311dd9c487b75dfc759d067c286bb10d79c |
| +@coverage . 324f3e9b1718abb0fe1f07c31f977e27ae50dc32a8c43e8977e636ba1793992a |
| +@coverage internal/grouproll 57beceed675c5d836f5e6115a8fa2e109fddf51ce2d9fcaf441d4e2eb9973ffb |
| @coverage internal/grouprollaws d9bc632b24975cd6e6434b0c23439871a68e4b4659041e6e110ba8b8b5e96ffc |
| @coverage internal/release e8d4983a8b37969c7d4ad9b99facf8332113f12f69c640b0b9624901184c9e54 |
diff --git a/parity/cli.tsv b/parity/cli.tsv| index e71ddec3e..b9ddb0484 100644 |
| --- a/parity/cli.tsv |
| +++ b/parity/cli.tsv |
| @@ -250,8 +250,11 @@ system geoip off operator - - - - - |
| system geoip publish operator - - - - - |
| system geoip status operator - - - - - |
| system group abandon operator - - - - - |
| +system group cancel-drain operator - - - - - |
| system group close-lost operator - - - - - |
| system group plan operator - - - - - |
| +system group remove operator - - - - - |
| +system group replace operator - - - - - |
| system group resume operator - - - - - |
| system group return operator - - - - - |
| system group role operator - - - - - |
diff --git a/parity/parity.tsv b/parity/parity.tsv| index 8d553a766..6f96e2f3d 100644 |
| --- a/parity/parity.tsv |
| +++ b/parity/parity.tsv |
| @@ -210,7 +210,7 @@ op-system-layout operator operator system layout status ; system layout migrate |
| op-system-geoip operator operator system geoip publish ; system geoip status ; system geoip off The platform GeoIP database. |
| op-system-cutovers operator operator system seeds-floor publish ; system legacy-routes assign ; system lifetimes cutover ; system hosts-used status One-off cutovers and floors. |
| op-system-roles operator operator system box role ; system group role Box and group roles. |
| -op-system-group-roll operator operator system group plan ; system group status ; system group roll ; system group resume ; system group rollback ; system group return ; system group abandon ; system group close-lost Group maintenance from an operator machine. |
| +op-system-group-roll operator operator system group plan ; system group status ; system group roll ; system group resume ; system group rollback ; system group return ; system group abandon ; system group close-lost ; system group replace ; system group remove ; system group cancel-drain Group maintenance from an operator machine. |
| op-system-demos operator operator system demos status ; system demos serving ; system demos takedown ; system demos takedown-status ; system demos reports ; system demos reports resolve Demo serving, takedowns and reports. |
| op-system-managed-fleets operator operator system managed-fleets show ; system managed-fleets set The managed-fleet catalog. |
diff --git a/system_group.go b/system_group.go| index c7059f8c2..9c3db0711 100644 |
| --- a/system_group.go |
| +++ b/system_group.go |
| @@ -20,7 +20,7 @@ import ( |
| ) |
| // carlos system group plan|status|roll|resume|rollback|return|abandon| |
| -// close-lost (group roll verb spec §3-§4): the |
| +// close-lost|replace|remove|cancel-drain (group roll verb spec §3-§4): the |
| // script scripts/region-group-roll.py's main, ported. It runs on an |
| // operator machine as the deployment's operator account, takes flags only, |
| // and works from the group config file alone: it never opens a console |
| @@ -77,6 +77,11 @@ func runSystemGroupRollback(args []string) { os.Exit(runSystemGroup("rollback", |
| func runSystemGroupReturn(args []string) { os.Exit(runSystemGroup("return", args)) } |
| func runSystemGroupAbandon(args []string) { os.Exit(runSystemGroup("abandon", args)) } |
| func runSystemGroupCloseLost(args []string) { os.Exit(runSystemGroup("close-lost", args)) } |
| +func runSystemGroupReplace(args []string) { os.Exit(runSystemGroup("replace", args)) } |
| +func runSystemGroupRemove(args []string) { os.Exit(runSystemGroup("remove", args)) } |
| +func runSystemGroupCancelDrain(args []string) { |
| + os.Exit(runSystemGroup("cancel-drain", args)) |
| +} |
| // groupFlags are one verb's flags, as the script's argparse declares them. |
| type groupFlags struct { |
| @@ -116,14 +121,18 @@ func parseGroupFlags(verb string, args []string) (f groupFlags, rc int, ok bool) |
| fs := flag.NewFlagSet("carlos system group "+verb, flag.ContinueOnError) |
| var out bytes.Buffer |
| fs.SetOutput(&out) |
| + help := verb |
| + if verb == "cancel-drain" { |
| + help = "cancel_drain" |
| + } |
| fs.Usage = func() { |
| - fmt.Fprintln(&out, grouproll.Text(verb)) |
| + fmt.Fprintln(&out, grouproll.Text(help)) |
| fs.PrintDefaults() |
| } |
| fs.StringVar(&f.config, "config", "", grouproll.Text("config")) |
| fs.StringVar(&f.attendedBy, "attended-by", "", grouproll.Text("attended")) |
| switch verb { |
| - case "plan", "roll", "rollback": |
| + case "plan", "roll", "rollback", "replace", "remove", "cancel-drain": |
| fs.StringVar(&f.member, "member", "", grouproll.Text("member")) |
| } |
| switch verb { |
| @@ -133,7 +142,9 @@ func parseGroupFlags(verb string, args []string) (f groupFlags, rc int, ok bool) |
| switch verb { |
| case "roll": |
| fs.StringVar(&f.transaction, "transaction", "", grouproll.Text("roll_transaction")) |
| - case "rollback", "resume", "status", "return", "abandon", "close-lost": |
| + case "replace", "remove": |
| + fs.StringVar(&f.transaction, "transaction", "", grouproll.Text("depart_transaction")) |
| + case "rollback", "resume", "status", "return", "abandon", "close-lost", "cancel-drain": |
| fs.StringVar(&f.transaction, "transaction", "", grouproll.Text("transaction")) |
| } |
| if err := fs.Parse(args); err != nil { |
| @@ -163,12 +174,13 @@ func parseGroupFlags(verb string, args []string) (f groupFlags, rc int, ok bool) |
| // first), and an empty member, artifact or transaction where the verb |
| // needs one (argparse's required arguments). |
| func checkGroupArgs(verb string, f groupFlags) error { |
| - if verb == "roll" && f.transactionSet && (!grouproll.TX.MatchString(f.transaction) || |
| + chosen := verb == "roll" || verb == "replace" || verb == "remove" |
| + if chosen && f.transactionSet && (!grouproll.TX.MatchString(f.transaction) || |
| strings.HasPrefix(f.transaction, "probe-") || strings.HasPrefix(f.transaction, "-")) { |
| return grouproll.Refusal{Key: "record"} |
| } |
| switch verb { |
| - case "plan", "roll", "rollback": |
| + case "plan", "roll", "rollback", "replace", "remove", "cancel-drain": |
| if f.member == "" { |
| return grouproll.Refusal{Key: "config_invalid"} |
| } |
| @@ -180,7 +192,7 @@ func checkGroupArgs(verb string, f groupFlags) error { |
| } |
| } |
| switch verb { |
| - case "rollback", "resume", "status", "return", "abandon", "close-lost": |
| + case "rollback", "resume", "status", "return", "abandon", "close-lost", "cancel-drain": |
| if f.transaction == "" { |
| return grouproll.Refusal{Key: "record"} |
| } |
| @@ -277,6 +289,10 @@ func runSystemGroup(verb string, args []string) int { |
| err = e.Abandon(ctx, f.transaction) |
| case "close-lost": |
| err = e.CloseLost(ctx, f.transaction) |
| + case "replace", "remove": |
| + err = e.Depart(ctx, f.member, verb, f.transaction) |
| + case "cancel-drain": |
| + err = e.CancelDrain(ctx, f.member, f.transaction) |
| default: |
| err = grouproll.Refusal{Key: "unsupported"} |
| } |
diff --git a/system_group_test.go b/system_group_test.go| index 3a225982a..890d13e9e 100644 |
| --- a/system_group_test.go |
| +++ b/system_group_test.go |
| @@ -315,6 +315,14 @@ func TestCLIGroupLeaves(t *testing.T) { |
| {"roll", join(member, sha, []string{"--transaction", "probe-x"}), "record"}, |
| {"roll", join(member, sha, []string{"--transaction", "../escape"}), "record"}, |
| {"roll", join(member, sha, []string{"--transaction", strings.Repeat("x", 81)}), "record"}, |
| + // replace, remove and cancel-drain (DepartArgvTests.test_transaction_ids). |
| + {"replace", nil, "config_invalid"}, |
| + {"remove", tx, "config_invalid"}, |
| + {"replace", join(member, []string{"--transaction", "-leading"}), "record"}, |
| + {"replace", join(member, []string{"--transaction=probe-x"}), "record"}, |
| + {"remove", join(member, []string{"--transaction", ""}), "record"}, |
| + {"cancel-drain", tx, "config_invalid"}, |
| + {"cancel-drain", member, "record"}, |
| } |
| for _, c := range refusals { |
| h := newGroupHarness(t) |
| @@ -331,6 +339,7 @@ func TestCLIGroupLeaves(t *testing.T) { |
| for verb, args := range map[string][]string{ |
| "roll": join(member, sha), "resume": tx, "rollback": join(member, tx), |
| "return": tx, "abandon": tx, "close-lost": tx, |
| + "replace": member, "remove": join(member, tx), "cancel-drain": join(member, tx), |
| } { |
| h := newGroupHarness(t) |
| state(h) |
| @@ -351,6 +360,21 @@ func TestCLIGroupLeaves(t *testing.T) { |
| !strings.Contains(h.stdout.String(), "-transaction") || !strings.Contains(h.stdout.String(), "-to-sha256") { |
| t.Fatalf("help: rc %d %q", rc, h.stdout.String()) |
| } |
| + for verb, key := range map[string]string{"replace": "replace", "remove": "remove", "cancel-drain": "cancel_drain"} { |
| + h := newGroupHarness(t) |
| + out := "" |
| + if rc := h.run(verb, "-h"); rc == 0 { |
| + out = h.stdout.String() |
| + } |
| + if !strings.Contains(out, grouproll.Text(key)) || !strings.Contains(out, "-member") || |
| + !strings.Contains(out, "-transaction") || strings.Contains(out, "-to-sha256") { |
| + t.Errorf("%s help: %q", verb, out) |
| + } |
| + } |
| + h = newGroupHarness(t) |
| + if rc := h.run("replace", "-h"); rc != 0 || !strings.Contains(h.stdout.String(), grouproll.Text("depart_transaction")) { |
| + t.Fatalf("replace help: %q", h.stdout.String()) |
| + } |
| } |
| // test_tty_operator_identity_is_recorded: with no --attended-by, the |
diff --git a/system_roles.go b/system_roles.go| index e360d8d22..eb0dd66f1 100644 |
| --- a/system_roles.go |
| +++ b/system_roles.go |
| @@ -140,6 +140,9 @@ func systemGroupCommand() *clireg.Node { |
| noHint(skipGolden(raw("return", clireg.Operator, runSystemGroupReturn), groupVerbGolden)), |
| noHint(skipGolden(raw("abandon", clireg.Operator, runSystemGroupAbandon), groupVerbGolden)), |
| noHint(skipGolden(raw("close-lost", clireg.Operator, runSystemGroupCloseLost), groupVerbGolden)), |
| + noHint(skipGolden(raw("replace", clireg.Operator, runSystemGroupReplace), groupVerbGolden)), |
| + noHint(skipGolden(raw("remove", clireg.Operator, runSystemGroupRemove), groupVerbGolden)), |
| + noHint(skipGolden(raw("cancel-drain", clireg.Operator, runSystemGroupCancelDrain), groupVerbGolden)), |
| }, |
| Fallback: systemRolesFallback, |
| } |
diff --git a/testdata/clireg-golden.jsonl b/testdata/clireg-golden.jsonl| index 3238ee418..e93d9f294 100644 |
| --- a/testdata/clireg-golden.jsonl |
| +++ b/testdata/clireg-golden.jsonl |
| @@ -804,8 +804,11 @@ |
| {"case":"system geoip | help","argv":["system","geoip","help"],"exit":2,"stdout":"","stderr":"system geoip: unknown verb \"help\"\n\nusage: 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 geoip | zz-unknown","argv":["system","geoip","zz-unknown"],"exit":2,"stdout":"","stderr":"system geoip: unknown verb \"zz-unknown\"\n\nusage: 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 abandon | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| +{"case":"system group cancel-drain | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| {"case":"system group close-lost | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| {"case":"system group plan | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| +{"case":"system group remove | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| +{"case":"system group replace | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| {"case":"system group resume | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| {"case":"system group return | skipped","skipped":"refuses root and carlos boxes before it reads its arguments, -h included"} |
| {"case":"system group role x y --zz z | extra","argv":["system","group","role","x","y","--zz","z"],"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"} |