instance policy: apply the approved copy of plans 1 to 3 (Luna pass, approved by delegation, PM-1)
Every in-scope string of the three instance policy decks, as the Luna pass of 2026-10-26 returned it (docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md), applied verbatim: door and CLI strings lower case after a full stop, success lines say what was set, the alert names the account id and the whole-list fix, root's claims detail no longer repeats the state word, the status --layout REASON cell prints "-" for empty, and the size footnote and after-change line state the memory rule (ruling 12). approved_instance_policy_copy_test.go pins all 123 approved strings through docs/superpowers/plans/2026-10-21-instance-policy-copy.json, and TestMovesLegacyExemptionsAreLegacy now counts them as approved elsewhere (IP1-40 answers main's create door in apicli.go). Approved-copy records changed by the instance-policy Luna pass (this branch added the commands, flags and columns they describe): - zdd.apps.usage-line: `show` added (IP1-56) - zdd.apps-set.nothing: --egress-allow and --size added (IP1-57) - zdd.list.header: the EGRESS column (IP2-02) - zdd.apps-set.usage: the synopsis lists --egress-allow and --size (GAP-2) - zdd.apps-set.flag-app: "app whose swap or instance policy to set" (GAP-3) - settings.cli.set-usage: --size added; an empty value clears an update setting (GAP-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 files changed,
+343
−118
approved_instance_policy_copy_test.go+83 −0approved_moves_copy_test.go+5 −0apps.go+1 −1apps_policy.go+21 −22apps_policy_test.go+6 −6apps_swap.go+2 −2docs/superpowers/plans/2026-10-07-instance-settings-5-copy.json+1 −1docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json+5 −5docs/superpowers/plans/2026-10-21-instance-policy-copy.json+130 −0instances_cli.go+1 −1instances_cli_test.go+1 −1internal/console/apiinstances.go+1 −2internal/console/apiinstances_test.go+1 −1internal/console/apipolicy.go+7 −7internal/console/apipolicy_test.go+3 −3internal/console/egressfleet.go+17 −12internal/console/egressfleet_test.go+10 −10internal/console/policylease.go+6 −6internal/console/policysize.go+4 −4internal/console/policysize_test.go+4 −4internal/console/server.go+2 −2internal/egressaddr/egressaddr.go+4 −4internal/host/egress_source.go+3 −2internal/host/egress_source_test.go+1 −1internal/host/egress_startpaths_rootrunner_linux_test.go+1 −1internal/host/egress_status_test.go+1 −1internal/instancectl/egress_due_linux_test.go+2 −2internal/instancectl/egress_restart_linux_test.go+4 −4internal/instancectl/egress_startpaths_test.go+1 −1internal/instancectl/egress_test.go+2 −2internal/status/snapshot_test.go+2 −2internal/updatewords/words_surfaces.go+1 −1status_instances.go+7 −4status_instances_test.go+3 −3
diff --git a/approved_instance_policy_copy_test.go b/approved_instance_policy_copy_test.go| new file mode 100644 |
| index 000000000..bcac68f9a |
| --- /dev/null |
| +++ b/approved_instance_policy_copy_test.go |
| @@ -0,0 +1,83 @@ |
| +package main |
| + |
| +import ( |
| + "encoding/json" |
| + "os" |
| + "testing" |
| +) |
| + |
| +// instancePolicyCopyRecordPath is the instance policy copy record (#328, |
| +// #329): every string of plans 1 to 3's decks |
| +// (docs/superpowers/notes/copy-instance-policy-plan{1,2,3}.md) that the Luna |
| +// pass approved by delegation on 2026-10-26 |
| +// (docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md). |
| +const instancePolicyCopyRecordPath = "docs/superpowers/plans/2026-10-21-instance-policy-copy.json" |
| + |
| +// instancePolicyCopyIDs is the record's inventory, pinned as a literal: a |
| +// record that loses an entry fails here even though every entry left in it |
| +// is applied. |
| +var instancePolicyCopyIDs = []string{ |
| + "IP1-01", "IP1-02", "IP1-03", "IP1-04", "IP1-05", "IP1-06", "IP1-07", |
| + "IP1-08", "IP1-09", "IP1-10", "IP1-11", "IP1-12", "IP1-13", "IP1-14", |
| + "IP1-15", "IP1-16", "IP1-17", "IP1-18", "IP1-19", "IP1-20", "IP1-21", |
| + "IP1-22", "IP1-23", "IP1-24", "IP1-25", "IP1-26", "IP1-27", "IP1-28", |
| + "IP1-29", "IP1-30", "IP1-45", "IP1-A1", "IP1-A2", "IP1-A3", "IP1-A5", |
| + "IP1-A6", "IP3-01", "IP3-02", "IP3-03", "IP1-40", "IP1-41", "IP1-46", |
| + "IP1-47", "IP1-48", "IP1-49", "IP1-58", "IP1-59", "IP1-31", "IP1-32", |
| + "IP1-33", "IP1-34", "IP1-35", "IP1-36", "IP1-37", "IP2-30", "IP1-38", |
| + "IP1-39", "IP1-42", "IP1-43", "IP3-10", "IP3-11", "IP1-44", "IP1-50", |
| + "IP1-51", "IP1-52", "IP1-53", "IP1-54", "IP1-60", "IP1-61", "IP1-62", |
| + "IP1-63", "IP1-64", "IP1-65", "IP2-31", "IP1-55", "IP1-56", "IP1-57", |
| + "GAP-1", "GAP-2", "GAP-3", "IP3-04", "IP3-08", "IP3-12", "IP3-09", |
| + "IP3-05", "IP3-06", "IP3-07", "IP2-02", "IP2-03", "IP2-04", "IP2-06", |
| + "IP2-07", "IP2-08", "IP2-10", "IP2-11", "IP2-12", "IP2-13", "IP2-14", |
| + "IP2-15", "IP2-16", "IP2-17", "IP2-20", "IP2-21", "IP2-22", "IP2-60", |
| + "IP2-61", "IP2-45", "IP2-49", "IP2-46", "IP2-47", "IP2-48", "IP2-70", |
| + "IP2-71", "IP2-72", "IP2-73", "IP2-74", "IP2-40", "IP2-41", "IP2-42", |
| + "IP2-43", "IP2-44", "IP2-50", "IP2-51", |
| +} |
| + |
| +// Every approved instance policy string is present, byte for byte, in the |
| +// file the record names. |
| +func TestInstancePolicyCopyIsApplied(t *testing.T) { |
| + raw, err := os.ReadFile(instancePolicyCopyRecordPath) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + checkApprovedCopy(t, raw, ".", instancePolicyCopyIDs, nil) |
| +} |
| + |
| +// instancePolicyApprovedPatterns is every approved instance policy text as |
| +// the moves scan reads a sentence (formatPattern), for the scan's |
| +// approved-elsewhere set: IP1-40 is spoken by main's create door in |
| +// internal/console/apicli.go, a file under the moves series' legacy |
| +// exemption. |
| +func instancePolicyApprovedPatterns(t *testing.T) map[string]bool { |
| + t.Helper() |
| + raw, err := os.ReadFile(instancePolicyCopyRecordPath) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var rec struct { |
| + Entries []struct{ ID, File, Text string } |
| + } |
| + if err := json.Unmarshal(raw, &rec); err != nil { |
| + t.Fatal(err) |
| + } |
| + out := map[string]bool{} |
| + for _, e := range rec.Entries { |
| + out[formatPattern(e.Text)] = true |
| + } |
| + return out |
| +} |
| + |
| +func TestInstancePolicyApprovedPatternsHoldTheCreateDoor(t *testing.T) { |
| + p := instancePolicyApprovedPatterns(t) |
| + if want := formatPattern(appCreatePolicyClearForTest); !p[want] { |
| + t.Errorf("the approved patterns lack IP1-40 %q", want) |
| + } |
| +} |
| + |
| +// appCreatePolicyClearForTest is IP1-40 as approved, kept here so the test |
| +// above checks the pattern set against the approved text, not the code's. |
| +const appCreatePolicyClearForTest = "an earlier app's instance policy under this name could not be cleared, so nothing was created. try again, or ask an operator to delete %s from the deployment bucket" |
diff --git a/approved_moves_copy_test.go b/approved_moves_copy_test.go| index 1d92bc26d..6d21aefeb 100644 |
| --- a/approved_moves_copy_test.go |
| +++ b/approved_moves_copy_test.go |
| @@ -1952,6 +1952,11 @@ func TestMovesExemptionHolds(t *testing.T) { |
| func TestMovesLegacyExemptionsAreLegacy(t *testing.T) { |
| base := movesScanBaseRef(t) |
| approvedElsewhere := rootfsBuiltTexts(mustParseRootfsRecord(t)) |
| + // The instance policy deck's approved texts (Luna pass, 2026-10-26): |
| + // IP1-40 answers main's create door in apicli.go. |
| + for p := range instancePolicyApprovedPatterns(t) { |
| + approvedElsewhere[p] = true |
| + } |
| files := map[string]bool{} |
| for f := range movesLegacyFiles { |
| files[f] = true |
diff --git a/apps.go b/apps.go| index 22fd90452..ed37ba017 100644 |
| --- a/apps.go |
| +++ b/apps.go |
| @@ -86,7 +86,7 @@ const appsUsage = `usage: carlos apps <create|place|build-probe|set|show|delete| |
| set <app> [--swap overlap|hold] [--swap-concurrency <n>] how the app's |
| running instances take a new build: see carlos apps set -h. |
| - show <app> the app's egress allow and sizes. System operators only. |
| + show <app> the app's egress allow and sizes. system operators only |
| delete [flags] <app> move an app to the Trash: every route drops |
| (custom domains included), its name stays reserved, and it |
diff --git a/apps_policy.go b/apps_policy.go| index 75de82cf0..b39815bd9 100644 |
| --- a/apps_policy.go |
| +++ b/apps_policy.go |
| @@ -31,33 +31,33 @@ import ( |
| "github.com/carlosframework/platform/internal/updatewords" |
| ) |
| -// Copy (collected for review in plan Task 15). |
| +// Copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan1.md). |
| const ( |
| - appsSetFlagEgress = `private addresses every instance of the app may reach, comma-separated, never a port. "" clears them. System operators only` |
| - appsSetFlagSize = "the size the app's instances run at: small, standard, large or xlarge. default goes back to the build's size. System operators only" |
| - instancesSetFlagSize = "this instance's size: small, standard, large or xlarge. default follows the app's size. System operators only" |
| + appsSetFlagEgress = `private addresses every instance of the app may reach, comma-separated, never a port. pass the whole list; "" clears it. system operators only` |
| + appsSetFlagSize = "the size the app's instances run at: small, standard, large or xlarge. default uses the build's size. system operators only" |
| + instancesSetFlagSize = "this instance's size: small, standard, large or xlarge. default follows the app's size. system operators only" |
| appsSetPolicyUsage = `Only system operators may pass --egress-allow or --size. A change reaches |
| -the app's boxes within seconds once they run a release that applies it.` |
| +the app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box.` |
| appsSetBadEgress = "apps set: --egress-allow: %v" |
| appsSetBadSize = "apps set: --size is small, standard, large, xlarge or default, not %q" |
| instancesSetBadSize = "instances set: --size is small, standard, large, xlarge or default, not %q" |
| appsPolicyOldConsole = "not found: either %s is not an app in this account, you are not a system operator, or this console predates app policies (deploy a console built from current main)" |
| - appsPolicyChanged = "the policy changed while this ran. Run it again" |
| - appsSetEgressDone = "%s instances may reach %s" |
| - appsSetEgressCleared = "%s instances have no egress allow" |
| - appsSetEgressNotChecked = "Not checked against these boxes, which publish no address list: %s." |
| - appsSetSizeDone = "%s instances run at %s unless an instance has its own size" |
| - appsSetSizeCleared = "%s instances run at the build's size unless an instance has its own size" |
| - instancesSetSizeDone = "%s runs at %s" |
| - instancesSetSizeDefault = "%s follows the app's size" |
| + appsPolicyChanged = "the policy changed while this ran. run it again" |
| + appsSetEgressDone = "egress allow for %s set to %s" |
| + appsSetEgressCleared = "egress allow for %s cleared" |
| + appsSetEgressNotChecked = "not checked against these boxes, which publish no address list: %s" |
| + appsSetSizeDone = "default size for %s set to %s. instances with their own size are unchanged" |
| + appsSetSizeCleared = "default size for %s set to the build's size. instances with their own size are unchanged" |
| + instancesSetSizeDone = "%s size set to %s" |
| + instancesSetSizeDefault = "%s size cleared. it follows the app's size" |
| appsShowUsage = "usage: carlos apps show <app> [--account <sqid|name>] [--account-id <sqid>] [--console <origin>]" |
| appsShowEgress = "egress allow %s" |
| appsShowDefault = "default size %s" |
| appsShowOverride = "size %s %s" |
| appsShowNone = "none" |
| appsShowBuildSize = "the build's size" |
| - appsShowStale = " (not in force. The instance was deleted or recreated)" |
| - appsShowDirectMode = "apps show works through a console, and this shell is in direct bucket mode (CARLOS_DEPLOYMENT_BUCKET or CARLOS_DEPLOYMENT_DIR is set). Log in instead: carlos auth login --console <url>" |
| + appsShowStale = " (not in force. the instance was deleted or recreated)" |
| + appsShowDirectMode = "apps show works through a console, and this shell is in direct bucket mode (CARLOS_DEPLOYMENT_BUCKET or CARLOS_DEPLOYMENT_DIR is set). log in instead: carlos auth login --console <url>" |
| ) |
| // policySizeDefault is the size value that removes an instance's override |
| @@ -105,14 +105,13 @@ type sizeCommittedBox struct { |
| FreeMiB int64 `json:"free_mib"` |
| } |
| -// sizeCommittedLine is plan 3 Task 14's string 5, a draft until the copy |
| -// review approves it. |
| -const sizeCommittedLine = "%s: %d MiB committed to awake instances, of %d MiB. %d MiB free." |
| +// sizeCommittedLine is plan 3's IP3-10 (approved by delegation, Luna pass 2026-10-26). |
| +const sizeCommittedLine = "%s: %d MiB committed to awake instances, of %d MiB. %d MiB free" |
| -// sizeTakesEffectLine is plan 3 copy string 7 (ruling 12), a draft until |
| -// the copy review approves it: printed after every size change, since |
| -// memory changes only at an instance's next start and CPU and IO at once. |
| -const sizeTakesEffectLine = "The new memory size applies when an instance next starts or is deployed. CPU and IO apply now." |
| +// sizeTakesEffectLine is plan 3's IP3-11 (ruling 12; approved by delegation, Luna pass 2026-10-26): printed after |
| +// every size change, since memory changes only at an instance's next start |
| +// or deploy and CPU and IO at once. |
| +const sizeTakesEffectLine = "the new memory size applies at the next start. a larger size also applies at the next deploy; a smaller size waits for a cold start. CPU and IO apply now" |
| // printSizeCommitted prints one line per box the console checked a size |
| // change against, in the order the reply gives them. |
diff --git a/apps_policy_test.go b/apps_policy_test.go| index aee1c1261..573ee2161 100644 |
| --- a/apps_policy_test.go |
| +++ b/apps_policy_test.go |
| @@ -178,7 +178,7 @@ func TestChangeAppPolicyWireShape(t *testing.T) { |
| // A 412 is said plainly and not retried. |
| c = &policyConsole{getBody: `{"policy":{"v":1},"etag":"e1"}`, putStatus: http.StatusPreconditionFailed, |
| - putBody: `{"error":"the policy changed since it was read. Read it again and retry"}`} |
| + putBody: `{"error":"the policy changed since it was read. read it again and retry"}`} |
| if _, err := c.session(t).changeAppPolicy(ctx, acct, "shop", *change); err == nil || err.Error() != appsPolicyChanged { |
| t.Fatalf("412: err = %v", err) |
| } |
| @@ -323,7 +323,7 @@ func TestAppsSetPrintsNotChecked(t *testing.T) { |
| if out.String() != want { |
| t.Fatalf("stdout = %q, want %q", out.String(), want) |
| } |
| - if want := "Not checked against these boxes, which publish no address list: box-c.\n"; !strings.HasSuffix(out.String(), want) { |
| + if want := "not checked against these boxes, which publish no address list: box-c\n"; !strings.HasSuffix(out.String(), want) { |
| t.Fatalf("stdout = %q, want it to end %q", out.String(), want) |
| } |
| @@ -450,8 +450,8 @@ func TestPrintSizeCommitted(t *testing.T) { |
| {Box: "annie", CommittedMiB: 2304, TotalMiB: 3884, FreeMiB: 1200}, |
| {Box: "bx-1", CommittedMiB: 1024, TotalMiB: 16384, FreeMiB: 9000}, |
| }) |
| - want := "annie: 2304 MiB committed to awake instances, of 3884 MiB. 1200 MiB free.\n" + |
| - "bx-1: 1024 MiB committed to awake instances, of 16384 MiB. 9000 MiB free.\n" |
| + want := "annie: 2304 MiB committed to awake instances, of 3884 MiB. 1200 MiB free\n" + |
| + "bx-1: 1024 MiB committed to awake instances, of 16384 MiB. 9000 MiB free\n" |
| if buf.String() != want { |
| t.Fatalf("got %q, want %q", buf.String(), want) |
| } |
| @@ -466,12 +466,12 @@ func TestPrintSizeCommitted(t *testing.T) { |
| // the size line, then when the new size takes effect (ruling 12); an older |
| // console's reply, with no committed key, prints no committed line. |
| func TestSizeChangePrintsCommitted(t *testing.T) { |
| - if sizeTakesEffectLine != "The new memory size applies when an instance next starts or is deployed. CPU and IO apply now." { |
| + if sizeTakesEffectLine != "the new memory size applies at the next start. a larger size also applies at the next deploy; a smaller size waits for a cold start. CPU and IO apply now" { |
| t.Fatalf("sizeTakesEffectLine = %q", sizeTakesEffectLine) |
| } |
| out := captureStdout(t) |
| committed := `"committed":[{"box":"annie","committed_mib":2304,"total_mib":3884,"free_mib":1200}]` |
| - line := "annie: 2304 MiB committed to awake instances, of 3884 MiB. 1200 MiB free.\n" |
| + line := "annie: 2304 MiB committed to awake instances, of 3884 MiB. 1200 MiB free\n" |
| c := &policyConsole{getBody: `{"policy":{"v":1},"etag":""}`, |
| putBody: `{"policy":{"v":1,"default_size":"large"},"etag":"e1",` + committed + `}`} |
diff --git a/apps_swap.go b/apps_swap.go| index 2ae2cd223..083bd53ee 100644 |
| --- a/apps_swap.go |
| +++ b/apps_swap.go |
| @@ -19,7 +19,7 @@ import ( |
| "github.com/carlosframework/platform/internal/updatewords" |
| ) |
| -const appsSetUsage = `usage: carlos apps set <app> [--swap overlap|hold] [--swap-concurrency <n>] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>] |
| +const appsSetUsage = `usage: carlos apps set <app> [--swap overlap|hold] [--swap-concurrency <n>] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>] [--egress-allow <ip,...>] [--size small|standard|large|xlarge|default] |
| --swap overlap|hold how a running instance takes a new build. overlap |
| starts the new build beside the old one and switches |
| @@ -35,7 +35,7 @@ Any member of the app may change these. They reach the app's boxes with its |
| config, within seconds.` |
| const ( |
| - appsSetFlagApp = "app whose swap policy to set" |
| + appsSetFlagApp = "app whose swap or instance policy to set" |
| appsSetFlagSwap = "overlap or hold: how a running instance takes a new build" |
| appsSetFlagConcurrency = "how many instances of the app may swap at once on one box (1 or more)" |
| appsSetNothing = "apps set: nothing to set. Pass --swap, --swap-concurrency, --egress-allow or --size" |
diff --git a/docs/superpowers/plans/2026-10-07-instance-settings-5-copy.json b/docs/superpowers/plans/2026-10-07-instance-settings-5-copy.json| index a330cc8ca..4c82074b2 100644 |
| --- a/docs/superpowers/plans/2026-10-07-instance-settings-5-copy.json |
| +++ b/docs/superpowers/plans/2026-10-07-instance-settings-5-copy.json |
| @@ -130,7 +130,7 @@ |
| { |
| "id": "settings.cli.set-usage", |
| "file": "internal/updatewords/words_surfaces.go", |
| - "text": "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] (an empty value clears)" |
| + "text": "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] [--size small|standard|large|xlarge|default] (an empty value clears an update setting)" |
| }, |
| { |
| "id": "settings.cli.update-done", |
diff --git a/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json b/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json| index 821ba599c..b7d256255 100644 |
| --- a/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json |
| +++ b/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json |
| @@ -44,13 +44,13 @@ |
| {"id": "zdd.api.retry-not-held", "file": "internal/console/apiretry.go", "text": "%s is not held back by a failed build, as far as its box last reported, so there is nothing to retry"}, |
| {"id": "zdd.api.retry-no-bucket", "file": "internal/console/apiretry.go", "text": "no deployment bucket on this host. this console cannot request a retry"}, |
| {"id": "zdd.api.retry-limited", "file": "internal/console/apiretry.go", "text": "too many requests. wait a minute and try again"}, |
| - {"id": "zdd.apps.usage-line", "file": "apps.go", "text": "usage: carlos apps <create|place|build-probe|set|delete|restore|ttl|keep|list> [flags] <app>"}, |
| + {"id": "zdd.apps.usage-line", "file": "apps.go", "text": "usage: carlos apps <create|place|build-probe|set|show|delete|restore|ttl|keep|list> [flags] <app>"}, |
| {"id": "zdd.apps.usage-set", "file": "apps.go", "text": " set <app> [--swap overlap|hold] [--swap-concurrency <n>] how the app's\n running instances take a new build: see carlos apps set -h."}, |
| - {"id": "zdd.apps-set.usage", "file": "apps_swap.go", "text": "usage: carlos apps set <app> [--swap overlap|hold] [--swap-concurrency <n>] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>]\n\n --swap overlap|hold how a running instance takes a new build. overlap\n starts the new build beside the old one and switches\n once it answers its health check, so no request\n waits. hold stops the old one first, and requests\n wait until the new one is up. Use hold when two\n builds cannot share the database.\n --swap-concurrency <n> how many instances of the app may swap at once on\n one box, after the first has stayed up for ten\n seconds. 1 or more; it starts at 1.\n\nAny member of the app may change these. They reach the app's boxes with its\nconfig, within seconds."}, |
| + {"id": "zdd.apps-set.usage", "file": "apps_swap.go", "text": "usage: carlos apps set <app> [--swap overlap|hold] [--swap-concurrency <n>] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>] [--egress-allow <ip,...>] [--size small|standard|large|xlarge|default]\n\n --swap overlap|hold how a running instance takes a new build. overlap\n starts the new build beside the old one and switches\n once it answers its health check, so no request\n waits. hold stops the old one first, and requests\n wait until the new one is up. Use hold when two\n builds cannot share the database.\n --swap-concurrency <n> how many instances of the app may swap at once on\n one box, after the first has stayed up for ten\n seconds. 1 or more; it starts at 1.\n\nAny member of the app may change these. They reach the app's boxes with its\nconfig, within seconds."}, |
| {"id": "zdd.apps-set.flag-swap", "file": "apps_swap.go", "text": "overlap or hold: how a running instance takes a new build"}, |
| {"id": "zdd.apps-set.flag-concurrency", "file": "apps_swap.go", "text": "how many instances of the app may swap at once on one box (1 or more)"}, |
| - {"id": "zdd.apps-set.flag-app", "file": "apps_swap.go", "text": "app whose swap policy to set"}, |
| - {"id": "zdd.apps-set.nothing", "file": "apps_swap.go", "text": "apps set: nothing to set. Pass --swap, --swap-concurrency, or both"}, |
| + {"id": "zdd.apps-set.flag-app", "file": "apps_swap.go", "text": "app whose swap or instance policy to set"}, |
| + {"id": "zdd.apps-set.nothing", "file": "apps_swap.go", "text": "apps set: nothing to set. Pass --swap, --swap-concurrency, --egress-allow or --size"}, |
| {"id": "zdd.apps-set.bad-swap", "file": "apps_swap.go", "text": "apps set: --swap is overlap or hold, not %q"}, |
| {"id": "zdd.apps-set.bad-concurrency", "file": "apps_swap.go", "text": "apps set: --swap-concurrency must be 1 or more"}, |
| {"id": "zdd.apps-set.two-apps", "file": "apps_swap.go", "text": "apps set: name the app once, either first or with --app"}, |
| @@ -73,7 +73,7 @@ |
| {"id": "zdd.instances-retry.usage-para", "file": "instances_cli.go", "text": "retry clears the failure hold on one instance: the build that failed on its\nbox is tried again there, as a canary. \"carlos promote --retry <version>\n<channel>\" does the same on every box."}, |
| {"id": "zdd.instances-retry.done", "file": "instances_cli.go", "text": "retry requested for %s: its next attempt at %s runs as a canary"}, |
| {"id": "zdd.instances-retry.old-console", "file": "instances_cli.go", "text": "not found: either %s has no instance %s, or this console predates carlos instances retry (deploy a console built from current main)"}, |
| - {"id": "zdd.list.header", "file": "instances_cli.go", "text": "HOST\\tREGION\\tCHANNEL\\tPOOL\\tINSTALLED\\tSERVING\\tHEALTH\\tUPSTREAMS\\tDB\\tCREATED\\tBY\\tREASON"}, |
| + {"id": "zdd.list.header", "file": "instances_cli.go", "text": "HOST\\tREGION\\tCHANNEL\\tPOOL\\tINSTALLED\\tSERVING\\tHEALTH\\tUPSTREAMS\\tDB\\tEGRESS\\tCREATED\\tBY\\tREASON"}, |
| {"id": "zdd.list.retry-hint", "file": "instances_cli.go", "text": "a build that failed is tried again on every box with carlos promote --app %s --retry <version> <channel>, or on one instance with carlos instances retry --app %s <host>"}, |
| {"id": "zdd.state.held", "file": "internal/rolloutwords/words.go", "text": "held: build %s failed on this box"}, |
| {"id": "zdd.state.rolling-out", "file": "internal/rolloutwords/words.go", "text": "rolling out"}, |
diff --git a/docs/superpowers/plans/2026-10-21-instance-policy-copy.json b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json| new file mode 100644 |
| index 000000000..29caf50a5 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json |
| @@ -0,0 +1,130 @@ |
| +{ |
| + "approved_by": "delegation (Luna pass, gpt-5.6-luna; Paul's standing rule for platform copy decks)", |
| + "approved_on": "2026-10-26", |
| + "source": "docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md", |
| + "entries": [ |
| + {"id": "IP1-01", "file": "internal/egressaddr/egressaddr.go", "text": "an address is empty"}, |
| + {"id": "IP1-02", "file": "internal/egressaddr/egressaddr.go", "text": "%q is a range. allow single addresses only"}, |
| + {"id": "IP1-03", "file": "internal/egressaddr/egressaddr.go", "text": "%q has a port. an allow opens an address, never a port"}, |
| + {"id": "IP1-04", "file": "internal/egressaddr/egressaddr.go", "text": "%q has a zone. name the address without it"}, |
| + {"id": "IP1-05", "file": "internal/egressaddr/egressaddr.go", "text": "%q is not an IP address"}, |
| + {"id": "IP1-06", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a loopback address"}, |
| + {"id": "IP1-07", "file": "internal/egressaddr/egressaddr.go", "text": "%s is the unspecified address"}, |
| + {"id": "IP1-08", "file": "internal/egressaddr/egressaddr.go", "text": "%s is the cloud metadata service"}, |
| + {"id": "IP1-09", "file": "internal/egressaddr/egressaddr.go", "text": "%s is link-local"}, |
| + {"id": "IP1-10", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a multicast address"}, |
| + {"id": "IP1-11", "file": "internal/egressaddr/egressaddr.go", "text": "%s is in %s, a reserved range"}, |
| + {"id": "IP1-12", "file": "internal/egressaddr/egressaddr.go", "text": "%s is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address"}, |
| + {"id": "IP1-13", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a public address and is already reachable. no allow is needed"}, |
| + {"id": "IP1-14", "file": "internal/egressaddr/egressaddr.go", "text": "at most %d addresses per app (%d given)"}, |
| + {"id": "IP1-15", "file": "internal/console/policylease.go", "text": "another console (%s) is the policy writer for this deployment until %s. use that console, or try again after that"}, |
| + {"id": "IP1-16", "file": "internal/console/policylease.go", "text": "another console is the policy writer for this deployment until %s. use the console that holds the lease, or try again after that"}, |
| + {"id": "IP1-17", "file": "internal/console/policylease.go", "text": "could not take the policy writer lease. try again"}, |
| + {"id": "IP1-18", "file": "internal/console/policylease.go", "text": "this console is not set up to write app policies (no writer lease). deploy a console built from current main"}, |
| + {"id": "IP1-19", "file": "internal/console/policylease.go", "text": "this console stopped being the policy writer during the change, so it may not have been published. read the policy again before you retry"}, |
| + {"id": "IP1-20", "file": "internal/console/apipolicy.go", "text": "nothing to set: send egress_allow, default_size or size"}, |
| + {"id": "IP1-21", "file": "internal/console/apipolicy.go", "text": "default_size must be small, standard, large or xlarge, or empty for the build's size"}, |
| + {"id": "IP1-22", "file": "internal/console/apipolicy.go", "text": "size must be small, standard, large, xlarge or default"}, |
| + {"id": "IP1-23", "file": "internal/console/apipolicy.go", "text": "no instance %s in this app"}, |
| + {"id": "IP1-24", "file": "internal/console/apipolicy.go", "text": "send If-Match with the policy's etag, or If-None-Match: * when there is none"}, |
| + {"id": "IP1-25", "file": "internal/console/apipolicy.go", "text": "the policy changed since it was read. read it again and retry"}, |
| + {"id": "IP1-26", "file": "internal/console/apipolicy.go", "text": "the change could not be recorded, so it was not made. try again"}, |
| + {"id": "IP1-27", "file": "internal/console/apipolicy.go", "text": "the change could not be audited, so it was not made. try again"}, |
| + {"id": "IP1-28", "file": "internal/console/apipolicy.go", "text": "the change is recorded but not yet published. run the command again to publish it now"}, |
| + {"id": "IP1-29", "file": "internal/console/apipolicy.go", "text": "could not read the policy. try again"}, |
| + {"id": "IP1-30", "file": "internal/console/apipolicy.go", "text": "invalid host"}, |
| + {"id": "IP1-45", "file": "internal/console/apipolicy.go", "text": "the app was deleted, renamed or moved while the change was being made, so it was not made"}, |
| + {"id": "IP1-A1", "file": "internal/console/apipolicy.go", "text": "egress allow: "}, |
| + {"id": "IP1-A2", "file": "internal/console/apipolicy.go", "text": "default size: "}, |
| + {"id": "IP1-A3", "file": "internal/console/apipolicy.go", "text": "size of "}, |
| + {"id": "IP1-A5", "file": "internal/console/apipolicy.go", "text": "the build's size"}, |
| + {"id": "IP1-A6", "file": "internal/console/apipolicy.go", "text": "the app's size"}, |
| + {"id": "IP3-01", "file": "internal/console/policysize.go", "text": "%s is more than a quarter of the memory on %s (%d MiB). choose a smaller size"}, |
| + {"id": "IP3-02", "file": "internal/console/policysize.go", "text": "%s does not publish its memory total, so only small and standard can be set. upgrade the box, then try again"}, |
| + {"id": "IP3-03", "file": "internal/console/policysize.go", "text": "could not read every box's memory total, so only small and standard can be set. try again in a minute"}, |
| + {"id": "IP1-40", "file": "internal/console/server.go", "text": "an earlier app's instance policy under this name could not be cleared, so nothing was created. try again, or ask an operator to delete %s from the deployment bucket"}, |
| + {"id": "IP1-41", "file": "internal/console/server.go", "text": "Could not clear an earlier app's instance policy under this name, so nothing was created. Please try again."}, |
| + {"id": "IP1-46", "file": "internal/console/appsettings.go", "text": "This app has had an instance policy set by an operator, so it cannot be renamed. Create a new app instead."}, |
| + {"id": "IP1-47", "file": "internal/console/appsettings.go", "text": "The name %s has had an instance policy set by an operator, so no app can be renamed to it. Choose another name."}, |
| + {"id": "IP1-48", "file": "internal/console/appsettings.go", "text": "Could not check the instance policies, so nothing was renamed. Try again."}, |
| + {"id": "IP1-49", "file": "internal/console/appsettings.go", "text": "This app has had an instance policy set by an operator, so its record cannot be moved to another account. Ask an operator to move it."}, |
| + {"id": "IP1-58", "file": "internal/console/appsettings.go", "text": "An earlier app named %s in %s had an instance policy set by an operator, so this app cannot be moved there. Ask an operator to move it."}, |
| + {"id": "IP1-59", "file": "internal/console/appsettings.go", "text": "Could not check the instance policies, so nothing was moved. Try again."}, |
| + {"id": "IP1-31", "file": "apps_policy.go", "text": "apps set: --egress-allow: %v"}, |
| + {"id": "IP1-32", "file": "apps_policy.go", "text": "apps set: --size is small, standard, large, xlarge or default, not %q"}, |
| + {"id": "IP1-33", "file": "apps_policy.go", "text": "instances set: --size is small, standard, large, xlarge or default, not %q"}, |
| + {"id": "IP1-34", "file": "apps_policy.go", "text": "not found: either %s is not an app in this account, you are not a system operator, or this console predates app policies (deploy a console built from current main)"}, |
| + {"id": "IP1-35", "file": "apps_policy.go", "text": "the policy changed while this ran. run it again"}, |
| + {"id": "IP1-36", "file": "apps_policy.go", "text": "egress allow for %s set to %s"}, |
| + {"id": "IP1-37", "file": "apps_policy.go", "text": "egress allow for %s cleared"}, |
| + {"id": "IP2-30", "file": "apps_policy.go", "text": "not checked against these boxes, which publish no address list: %s"}, |
| + {"id": "IP1-38", "file": "apps_policy.go", "text": "default size for %s set to %s. instances with their own size are unchanged"}, |
| + {"id": "IP1-39", "file": "apps_policy.go", "text": "default size for %s set to the build's size. instances with their own size are unchanged"}, |
| + {"id": "IP1-42", "file": "apps_policy.go", "text": "%s size set to %s"}, |
| + {"id": "IP1-43", "file": "apps_policy.go", "text": "%s size cleared. it follows the app's size"}, |
| + {"id": "IP3-10", "file": "apps_policy.go", "text": "%s: %d MiB committed to awake instances, of %d MiB. %d MiB free"}, |
| + {"id": "IP3-11", "file": "apps_policy.go", "text": "the new memory size applies at the next start. a larger size also applies at the next deploy; a smaller size waits for a cold start. CPU and IO apply now"}, |
| + {"id": "IP1-44", "file": "apps_policy.go", "text": "apps show works through a console, and this shell is in direct bucket mode (CARLOS_DEPLOYMENT_BUCKET or CARLOS_DEPLOYMENT_DIR is set). log in instead: carlos auth login --console <url>"}, |
| + {"id": "IP1-50", "file": "apps_policy.go", "text": "private addresses every instance of the app may reach, comma-separated, never a port. pass the whole list; \"\" clears it. system operators only"}, |
| + {"id": "IP1-51", "file": "apps_policy.go", "text": "the size the app's instances run at: small, standard, large or xlarge. default uses the build's size. system operators only"}, |
| + {"id": "IP1-52", "file": "apps_policy.go", "text": "this instance's size: small, standard, large or xlarge. default follows the app's size. system operators only"}, |
| + {"id": "IP1-53", "file": "apps_policy.go", "text": "Only system operators may pass --egress-allow or --size. A change reaches\nthe app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box."}, |
| + {"id": "IP1-54", "file": "apps_policy.go", "text": "usage: carlos apps show <app> [--account <sqid|name>] [--account-id <sqid>] [--console <origin>]"}, |
| + {"id": "IP1-60", "file": "apps_policy.go", "text": "egress allow %s"}, |
| + {"id": "IP1-61", "file": "apps_policy.go", "text": "default size %s"}, |
| + {"id": "IP1-62", "file": "apps_policy.go", "text": "size %s %s"}, |
| + {"id": "IP1-63", "file": "apps_policy.go", "text": "none"}, |
| + {"id": "IP1-64", "file": "apps_policy.go", "text": "the build's size"}, |
| + {"id": "IP1-65", "file": "apps_policy.go", "text": " (not in force. the instance was deleted or recreated)"}, |
| + {"id": "IP2-31", "file": "apps_policy.go", "text": "!"}, |
| + {"id": "IP1-55", "file": "apps.go", "text": " show <app> the app's egress allow and sizes. system operators only\n"}, |
| + {"id": "IP1-56", "file": "apps.go", "text": "usage: carlos apps <create|place|build-probe|set|show|delete|restore|ttl|keep|list> [flags] <app>"}, |
| + {"id": "IP1-57", "file": "apps_swap.go", "text": "apps set: nothing to set. Pass --swap, --swap-concurrency, --egress-allow or --size"}, |
| + {"id": "GAP-1", "file": "internal/updatewords/words_surfaces.go", "text": "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] [--size small|standard|large|xlarge|default] (an empty value clears an update setting)"}, |
| + {"id": "GAP-2", "file": "apps_swap.go", "text": "usage: carlos apps set <app> [--swap overlap|hold] [--swap-concurrency <n>] [--account <sqid|name>] [--account-id <sqid>] [--console <origin>] [--egress-allow <ip,...>] [--size small|standard|large|xlarge|default]\n"}, |
| + {"id": "GAP-3", "file": "apps_swap.go", "text": "app whose swap or instance policy to set"}, |
| + {"id": "IP3-04", "file": "status_instances.go", "text": "BOX HOST LAYOUT SIZE EGRESS REASON"}, |
| + {"id": "IP3-08", "file": "status_instances.go", "text": "-"}, |
| + {"id": "IP3-12", "file": "status_instances.go", "text": "-"}, |
| + {"id": "IP3-09", "file": "status_instances.go", "text": "A size after > is the wanted size. A larger size takes effect at the instance's next start or deploy; a smaller size waits for a cold start. Restart the instance to apply the new memory size now."}, |
| + {"id": "IP3-05", "file": "internal/host/sizestatus.go", "text": "swap"}, |
| + {"id": "IP3-06", "file": "internal/host/sizestatus.go", "text": "?"}, |
| + {"id": "IP3-07", "file": "internal/host/sizestatus.go", "text": ">"}, |
| + {"id": "IP2-02", "file": "instances_cli.go", "text": "HOST\\tREGION\\tCHANNEL\\tPOOL\\tINSTALLED\\tSERVING\\tHEALTH\\tUPSTREAMS\\tDB\\tEGRESS\\tCREATED\\tBY\\tREASON"}, |
| + {"id": "IP2-03", "file": "instances_cli.go", "text": "-"}, |
| + {"id": "IP2-04", "file": "instances_cli.go", "text": "!"}, |
| + {"id": "IP2-06", "file": "instances_cli.go", "text": " !"}, |
| + {"id": "IP2-07", "file": "instances_cli.go", "text": "refused"}, |
| + {"id": "IP2-08", "file": "instances_cli.go", "text": "egress: "}, |
| + {"id": "IP2-10", "file": "instances_cli.go", "text": "failing"}, |
| + {"id": "IP2-11", "file": "instances_cli.go", "text": "policy unreadable"}, |
| + {"id": "IP2-12", "file": "instances_cli.go", "text": "policy unverifiable"}, |
| + {"id": "IP2-13", "file": "instances_cli.go", "text": "policy expired"}, |
| + {"id": "IP2-14", "file": "instances_cli.go", "text": "box not wholly nested"}, |
| + {"id": "IP2-15", "file": "instances_cli.go", "text": "not yet supported under claims"}, |
| + {"id": "IP2-16", "file": "instances_cli.go", "text": "pending"}, |
| + {"id": "IP2-17", "file": "instances_cli.go", "text": "not available"}, |
| + {"id": "IP2-20", "file": "internal/console/apiinstances.go", "text": "the allow takes effect when the instance next starts"}, |
| + {"id": "IP2-21", "file": "internal/console/apiinstances.go", "text": "the box could not apply the allow, and tries again"}, |
| + {"id": "IP2-22", "file": "internal/console/apiinstances.go", "text": "the allow is not in force on this box"}, |
| + {"id": "IP2-60", "file": "internal/instancectl/egress.go", "text": "%s: an address of this box (%s)"}, |
| + {"id": "IP2-61", "file": "internal/instancectl/egress.go", "text": ": this box's addresses could not be read"}, |
| + {"id": "IP2-45", "file": "internal/instancectl/egress.go", "text": "the policy has more than %d addresses (%d); every one is closed"}, |
| + {"id": "IP2-49", "file": "internal/instancectl/egress.go", "text": "revoked (restarted)"}, |
| + {"id": "IP2-46", "file": "internal/host/egress_source.go", "text": "host claims are on, so this box did not apply the allow"}, |
| + {"id": "IP2-47", "file": "internal/host/egress_source.go", "text": "no expiry recorded"}, |
| + {"id": "IP2-48", "file": "internal/host/egress_source.go", "text": "the policy expired at "}, |
| + {"id": "IP2-70", "file": "internal/host/egress_source.go", "text": " is a sidecar member, which runs flat"}, |
| + {"id": "IP2-71", "file": "internal/host/egress_source.go", "text": "%s runs as %s, whose user could not be read: %v"}, |
| + {"id": "IP2-72", "file": "internal/host/egress_source.go", "text": "%s runs as %s, which runs as the agent's user"}, |
| + {"id": "IP2-73", "file": "internal/host/egress_source.go", "text": "%s has backing %q, which this check does not know"}, |
| + {"id": "IP2-74", "file": "internal/host/egress_source.go", "text": "%s is a %q row, which this check does not know"}, |
| + {"id": "IP2-40", "file": "internal/console/egressfleet.go", "text": "%s is an address of box %s. an egress allow cannot open a box of this fleet"}, |
| + {"id": "IP2-41", "file": "internal/console/egressfleet.go", "text": "box %s's address list could not be read. try again in a minute"}, |
| + {"id": "IP2-42", "file": "internal/console/egressfleet.go", "text": "box %s does not publish its addresses yet. upgrade it before granting an egress allow"}, |
| + {"id": "IP2-43", "file": "internal/console/egressfleet.go", "text": "the fleet's address lists could not be read. try again in a minute"}, |
| + {"id": "IP2-44", "file": "internal/console/egressfleet.go", "text": "the fleet's list of boxes could not be read. try again in a minute"}, |
| + {"id": "IP2-50", "file": "internal/console/egressfleet.go", "text": "Egress allow %s is now a fleet box's address."}, |
| + {"id": "IP2-51", "file": "internal/console/egressfleet.go", "text": "App %s in account id %s may reach %s, and box %s now holds that address. The allow is still in force. Set the whole list again without that address by running carlos apps set %s --egress-allow, or move the address off the box."} |
| + ] |
| +} |
diff --git a/instances_cli.go b/instances_cli.go| index 3fbd50375..270d24b06 100644 |
| --- a/instances_cli.go |
| +++ b/instances_cli.go |
| @@ -472,7 +472,7 @@ type apiEgress struct { |
| Reason string `json:"reason,omitempty"` // the member projection's fixed reason |
| } |
| -// Copy: drafts for plan 2 Task 17's review (#328). egressStateWords maps a |
| +// Copy (approved by delegation, Luna pass 2026-10-26; #328). egressStateWords maps a |
| // box's state code (status.HostEgress.State) to the word the EGRESS cell |
| // shows after "!"; a code missing here shows as sent. |
| var egressStateWords = map[string]string{ |
diff --git a/instances_cli_test.go b/instances_cli_test.go| index 9f31c039c..1eeac5764 100644 |
| --- a/instances_cli_test.go |
| +++ b/instances_cli_test.go |
| @@ -121,7 +121,7 @@ func TestEgressCellTable(t *testing.T) { |
| {"unverifiable", &apiEgress{State: "unverifiable"}, "- !policy unverifiable"}, |
| {"expired", &apiEgress{State: "expired"}, "- !policy expired"}, |
| {"not nested", &apiEgress{State: "not_nested", Detail: "flat row shop-b.example.com"}, "- !box not wholly nested"}, |
| - {"under claims", &apiEgress{State: "under_claims", Detail: "not yet supported under claims"}, "- !not yet supported under claims"}, |
| + {"under claims", &apiEgress{State: "under_claims", Detail: "host claims are on, so this box did not apply the allow"}, "- !not yet supported under claims"}, |
| {"an unknown state shows as sent", &apiEgress{State: "later"}, "- !later"}, |
| {"refused only", &apiEgress{Allowed: []string{"10.0.5.20"}, Refused: []string{"10.0.5.1: an address of this box"}}, "10.0.5.20 !refused"}, |
| {"a state outranks refused", &apiEgress{Refused: []string{"x"}, State: "failing"}, "- !failing"}, |
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go| index 70ce00a22..b3775045c 100644 |
| --- a/internal/console/apiinstances.go |
| +++ b/internal/console/apiinstances.go |
| @@ -232,8 +232,7 @@ type memberEgress struct { |
| Reason string `json:"reason,omitempty"` |
| } |
| -// The member states and their fixed reasons. Copy: drafts for plan 2 |
| -// Task 17's review. |
| +// The member states and their fixed reasons. Copy: approved by delegation, Luna pass 2026-10-26. |
| const ( |
| memberEgressPending = "pending" |
| memberEgressFailing = "failing" |
diff --git a/internal/console/apiinstances_test.go b/internal/console/apiinstances_test.go| index c1d0ca749..d8d41821f 100644 |
| --- a/internal/console/apiinstances_test.go |
| +++ b/internal/console/apiinstances_test.go |
| @@ -2757,7 +2757,7 @@ func TestMemberEgressViewStates(t *testing.T) { |
| {status.HostEgress{State: "unverifiable"}, memberEgressNotAvailable}, |
| {status.HostEgress{State: "expired"}, memberEgressNotAvailable}, |
| {status.HostEgress{State: "not_nested", Detail: "x"}, memberEgressNotAvailable}, |
| - {status.HostEgress{State: "under_claims", Detail: "not yet supported under claims"}, memberEgressNotAvailable}, |
| + {status.HostEgress{State: "under_claims", Detail: "host claims are on, so this box did not apply the allow"}, memberEgressNotAvailable}, |
| {status.HostEgress{State: "something_new"}, memberEgressNotAvailable}, |
| {status.HostEgress{Refused: []string{"10.0.9.7: an address of this box (10.0.9.0/24)"}}, memberEgressNotAvailable}, |
| } { |
diff --git a/internal/console/apipolicy.go b/internal/console/apipolicy.go| index 032a20b58..f687b99a7 100644 |
| --- a/internal/console/apipolicy.go |
| +++ b/internal/console/apipolicy.go |
| @@ -59,18 +59,18 @@ import ( |
| "github.com/carlosframework/platform/internal/release" |
| ) |
| -// Door copy (collected for review in plan Task 15). |
| +// Door copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan1.md). |
| const ( |
| policyNothingMsg = "nothing to set: send egress_allow, default_size or size" |
| policyDefaultSizeMsg = "default_size must be small, standard, large or xlarge, or empty for the build's size" |
| policySizeMsg = "size must be small, standard, large, xlarge or default" |
| policyNoInstanceMsg = "no instance %s in this app" |
| policyPreconditionMsg = "send If-Match with the policy's etag, or If-None-Match: * when there is none" |
| - policyChangedMsg = "the policy changed since it was read. Read it again and retry" |
| - policyRecordFailedMsg = "the change could not be recorded, so it was not made. Try again" |
| - policyAuditFailedMsg = "the change could not be audited, so it was not made. Try again" |
| - policyUnpublishedMsg = "the change is recorded but not yet published. Run the command again to publish it now" |
| - policyReadFailedMsg = "could not read the policy. Try again" |
| + policyChangedMsg = "the policy changed since it was read. read it again and retry" |
| + policyRecordFailedMsg = "the change could not be recorded, so it was not made. try again" |
| + policyAuditFailedMsg = "the change could not be audited, so it was not made. try again" |
| + policyUnpublishedMsg = "the change is recorded but not yet published. run the command again to publish it now" |
| + policyReadFailedMsg = "could not read the policy. try again" |
| policyAppReplacedMsg = "the app was deleted, renamed or moved while the change was being made, so it was not made" |
| policyInvalidHostMsg = "invalid host" |
| policyAuditAction = "app-policy" |
| @@ -1171,7 +1171,7 @@ func policyAuditDetail(old, next apppolicy.Policy, req policyPutReq) string { |
| if o, ok := p.Sizes[host]; ok { |
| return o.Size |
| } |
| - return "the app default" |
| + return "the app's size" |
| } |
| a, b := size(old), size(next) |
| add("size of "+host+": "+a+" -> "+b, a != b) |
diff --git a/internal/console/apipolicy_test.go b/internal/console/apipolicy_test.go| index 10f642768..3997669d5 100644 |
| --- a/internal/console/apipolicy_test.go |
| +++ b/internal/console/apipolicy_test.go |
| @@ -357,7 +357,7 @@ func TestPolicyPutIsCompareAndSwap(t *testing.T) { |
| t.Fatalf("no precondition = %d %s", st, out) |
| } |
| if st, _, out := fx.put(t, "shop", body, policyIfMatch("stale")); st != http.StatusPreconditionFailed || |
| - errorOf(t, out) != "the policy changed since it was read. Read it again and retry" { |
| + errorOf(t, out) != "the policy changed since it was read. read it again and retry" { |
| t.Fatalf("If-Match stale = %d %s", st, out) |
| } |
| fx.noObject(t, "shop") |
| @@ -428,7 +428,7 @@ func TestPolicyOverrideCapturesTheRecord(t *testing.T) { |
| if len(r.Policy.Sizes) != 0 { |
| t.Fatalf("sizes %+v after default, want none", r.Policy.Sizes) |
| } |
| - if evs := fx.policyEvents(t, "shop"); len(evs) != 2 || !strings.Contains(evs[0].Detail+evs[1].Detail, "size of shop-a.example.com: xlarge -> the app default") { |
| + if evs := fx.policyEvents(t, "shop"); len(evs) != 2 || !strings.Contains(evs[0].Detail+evs[1].Detail, "size of shop-a.example.com: xlarge -> the app's size") { |
| t.Fatalf("events %+v", evs) |
| } |
| } |
| @@ -1465,7 +1465,7 @@ func TestCreateIsRefusedWhileAPredecessorsPolicyLingers(t *testing.T) { |
| // name is refused as a create failure rather than as a failed clear. |
| // It fails closed either way. |
| loc, page := w.createForm(t, "shop") |
| - if loc != w.path("/apps/new") || (!w.claims && !strings.Contains(page, "settings under this name, so nothing was created. Please try again.")) { |
| + if loc != w.path("/apps/new") || (!w.claims && !strings.Contains(page, "instance policy under this name, so nothing was created. Please try again.")) { |
| t.Fatalf("form create -> %s, want the refusal on the form:\n%s", loc, page) |
| } |
| if w.hasApp(t, "shop") { |
diff --git a/internal/console/egressfleet.go b/internal/console/egressfleet.go| index 01593e5e7..d7ea25b04 100644 |
| --- a/internal/console/egressfleet.go |
| +++ b/internal/console/egressfleet.go |
| @@ -38,13 +38,13 @@ import ( |
| "github.com/carlosframework/platform/internal/status" |
| ) |
| -// Door copy (drafts, collected for review in plan 2 Task 17). |
| +// Door copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan2.md). |
| const ( |
| - egressFleetHeldMsg = "%s is an address of box %s. An egress allow cannot open a box of this fleet." |
| - egressFleetUnreadableMsg = "Box %s's address list could not be read. Try again in a minute." |
| - egressFleetOlderBoxMsg = "Box %s does not publish its addresses yet. Upgrade it before granting an egress allow." |
| - egressFleetListMsg = "The fleet's address lists could not be read. Try again in a minute." |
| - egressFleetBoxesMsg = "The fleet's list of boxes could not be read. Try again in a minute." |
| + egressFleetHeldMsg = "%s is an address of box %s. an egress allow cannot open a box of this fleet" |
| + egressFleetUnreadableMsg = "box %s's address list could not be read. try again in a minute" |
| + egressFleetOlderBoxMsg = "box %s does not publish its addresses yet. upgrade it before granting an egress allow" |
| + egressFleetListMsg = "the fleet's address lists could not be read. try again in a minute" |
| + egressFleetBoxesMsg = "the fleet's list of boxes could not be read. try again in a minute" |
| ) |
| // egressGrantCheck checks the addresses a grant adds (new minus old) against |
| @@ -160,13 +160,18 @@ const ( |
| // egressReport.page stands in for it in tests. |
| var pageEgressConflict = alerting.Page |
| -// egressConflictAlert is the report's alert (drafts, collected for review |
| -// in plan 2 Task 17). |
| +// The report's alert (approved by delegation, Luna pass 2026-10-26): the |
| +// subject names the address; the body names the app, the account's sqid, the |
| +// address, the box and the app again. |
| +const ( |
| + egressConflictSubject = "Egress allow %s is now a fleet box's address." |
| + egressConflictBody = "App %s in account id %s may reach %s, and box %s now holds that address. The allow is still in force. Set the whole list again without that address by running carlos apps set %s --egress-allow, or move the address off the box." |
| +) |
| + |
| +// egressConflictAlert is the report's alert. |
| func egressConflictAlert(sqid, app string, addr netip.Addr, box string) (subject, body string) { |
| - return fmt.Sprintf("Egress allow %s is now a fleet box's address", addr), |
| - fmt.Sprintf("App %s in account %s may reach %s, and box %s now holds that address. "+ |
| - "The allow is still in force. Remove it with carlos apps set %s --egress-allow, or move the address off the box.", |
| - app, sqid, addr, box, app) |
| + return fmt.Sprintf(egressConflictSubject, addr), |
| + fmt.Sprintf(egressConflictBody, app, sqid, addr, box, app) |
| } |
| // egressReportState is the report's memory. Every field after mu is guarded |
diff --git a/internal/console/egressfleet_test.go b/internal/console/egressfleet_test.go| index 28a1c049e..8ada88f18 100644 |
| --- a/internal/console/egressfleet_test.go |
| +++ b/internal/console/egressfleet_test.go |
| @@ -164,9 +164,9 @@ func TestEgressGrantRefusesAFleetAddress(t *testing.T) { |
| add []string |
| want string |
| }{ |
| - {[]string{"10.0.5.20"}, "10.0.5.20 is an address of box olive. An egress allow cannot open a box of this fleet."}, |
| - {[]string{"10.0.9.9", "10.0.1.5"}, "10.0.1.5 is an address of box annie. An egress allow cannot open a box of this fleet."}, |
| - {[]string{"fd00:5::20"}, "fd00:5::20 is an address of box annie. An egress allow cannot open a box of this fleet."}, |
| + {[]string{"10.0.5.20"}, "10.0.5.20 is an address of box olive. an egress allow cannot open a box of this fleet"}, |
| + {[]string{"10.0.9.9", "10.0.1.5"}, "10.0.1.5 is an address of box annie. an egress allow cannot open a box of this fleet"}, |
| + {[]string{"fd00:5::20"}, "fd00:5::20 is an address of box annie. an egress allow cannot open a box of this fleet"}, |
| } { |
| nc, ref := s.egressGrantCheck(context.Background(), addrs(t, c.add...)) |
| if ref == nil || ref.Status != http.StatusConflict || ref.Msg != c.want { |
| @@ -188,14 +188,14 @@ func TestEgressGrantRefusesWhileAFileIsUnreadable(t *testing.T) { |
| putEdgesAddrs(t, cs, "annie", []string{"10.0.1.5"}) |
| putFixtureObject(t, cs, edgesfile.Key("betty"), []byte(`{"v":1,"box":"betty",`)) |
| nc, ref := s.egressGrantCheck(context.Background(), addrs(t, "10.0.5.20")) |
| - if want := "Box betty's address list could not be read. Try again in a minute."; ref == nil || |
| + if want := "box betty's address list could not be read. try again in a minute"; ref == nil || |
| ref.Status != http.StatusServiceUnavailable || ref.Msg != want { |
| t.Fatalf("an unreadable file = %v %+v, want 503 %q", nc, ref, want) |
| } |
| cs.fail(true) |
| nc, ref = s.egressGrantCheck(context.Background(), addrs(t, "10.0.5.20")) |
| - if want := "The fleet's address lists could not be read. Try again in a minute."; ref == nil || |
| + if want := "the fleet's address lists could not be read. try again in a minute"; ref == nil || |
| ref.Status != http.StatusServiceUnavailable || ref.Msg != want { |
| t.Fatalf("a failed listing = %v %+v, want 503 %q", nc, ref, want) |
| } |
| @@ -209,7 +209,7 @@ func TestEgressGrantRefusesAnOlderBox(t *testing.T) { |
| putEdgesAddrs(t, cs, "annie", []string{"10.0.1.5"}) |
| putEdgesAddrs(t, cs, "betty", nil) |
| nc, ref := s.egressGrantCheck(context.Background(), addrs(t, "10.0.5.20")) |
| - if want := "Box betty does not publish its addresses yet. Upgrade it before granting an egress allow."; ref == nil || |
| + if want := "box betty does not publish its addresses yet. upgrade it before granting an egress allow"; ref == nil || |
| ref.Status != http.StatusConflict || ref.Msg != want { |
| t.Fatalf("an older box = %v %+v, want 409 %q", nc, ref, want) |
| } |
| @@ -351,7 +351,7 @@ func TestPolicyDoorWritesNothingWhenTheCheckRefuses(t *testing.T) { |
| putEdgesAddrs(t, fx.rel, "annie", []string{"10.0.5.20"}) |
| before := fx.serial(t) |
| st, _, out := fx.put(t, "shop", `{"egress_allow":["10.0.5.20"],"default_size":"large"}`, policyCreate) |
| - if want := "10.0.5.20 is an address of box annie. An egress allow cannot open a box of this fleet."; st != http.StatusConflict || errorOf(t, out) != want { |
| + if want := "10.0.5.20 is an address of box annie. an egress allow cannot open a box of this fleet"; st != http.StatusConflict || errorOf(t, out) != want { |
| t.Fatalf("PUT = %d %s, want 409 %q", st, out, want) |
| } |
| fx.noObject(t, "shop") |
| @@ -589,9 +589,9 @@ func TestEgressReportAlertsOnceAndKeepsTheAllow(t *testing.T) { |
| if n := fx.ticks(t, reportBackstopTo); n != 1 { |
| t.Fatalf("the backstop ran %d passes in 33 minutes, want 1", n) |
| } |
| - want := "Egress allow 10.0.5.20 is now a fleet box's address\n" + |
| - "App shop in account " + fx.sqid + " may reach 10.0.5.20, and box betty now holds that address. " + |
| - "The allow is still in force. Remove it with carlos apps set shop --egress-allow, or move the address off the box." |
| + want := "Egress allow 10.0.5.20 is now a fleet box's address.\n" + |
| + "App shop in account id " + fx.sqid + " may reach 10.0.5.20, and box betty now holds that address. " + |
| + "The allow is still in force. Set the whole list again without that address by running carlos apps set shop --egress-allow, or move the address off the box." |
| if got := fx.sent(); len(got) != 1 || got[0] != want { |
| t.Fatalf("pages = %q, want one: %q", got, want) |
| } |
diff --git a/internal/console/policylease.go b/internal/console/policylease.go| index 6393c9617..73d036ee2 100644 |
| --- a/internal/console/policylease.go |
| +++ b/internal/console/policylease.go |
| @@ -75,13 +75,13 @@ const policyAttemptWindow = 10 * time.Second |
| // policyLeaseReleaseBudget bounds a release, as the housekeeper's does. |
| const policyLeaseReleaseBudget = 5 * time.Second |
| -// Door copy (collected for review in plan Task 15). |
| +// Door copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan1.md). |
| const ( |
| - policyLeaseHeldMsg = "another console (%s) is the policy writer for this deployment until %s. Make the change there, or try again after that" |
| - policyLeaseHeldNoOwnerMsg = "another console is the policy writer for this deployment until %s. Make the change there, or try again after that" |
| - policyLeaseUnavailableMsg = "could not take the policy writer lease. Try again" |
| - policyLeaseMissingMsg = "this console is not set up to write app policies (no writer lease). Deploy a console built from current main" |
| - policyLeaseLostMsg = "this console stopped being the policy writer during the change, so it may not have been published. Read the policy again before you retry" |
| + policyLeaseHeldMsg = "another console (%s) is the policy writer for this deployment until %s. use that console, or try again after that" |
| + policyLeaseHeldNoOwnerMsg = "another console is the policy writer for this deployment until %s. use the console that holds the lease, or try again after that" |
| + policyLeaseUnavailableMsg = "could not take the policy writer lease. try again" |
| + policyLeaseMissingMsg = "this console is not set up to write app policies (no writer lease). deploy a console built from current main" |
| + policyLeaseLostMsg = "this console stopped being the policy writer during the change, so it may not have been published. read the policy again before you retry" |
| ) |
| // PolicyLease is the slice of *lease.Held the writer uses. |
diff --git a/internal/console/policysize.go b/internal/console/policysize.go| index c5ded6bc8..e5cb79320 100644 |
| --- a/internal/console/policysize.go |
| +++ b/internal/console/policysize.go |
| @@ -34,11 +34,11 @@ import ( |
| "github.com/carlosframework/platform/internal/status" |
| ) |
| -// Door copy (drafts, plan 3 Task 14 strings 1-3). |
| +// Door copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan3.md IP3-01 to IP3-03). |
| const ( |
| - sizeQuarterMsg = "%s is more than a quarter of the memory on %s (%d MiB). Choose a smaller size." |
| - sizeNoTotalMsg = "%s does not publish its memory total, so only small and standard can be set. Upgrade the box, then try again." |
| - sizeUnreadMsg = "Could not read every box's memory total, so only small and standard can be set. Try again in a minute." |
| + sizeQuarterMsg = "%s is more than a quarter of the memory on %s (%d MiB). choose a smaller size" |
| + sizeNoTotalMsg = "%s does not publish its memory total, so only small and standard can be set. upgrade the box, then try again" |
| + sizeUnreadMsg = "could not read every box's memory total, so only small and standard can be set. try again in a minute" |
| ) |
| // sizeBox is one box a size may land on. TotalMiB 0 is unknown. fleet is |
diff --git a/internal/console/policysize_test.go b/internal/console/policysize_test.go| index 82e8e717e..4f69ac980 100644 |
| --- a/internal/console/policysize_test.go |
| +++ b/internal/console/policysize_test.go |
| @@ -133,7 +133,7 @@ func TestSizeCapacityRefusesAboveAQuarterOfTheSmallestBox(t *testing.T) { |
| recs := []provision.Record{sizeRecord(t, fx.rel, fx.sqid, "shop", shopHost, "")} |
| got := checkSizes(t, fx.srv, acct, recs, "xlarge", "large", "standard", "small") |
| - want := "xlarge is more than a quarter of the memory on annie (3884 MiB). Choose a smaller size." |
| + want := "xlarge is more than a quarter of the memory on annie (3884 MiB). choose a smaller size" |
| if r := got["xlarge"]; r == nil || r.Status != http.StatusConflict || r.Msg != want { |
| t.Fatalf("xlarge = %+v, want 409 %q", r, want) |
| } |
| @@ -158,7 +158,7 @@ func TestSizeCapacityRefusesAboveStandardWhenATotalIsMissing(t *testing.T) { |
| recs := []provision.Record{sizeRecord(t, fx.rel, fx.sqid, "shop", shopHost, "")} |
| got := checkSizes(t, fx.srv, acct, recs, "large", "standard", "small") |
| - want := "betty does not publish its memory total, so only small and standard can be set. Upgrade the box, then try again." |
| + want := "betty does not publish its memory total, so only small and standard can be set. upgrade the box, then try again" |
| if r := got["large"]; r == nil || r.Status != http.StatusConflict || r.Msg != want { |
| t.Fatalf("large = %+v, want 409 %q", r, want) |
| } |
| @@ -192,7 +192,7 @@ func TestSizeCapacityRefusesAboveStandardOnAnIncompleteSnapshot(t *testing.T) { |
| recs := []provision.Record{sizeRecord(t, fx.rel, fx.sqid, "shop", shopHost, "")} |
| got := checkSizes(t, fx.srv, acct, recs, "large", "standard") |
| - want := "Could not read every box's memory total, so only small and standard can be set. Try again in a minute." |
| + want := "could not read every box's memory total, so only small and standard can be set. try again in a minute" |
| if r := got["large"]; r == nil || r.Status != http.StatusServiceUnavailable || r.Msg != want { |
| t.Fatalf("large = %+v, want 503 %q", r, want) |
| } |
| @@ -328,7 +328,7 @@ func TestSizeCapacityRefusesAboveStandardWhenTheBoxListingIsIncomplete(t *testin |
| t.Fatal("sizeBoxes says complete with an unreadable status report") |
| } |
| got := checkSizes(t, fx.srv, acct, recs, "large", "standard") |
| - if r := got["large"]; r == nil || r.Status != http.StatusServiceUnavailable || !strings.HasPrefix(r.Msg, "Could not read every box's memory total") { |
| + if r := got["large"]; r == nil || r.Status != http.StatusServiceUnavailable || !strings.HasPrefix(r.Msg, "could not read every box's memory total") { |
| t.Fatalf("large = %+v, want 503 (string 3)", r) |
| } |
| if got["standard"] != nil { |
diff --git a/internal/console/server.go b/internal/console/server.go| index c3f28e247..897cd012e 100644 |
| --- a/internal/console/server.go |
| +++ b/internal/console/server.go |
| @@ -4260,8 +4260,8 @@ const ( |
| // Create door copy (collected for review in plan Task 15): the create-time |
| // clear of an earlier app's policy failed, so nothing was created. |
| const ( |
| - appCreatePolicyClearMsg = "an earlier app's settings under this name could not be cleared, so nothing was created. Try again, or ask an operator to delete %s from the deployment bucket" |
| - appCreatePolicyClearFlash = "Could not clear an earlier app's settings under this name, so nothing was created. Please try again." |
| + appCreatePolicyClearMsg = "an earlier app's instance policy under this name could not be cleared, so nothing was created. try again, or ask an operator to delete %s from the deployment bucket" |
| + appCreatePolicyClearFlash = "Could not clear an earlier app's instance policy under this name, so nothing was created. Please try again." |
| ) |
| // normalizeAppName is the one normalization both claim doors apply before |
diff --git a/internal/egressaddr/egressaddr.go b/internal/egressaddr/egressaddr.go| index c209d4a5b..bc938751c 100644 |
| --- a/internal/egressaddr/egressaddr.go |
| +++ b/internal/egressaddr/egressaddr.go |
| @@ -34,9 +34,9 @@ const MaxAllow = 8 |
| // Refusal text. A person reads these at the door and in root's report. |
| const ( |
| msgEmpty = "an address is empty" |
| - msgRange = "%q is a range. Allow single addresses only" |
| - msgPort = "%q has a port. An allow opens an address, never a port" |
| - msgZone = "%q has a zone. Name the address without it" |
| + msgRange = "%q is a range. allow single addresses only" |
| + msgPort = "%q has a port. an allow opens an address, never a port" |
| + msgZone = "%q has a zone. name the address without it" |
| msgNotAddr = "%q is not an IP address" |
| msgLoopback = "%s is a loopback address" |
| msgUnspecified = "%s is the unspecified address" |
| @@ -45,7 +45,7 @@ const ( |
| msgMulticast = "%s is a multicast address" |
| msgReserved = "%s is in %s, a reserved range" |
| msgNAT64 = "%s is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address" |
| - msgPublic = "%s is a public address and is already reachable. No allow is needed" |
| + msgPublic = "%s is a public address and is already reachable. no allow is needed" |
| msgTooMany = "at most %d addresses per app (%d given)" |
| ) |
diff --git a/internal/host/egress_source.go b/internal/host/egress_source.go| index 3488f55e9..8ac53a6d7 100644 |
| --- a/internal/host/egress_source.go |
| +++ b/internal/host/egress_source.go |
| @@ -392,8 +392,9 @@ func registryEgressHosts(dataDir string) func() ([]string, error) { |
| } |
| // claimsEgressDetail is the report's Detail under host claims; the REASON |
| -// column renders it as "egress: not yet supported under claims". |
| -const claimsEgressDetail = "not yet supported under claims" |
| +// column renders it after "egress: ". It says what the state word (IP2-15, |
| +// "not yet supported under claims") does not. |
| +const claimsEgressDetail = "host claims are on, so this box did not apply the allow" |
| // claimsEgressSource is root's egress source under host claims (spec §0 |
| // ruling 9). It answers every host EgressPolicy{Closed: EgressUnderClaims, |
diff --git a/internal/host/egress_source_test.go b/internal/host/egress_source_test.go| index 28e7065ee..6c98a45a3 100644 |
| --- a/internal/host/egress_source_test.go |
| +++ b/internal/host/egress_source_test.go |
| @@ -783,7 +783,7 @@ func TestClaimsEgressSourceClosesEveryHost(t *testing.T) { |
| for i := range 100 { |
| wantPolicy(t, readPolicy(t, src, hosts[i%len(hosts)]), want) |
| } |
| - if claimsEgressDetail != "not yet supported under claims" { |
| + if claimsEgressDetail != "host claims are on, so this box did not apply the allow" { |
| t.Fatalf("detail = %q", claimsEgressDetail) |
| } |
| if n := store.total(); n != 0 { |
diff --git a/internal/host/egress_startpaths_rootrunner_linux_test.go b/internal/host/egress_startpaths_rootrunner_linux_test.go| index 5af68a410..d3f26f606 100644 |
| --- a/internal/host/egress_startpaths_rootrunner_linux_test.go |
| +++ b/internal/host/egress_startpaths_rootrunner_linux_test.go |
| @@ -503,7 +503,7 @@ func plan14EgressClaimChecks(t *testing.T, host string, tenant *http.Client, tar |
| t.Fatalf("under claims: the status probe published %+v (%v), want under_claims %q", h, ok, claimsEgressDetail) |
| } |
| // instances_cli.go's egressReason renders REASON as the label and the detail. |
| - if reason := "egress: " + h.Detail; reason != "egress: not yet supported under claims" { |
| + if reason := "egress: " + h.Detail; reason != "egress: host claims are on, so this box did not apply the allow" { |
| t.Fatalf("REASON would read %q", reason) |
| } |
| policyDir := filepath.Join(systemGuardDir(optDir), "app-policy") |
diff --git a/internal/host/egress_status_test.go b/internal/host/egress_status_test.go| index 8141a6ff9..61198ea92 100644 |
| --- a/internal/host/egress_status_test.go |
| +++ b/internal/host/egress_status_test.go |
| @@ -161,7 +161,7 @@ func TestEgressStatusProbeShowsUnderClaimsOnlyWhereGranted(t *testing.T) { |
| } |
| got := egressStatusProbe(c, rows, nil) |
| want := map[string]status.HostEgress{ |
| - "shop-a.example.com": {State: "under_claims", Detail: "not yet supported under claims"}, |
| + "shop-a.example.com": {State: "under_claims", Detail: "host claims are on, so this box did not apply the allow"}, |
| } |
| if !reflect.DeepEqual(got, want) { |
| t.Fatalf("probe = %+v\nwant %+v", got, want) |
diff --git a/internal/instancectl/egress_due_linux_test.go b/internal/instancectl/egress_due_linux_test.go| index ccb929e03..3b64f0f31 100644 |
| --- a/internal/instancectl/egress_due_linux_test.go |
| +++ b/internal/instancectl/egress_due_linux_test.go |
| @@ -263,14 +263,14 @@ func TestEgressDueRecordFailureNeverHoldsARevoke(t *testing.T) { |
| logged(t, *logs) |
| }) |
| t.Run("under claims: the reset is written and the units restart", func(t *testing.T) { |
| - claims := EgressPolicy{Closed: EgressUnderClaims, Detail: "not yet supported under claims"} |
| + claims := EgressPolicy{Closed: EgressUnderClaims, Detail: "host claims are on, so this box did not apply the allow"} |
| ctl, e, logs := box(t, slice, claims, true) |
| rep := mustAssert(t, e, egressHost) |
| calls := ctl.takeCalls() |
| if !slices.Contains(calls, setCall(egressHost)) || !slices.Contains(calls, "try-restart "+run) { |
| t.Fatalf("calls %q, want the slice reset and the run unit restarted", calls) |
| } |
| - if rep.State != EgressUnderClaims || rep.Detail != "not yet supported under claims; "+egressRestarted || len(rep.Allowed) != 0 { |
| + if rep.State != EgressUnderClaims || rep.Detail != "host claims are on, so this box did not apply the allow; "+egressRestarted || len(rep.Allowed) != 0 { |
| t.Fatalf("report = %+v", rep) |
| } |
| logged(t, *logs) |
diff --git a/internal/instancectl/egress_restart_linux_test.go b/internal/instancectl/egress_restart_linux_test.go| index 51cf297d2..5977df71f 100644 |
| --- a/internal/instancectl/egress_restart_linux_test.go |
| +++ b/internal/instancectl/egress_restart_linux_test.go |
| @@ -120,9 +120,9 @@ func TestEgressRevokeToEmptyRestartsWithoutAParentAllow(t *testing.T) { |
| }) |
| t.Run("under claims the reset of a stale allow restarts too, the detail kept", func(t *testing.T) { |
| ctl, root := box(t, "10.0.5.20/32", "") |
| - rep := mustAssert(t, asserter(ctl, root, EgressPolicy{Closed: EgressUnderClaims, Detail: "not yet supported under claims"}), egressHost) |
| + rep := mustAssert(t, asserter(ctl, root, EgressPolicy{Closed: EgressUnderClaims, Detail: "host claims are on, so this box did not apply the allow"}), egressHost) |
| wantCalls(t, restarts(ctl), "try-restart "+run) // under claims no parent read: every revoke restarts |
| - if rep.State != EgressUnderClaims || rep.Detail != "not yet supported under claims; "+egressRestarted { |
| + if rep.State != EgressUnderClaims || rep.Detail != "host claims are on, so this box did not apply the allow; "+egressRestarted { |
| t.Fatalf("report = %+v", rep) |
| } |
| }) |
| @@ -420,13 +420,13 @@ func TestEgressChangeNudgesRunningServices(t *testing.T) { |
| } |
| }) |
| t.Run("under claims a revoke restarts, with a parent allow, no nudge", func(t *testing.T) { |
| - ctl, e, run := nudgeBox(t, "10.0.5.20/32", "10.0.5.53/32", EgressPolicy{Closed: EgressUnderClaims, Detail: "not yet supported under claims"}, nil) |
| + ctl, e, run := nudgeBox(t, "10.0.5.20/32", "10.0.5.53/32", EgressPolicy{Closed: EgressUnderClaims, Detail: "host claims are on, so this box did not apply the allow"}, nil) |
| rep := mustAssert(t, e, egressHost) |
| calls := unitCalls(ctl, run) |
| if !slices.Contains(calls, "try-restart "+run) || slices.Contains(calls, nudgeCalls(run)[1]) { |
| t.Fatalf("calls = %q, want a restart and no nudge", calls) |
| } |
| - if rep.State != EgressUnderClaims || rep.Detail != "not yet supported under claims; "+egressRestarted { |
| + if rep.State != EgressUnderClaims || rep.Detail != "host claims are on, so this box did not apply the allow; "+egressRestarted { |
| t.Fatalf("report = %+v", rep) |
| } |
| }) |
diff --git a/internal/instancectl/egress_startpaths_test.go b/internal/instancectl/egress_startpaths_test.go| index 8ef4861c2..fda289b8b 100644 |
| --- a/internal/instancectl/egress_startpaths_test.go |
| +++ b/internal/instancectl/egress_startpaths_test.go |
| @@ -247,7 +247,7 @@ type noPolicyAsserter struct { |
| } |
| // claimsDetail is the host package's claimsEgressDetail. |
| -const claimsDetail = "not yet supported under claims" |
| +const claimsDetail = "host claims are on, so this box did not apply the allow" |
| func noPolicyAsserters() []noPolicyAsserter { |
| return []noPolicyAsserter{ |
diff --git a/internal/instancectl/egress_test.go b/internal/instancectl/egress_test.go| index 47b1005a4..78d666162 100644 |
| --- a/internal/instancectl/egress_test.go |
| +++ b/internal/instancectl/egress_test.go |
| @@ -201,8 +201,8 @@ func TestEgressRefusesEachBadEntryWithItsReason(t *testing.T) { |
| // egressaddr's errors already name the address (C4): carried as-is. |
| want := []string{ |
| "127.0.0.1 is a loopback address", |
| - "8.8.8.8 is a public address and is already reachable. No allow is needed", |
| - `"10.0.5.20:5432" has a port. An allow opens an address, never a port`, |
| + "8.8.8.8 is a public address and is already reachable. no allow is needed", |
| + `"10.0.5.20:5432" has a port. an allow opens an address, never a port`, |
| } |
| if !reflect.DeepEqual(rep.Refused, want) { |
| t.Fatalf("Refused = %q, want %q", rep.Refused, want) |
diff --git a/internal/status/snapshot_test.go b/internal/status/snapshot_test.go| index 4e9750520..bef0e54e3 100644 |
| --- a/internal/status/snapshot_test.go |
| +++ b/internal/status/snapshot_test.go |
| @@ -234,7 +234,7 @@ func TestCollectBoxCarriesEgress(t *testing.T) { |
| at := time.Date(2026, 10, 25, 9, 0, 0, 0, time.UTC) |
| eg := map[string]HostEgress{ |
| "shop-a.example.com": {Allowed: []string{"10.0.5.20"}, Refused: []string{"10.0.0.0/8: too wide"}}, |
| - "shop-b.example.com": {State: "under_claims", Detail: "not yet supported under claims"}, |
| + "shop-b.example.com": {State: "under_claims", Detail: "host claims are on, so this box did not apply the allow"}, |
| } |
| b := CollectBox(nil, Probes{Egress: eg}, at) |
| if b.Metrics == nil { |
| @@ -249,7 +249,7 @@ func TestCollectBoxCarriesEgress(t *testing.T) { |
| } |
| for _, want := range []string{ |
| `"egress":{"shop-a.example.com":{"allowed":["10.0.5.20"],"refused":["10.0.0.0/8: too wide"]}`, |
| - `"shop-b.example.com":{"state":"under_claims","detail":"not yet supported under claims"}`, |
| + `"shop-b.example.com":{"state":"under_claims","detail":"host claims are on, so this box did not apply the allow"}`, |
| } { |
| if !strings.Contains(string(out), want) { |
| t.Errorf("json lacks %s: %s", want, out) |
diff --git a/internal/updatewords/words_surfaces.go b/internal/updatewords/words_surfaces.go| index 31784e311..7237335a7 100644 |
| --- a/internal/updatewords/words_surfaces.go |
| +++ b/internal/updatewords/words_surfaces.go |
| @@ -28,7 +28,7 @@ func init() { |
| Context: "Two entries added to the list of verbs printed by carlos instances with no verb, after retry."}, |
| Draft{ID: "settings.cli.instances-usage-para", Text: "set changes how one instance takes new builds: --updates auto or manual,\n--channel (the app's pipeline rules apply), --major to stay on one major\nversion of stable, and --pin to run exactly one build. An empty value clears\na setting, so the app's default applies again. update asks the instance's\nbox to install the newest build it considers ready, even with manual\nupdates; --fast-track skips the safety delay and needs an account owner.", |
| Context: "Paragraph added to the carlos instances usage text, after the paragraph about retry."}, |
| - Draft{ID: "settings.cli.set-usage", Text: "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] (an empty value clears)", |
| + Draft{ID: "settings.cli.set-usage", Text: "usage: carlos instances set <host> [--app <a>] [--updates auto|manual] [--channel <c>] [--major <n>] [--pin <build>] [--size small|standard|large|xlarge|default] (an empty value clears an update setting)", |
| Context: "Usage line for carlos instances set."}, |
| Draft{ID: "settings.cli.set-done", Text: "%s: updates %s, channel %s, major %s, pin %s", |
| Context: "Printed after a change. Host, then each setting as it now stands (none where unset)."}, |
diff --git a/status_instances.go b/status_instances.go| index c186788f2..6d79ff5ae 100644 |
| --- a/status_instances.go |
| +++ b/status_instances.go |
| @@ -153,11 +153,10 @@ type statusLayoutRow struct { |
| Size string `json:"size"` |
| } |
| -// Copy for `carlos status --layout` (plan 3 Task 14, drafts until the copy |
| -// review approves them). |
| +// Copy for `carlos status --layout` (plan 3 IP3-04 and IP3-09, approved by delegation, Luna pass 2026-10-26). |
| const ( |
| statusLayoutHeading = "BOX HOST LAYOUT SIZE EGRESS REASON" |
| - statusLayoutSizePending = "A size after > takes effect when the instance next starts cold. Restart the instance to apply it now." |
| + statusLayoutSizePending = "A size after > is the wanted size. A larger size takes effect at the instance's next start or deploy; a smaller size waits for a cold start. Restart the instance to apply the new memory size now." |
| ) |
| // statusLayoutBox is one box's layout report. |
| @@ -273,7 +272,11 @@ func printStatusLayout(w io.Writer, boxes []statusLayoutBox) { |
| }) |
| fmt.Fprintln(w, statusLayoutHeading) |
| for _, l := range lines { |
| - fmt.Fprintf(w, "%s %s %s %s %s %s\n", l.box, l.host, l.layout, l.size, l.egress, dashIfEmpty(l.reason)) |
| + reason := l.reason |
| + if reason == "" { |
| + reason = "-" |
| + } |
| + fmt.Fprintf(w, "%s %s %s %s %s %s\n", l.box, l.host, l.layout, l.size, l.egress, reason) |
| } |
| // A size cell "in>want" is a new size waiting for a cold start (a |
| // populated slice is not shrunk live, and under host claims no size |
diff --git a/status_instances_test.go b/status_instances_test.go| index a26a46266..0dad8278c 100644 |
| --- a/status_instances_test.go |
| +++ b/status_instances_test.go |
| @@ -176,10 +176,10 @@ func TestStatusLayoutShowsEgress(t *testing.T) { |
| out := buf.String() |
| for _, want := range []string{ |
| "BOX HOST LAYOUT SIZE EGRESS REASON\n", |
| - "ie-1 shop-a.example.com nested - !10.0.5.20,fd00:5::20 " + dashIfEmpty("") + "\n", |
| + "ie-1 shop-a.example.com nested - !10.0.5.20,fd00:5::20 -\n", |
| "ie-1 shop-b.example.com foreign - 10.0.5.20 !refused db and socket are neither default; egress: 10.0.5.1: an address of this box\n", |
| "ie-1 shop-c.example.com nested - - !box not wholly nested egress: flat row shop-d.example.com\n", |
| - "ie-1 shop-d.example.com flat - - " + dashIfEmpty("") + "\n", |
| + "ie-1 shop-d.example.com flat - - -\n", |
| } { |
| if !strings.Contains(out, want) { |
| t.Errorf("missing %q in:\n%s", want, out) |
| @@ -269,7 +269,7 @@ func TestStatusLayoutShowsSize(t *testing.T) { |
| t.Errorf("missing %q in:\n%s", want, out) |
| } |
| } |
| - footnote := "A size after > takes effect when the instance next starts cold. Restart the instance to apply it now.\n" |
| + footnote := "A size after > is the wanted size. A larger size takes effect at the instance's next start or deploy; a smaller size waits for a cold start. Restart the instance to apply the new memory size now.\n" |
| if n := strings.Count(out, footnote); n != 1 { |
| t.Errorf("the > footnote printed %d times, want once:\n%s", n, out) |
| } |