Managed fleets 1b: Luna copy pass applied verbatim
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
4 files changed,
+21
−19
docs/site/cli.md+11 −13docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md+2 −0fleets.go+7 −5internal/console/fleetrelabel.go+1 −1
diff --git a/docs/site/cli.md b/docs/site/cli.md| index dd4cf9fda..e7c26ecda 100644 |
| --- a/docs/site/cli.md |
| +++ b/docs/site/cli.md |
| @@ -2162,28 +2162,26 @@ carlos fleets drain acme pi-1 |
| carlos fleets detach-box acme pi-1 |
| ``` |
| -`drain` moves every instance on the box to the fleet's other boxes and gives |
| -the box no new ones. If any instance has nowhere to go, nothing changes and the |
| -command names its apps. That happens when no other box is ready for it, when |
| -the platform does not run its process (it has an upstream address, or never |
| -hibernates), or when the console has not placed it on a box yet. A placed |
| -instance is one that has woken on some box since it was created. The box keeps |
| -its access while its instances leave, so it can stop them and upload their |
| -last writes. |
| +`drain` moves every instance assigned to the box to the fleet's other boxes |
| +and gives the box no new ones. If any instance has nowhere to go, nothing |
| +changes and the command names the affected apps. This happens when no other box |
| +is ready for it, when the platform does not manage its process, or when the |
| +console has not placed it on a box yet. The box keeps its access while its |
| +instances leave, so it can stop them and upload their final writes. |
| `detach-box` waits for the box to say it is done. The console detaches a box |
| that has run instances only when the box's newest report, sent after the drain |
| began, shows no instances, no held leases and no failed final uploads. Until |
| then the command refuses and says to drain first. A box that has gone silent |
| -stays attached: its instances still move to other boxes after 20 minutes, but |
| -it cannot be detached until it reports again. A box that has never run an |
| -instance detaches at once. |
| +stays attached. Its instances can still move to other boxes, but it cannot be |
| +detached until it reports again. A box that has never run an instance detaches |
| +at once. |
| In `carlos fleets ls`, a draining box shows `draining` in STATUS. LABELS |
| PAUSED reads `yes` while a box of the fleet runs a release too old for the |
| console to move instances between boxes. The console stops moving them and |
| logs an alert until that box is updated. It reads `unknown` when the console |
| -could not read every box's report. |
| +could not read every box's report, and `-` otherwise. |
| An app on a fleet cannot hold a secret until the fleet has its own secrets key. The key is a pair. The private half stays on your fleet's boxes and the platform never sees it. The public half goes to the console, which seals every secret and credential for the fleet's apps to it. |
| @@ -2197,7 +2195,7 @@ If apps on the fleet already hold sealed values, the command lists them. They we |
| To check that a box holds the registered key, run `carlos secrets fingerprint` on the box. Its answer should start with the characters in the SECRETS KEY column of `carlos fleets ls`, which shows the first 12 after `sha256:`. |
| -You can replace a fleet's key only while none of its apps holds a sealed value. Unset those apps' secrets, register the new key, set the secrets again and rotate the credentials the console minted. If a key may have leaked, take the box off the fleet first. A box that holds nothing can be detached at once with `carlos fleets detach-box <fleet> <label>`. Otherwise drain it with `carlos fleets drain <fleet> <label>`, then detach it once it is done, then rotate. The drain needs the box's current token: rotating first would cut the box off before it sees its instances leave. A detached box stops reading the platform's store. |
| +You can replace a fleet's key only while none of its apps holds a sealed value. Unset those apps' secrets, register the new key, set the secrets again and rotate the credentials the console minted. If a key may have leaked, take the box off the fleet first. A box that has never run an instance can be detached at once with `carlos fleets detach-box <fleet> <label>`. Otherwise drain it with `carlos fleets drain <fleet> <label>`, then detach it when its report shows no instances, no held leases and no failed final uploads. Rotate the credentials after detaching. The drain needs the box's current token: rotating first would cut the box off before it sees its instances leave. A detached box stops reading the platform's store. |
| ### carlos services |
diff --git a/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md b/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md| index 80c6ab921..0e65f1619 100644 |
| --- a/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md |
| +++ b/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md |
| @@ -16,6 +16,8 @@ usage line now names `drain`, and the leaked-key advice drains a box that |
| holds instances before it is detached. Their new text is in the managed |
| fleets 1b copy pass (plan `2026-10-30-managed-fleets-1b-box-per-instance.md`, |
| Task 8). |
| +Their new text was approved in the managed fleets 1b Luna pass (2026-10-31, |
| +`~/.cache/mf1b-copy/luna.md` items D6 and D7). |
| The rules: |
diff --git a/fleets.go b/fleets.go| index 91df9bf24..45fb3f944 100644 |
| --- a/fleets.go |
| +++ b/fleets.go |
| @@ -75,14 +75,16 @@ const fleetsUsage = `usage: carlos fleets <create|add-box|rotate-token|tag-box|d |
| and give it no new ones. if any instance has nowhere to go, |
| nothing changes and the apps are named. the box keeps its |
| access while its instances leave. detach it with |
| - detach-box once it reports it holds nothing. |
| + detach-box once it reports no instances, no held leases and |
| + no failed final uploads. |
| detach-box [--account <sqid|name>] <fleet> <label> |
| the hard revocation rotate-token is not: flips the box to |
| "detached", which refuses its next dial-in AND closes any |
| channel it already holds. a box that ever ran instances the |
| console placed on it is detached only after a drain, once |
| - the box reports it holds nothing. |
| + the box reports no instances, no held leases and no failed |
| + final uploads. |
| secrets-key [--account <sqid|name>] [--file <path>] <fleet> [<pubkey>] |
| register the public half of the fleet's secrets key. every secret |
| @@ -96,8 +98,8 @@ const fleetsUsage = `usage: carlos fleets <create|add-box|rotate-token|tag-box|d |
| list every fleet the account owns, with its secrets key fingerprint and each box's label, |
| status and tags. STALE counts the sealed values its boxes cannot |
| open yet. LABELS PAUSED is yes while a box runs a release too old |
| - for the console to move instances between boxes, and unknown when |
| - the console could not read every box's report. |
| + for the console to move instances between boxes, unknown when the |
| + console could not read every box's report, and - otherwise. |
| --account <sqid|name> account the fleet belongs to (default: your only |
| account, or the configured/chosen one) — |
| @@ -379,7 +381,7 @@ func runFleetsDrain(args []string) { |
| log.Fatalf("fleets drain: %v", err) |
| } |
| fmt.Fprintf(stdout, "draining %s/%s. its instances are moving to the fleet's other boxes\n", fleet, label) |
| - fmt.Fprintf(stdout, " when the box reports it holds nothing, detach it: carlos fleets detach-box %s %s\n", fleet, label) |
| + fmt.Fprintf(stdout, " when the box reports no instances, no held leases and no failed final uploads, detach it: carlos fleets detach-box %s %s\n", fleet, label) |
| } |
| func runFleetsDetachBox(args []string) { |
diff --git a/internal/console/fleetrelabel.go b/internal/console/fleetrelabel.go| index dcd7b43de..12b4f8a18 100644 |
| --- a/internal/console/fleetrelabel.go |
| +++ b/internal/console/fleetrelabel.go |
| @@ -593,7 +593,7 @@ func msgDrainStrandsApps(fleet, label string, apps []string) string { |
| // msgDetachNotDrained is both detach doors' refusal of a box that may |
| // still hold instances, leases or unsynced data. |
| func msgDetachNotDrained(fleet, label string) string { |
| - return fmt.Sprintf("%s/%s may still hold instances. run carlos fleets drain %s %s, then detach it when the box reports it holds nothing", |
| + return fmt.Sprintf("%s/%s may still hold instances, leases or failed final uploads. run carlos fleets drain %s %s, then detach it when the box reports no instances, no held leases and no failed final uploads", |
| fleet, label, fleet, label) |
| } |