carlos / platform Public

copy: drill 1 rows and docs for copies and releases (#511)

Seven SR-4 rows, approved (controller; Luna house rules): the join's
secrets refusal (C83), the release's config wait (C84), the copies
door's size refusal (C85), placement blocked (C86), and three docs
paragraphs: eligibility by size (C87), raising copies as a join (C88)
and the release waiting for configuration (C89). No em dashes, no box
command in user text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 6295f1bccf2d7c7f767dd7681c70d553e79f6a11 parent 736b8ce
2 files changed, +13 −0
  • docs/site/stateless-replicas.md +6 −0
  • docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md +7 −0
diff --git a/docs/site/stateless-replicas.md b/docs/site/stateless-replicas.md
index 9df1f8ccc..718126592 100644
--- a/docs/site/stateless-replicas.md
+++ b/docs/site/stateless-replicas.md
@@ -18,12 +18,18 @@ carlos apps set shop --copies 2
Each instance of shop gets two copies on different eligible fleet boxes. The command refuses a count larger than the eligible fleet.
+A box is eligible only if it has room for the instance's size: a size may use at most a quarter of a box's memory, and an app with no size set uses standard. If too few boxes have room, the command says so and changes nothing.
+
+Raising the count adds the new copies one box at a time, on the build the instance already runs. The copy that is already running keeps serving, and the release command does not run again.
+
More than one copy needs an always-on release. Set --copies 1 and wait for removed copies to stop before selecting a hibernating release or one with a local database. Switching to stateless leaves the old database and replica untouched.
## Deploys
A deploy runs the release command once per instance, then switches its copies one box at a time. Your migrations must allow old and new code to serve together. Each copy runs every declared worker.
+The release command runs only once the instance's configuration is on its box. If you set env or secrets before the instance existed, its first release waits a few seconds for them rather than running without them.
+
If the box running the release command disappears, its result may be unknown. The deploy stops and the previous build keeps serving. Deploying again runs the command again, so release commands must be safe to repeat. Rails migrations record completed migrations in schema_migrations.
A deploy can stop partway. If a copy's switch is not confirmed, or the new build's workers or web process fail on a box after it switched, the deploy stops there. Copies that switched run the new build and the others keep the old one, and the instance's deploy status says where it stopped. Copies stay on different builds until you retry the deploy, deploy a fixed build or roll back.
diff --git a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
index 9eaa62200..82f9fab92 100644
--- a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
+++ b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
@@ -154,3 +154,10 @@ copy too. Internal wire enums are not an excuse to expose unreviewed text.
| SR-4-C80 | docs/site/stateless-replicas.md | A deploy can stop partway. If a copy's switch is not confirmed, or the new build's workers or web process fail on a box after it switched, the deploy stops there. Copies that switched run the new build and the others keep the old one, and the instance's deploy status says where it stopped. Copies stay on different builds until you retry the deploy, deploy a fixed build or roll back. | approved (controller, final wave; Luna-style house rules) |
| SR-4-C81 | docs/site/stateless-replicas.md | `carlos restart --host` restarts a route on the console's own box. Copies never run there, so it refuses an instance with more than one copy. Deploy a new build instead. | approved (controller, final wave; Luna-style house rules) |
| SR-4-C82 | docs/site/stateless-replicas.md | Release note for v0.35.0: once the console is on v0.35.0, a box still on v0.34.x cannot retry a stateless release whose release command failed or whose result is unknown, even with one copy. Ship a new build, or retry after the box is on v0.35.0. | approved (controller, final wave; Luna-style house rules) |
+| SR-4-C83 | internal/activator/replicadeploy.go | the new copy could not get the instance's shared secrets, so it did not start and the deploy stopped. existing copies keep serving | approved (controller; Luna house rules) (drill 1, R21) |
+| SR-4-C84 | internal/activator/backend_rootfs.go | the release waits until this instance's configuration is written on this box. nothing ran yet | approved (controller; Luna house rules) (drill 1, R20) |
+| SR-4-C85 | internal/console/appcopies.go | <n> copies need <n> boxes with room for size <size>. this fleet has <fit>. choose a smaller size | approved (controller; Luna house rules) (drill 1, R19) |
+| SR-4-C86 | internal/console/replicaplacement.go | placement blocked: fewer boxes can hold this instance's copies than the <n> it asks for, so its copy on <box> keeps running where it is | approved (controller; Luna house rules) (drill 1, R19) |
+| SR-4-C87 | docs/site/stateless-replicas.md | A box is eligible only if it has room for the instance's size: a size may use at most a quarter of a box's memory, and an app with no size set uses standard. If too few boxes have room, the command says so and changes nothing. | approved (controller; Luna house rules) (drill 1, R19) |
+| SR-4-C88 | docs/site/stateless-replicas.md | Raising the count adds the new copies one box at a time, on the build the instance already runs. The copy that is already running keeps serving, and the release command does not run again. | approved (controller; Luna house rules) (drill 1, R18) |
+| SR-4-C89 | docs/site/stateless-replicas.md | The release command runs only once the instance's configuration is on its box. If you set env or secrets before the instance existed, its first release waits a few seconds for them rather than running without them. | approved (controller; Luna house rules) (drill 1, R20) |