carlos / platform Public

copy: merge B strings approved (delegated Luna pass on Paul's standing rule); spec notes the cancel deviation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev c30283a03cc647f059064be558fcb51b1c335ea8 parent 70d3767
1 file changed, +126 −0
  • docs/superpowers/notes/copy/nearest-region-never-reuse-b.md +126 −0

CI passed — run details

diff --git a/docs/superpowers/notes/copy/nearest-region-never-reuse-b.md b/docs/superpowers/notes/copy/nearest-region-never-reuse-b.md
new file mode 100644
index 000000000..c6bf844f4
--- /dev/null
+++ b/docs/superpowers/notes/copy/nearest-region-never-reuse-b.md
@@ -0,0 +1,126 @@
+# Nearest-region never-reuse, merge B: approved copy
+
+approved by delegated Luna pass on Paul's standing rule, 2026-10-26. Apply verbatim; placeholders are in angle brackets. S1-S8 are in nearest-region-never-reuse.md. Line breaks inside the README text are wrapping only.
+
+S1-S8 are approved and used verbatim. Placeholders: <n>, <target>, <fleet>, <entry>, <version>, <commit>, <mode line>.
+
+## A. `carlos system hosts-used status` lines (A1-A9 committed as drafts in merge A)
+A1 mode: incomplete. new hostnames are recorded, and a hostname that held data is not refused yet
+A2 mode: activating. new instances, moves and placement changes are paused
+A3 mode: active. a hostname that has held data is never created again
+A4 mode: invalidated. new instances are refused until a fresh inventory completes
+A5 hostnames recorded: <n>
+A6 create and placement requests in progress: <n> (was "create requests in progress")
+A7 instance creates still settling: <n>
+A8 instance deletes still settling: <n>
+A9 moves not finished: <n>
+A10 listings imported: <n> of <n> (only while the window is open)
+A11 not imported yet: <target>, <target> (only while the window is open)
+A12 closed fleets: <fleet>, <fleet>
+A13 floor: <version> (<commit>)
+
+## B. Other command output
+B1 begin: maintenance window open. new instances, moves and placement changes are paused until you complete or cancel it
+B2 begin: run carlos system hosts-used status until every count is 0, then scan every target and import the listings
+B3 cancel: maintenance window closed. nothing was recorded (then the A1/A4 mode line)
+B4 import, per target: <target>: <n> hostnames
+B5 import, per target: <target>: the listing failed: <error>
+B6 import, per target: <target>: <n> entries have no hostname, such as <entry>
+B7 close-fleet: fleet <fleet> is closed. new instances can't be placed on it
+B8 complete: the hostname history is complete. <n> hostnames recorded
+B9 invalidate: the hostname history is invalidated. new instances are refused until a fresh inventory completes
+B10 accounts migrate below the floor: this carlos is older than the hostname history's floor, <version>. update carlos, then run it again.
+
+## C. Refusals from the console doors (shown by the CLI)
+C1 The hostname history is already complete.
+C2 A maintenance window is already open.
+C3 No maintenance window is open. Start one with carlos system hosts-used begin.
+C4 <target> was not on the list of targets when the window opened.
+C5 <target> is not a fleet on the window's list. Regions and pools can't be closed.
+C6 Work is still settling. Run carlos system hosts-used status until every count is 0.
+C7 No listing has been imported for <target>, <target>.
+C8 The listing of <target> failed. Scan it again and import it.
+C9 The listing of <target> has entries with no hostname, such as <entry>.
+C10 The regions, fleets or boxes changed since the window opened. Cancel it and begin again.
+C11 This console runs host claims or live moves, so the hostname history can't be completed.
+C12 The hostname history is not active, so there is nothing to invalidate.
+
+## D. Operator log lines and the alert page
+D1 log, once at start: app regions are off until the hostname history is complete
+D2 page: the hostname history is invalidated: <key> is a record the history does not cover
+D3 page: the hostname history is invalidated: a pending create for <host> would publish a record the history does not cover
+D4 page: the hostname history is invalidated by an operator
+
+## E. `carlos system` usage
+E1 hosts-used status
+E2 the hostname history: its mode, how many hostnames it has
+E3 recorded, and how much work is still settling
+E4 hosts-used begin | cancel
+E5 open or close the maintenance window used to complete the history
+E6 hosts-used import <file> | close-fleet <fleet> | complete
+E7 inside the window: load the scan, close a fleet, finish
+E8 hosts-used invalidate
+E9 stop new instances until a fresh inventory completes
+
+## F. README (Task 13): new section, after "Turning app regions on"
+
+**The hostname history.** Once app regions are on, a hostname that has
+held an app's data is never given to a new instance again, in any region.
+Its old data may still sit in a bucket or on a box, and a new instance with
+the same name would read it. The console keeps a history of every hostname
+that may hold data, under `control/hosts-used/`, and refuses to create one
+again. Static sites and services hold no data and are not recorded.
+
+The history has four modes, which `carlos system hosts-used status` shows:
+
+- incomplete, from the release until the history is completed. New
+ hostnames are recorded and nothing is refused. App regions stay off.
+- activating, while the maintenance window below is open. New instances,
+ moves and placement changes are paused.
+- active. A recorded hostname is refused everywhere, and app regions can
+ be turned on.
+- invalidated, when the console finds a record the history does not
+ cover, or an operator invalidates it. New instances are refused until
+ the window is run again.
+
+**Completing the history.** Complete it once per deployment, starting in
+dev. It needs a maintenance window. Announce it because new instances,
+moves and placement changes are refused while it is open.
+
+1. Run `carlos system hosts-used begin`. The console fixes its list of
+ regions, pools, fleets and boxes from this moment.
+2. Run `carlos system hosts-used status` until every count is 0. Work
+ admitted before the window finishes on its own.
+3. Scan every target on the list with `scripts/hosts-used-scan-aws.sh`
+ (in infra) and run `carlos system hosts-used import <file>`. Every
+ target needs a listing that imports successfully.
+4. A fleet that cannot be scanned can be closed instead, with
+ `carlos system hosts-used close-fleet <fleet>`. A closed fleet takes no
+ new instances. Regions and pools cannot be closed.
+5. Run `carlos system hosts-used complete`. It refuses while anything is
+ unsettled, unscanned or unreadable, and reports the problem. On success
+ the mode is active and the floor is written.
+6. Or run `carlos system hosts-used cancel` at any point. Nothing is lost:
+ the hostnames recorded so far stay recorded.
+
+Two limits. A deployment runs one console process; a second console would
+not see the first one's mode. And a region, pool or fleet added after
+completion takes no new instances until its own listing is imported.
+
+**The history's floor.** Completing writes the floor to
+`control/hosts-used/@floor`. The floor is the release that completed the
+history, and `status` shows it. From then on, never run a console or
+`carlos accounts migrate` older than the floor: an older build creates
+records without recording them. The roll script refuses a console below
+the floor, and `carlos accounts migrate` refuses to run below it.
+
+**Restores.** Restoring the console's database alone is safe. A restore of
+the control bucket must keep every object under `control/hosts-used/`. If
+any objects may have been dropped, run `carlos system hosts-used
+invalidate` and complete the history again.
+
+Changes to "Turning app regions on":
+- new step 0: Complete the hostname history (above). Until it is active,
+ turning the switch on has no effect.
+- in step 5: Use new probe hostnames every run. A probe hostname is
+ recorded once created, so it can never be created again.