instance policy: the Luna copy result for plans 1 to 3 (approved by delegation, PM-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+164
−0
docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md+164 −0
diff --git a/docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md b/docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md| new file mode 100644 |
| index 000000000..6d5ce54f1 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md |
| @@ -0,0 +1,164 @@ |
| +# Luna copy result: instance policies, egress allows and sizes (#328, #329) |
| + |
| +Approved by delegation (Luna). Model gpt-5.6-luna via codex, reasoning high, read-only, run 2026-10-26 against docs/superpowers/specs/LUNA-COPY-BRIEF-INSTANCE-POLICY.md. Applied verbatim. Luna flagged nothing for Paul. Its first line below is its own note on the run (the orchestra check it tried is a network call the read-only sandbox refused). |
| + |
| +No files edited. The orchestra check could not reach its registry service because network access is blocked. |
| + |
| +| key | new | why | |
| +|---|---|---| |
| +| IP1-01 | an address is empty | unchanged | |
| +| IP1-02 | %q is a range. allow single addresses only | lower-case after the full stop | |
| +| IP1-03 | %q has a port. an allow opens an address, never a port | lower-case after the full stop | |
| +| IP1-04 | %q has a zone. name the address without it | lower-case after the full stop | |
| +| IP1-05 | %q is not an IP address | unchanged | |
| +| IP1-06 | %s is a loopback address | unchanged | |
| +| IP1-07 | %s is the unspecified address | unchanged | |
| +| IP1-08 | %s is the cloud metadata service | unchanged | |
| +| IP1-09 | %s is link-local | unchanged | |
| +| IP1-10 | %s is a multicast address | unchanged | |
| +| IP1-11 | %s is in %s, a reserved range | unchanged | |
| +| IP1-12 | %s is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address | unchanged | |
| +| IP1-13 | %s is a public address and is already reachable. no allow is needed | lower-case after the full stop | |
| +| IP1-14 | at most %d addresses per app (%d given) | unchanged | |
| +| IP1-15 | another console (%s) is the policy writer for this deployment until %s. use that console, or try again after that | Covers app creates as well as policy changes | |
| +| IP1-16 | another console is the policy writer for this deployment until %s. use the console that holds the lease, or try again after that | Covers app creates as well as policy changes | |
| +| IP1-17 | could not take the policy writer lease. try again | Lower-case after the full stop | |
| +| IP1-18 | this console is not set up to write app policies (no writer lease). deploy a console built from current main | Lower-case after the full stop | |
| +| IP1-19 | this console stopped being the policy writer during the change, so it may not have been published. read the policy again before you retry | Lower-case after the full stop | |
| +| IP1-20 | nothing to set: send egress_allow, default_size or size | unchanged | |
| +| IP1-21 | default_size must be small, standard, large or xlarge, or empty for the build's size | unchanged | |
| +| IP1-22 | size must be small, standard, large, xlarge or default | unchanged | |
| +| IP1-23 | no instance %s in this app | unchanged | |
| +| IP1-24 | send If-Match with the policy's etag, or If-None-Match: * when there is none | unchanged | |
| +| IP1-25 | the policy changed since it was read. read it again and retry | Lower-case after the full stop | |
| +| IP1-26 | the change could not be recorded, so it was not made. try again | Lower-case after the full stop | |
| +| IP1-27 | the change could not be audited, so it was not made. try again | Lower-case after the full stop | |
| +| IP1-28 | the change is recorded but not yet published. run the command again to publish it now | Lower-case after the full stop | |
| +| IP1-29 | could not read the policy. try again | unchanged | |
| +| IP1-30 | invalid host | unchanged | |
| +| IP1-45 | the app was deleted, renamed or moved while the change was being made, so it was not made | unchanged | |
| +| IP3-01 | %s is more than a quarter of the memory on %s (%d MiB). choose a smaller size | Door casing and terminal punctuation | |
| +| IP3-02 | %s does not publish its memory total, so only small and standard can be set. upgrade the box, then try again | Door casing and terminal punctuation | |
| +| IP3-03 | could not read every box's memory total, so only small and standard can be set. try again in a minute | Door casing and terminal punctuation | |
| +| IP1-A1 | egress allow: %s -> %s | unchanged | |
| +| IP1-A2 | default size: %s -> %s | unchanged | |
| +| IP1-A3 | size of %s: %s -> %s | unchanged | |
| +| IP1-A5 | the build's size | Keep the shared phrase | |
| +| IP1-A6 | the app's size | Matches the corresponding policy state | |
| +| IP1-40 | 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 | Replaces ambiguous “settings” and fixes casing | |
| +| IP1-41 | Could not clear an earlier app's instance policy under this name, so nothing was created. Please try again. | Replaces ambiguous “settings” | |
| +| IP1-46 | This app has had an instance policy set by an operator, so it cannot be renamed. Create a new app instead. | unchanged | |
| +| IP1-47 | The name %s has had an instance policy set by an operator, so no app can be renamed to it. Choose another name. | unchanged | |
| +| IP1-48 | Could not check the instance policies, so nothing was renamed. Try again. | unchanged | |
| +| IP1-49 | 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. | unchanged | |
| +| IP1-58 | 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. | unchanged | |
| +| IP1-59 | Could not check the instance policies, so nothing was moved. Try again. | unchanged | |
| +| IP1-31 | apps set: --egress-allow: %v | unchanged | |
| +| IP1-32 | apps set: --size is small, standard, large, xlarge or default, not %q | unchanged | |
| +| IP1-33 | instances set: --size is small, standard, large, xlarge or default, not %q | unchanged | |
| +| IP1-34 | 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) | unchanged | |
| +| IP1-35 | the policy changed while this ran. run it again | Lower-case after the full stop | |
| +| IP1-36 | egress allow for %s set to %s | Says what was recorded | |
| +| IP1-37 | egress allow for %s cleared | Says what was recorded | |
| +| IP2-30 | not checked against these boxes, which publish no address list: %s | CLI casing and punctuation | |
| +| IP1-38 | default size for %s set to %s. instances with their own size are unchanged | Says what was recorded | |
| +| IP1-39 | default size for %s set to the build's size. instances with their own size are unchanged | Says what was recorded | |
| +| IP1-42 | %s size set to %s | Says what was recorded | |
| +| IP1-43 | %s size cleared. it follows the app's size | Says what was recorded | |
| +| IP3-10 | %s: %d MiB committed to awake instances, of %d MiB. %d MiB free | Removes terminal punctuation | |
| +| IP3-11 | 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 | Matches the memory timing rules | |
| +| IP1-44 | 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\> | Lower-case after the full stop | |
| +| IP1-50 | private addresses every instance of the app may reach, comma-separated, never a port. pass the whole list; "" clears it. system operators only | Makes replacement semantics explicit | |
| +| IP1-51 | the size the app's instances run at: small, standard, large or xlarge. default uses the build's size. system operators only | Plain wording and casing | |
| +| IP1-52 | this instance's size: small, standard, large or xlarge. default follows the app's size. system operators only | Lower-case after the full stop | |
| +| IP1-53 | Only system operators may pass --egress-allow or --size. A change reaches<br>the app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box. | Corrects the timing claim | |
| +| IP1-54 | usage: carlos apps show \<app\> [--account \<sqid\|name>] [--account-id \<sqid>] [--console \<origin>] | unchanged | |
| +| IP1-55 | ` show <app> the app's egress allow and sizes. system operators only` | CLI casing and punctuation | |
| +| IP1-56 | usage: carlos apps \<create\|place\|build-probe\|set\|show\|delete\|restore\|ttl\|keep\|list\> [flags] \<app\> | unchanged | |
| +| IP1-57 | apps set: nothing to set. Pass --swap, --swap-concurrency, --egress-allow or --size | unchanged | |
| +| IP1-60 | `egress allow %s` | unchanged | |
| +| IP1-61 | `default size %s` | unchanged | |
| +| IP1-62 | `size %s %s` | unchanged | |
| +| IP1-63 | none | unchanged | |
| +| IP1-64 | the build's size | Keep the shared phrase | |
| +| IP1-65 | ` (not in force. the instance was deleted or recreated)` | Lower-case after the full stop | |
| +| GAP-1 | 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) | Adds `--size` and limits the empty-value note | |
| +| GAP-2 | 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] | Adds both policy flags | |
| +| GAP-3 | app whose swap or instance policy to set | Covers the expanded command | |
| +| IP3-04 | `BOX HOST LAYOUT SIZE EGRESS REASON` | unchanged | |
| +| IP2-02 | `HOST REGION CHANNEL POOL INSTALLED SERVING HEALTH UPSTREAMS DB EGRESS CREATED BY REASON` | unchanged | |
| +| IP3-05 | swap | unchanged | |
| +| IP3-06 | ? | unchanged | |
| +| IP3-07 | `<in force>><wanted>`, as `standard>large` | unchanged | |
| +| IP3-08 | - | unchanged | |
| +| IP3-12 | - | Uses one glyph throughout this table | |
| +| IP3-09 | 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. | Keeps the footnote and fixes its timing | |
| +| IP2-04 | `!` before an address | unchanged | |
| +| IP2-07 | refused | unchanged | |
| +| IP2-08 | `egress: ` | unchanged | |
| +| IP2-10 | failing | unchanged | |
| +| IP2-11 | policy unreadable | unchanged | |
| +| IP2-12 | policy unverifiable | unchanged | |
| +| IP2-13 | policy expired | unchanged | |
| +| IP2-14 | box not wholly nested | unchanged | |
| +| IP2-15 | not yet supported under claims | unchanged | |
| +| IP2-16 | pending | unchanged | |
| +| IP2-17 | not available | unchanged | |
| +| IP2-20 | the allow takes effect when the instance next starts | unchanged | |
| +| IP2-21 | the box could not apply the allow, and tries again | unchanged | |
| +| IP2-22 | the allow is not in force on this box | unchanged | |
| +| IP2-60 | %s: an address of this box (%s) | unchanged | |
| +| IP2-61 | %s: this box's addresses could not be read | unchanged | |
| +| IP2-45 | the policy has more than %d addresses (%d); every one is closed | unchanged | |
| +| IP2-46 | host claims are on, so this box did not apply the allow | Avoids repeating the state word | |
| +| IP2-47 | no expiry recorded | unchanged | |
| +| IP2-48 | the policy expired at %s | unchanged | |
| +| IP2-49 | revoked (restarted) | unchanged | |
| +| IP2-70 | %s is a sidecar member, which runs flat | unchanged | |
| +| IP2-71 | %s runs as %s, whose user could not be read: %v | unchanged | |
| +| IP2-72 | %s runs as %s, which runs as the agent's user | unchanged | |
| +| IP2-73 | %s has backing %q, which this check does not know | unchanged | |
| +| IP2-74 | %s is a %q row, which this check does not know | unchanged | |
| +| IP2-40 | %s is an address of box %s. an egress allow cannot open a box of this fleet | Door casing and punctuation | |
| +| IP2-41 | box %s's address list could not be read. try again in a minute | Door casing and punctuation | |
| +| IP2-42 | box %s does not publish its addresses yet. upgrade it before granting an egress allow | Door casing and punctuation | |
| +| IP2-43 | the fleet's address lists could not be read. try again in a minute | Door casing and punctuation | |
| +| IP2-44 | the fleet's list of boxes could not be read. try again in a minute | Door casing and punctuation | |
| +| IP2-50 | Egress allow %s is now a fleet box's address. | Adds alert punctuation | |
| +| IP2-51 | 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. | Identifies the account value as a sqid and fixes the whole-list instruction | |
| +| DOC-1 | System operators can also set an app's instance policy: which private addresses its instances may reach and the size each instance runs at. `carlos apps show` reads it back. | Makes the size subject precise | |
| +| DOC-2 | An instance cannot reach a private address unless its app allows it. `--egress-allow` takes the app's whole list, comma-separated, and replaces the list before it. To drop one address, pass the list without it; `--egress-allow ""` removes them all. Each entry is a single IP address, with no range, port or zone. Public addresses are refused because instances can reach them already, and so are loopback, link-local, multicast and reserved addresses, the cloud metadata service and the NAT64 prefix. An app may allow at most 8. | unchanged | |
| +| DOC-3 | A change that adds an address is checked against the deployment's boxes. An address that belongs to one of them is refused, and so is any new address while a box does not publish its address list yet. Boxes that publish none at all are named after the change. An allow takes effect only on a box where every instance runs nested (see `carlos status --layout`). It does not take effect while host claims are on. If a box later takes an allowed address, the console sends an alert. | Clarifies the claims condition | |
| +| DOC-4 | The sizes are `small` (256 MiB of memory), `standard` (512 MiB), `large` (1 GiB) and `xlarge` (2 GiB), with CPU and IO to match. `carlos apps set --size` sets the app's size, and `--size default` goes back to the build's size. `carlos instances set --size` gives one instance a size of its own, and `--size default` makes it follow the app's size again. A size above `standard` is refused when it is more than a quarter of the memory on the smallest box the app can run on, or when one of those boxes reports no memory total. | Clarifies “the app's” | |
| +| DOC-5 | After a size change, the command prints each box's memory committed to awake instances, out of its total. CPU and IO change at once. A larger size's memory applies when an instance next starts or is deployed. A smaller size applies only when the instance starts cold. Restart it to apply the new memory now. `carlos status --layout` shows the size each instance runs at. | Fixes the smaller-size deploy claim | |
| +| DOC-6 | The console records a change, and the app's boxes apply it. A box that follows the deployment's change index does so within seconds; any other box within about 33 minutes. `carlos apps show` prints the egress allow, the app's size, and every instance with a size of its own. A `!` before an address means one of the deployment's boxes now holds it. | unchanged | |
| +| DOC-7 | An empty value clears an update setting, so the app's default applies again. System operators can also give the instance its own size with `--size`; `--size default` clears it. See [carlos apps](/docs/cli#carlos-apps). | unchanged | |
| +| DOC-8 | The `EGRESS` column lists the private addresses the instance may reach, or `-` for none. A word after `!` means the allow is not in force yet: `pending` until the instance next starts, `failing` while its box retries, or `not available` on a box that cannot apply it. The `REASON` column says why, after `egress:`. | unchanged | |
| +| DOC-9 | The `SIZE` column is the size an awake nested instance runs at: `swap` while a deploy is swapping it, `?` when its box could not read it, and `-` for anything else. `standard>large` means it runs at standard and its policy asks for large; a note under the table says when that takes effect. The `EGRESS` column is the instance's egress allow as its box applies it. A `!` before an address means one of the deployment's boxes now holds it. A word after `!` means the allow is not in force: `failing`, `policy unreadable`, `policy unverifiable`, `policy expired`, `box not wholly nested`, `not yet supported under claims`, or `refused` when the box dropped an entry. `REASON` gives the detail after `egress:`. | unchanged | |
| +| DOC-10 | - one console per bucket writes policies. it holds a lease at `control/app-policy-lease/lock.json`, taken the first time it changes a policy and renewed every five minutes after that. an app create takes it too, but only when an earlier app's policy is still stored under the new name and has to be cleared first. a second console on the same bucket refuses those changes and creates, and names the console that holds the lease and when it expires. | unchanged | |
| +| DOC-11 | - a console that stops cleanly gives the lease back. if it crashes, or its role may not delete objects in the bucket, the lease stays held for up to 15 minutes. until it lapses, the console that replaced it refuses policy changes, and app creates that would have to clear an earlier policy. | unchanged | |
| +| DOC-12 | - every box must run this release before the first egress grant. a box that does not publish its addresses refuses every grant that adds one, and a box with no address list at all is named as not checked. | unchanged | |
| +| DOC-13 | - a revoke takes effect at once when `carlos-instances.slice` holds the resolver allow, the normal case. on a box where it holds none, or cannot be read, a revoke that empties a host's allow restarts that host's running units, and `carlos status --layout` says `revoked (restarted)`. | unchanged | |
| +| DOC-14 | - after every change to a host's allow, root writes an empty `IPAddressAllow=` on each running unit in the slice so the change reaches it. that leaves `/run/systemd/system.control/<unit>.d/50-IPAddressAllow.conf` until reboot. it is expected: the claim checks accept exactly that drop-in, so nothing needs clearing before claims are switched on. | unchanged | |
| +| DOC-15 | - under host claims root writes no allow, and `carlos status --layout` says `not yet supported under claims`. switching claims on resets every allow granted before, and restarts the running units of each host that held one. an allow is honoured only on a box where every row is nested; otherwise `box not wholly nested` names the first row that is not. | unchanged | |
| +| DOC-16 | - the console re-checks live allows against the boxes' addresses when a box's address list changes (with `CARLOS_CHANGE_INDEX=read`, and not under host claims), and otherwise every 30 to 33 minutes. it alerts through `CARLOS_ALERT_WEBHOOK` or `CARLOS_ALERT_SNS_TOPIC_ARN`, at most once a day per app and address. with neither set it only logs. | unchanged | |
| +| DOC-17 | - memory never changes on a running instance. a larger size's memory applies at the instance's next start or deploy, and a smaller size waits for a cold start. cpu and io change at once. a size above standard is refused when a box the app can run on reports no memory total, or when it is more than a quarter of the smallest such box's memory. | Makes the deploy rule explicit | |
| + |
| +## Reviewer items |
| + |
| +1. Keep `!` for both meanings. Its position distinguishes a held address from a state word, and the docs explain both forms. |
| +2. Lower-case IP2-40 to IP2-44 and IP3-01 to IP3-03 as door strings, with no terminal full stop. |
| +3. Change IP2-46 to `host claims are on, so this box did not apply the allow`. |
| +4. Identify the alert value as an account id with `account id %s`. |
| +5. Tell the operator to set the whole list again without the held address. |
| +6. Rewrite success lines to say what was set. Correct the propagation timing to seconds for change-index boxes and about 33 minutes for others. Correct the memory timing for smaller sizes. |
| +7. Add `--size` to GAP-1 and say that only an empty update setting clears. |
| +8. Use `-` for the empty `REASON` cell in `status --layout`. |
| +9. Keep the footnote under the table. Explain that the size after `>` is wanted, that larger memory applies on the next start or deploy, and that smaller memory waits for a cold start. |
| +10. Keep `the build's size` unchanged in all five occurrences. Change IP1-A6 to `the app's size` so the equivalent state is named consistently. |
| +11. Replace “make the change there” with wording that also covers app creates. |
| +12. Replace “settings” with “instance policy” in IP1-40 and IP1-41. |
| + |
| +## Flags |
| + |
| +None. |
| \ No newline at end of file |