oficina / base Public

Spec: apps go live, revision 6 fixes after Astra's fresh round

Four P1s fixed once, not re-reviewed: apps delete takes the app as a
positional argument; Try again on an unconfirmed deploy uses promote
--retry when the version was shipped; setup-only failures release the
fence and restore head_sha; the sweep acts only on a complete list and
decides each delete in the transaction that registers previews. Factual
P2 and P3 corrections in the same pass. P-B filed as carlos/platform
discussion 1496; P-E and P-G already exist in CARLOS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 4c0b55ea7ef52902eab36d0e416af75aba29fe1b parent 2352bd0
1 file changed, +42 −30
  • docs/superpowers/specs/2026-11-28-apps-go-live-design.md +42 −30

CI passed — run details

CI log
=== build ===
CGO_ENABLED=0 go build ./...
=== vet ===
go vet ./...
=== fmt-check ===
=== staticcheck ===
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./...
=== govulncheck ===
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
No vulnerabilities found.
=== gitleaks ===
11:15AM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
11:15AM INF 1 commits scanned.
11:15AM INF scanned ~2911801 bytes (2.91 MB) in 304ms
11:15AM INF no leaks found
=== budget ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 22 directories within budget
=== script-test ===
scripts/prepare-apps_test.sh
ok   releases lookup failure stops before ship
ok   app owned elsewhere stops the script
ok   apps listing failure stops before create
ok   ambiguous release dir is refused
ok   explicit version resolves the ambiguity
ok   releases match is exact, not substring
ok   shipped version is only promoted, existing app not created
ok   fresh account creates, ships, promotes to edge, enables
ok   failing promote stops the script
ok   ship is retried while uploads are rate limited
all passed
hack/fonts_test.sh
fonts_test: ok
=== test ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./...

receipt: test step 9.704s against a 60s target (the gate's other steps are not in this figure)
receipt: 16 packages ran, 0 cached, 6 without tests, 0 failed
receipt: slow package 8.867s amadan.net/oficina/base/internal/webtest
receipt: slow package 1.112s amadan.net/oficina/base/internal/issuer
receipt: slow package 633ms amadan.net/oficina/base/internal/equipo
receipt: slow package 608ms amadan.net/oficina/base/internal/operations
receipt: slow package 227ms amadan.net/oficina/base/internal/consumer
receipt: slow test 1.51s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot
receipt: slow test 1.08s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce
receipt: slow test 800ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp
receipt: slow test 620ms amadan.net/oficina/base/internal/webtest TestAskUploadStalledBodyFreesItsSlot
receipt: slow test 520ms amadan.net/oficina/base/internal/operations TestOperationsRefusals
=== native ===
strings: copy review's strings.json is not here (git-ignored); its comparison skipped
strings: 120 in the catalog, 117 used
worktree-lib_test: ok
diff --git a/docs/superpowers/specs/2026-11-28-apps-go-live-design.md b/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
index cf44244..39f0d87 100644
--- a/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
+++ b/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
@@ -1,6 +1,6 @@
# Apps Equipo builds get tested, previewed and put live with an address
-Date: 2026-11-28. Paul approved the direction on 2026-11-28. Design only: nothing here is built, merged or deployed. Revision 6, 2026-11-29, after Paul's rulings of 2026-11-29 (see Rulings), with one fresh Astra round (see Review).
+Date: 2026-11-28. Paul approved the direction on 2026-11-28. Design only: nothing here is built, merged or deployed. Revision 6, 2026-11-29, after Paul's rulings of 2026-11-29 (see Rulings), with one fresh Astra round whose P1s are fixed here and not re-reviewed (see Review).
An addendum to the jobs design (`2026-11-20-jobs-that-keep-moving-design.md`, "jobs spec", K1 to K16) and its plan (`2026-11-25-jobs-that-keep-moving.md`, "jobs plan"), both on Base branch `jobs-rulings` 19e1897. It reads the abilities design (`2026-11-26-assistant-abilities-design.md` revision 8, branch `assistant-abilities` 291b252, "abilities spec") for the `build` and `go_live` gates, and Equipo's places design (`equipo:docs/superpowers/specs/2026-11-26-places-config.md` revision 3 and Paul's rulings of 2026-11-26, "places spec") for where sites go and who holds which CARLOS credential. Code references are to Equipo `origin/main` 57f370c5 (`equipo:`), the CARLOS CLI on docs-t1 (`carlos <verb> -h`), the platform docs (`carlos/platform/docs/site/cli.md`, "cli.md"; `plans.md`) and the CARLOS app spec (`carlos/spec/spec.md`, "app spec"). Every person-facing string is **DRAFT** and listed in the copy register at the end; none goes into code before copy review.
@@ -83,7 +83,7 @@ An ordinary CARLOS binary app, one per preview, in the **previews place**: a pla
- **Scan.** The candidate's tree goes through the same secret scan static exports get (`preview_security.go`). A scan that can't run fails the preview with `preview_scanner` (jobs spec K6); nothing is deployed unscanned.
- **Build.** In the existing checks sandbox (`Gate.Run` and the dependency stage, as Checks use): `CGO_ENABLED=0 GOTOOLCHAIN=local GOFLAGS=-mod=readonly go build -trimpath -buildvcs=true` of `main`'s `release/app.json` package from a checkout at the candidate, for the previews place's target (`linux-arm64` by default). The binary's SHA-256 is the preview's digest, bound to the reviewed candidate as the export digest is today. Nothing is run on the runner beyond the checks that already ran.
- **Name.** `preview-<job>-<attempt>`, where `<job>` is the hand-off id's random part, at most 30 characters. Each attempt gets a new name, because a deleted app's name stays reserved in the Trash for 30 days (cli.md, `apps delete`).
-- **Create and deploy.** The fixed templates of C3's first deploy, in the previews place: `carlos apps create --app <name> --build-probe /version`, then `carlos deploy --kind binary --target <target> --region <region> --channel edge --timeout 5m --version <v> --no-prompt <artifact>`, with the same command environment (C3). No deploy credential is minted for a preview. A new app starts with its own empty database; a preview never gets a copy of live data, even for a change to an app that is already live (Q11).
+- **Create and deploy.** First the instance registers the preview (B3) and authorizes `setup`; only then does the runner run, in the previews place, `carlos apps create --app <name> --region <region> --build-probe /version`, then `carlos deploy --kind binary --target <target> --region <region> --channel edge --timeout 5m --version <v> --no-prompt <artifact>`, with C3's command environment. The region is the previews place's, given at creation so the deploy's region always matches. No deploy credential is minted for a preview. A new app starts with its own empty database; a preview never gets a copy of live data, even for a change to an app that is already live (Q11).
- **Proof.** The preview is up once the build probe saw `<v>` and the runner's own `GET /version` on its address answers `<v>`. Then the link "Try your app" goes on the pill (D1).
- **The shipped build is proven too.** The preview runs the same target and flags a live deploy will use, so when it comes up the person knows the app starts on CARLOS's real hosts, not only in Checks.
- **First looks.** A request for an app still starts with a first look: one static page through the existing static preview (jobs spec K13 and K14). The app preview follows once the full build is approved.
@@ -92,7 +92,7 @@ An ordinary CARLOS binary app, one per preview, in the **previews place**: a pla
Creating an app needs a person's login or an account-wide credential, and minting its first platform address needs a person or a `publish` credential (places spec §1, "Site"); moving an app to the Trash needs `publish` or a person (Base first-slice spec §4). Paul's ruling 2 gives previews "the account and permissions of a first live deploy", so v1 uses the owner's CARLOS login on the runner that holds the previews place, as a site's first publish does (places ruling 2), with three limits:
-- only the fixed templates in B1 and B3 (`apps list`, `apps create`, `deploy`, `apps delete`), only in the dedicated previews account, only for names that begin `preview-`;
+- only the fixed templates in B1 and B3 (`apps list`, `instances list`, `releases`, `apps create`, `deploy`, `apps delete`), only in the dedicated previews account, only for names that begin `preview-`;
- the login never enters a sandbox, and the build never sees it (as `site.go`);
- unlike a site's first publish, there is **no tap per preview**: the owner's confirmation of the previews place is the consent, and every preview is still gated by Review, the scan, the project's public-preview setting and `build`. That is a widening of places ruling 2, which Paul's ruling 2 of 2026-11-29 asks for; Q3 asks him to confirm it.
@@ -102,21 +102,22 @@ An account-wide `publish` credential for the previews account could replace the
| what | rule |
|---|---|
-| life | 7 days from deploy, the same as a static preview (`previewTTL`), or less as below (Q4) |
+| life | a cleanup deadline is recorded when the preview is registered, before `apps create`: one hour, so a preview whose create or deploy fails, is refused or stalls is still deleted. When the deploy is confirmed, the deadline becomes 7 days, the same as a static preview (`previewTTL`), or less as below (Q4) |
| deleted at once | when the job's candidate goes live (C3 confirms), the job is dropped or dismissed, or a newer candidate's preview comes up |
-| who deletes | the instance records each preview app (name, place, candidate, `expires_at`) on the preview step, and its housekeeping tick dispatches a delete step to the runner holding the previews place: `carlos apps delete --app <name>` with the same command environment. Housekeeping may delete previews; it never creates or deploys one |
+| who deletes | the instance registers each preview (name, place, candidate, state `registered`, deadline) in the transaction that authorizes its `setup`, before the runner sends `apps create`. Its housekeeping tick dispatches a delete step to the runner holding the previews place when the deadline passes or one of the events above happens: `carlos apps delete --console <o> --account-id <sqid> <name>` (the app is positional; `apps delete` has no `--app` flag), with C3's command environment. Each delete is authorized right before it is sent (`authorizeAppPreview`, purpose `delete`). Housekeeping may delete previews; it never creates or deploys one |
| after deletion | the step records the preview as ended, so `taskPreview` stops offering its link and `previewRetryCheck` (`chat/preview_retry.go`) allows Try again, which is `retryPreview`: the same preview step's next attempt, with a new name |
-| the sweep | at runner start-up and once a day, the runner lists the previews account (`carlos apps list`) and deletes every `preview-` app that is past its `expires_at` by the instance's record, or that no instance record accounts for (a create whose answer was lost, an instance database restored from backup). Apps without the prefix are never touched |
+| the sweep | at runner start-up and once a day. The runner first fetches from the instance the complete list of preview registrations for that place; if the instance can't be reached or answers anything short of a complete list, the sweep deletes nothing. It then lists the previews account (`carlos apps list`) and, for each `preview-` app that is past its deadline or has no registration, asks the instance to authorize the delete. The instance decides in one transaction against its registrations, so a preview registered meanwhile is never deleted: registration happens before create, and the decision is serialized with it. Apps without the prefix are never touched |
| a delete that fails | retried by the next tick and the next sweep; after 24 hours of failures, an operator alert (jobs spec O8) |
**Trade-offs, said plainly.**
- **Clean-up depends on Equipo being up.** The timer is the instance's housekeeping, and the deletes run on the runner that holds the login. If either is down, expired previews stay up until it returns; the start-up sweep is the backstop. A preview left up longer than planned runs only reviewed code with no real data, and it hibernates when idle (app spec 8.5).
-- **Deleted apps sit 30 days in the Trash**, with the name reserved and its address unusable (cli.md, `apps delete` and `apps create`). Hence a new name per attempt. Whether a trashed app counts against the account's limits isn't documented; Q5 asks CARLOS's maintainers before phase 4.
-- **Account limits.** A plan caps the apps and instances an account runs (`plans.md`, `running_things`: 3 on `free`, 25 on `personal`, packs of 5, ceiling 200). Previews in a dedicated account don't use the live account's room. Equipo caps a person's open previews at 5 and the previews account's at 20 (fewer if its plan is smaller); past that, a new preview waits, and the pill says it is waiting its turn. `apps create` is also rate limited per address per day (cli.md); a refusal for the limit leaves the preview waiting and retries at the next tick.
+- **Deleted apps sit 30 days in the Trash**, with the name reserved and its address unusable (cli.md, `apps delete` and `apps create`). Hence a new name per attempt. A trashed app and its instances don't count against the plan's limits (`carlos/platform/internal/console/plancaps.go`, `runningThings`).
+- **Account limits.** A plan caps the account's `running_things`: its live apps, temporary ones included, plus their instance records (`plancaps.go`; `plans.md`'s catalog values, such as 25 on `personal`, are examples a deployment sets). A preview costs two: its app and its one instance. Previews in a dedicated account don't use the live account's room. The previews place records the account's limit; Equipo reserves two units per preview when it registers it, releases them only once its delete is confirmed, caps a person's open previews at 5, and never reserves past the limit. Past that, a new preview waits, and the pill says it is waiting its turn. `apps create` is also rate limited per address per day (cli.md); a refusal for that leaves the preview waiting and retries at the next tick.
- **The permission it needs** is the owner's login on the runner, used without a tap per preview (B2). That is more than any other v1 command and is limited to the fixed templates, the dedicated account and the `preview-` prefix.
- **Where the code runs.** On CARLOS's isolated tenant hosting, not on the person's machine. None of revision 5's runner sandbox, proxy or devbox links returns. CARLOS treats a preview like any tenant app; its pages are public to anyone with the address (Q2).
- **Cost.** An ordinary app on the previews account's plan, asleep when idle.
+- **What the browser can still do.** Moving the code to CARLOS removes the person's machine from the picture, not the browser's. A preview's pages are an ordinary public site: they can run scripts, send what someone types to another site, or link anywhere, as any website can. What this design keeps away from them is the person's own things: a separate account (so no shared plan, data or address under the live account), no live data, no credentials of any kind, Review's approval of the code, and the cookie check in Q2. The risk accepted is that of visiting a reviewed, ordinary website on a separate address.
### B4. What previews don't do in v1
@@ -130,7 +131,7 @@ An account-wide `publish` credential for the previews account could replace the
For a job whose project is a `go_app` with a confirmed `app` place (C2), the go-ahead card asks "Your app is ready. Put it live?" with "Put it live" and "Not now" (DRAFT).
-- **Who.** Only the task's creator, who must still be an owner (today's rule for merging, `answerMerge` and `isOwner`, and for publishing, `publishRefusal`). Nobody can put another person's work live today, and this design adds no way to (abilities spec Q4). A member who isn't an owner gets no "Put it live": their app job ends at "Ready to try" with "Only an owner of this Base can put apps live for now." (DRAFT), and keeps the preview, Drop it and Dismiss.
+- **Who.** Only the task's creator, who must still be an owner (today's rule for merging, `answerMerge` and `isOwner`, and for publishing, `publishRefusal`). Nobody can put another person's work live today, and this design adds no way to (abilities spec Q4). Previews keep today's rule too: `authorizePreview` refuses a preview unless the task's creator is still an owner (`chat/preview.go`), so a member who isn't an owner gets neither a preview nor "Put it live". Their app job ends at "Ready to try" with "Only an owner of this Base can try or put apps live for now." (DRAFT), and keeps Drop it and Dismiss.
- **What the tap is bound to.** The card stores a snapshot, as a publish card does: the candidate SHA, the place id and revision, the project binding and revision, the destination hash (console, account, app, region, target), the deploy mode (`setup` for an app with none yet, `deploy` for one with its credential) and the fence generation it saw (C3). The tap merges that candidate through `answerMerge`'s path; the deploy step it starts carries the snapshot.
- **Merge, then deploy.** The deploy follows the merge on the same tap when the merged commit's tree is exactly the approved candidate's tree, which is always so for a new repository. Otherwise (another change landed in between) the merged commit gets Checks and Review of its own, then a second card asks for the merged result: a Publish-style card, one per merged commit, as `offerPublish` does for sites, under the same rules. When those fail, the job stops with Fix it (D1). A candidate that changed the build contract is the one case tested again without a second card (A1): what the person approved is unchanged, only how it is built.
- **No automatic merges for apps.** `mergegate` gains a criterion, `app_place`, that fails for every task of a project with an `app` place, whatever its merge policy. `CritShips` alone isn't enough: it reads `Policy.MainShips`, which a project may have set to `no` before it had an app (`mergegate/gate.go`, `changeCriteria`). The criterion is checked wherever a merge is decided: `autoMerge`, `authorizeMerge` and `authorizeMergeLease`, so a merge queued before a project gained its app place is refused before its request goes.
@@ -172,7 +173,7 @@ The rules, each enforced by `authorizeAppDeploy` in the transaction that decides
1. **Taking the fence** (the step's start). The step may start only when no step holds `pending`, `generation` still equals the snapshot's `seen_generation`, and its merge SHA is a descendant of `head_sha` (or there is none yet). In the same transaction it sets `generation = generation + 1`, `pending` to itself, `pending_generation` to the new value, and `pending_sha` and `head_sha` to its merge SHA. Ancestry stops an older change, however late its card was answered; the generation stops a tap answered before a rollback or another deploy.
2. **Every later command of that step** (region, deploy, mint) requires `pending` to be this step and `generation == pending_generation`. A step's own start never invalidates it.
3. **Its next attempt** (Try again on the same step) inherits the fence and still checks rule 2.
-4. **Releasing.** Only when the outcome is known: confirmed live (`deployed_sha = pending_sha`), refused before any command that changes CARLOS was sent (then `head_sha` goes back), or an owner's explicit release after reconciling (below), which keeps `head_sha` at the unconfirmed SHA. "Not confirmed" keeps the lock.
+4. **Releasing.** Only when the outcome is known: confirmed live (`deployed_sha = pending_sha`); refused or failed before anything that can change what the app serves was sent (`ship`, `deploy` or `promote`), in which case `head_sha` goes back to what it was, whether or not setup commands (`apps create`, `apps region --set`) ran, and the step records `app_created` so a later step adopts the app; or an owner's explicit release after reconciling (below), which keeps `head_sha` at the unconfirmed SHA. "Not confirmed" keeps the lock. A Try again after a release is a new step with a new snapshot, and takes the fence afresh under rule 1.
5. **Rollback** (C7) is the only path backwards: it takes the fence like a deploy, needs no ancestry, and sets `head_sha` to the version it restores once confirmed.
A refused start settles the step as superseded. If its change is already in what is live, the job is done with the address; if not, a new card asks again.
@@ -181,14 +182,16 @@ A refused start settles the step as superseded. If its change is already in what
| phase recorded | what may have happened | recovery |
|---|---|---|
-| `setup_listing` (before `apps create`; `carlos apps list`'s answer, without the name, is stored) | nothing, or the app was created and the answer lost | list again: absent, go on; present with no releases and no instances, adopt it (the name is code-minted with a random suffix); anything else, a new suffix |
+| `setup_listing` (before `apps create`; `carlos apps list`'s answer, without the name, is stored) | nothing, or the app was created and the answer lost | list again: absent, go on; present, read `carlos instances list --app <name>` and `carlos releases --app <name>` with the same login: no instances and no releases, adopt it as this step's; anything else, never adopt: a new suffix (live apps) or a new preview name |
| `setup_created` | the region may not be set | run `apps region --set` again |
| `deploy_sent` | a rollout may be under way | reconcile with reads only (below) |
| `minting` | the key may be lost | as for sites: the next deploy asks for setup's mint again |
Preview apps (B1) use the first two rows, and a restart in their `deploy_sent` phase reads the probe as below; a preview whose state is unknown is deleted and made again.
-**Reconciling.** A step restarted in `deploy_sent`, or left "not confirmed", reconciles with **reads only**, as `siteReconcile` does with its marker (`site.go`): the runner's own `GET /version` on the address and, once P-B lands, each instance's serving build. It sends nothing, so it needs only the fence (rule 2), not `go_live`. The instance re-runs it every 10 minutes for 24 hours. Seeing `<v>` makes the step live and releases the fence. Not seeing it proves nothing either way. After 24 hours reconciling stops; the job keeps "Not confirmed" and gains Open in Equipo (jobs spec K6), where an owner can send the same version again (Try again, under `go_live`) or release the lock after reading CARLOS's console (audited as `app.deploy.released_unknown`; `head_sha` stays).
+**Reconciling.** A step restarted in `deploy_sent`, or left "not confirmed", reconciles with **reads only**, as `siteReconcile` does with its marker (`site.go`): the runner's own `GET /version` on the address and, once P-B lands, each instance's serving build. It sends nothing, so it needs only the fence (rule 2), not `go_live`. The instance re-runs it every 10 minutes for 24 hours. Seeing `<v>` makes the step live and releases the fence. Not seeing it proves nothing either way.
+
+**Try again on "not confirmed"** is the same step's next attempt, under the fence (rules 2 and 3) and `go_live`. It reads `carlos releases --app <app>`: if `<v>` was never shipped, it runs the same `carlos deploy`; if it was, it runs `carlos promote --app <app> --retry <v> edge`, which re-signs the channel's promotion so a box that refused the build tries again (cli.md, `promote`). A plain `deploy` of a version already on the channel would do nothing. It then waits for the same proof. After 24 hours of reconciling without proof, the job keeps "Not confirmed" and gains Open in Equipo (jobs spec K6), where an owner can Try again as above or release the lock after reading CARLOS's console (audited as `app.deploy.released_unknown`; `head_sha` stays).
### C4. The address
@@ -203,8 +206,8 @@ A binary instance gets its own SQLite database (`--db`), replicated off the box
| where it stopped | what is known | job (D1) | next step offered | fence |
|---|---|---|---|---|
| refused before anything was sent | unchanged | Didn't go live | Try again | released |
-| first deploy: `apps create` done, then refused or failed before ship | nothing yet | Didn't go live | Try again, which adopts the recorded app | released |
-| sent, proof not seen | unknown | Not confirmed | reconciling (reads only); Try again sends the same version again as the step's next attempt | held |
+| refused or failed before `ship`/`deploy`/`promote` was sent, setup done or not | nothing yet, or the same as before | Didn't go live | Try again: a new step that adopts any app the step created (rule 4) | released, `head_sha` restored |
+| sent, proof not seen | unknown | Not confirmed | reconciling (reads only); Try again: `promote --retry`, or `deploy` if never shipped (C3) | held |
| proof seen | the new build serves on at least one instance | Done | none | released |
| superseded (C3) | something newer | Done, if its change is live; else a new card asks | per the new card | not taken |
@@ -212,7 +215,7 @@ Once P-B lands, "not confirmed" can split into "live", "partly live" and "nothin
### C7. Rollback
-`carlos rollback --app <app> edge` points the channel back at the version before. In v1 it is an owner's action on Equipo's task page, run with the deploy credential (request P-E, if that role can't today), audited and gated by `go_live`. It takes the fence like a deploy, moves `generation` (so a deploy tapped before it is refused and re-asked) and sets `deployed_sha` back once confirmed. It never touches data. Base offers no rollback in v1 (Q7).
+`carlos rollback --app <app> edge` points the channel back at the version before. In v1 it is an owner's action on Equipo's task page, run with the deploy credential (CARLOS already allows `rollback` within a deploy credential's scope, `internal/console/apicli.go`, `deployScopeAllows`), audited and gated by `go_live`. It takes the fence like a deploy, moves `generation` (so a deploy tapped before it is refused and re-asked) and sets `deployed_sha` back once confirmed. It never touches data. Base offers no rollback in v1 (Q7).
### C8. The `go_live` and `build` gates, and the last checks
@@ -221,7 +224,7 @@ Following abilities spec §6.3 and §6.4: a switch is checked where each action
- `build` covers every step of the job, starter checks and previews included: `Store.Authorize` refuses a preview step's start when the person lacks `build`. A preview already up when `build` goes off stays until it expires or the job ends; no new one is made, and Try again is refused. Deleting previews never needs an ability.
- `go_live` covers "Put it live" (the merge and the deploy as one decision), the second card for a changed merged result, every live deploy step, Try again on a failed deploy, and rollback.
- `authorizeAppDeploy` is the last check for live deploys, beside `authorizePublish`, with its rules: the current attempt, on the creator's primary runner, of a task Equipo merged at exactly this merge SHA and didn't cancel, decided by the creator, who is still an owner; the snapshot equal to the card's; the place and binding at the snapshot's revisions; the built digest exactly the recorded one; for the step's start, C3 rule 1; for every later command and attempt, C3 rule 2; the creator holding `go_live`. It runs at the step's start and again before `apps create`, `apps region --set`, `deploy` and the mint (purposes `setup`, `region`, `deploy`, `mint`; `region` also checks the place's region is still the snapshot's). Every decision is audited.
-- A preview step's commands get the same kind of check, `authorizeAppPreview`: the current attempt, Review's approval of exactly this candidate, the export digest, the previews place at the step's revision, `build`, the public-preview setting, and the name beginning `preview-`. Deletes check only that the app is one this instance recorded, or a sweep candidate as B3 defines.
+- A preview step's commands get the same kind of check, `authorizeAppPreview`: the current attempt, Review's approval of exactly this candidate, the task's creator still an owner (as `authorizePreview` today), the digest, the previews place at the step's revision, `build`, the public-preview setting, the name beginning `preview-`, and a registration in state `registered` with capacity reserved (B3). Purpose `delete` checks only that the name is registered and due (deadline passed or an event in B3), or, for the sweep, that no registration exists, decided in the same transaction that would register one.
- The switch going off after the tap refuses everything after the next check. A command already sent finishes. Turning a switch off never takes an app down.
- When the merge went in and the deploy is refused for `go_live`, the job reads "Didn't go live" with the abilities line "Putting it live is turned off for you. {Owner} can turn it on." and keeps Drop it. Turning `go_live` back on deploys nothing by itself: the person taps Try again.
@@ -244,7 +247,7 @@ Following abilities spec §6.3 and §6.4: a switch is checked where each action
| preview up | Ready to try (approved) | the tested line (D2) | Try your app | Put it live, Not now, Drop it |
| preview ended (expired or replaced) | Ready to try | Your app's trial has ended. Try again for a fresh one. | | Try again, Put it live, Drop it |
| no preview possible (D2) | Ready to try | the tested line (D2) | | Put it live, Not now, Drop it |
-| member, not an owner | Ready to try | Only an owner of this Base can put apps live for now. | Try your app, while up | Drop it, Dismiss |
+| member, not an owner | Ready to try | Only an owner of this Base can try or put apps live for now. | | Drop it, Dismiss |
| putting it live | Going live | Putting your app live. | Try your app, while up | none |
| tested again after the tap | Testing it again | Testing it once more, together with the latest version, before it goes live. / Testing it once more, built the new way, before it goes live. | Try your app, while up | Drop it |
| live | Done (approved) | Your app is live. | Open your app | Dismiss |
@@ -275,7 +278,8 @@ The go-ahead card and the ready pill carry one line, read from the Checks result
| checks need a Mac (`needs_macos`) | Its tests need a Mac, and none was free to run them. |
| checks timed out | Its tests took too long and were stopped. |
| checks or the scan couldn't run (`checks_unavailable`, `base_gate_unavailable`, `preview_scanner`) | It couldn't be tested just now. We'll try again shortly. |
-| the preview failed to come up | It passed its tests but didn't start when we tried it, so you can't try it yet. |
+| the preview's deploy reported that the build failed to start on CARLOS (its health check failed) | It passed its tests but didn't start when we tried it, so you can't try it yet. |
+| the preview couldn't be set up (refused, a limit, an unreachable console, no proof within the deploy's time) | We couldn't set up a trial just now. We'll try again shortly. |
The approved "This is ready: it could not be fully tested. Go ahead?" stays for sites and Equipo's own work. For an app job, the line above stands before "Your app is ready. Put it live?".
@@ -287,16 +291,14 @@ The approved "This is ready: it could not be fully tested. Go ahead?" stays for
## 8. Platform requests (CARLOS)
-Places spec P2 to P7 stand and are not repeated (first deploys without a person, consent credentials, a temporary-only scope, the devbox domain, JSON listings, domains with a deploy credential). Filed for this design, each as a Feature Request on `carlos/platform`:
+Places spec P2 to P7 stand and are not repeated (first deploys without a person, consent credentials, a temporary-only scope, the devbox domain, JSON listings, domains with a deploy credential). Filed for this design, as a Feature Request on `carlos/platform`:
-- **P-B. Per-instance serving builds for a deploy credential** — discussion #{P-B}. Lets C6 say "partly live" and "the version before is still running" truthfully.
-- **P-E. Rollback with an app's deploy credential** — discussion #{P-E}. C7.
-- **P-G. Document the build probe's whole-token match** — discussion #{P-G}. A3 relies on it.
+- **P-B. Per-instance serving builds for a deploy credential** — [carlos/platform discussion #1496](https://amadan.net/carlos/platform/discussions/1496). Lets C6 say "partly live" and "the version before is still running" truthfully.
Not filed, and why:
-- **Temporary binary apps** (`carlos deploy --temporary --kind binary`, with a throwaway database): an optional later backstop (Paul, ruling 3). With it, CARLOS would expire previews itself even when Equipo is down, purge them after 3 days instead of 30, and keep them off the plan's app count. Not needed for v1.
-- Revision 5's canary credentials (P-C), canary data (P-D) and scoped `vet` (P-F): no longer used.
+- **Temporary binary apps** (`carlos deploy --temporary --kind binary`, with a throwaway database): an optional later backstop (Paul, ruling 3). With it, CARLOS would expire previews itself even when Equipo is down and purge them after 3 days instead of 30. They would still count against `running_things`. Not needed for v1.
+- Revision 5's canary credentials (P-C), canary data (P-D) and scoped `vet` (P-F): no longer used. Rollback with a deploy credential (P-E) and the build probe's whole-token match (P-G) already exist: `deployScopeAllows` covers `rollback`, and `carlos apps create -h` documents the match.
## 9. The stale go-ahead (shipped separately)
@@ -323,14 +325,14 @@ Equipo:
- `TestAppBuildContract`, `TestAppPackageMove`: a contract-changing candidate gets no preview and a Put it live with its line; the tap merges it; the merged commit is tested under the new contract and deploys on the same tap or stops with Fix it; a staged move passes and a one-step move fails the old contract.
- `TestAppVersionToken`: `/version`, `--version` and the runner's check are the same 12 characters, and CARLOS's real probe matcher (a test against `carlos/platform`'s matcher, not a fake) accepts it and rejects an 11- or 13-character variant.
- `TestAppPreviewCreate` (fake carlos, argument parsing from the real CLI's flag sets): only after Review's approval of that candidate, a passing scan, the public-preview setting and `build`; only in the previews place's account, under a `preview-` name; `apps create --build-probe`, then `deploy`, with `CARLOS_CONFIG` the runner's and a hostile repository `.carlos/config` changing nothing; no credential minted; the link appears only once `/version` answers `<v>`; a candidate that changes `release/app.json` gets none.
-- `TestAppPreviewDelete`: deleted at expiry, when the candidate goes live, when the job is dropped or dismissed, and when a newer candidate's preview comes up; housekeeping dispatches deletes but never creates; after deletion the link leaves the card and Try again makes a new name; a failing delete is retried, and alerts after 24 hours.
-- `TestAppPreviewSweep`: at start-up and daily, deletes an expired `preview-` app and one no record accounts for; never touches an app without the prefix; with the runner down past expiry, the next start-up deletes it.
-- `TestAppPreviewLimits`: a sixth open preview for a person, or the account's twenty-first, waits with the waiting line; a rate-limited create waits and retries.
+- `TestAppPreviewDelete` (real CLI argument parsing: `apps delete` takes the app positionally): a preview whose create or deploy fails is deleted at its one-hour deadline; deleted at expiry, when the candidate goes live, when the job is dropped or dismissed, and when a newer candidate's preview comes up; housekeeping dispatches deletes but never creates; after deletion the link leaves the card and Try again makes a new name; a failing delete is retried, and alerts after 24 hours.
+- `TestAppPreviewSweep`: at start-up and daily, deletes an expired `preview-` app and one no registration accounts for; deletes nothing when the instance's list can't be fetched whole; a preview registered while the sweep runs is never deleted (registration and the delete decision serialize); never touches an app without the prefix; with the runner down past expiry, the next start-up deletes it.
+- `TestAppPreviewLimits`: two units are reserved per preview and released only when its delete is confirmed; a person's sixth open preview, or one that would pass the account's recorded limit, waits with the waiting line; a rate-limited create waits and retries; a member's job gets no preview.
- `TestPutItLiveAuthority`: only the creator who is an owner may tap; a member sees the owner line; the snapshot binds the deploy; a place change, a binding change, the creator losing ownership and a lost credential between tap, setup, deploy and mint each refuse the next command.
- `TestAppPlaceNeverAutoMerges`: with an app place, `autoMerge` asks even with `MainShips` `no`; a merge queued before the place was confirmed is refused at `authorizeMergeLease`.
- `TestPutItLiveOneTap`: one tap merges and deploys when the trees match; otherwise the merged commit gets Checks and Review, then a second card; failures stop with Fix it (`TestFixAfterMerge`: one fix task per tap, its own Put it live passes ancestry).
- `TestAppDeployFence`: reversed deploy order leaves the newer live; a delayed card for an older commit is refused by ancestry; a "not confirmed" newer deploy keeps the fence; a rollback refuses a deploy tapped before it; a first deploy's own start doesn't fail its later checks; Try again inherits the fence; a restart with an unknown outcome only reconciles, with `go_live` off too; the owner's release after 24 hours keeps `head_sha` and is audited.
-- `TestAppFirstDeploy` and `TestAppRedeploy` (fake carlos): the fixed sequences, each behind its own final check; `go_live` off between create and region refuses the region; a region or target mismatch is refused; the secret only goes to the 0600 file; a taken name gets a suffix; recovery by phase as C3's table; `vet` is never called; each C6 row.
+- `TestAppFirstDeploy` and `TestAppRedeploy` (fake carlos): the fixed sequences, each behind its own final check; `go_live` off between create and region refuses the region; a region or target mismatch is refused; the secret only goes to the 0600 file; a taken name gets a suffix; recovery by phase as C3's table; `vet` is never called; each C6 row; Try again on "not confirmed" runs `promote --retry` when the version was shipped and `deploy` when it wasn't, and a version that failed to start after promotion comes up on the retry; a setup-only failure releases the fence, restores `head_sha`, and the next step adopts the app.
- `TestAppDeployAbilityOff`: `go_live` off before each check refuses everything after it; a command already sent finishes; back on, nothing deploys until Try again; `build` off stops new previews and leaves one that is up until it expires.
- `TestJobGoingLive`: "Going live" until the deploy settles, "Testing it again" while a changed merged result is tested, done only once confirmed; every D1 row's actions succeed in that state (extend jobs spec T1); the done job's link is the address; `team_status` says "It is live at …"; nothing names machinery (extend `TestContractAssistantLaneLeaksNoMachinery`).
- `TestHonestStatusLines`: each D2 row from its inputs, for the card's own candidate only.
@@ -345,7 +347,7 @@ Staging (after phase 4): from Base, "Can you create a simple app for sharing rec
- **Q2. Previews are public and in which account.** Recommended: a dedicated previews account per team (for Paul, `paulca-previews` on Carloku), so preview pages never share an account, address space or plan room with live apps; previews only when the project's "Publish previews publicly" setting is on. Before phase 4, confirm that Carloku's apps domain is on the Public Suffix List (or that each account's subdomain is), so a preview's page can't set cookies that a live app or Base would read; if it isn't, previews go on a separate console domain or wait. A shared password (`carlos gate`) on each preview can come later, once Base can hand it over without friction.
- **Q3. The owner's login for previews without a tap each time.** Recommended: yes, as Paul's ruling 2 of 2026-11-29 says, limited to the fixed templates, the dedicated account and the `preview-` prefix (B2). Replace it with an account-wide `publish` credential for the previews account when one is minted, and with places P4's narrower scope when CARLOS has it.
- **Q4. How long a preview lives.** Recommended: 7 days, as static previews, deleted sooner when the job goes live, is dropped or gets a newer preview.
-- **Q5. Trashed previews and plan limits.** Recommended: ask CARLOS's maintainers whether an app in the Trash counts against `running_things` before phase 4 ships. If it does, size the previews account's plan for 30 days of churn (or file a purge request then); if not, nothing to do.
+- **Q5. Preview capacity.** Recommended: size the previews account's plan for the person cap times two units (B3); trashed previews don't count (`plancaps.go`), so 30 days in the Trash costs names, not room.
- **Q6. Existing repositories with no checks (`recipes`).** Recommended: the next task on each adds its starter checks as part of the change, without asking (A4).
- **Q7. Rollback from Base.** Recommended: not in v1; owners roll back from Equipo's task page.
- **Q8. Custom domains.** Recommended: later, with the domain-buying flow.
@@ -363,7 +365,7 @@ Equipo instance copy, shown in Base:
|---|---|
| `assistant.outcome.app_question` | Your app is ready. Put it live? |
| `assistant.outcome.option.go_live` | Put it live |
-| `assistant.job.detail.owners_only` | Only an owner of this Base can put apps live for now. |
+| `assistant.job.detail.owners_only` | Only an owner of this Base can try or put apps live for now. |
| `assistant.job.status.app_preparing` | Making it ready to try |
| `assistant.job.detail.app_preparing` | Getting your app ready to try. |
| `assistant.job.status.app_waiting` | Ready soon |
@@ -397,6 +399,7 @@ Equipo instance copy, shown in Base:
| `assistant.tested.timeout` | Its tests took too long and were stopped. |
| `assistant.tested.unavailable` | It couldn't be tested just now. We'll try again shortly. |
| `assistant.tested.no_start` | It passed its tests but didn't start when we tried it, so you can't try it yet. |
+| `assistant.tested.trial_not_set_up` | We couldn't set up a trial just now. We'll try again shortly. |
| `assistant.outcome.merge_done` | This went ahead. (proposed for the closed go-ahead; `stale-goahead-card` ships the approved "This no longer needs an answer.") |
After P-B only: "Partly live", "Your app is live in some places but not others.", "Your app didn't go live. The version before is still running."
@@ -426,3 +429,12 @@ Model-facing (reviewed as code): the app contract note (A3), Review's migration
| 3.4 | executable reconciling | kept (C3) |
Revision 5's runner-preview P2s (lifetime reports, confinement limits, upgrade check, seed reads) went with the previews they covered.
+
+**Astra, fresh round on revision 6 (2026-11-29): 4 P1, 7 P2, 1 P3.** Paul asked for one round and one fix of its P1s; the fixes below are **not re-reviewed**. The factual P2 and P3 corrections were made in the same pass because they corrected wrong claims.
+
+1. P1, `apps delete` takes the app positionally, not `--app`: fixed in B3 and its test.
+2. P1, resending the same version doesn't retry a failed rollout: Try again reads `releases` and runs `promote --retry` when the version is shipped, `deploy` otherwise (C3, C6, §11).
+3. P1, setup-only failures were stranded between two fence rules: rule 4 releases when nothing that changes what is served was sent, restores `head_sha`, records `app_created`; Try again is a new step (C3, C6).
+4. P1, the sweep could delete a preview being created: registration before create, the sweep acts only on a complete list, and each delete is decided in the instance's transaction that would register one (B3, C8, §11).
+5. P2s applied: the region given at `apps create` (B1); capacity is app plus instance, reserved per preview, and trashed apps don't count (B3, Q5, §8); recovery reads `instances list` and `releases` (C3); a one-hour deadline from registration (B3); members get no preview, as `authorizePreview` requires (C1, C8, D1); "didn't start" only when CARLOS says so, else "couldn't set up a trial" (D2); the browser risk stated plainly (B3).
+6. P3 applied: rollback with a deploy credential and the probe's whole-token match already exist, so P-E and P-G aren't filed (§8).