carlos / platform Public

instances import for apps on a customer fleet Issue open

🤖 Ask: let carlos instances import (and create --from) work for apps placed on a customer fleet.

Who hits it. Eleven (account eleven, sqid bdr) is moving onto its own bring-your-own fleet eleven. All 17 chat spaces are across already: they were hibernating, so their replicas were already in the fleet's bucket and a fleet box restored them without any import. What's left is four shared services: the push relay, the OAuth broker, the passkey-backup server and the provisioner. Each has a small SQLite database on the old box (tens of MB at most) and was never a CARLOS instance. That's exactly what instances import is for, and it refuses:

> <app> places its instances in a pool or on a fleet, so it cannot take a seeded instance. (internal/console/apiinstanceseed.go:118-120)

Any bring-your-own-fleet customer arriving with an existing database hits the same wall on day one, and an existing database is the usual reason to bring your own fleet.

Why it refuses, as far as I can read. The seed path restores and uploads into the deployment's own buckets. A fleet keeps its data in the customer's bucket (CARLOS_HIBERNATE_BUCKET), which the console can't write to. Only the fleet's boxes hold credentials for it.

Proposed shape. Keep the console as coordinator and let a fleet box do the bucket work:

  1. import receives the snapshot as it does today and reserves the record (same verify/commit/abort semantics).
  2. The console hands the snapshot to a box of the app's fleet over the fleet tunnel. A presigned or staged object the box pulls would also work; the tunnel already carries the store door.
  3. That box writes the first replica generation into its fleet bucket under the instance host's prefix, takes the lease as for a wake, and runs --verify.
  4. commit / abort behave as now.

create --from <sibling> on a fleet app would follow the same path, with the box copying the sibling's replica inside its own bucket.

What we're doing meanwhile. Nothing hacky. The alternative was hand-building an LTX replica with litestream straight into the fleet prefix, and we'd rather the platform own that. Paul is happy to wait for this, or for it to be built in this session.

Done when: carlos instances import --app <fleet app> --host <h> --file <db> --verify /healthz, then commit, leaves the instance served by a fleet box from the imported data, with its replica in the fleet's bucket.

Spec draft on branch fleet-seeded-create (f53a713d9): docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md.

Proposes a fresh instances create --seed-file for fleet apps (import's --replaces takeover doesn't fit a fleet), the snapshot in the deployment bucket under apps/<sqid>/<app>/seeds/ (already readable by a fleet box through the store door), a console door for the fleet box's placed/refused transitions, and flat layout allowed on single-tenant customer fleets. Five rulings are asked of Paul in §2; review follows the rulings.

Design review closed after 3 rounds (findings R1-R3 on the branch).

  • Round 2 hit stopping rule 2 (the abandonment / cleanup-before-release family). Paul chose cut (a): on a fleet, a file seed's hostname is held until its owning box proves cleanup. A leftover replica holds it for the fleet owner to remove. No fleet-side delete is built.
  • Round 3 found two more holes in that family (HasReplica is not an emptiness proof; staging can restore unrelated data) and one P2 (snapshot retention vs the sweep). Paul chose to fix them and go to implementation without a 4th round. The placement/rollback task gets its own review naming R3-1 and R3-2.

Spec: docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md (94857de17), §8-§10 dispositions. Implementation plan is being written next.

Slice 1 (region --seed-file) on branch fleet-seeded-create-1 at c848a4c3a: Fable whole-branch review READY AFTER FIXES (P2 delete-door fixed), census APPROVED (#280). Merging once CI is green.

Slice 1 merged to main as 82e237a95 (region --seed-file). Next: dev rollout per plan Task 7 step 7 (boxes, console, seeds-floor publish Min 3, witness), and slice 2 (box release for fleet file seeds).

Slice 1 dev witness is owed: dev rolls with release cuts (platform-infrastructure re-pins to vX.Y.Z), not per merge. When the next release reaches dev: carlos system seeds-floor publish --min-release <it> (Min 3) after every dev box reports it, then --seed-file on a dev region app, first wake, data present, snapshot gone. Slice 2 (box release) started: fleet-seeded-create-2 (Tasks 8-10, 12) and fleet-seeded-create-2b (Tasks 11, 13).

Slice 2 (box release) merged to main as 772aabb. Slice 3 (console fleet path, Tasks 15-17) started on fleet-seeded-create-3.

Slice 3 (console fleet path) merged to main as fe854a4. #1139 code is complete on main (slices 1-3: 82e237a95, 772aabbb0, fe854a4). Remaining: slice 4 rollout. Dev and flagship take it with the next release cut; then on each deployment, after every box (and carlos.prev) runs it, carlos system seeds-floor publish so Min reaches 4; then witnesses (region --seed-file on dev; fleet --seed-file on a dev customer fleet if one exists). Then Eleven seeds push, connect, home and cloud onto fleet eleven (kepler must report nested; FS-26 names it if not).

Flagship witness PASS 2026-11-24 on fleet eleven (kepler, nested after layout migrate --box kepler on 11-23): carlos instances create --seed-file placed test-seed1139.11ch.at from an 8 KB SQLite file; the placed DB holds the marker row from the file plus the app's own 49 tables; the record moved to placed (seeded from a file 1217f27b0716) once the hub could reach the console. Found on the way: the flagship hub had no CARLOSREPLICACONSOLE_ADDR and the route-scan fallback can't find a console in the operator account, so fleet box doors 503'd (replicas too). Interim: env line set on carlos-flagship-ie (Paul's go); proper fix is #1385 (console-addr-from-install). Test instance deleted. Dev witness impossible: dev's home region is HA and no dev fleet has an attached box.