Spec: apps go live, revision 6 after Paul's rulings of 2026-11-29
Runner previews, their sandbox, proxy and devbox links are gone. App previews are ordinary CARLOS apps in a dedicated previews account, created and deployed with the owner's login, deleted by an Equipo timer when they expire or the job goes live or is dropped, with a start-up and daily sweep as the backstop. Trade-offs spelled out: clean-up needs Equipo up, 30 days in the Trash, plan limits, the permission it needs. Every earlier P1 re-checked against the smaller design. Temporary binary apps only as an optional later backstop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+218
−286
docs/superpowers/specs/2026-11-28-apps-go-live-design.md+218 −286
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 === [90m11:04AM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m11:04AM[0m [32mINF[0m [1m1 commits scanned.[0m [90m11:04AM[0m [32mINF[0m [1mscanned ~2905788 bytes (2.91 MB) in 269ms[0m [90m11:04AM[0m [32mINF[0m [1mno leaks found[0m === 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.684s 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.893s amadan.net/oficina/base/internal/webtest receipt: slow package 798ms amadan.net/oficina/base/internal/issuer receipt: slow package 627ms amadan.net/oficina/base/internal/equipo receipt: slow package 586ms amadan.net/oficina/base/internal/operations receipt: slow package 176ms amadan.net/oficina/base/internal/web receipt: slow test 1.52s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.11s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce receipt: slow test 620ms amadan.net/oficina/base/internal/webtest TestAskUploadStalledBodyFreesItsSlot receipt: slow test 550ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp receipt: slow test 510ms 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 7f15b54..cf44244 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,8 +1,15 @@ |
| # 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 5, after Astra's fourth and last review (see Review, at the end; the revision 5 changes have not been re-reviewed). |
| +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). |
| -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") 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. |
| +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. |
| + |
| +## Rulings (Paul, 2026-11-29) |
| + |
| +1. **No previews on the person's own runner.** Revision 5's runner previews, their confined sandbox, the proxy and the devbox links are gone. |
| +2. **App previews are ordinary CARLOS apps, with what CARLOS already provides.** Equipo creates one app per preview (`preview-…`), with the account and permissions of a first live deploy, and deploys the build there; a new app starts with its own empty database. A timer in Equipo deletes it when the preview expires, or at once when the job goes live or is dropped. A sweep at start-up and daily deletes any expired or unaccounted-for `preview-` app. |
| +3. **No CARLOS request for temporary binary apps now.** It is mentioned only as an optional later backstop (section 8). |
| +4. **v1 ships** starter checks, "Put it live" with an address, the honest tested line, and these previews. |
| ## 1. The problem |
| @@ -13,21 +20,21 @@ What the runner's own records show (read-only, docs-t1, 2026-11-28): one Enginee |
| Four causes: |
| 1. **Not tested: the repository has no checks.** `amadan ci status paulca/recipes` answers "No CI script". `create_project` (`equipo:internal/runner/thin/bridge.go`, `Forge.Create`, then `Clones.StartDefault` in `forge.go`) starts `main` at an empty first commit. The Checks step looks for `.amadan/ci.d`, `.amadan/ci` or `make ci` (`judge.go`, `findGate`), finds none, and reports `none`. The merge gate then fails `environment_reason` (`mergegate/gate.go`) and the card says "it could not be fully tested". |
| -2. **Not tried: previews are static only.** `preview.go` exports `release/preview.json`'s output folder and runs `carlos deploy --temporary ... --kind static`. The devbox host shares a folder. A Go program has no preview path, so nobody could try the app before it went in. |
| -3. **No address: going live for an app is only the merge.** Going live for a site is a separate Publish card and step (`site.go`: `carlos deploy --kind static` to a confirmed place, then a per-app `deploy` credential). For anything else, nothing creates a CARLOS app or deploys it. The work is merged and nothing serves it. |
| -4. **The go-ahead kept asking.** The Assistant's outcome card keeps the merge card's words once it is answered or withdrawn (`chat/outcome.go`, `fillMirror`), and `touchOutcomes` only cleared its links when the task ended. After the merge the card still read "…Go ahead?". The fix is on Equipo branch `stale-goahead-card` (section 9), separate from this design. |
| +2. **Not tried: previews are static only.** `preview.go` exports `release/preview.json`'s output folder and runs `carlos deploy --temporary ... --kind static`; cli.md says `--kind binary` is refused with `--temporary`. A Go program has no preview path. |
| +3. **No address: going live for an app is only the merge.** Going live for a site is a separate Publish card and step (`site.go`: `carlos deploy --kind static` to a confirmed place, then a per-app `deploy` credential). For anything else, nothing creates a CARLOS app or deploys it. |
| +4. **The go-ahead kept asking.** The Assistant's outcome card kept the merge card's words once it was answered (`chat/outcome.go`, `fillMirror`). Fixed on Equipo branch `stale-goahead-card` (section 9). |
| ## 2. What changes, in one paragraph |
| -Every repository Equipo creates starts with checks that fit what it holds: build, vet, test and a start-up check for a Go app; link and page checks for a static site. They sit in `.amadan/ci.d` on `main`'s first commit, so the hub runs them on every push and Equipo's Checks step judges each change by them. An approved Go app gets a preview the person can try. It is built and run on the person's own Linux machine in a confined sandbox of its own, with an empty database, no secrets and no network, behind a proxy that turns scripts off and keeps every link inside the trial, and is shared as a private link. It ends after 24 hours or when the job ends. Going live for an app is one tap, "Put it live", by the task's creator, who must be an owner. It merges the work and then deploys it as a CARLOS app in the confirmed place, one deploy per app at a time, never older over newer. The first deploy creates the app and its address and mints a deploy credential for that app alone; each later change redeploys with that credential. The job stays "Going live" until the deploy is confirmed, then shows the address, and the Assistant's reply says it. When something couldn't be tested or tried, Base says what and why in one plain line. |
| +Every repository Equipo creates starts with checks that fit what it holds: build, vet, test and a start-up check for a Go app; link and page checks for a static site. They sit in `.amadan/ci.d` on `main`'s first commit, so the hub runs them on every push and Equipo's Checks step judges each change by them. An approved Go app gets a preview: Equipo creates an ordinary CARLOS app for it in a dedicated previews account, deploys the build there with its own empty database, and deletes the app when the preview expires, the job goes live or the job is dropped. The preview runs on CARLOS's own isolated hosting, never on the person's machine. Going live is one tap, "Put it live", by the task's creator, who must be an owner. It merges the work and deploys it as a CARLOS app in the confirmed place, one deploy per app at a time, never older over newer. The first deploy creates the app and its address and mints a deploy credential for that app alone; later changes redeploy with it. The job stays "Going live" until the deploy is confirmed, then shows the address, and the Assistant's reply says it. When something couldn't be tested or tried, Base says what and why in one plain line. |
| ## 3. Rules this design keeps |
| - **Outcomes, not machinery.** Base never names Equipo, runners, tasks, checks, repositories, branches, merges or CARLOS. "Tests", "try it", "live" and "address" are the person's words. |
| -- **The person's decisions stay the person's** (jobs spec K12). Putting an app live, the first time and for every later change, is a tap. Nothing here lets the Assistant, housekeeping or merge authority deploy, and merge authority never merges an app task on its own (C1). |
| -- **Previews stay behind Review** (jobs spec O5, ruled). An app preview runs only for a candidate Review approved, under the same `authorizePreview` checks as a static preview. |
| -- **Don't work around CARLOS.** Where CARLOS lacks something, this design waits for it or uses what exists. Section 8 lists the requests. |
| -- **Places are the only destinations** (places spec §1). An app lives in a confirmed place on one console and account. Model text never names a console, account, region or app. |
| +- **The person's decisions stay the person's** (jobs spec K12). Putting an app live is a tap. Nothing lets the Assistant, housekeeping or merge authority deploy a live app, and merge authority never merges an app task on its own (C1). |
| +- **Previews stay behind Review** (jobs spec O5, ruled). An app preview is made only for a candidate Review approved, under the same `authorizePreview` checks as a static preview. |
| +- **Don't work around CARLOS.** This design uses what CARLOS has. Section 8 lists what it would still help to have. |
| +- **Places are the only destinations** (places spec §1). Live apps and previews each live in a confirmed place. Model text never names a console, account, region or app. |
| ## 4. Starter checks |
| @@ -37,89 +44,85 @@ Every repository Equipo creates starts with checks that fit what it holds: build |
| | kind | files on `main`'s first commit | what the steps check | |
| |---|---|---| |
| -| `go_app` | `.equipo/gates.json` (`{"version":1,"files":["release/app.json"]}`), `.amadan/ci.d/10-go`, `.amadan/ci.d/20-starts`, `release/app.json` (`{"build":"go","package":".","health":"/healthz"}`) | `10-go`: refuses without `go.mod`; `gofmt -l` is empty; `CGO_ENABLED=0 go build` of `release/app.json`'s package for `linux/amd64` and `linux/arm64`; `go vet ./...`; `go test -count=1 ./...`, and at least one test function exists (`go test -list '.*' ./...` prints at least one line starting with `Test`, not only package summaries). `20-starts`: builds that package for the host, starts it as CARLOS does (A3) with a socket and a database in a fresh temporary directory, waits up to 10 s for `GET /healthz` to answer 200, checks `GET /version` is exactly the commit under test (A3), and stops it. It then starts it again on the same database path and checks `/healthz` again, and that the file is the same file (same inode), still SQLite, and not smaller. That shows the app keeps its database rather than replacing it; it doesn't show the app reads back what it wrote, which is the app's own tests' job. | |
| +| `go_app` | `.equipo/gates.json` (`{"version":1,"files":["release/app.json"]}`), `.amadan/ci.d/10-go`, `.amadan/ci.d/20-starts`, `release/app.json` (`{"build":"go","package":".","health":"/healthz"}`) | `10-go`: refuses without `go.mod`; `gofmt -l` is empty; `CGO_ENABLED=0 go build` of `release/app.json`'s package for `linux/amd64` and `linux/arm64`; `go vet ./...`; `go test -count=1 ./...`, and at least one test function exists (`go test -list '.*' ./...` prints a line starting with `Test`). `20-starts`: builds that package for the host, starts it as CARLOS does (A3) with a socket and a database in a fresh temporary directory, waits up to 10 s for `GET /healthz` to answer 200, checks `GET /version` is exactly the commit under test (A3), and stops it. It then starts it again on the same database path and checks `/healthz` again, and that the file is the same file (same inode), still SQLite and not smaller. That shows the app keeps its database file rather than replacing it; reading back records is the app's own tests' job. | |
| | `site` | `.equipo/gates.json` (`{"version":1,"files":["release/preview.json"]}`), `.amadan/ci.d/10-site`, `release/preview.json` (`{"output":"site"}`) | `10-site` (POSIX `sh` and `awk`, no downloads): every `.html` file under the output folder starts with a doctype and has a `lang` and a `<title>`; every local `href` and `src` resolves to a file in the folder; nothing loads over `http:`; the folder is within the preview caps (`previewMaxFiles`, `previewMaxBytes`). | |
| | `other` | nothing (today's empty tree) | none: the card says so honestly (D2). | |
| -The `go_app` template also writes a short `README.md` with the app spec's declaration headings (§0.5) left for Engineering to fill, and an `AGENTS.md` that states the app contract (A3). These are files, not checks. |
| +The `go_app` template also writes a short `README.md` with the app spec's declaration headings (§0.5) for Engineering to fill, and an `AGENTS.md` stating the app contract (A3). |
| -**One build contract for checks, preview and deploy.** Naming `release/app.json` in `gates.json` pins it in Equipo's Checks: the verdict always comes from `main`'s copy. The preview (B1) and the deploy (C3) read `release/app.json` from the same place, `main` at the candidate's base, never from the candidate, so the package checked is the package tried and shipped. A candidate that changes `release/app.json` gets no app preview, because nothing trusted says how to build it yet. Its card still offers "Put it live", with the line "It changes how the app is built, so it will be tested again before it goes live." (D2). The tap merges it. The merged commit is then `main`, so its Checks, Review and the boot check run under the new contract as trusted ones ("Testing it again", D1). If they pass, the deploy follows on the same tap, bound to the same snapshot; if they fail, the job stops with Fix it (D1). The person isn't asked twice for the same decision. |
| +**One build contract for checks, preview and deploy.** Naming `release/app.json` in `gates.json` pins it in Equipo's Checks: the verdict always comes from `main`'s copy. The preview (B1) and the deploy (C3) read `release/app.json` from `main` at the candidate's base too, never from the candidate, so the package checked is the package tried and shipped. |
| -Because the verdict before the merge comes from the old contract, a contract change must be **staged**: the candidate that edits `release/app.json` must still build and pass under the old one. Moving the app from `.` to `cmd/app` is two changes: the first adds `cmd/app`, points `release/app.json` at it and leaves `.` building; once that is in and live, a second removes the old package. Engineering's app contract note (A3) says so. A candidate that removes the old package in the same change fails the old contract's checks and goes to a fix round like any failing change, so the merge gate (`mergegate/gate.go`, which refuses failed checks before it weighs the person's say) is never asked to make an exception. |
| +A candidate that changes `release/app.json` gets no preview, because nothing trusted says how to build it yet. Its card still offers "Put it live", with the line "It changes how the app is built, so it will be tested again before it goes live." (D2). The tap merges it; the merged commit is then `main`, so its Checks and Review run under the new contract as trusted ones ("Testing it again", D1). If they pass, the deploy follows on the same tap, bound to the same snapshot; if they fail, the job stops with Fix it (D1). |
| + |
| +Because the verdict before the merge comes from the old contract, a contract change must be **staged**: the candidate that edits `release/app.json` must still build and pass under the old one. Moving the app from `.` to `cmd/app` is two changes: the first adds `cmd/app`, points `release/app.json` at it and leaves `.` building; once that is live, a second removes the old package. Engineering's app contract note says so. A candidate that removes the old package at once fails the old contract's checks and goes to a fix round, so the merge gate (`mergegate/gate.go`, which refuses failed checks before it weighs the person's say) is never asked for an exception. |
| ### A2. The same checks in both places, and where they differ |
| -- **The hub.** Right after creating the repository, the runner turns hosted CI on with one fixed call (`amadan ci hosted <ns>/<repo> on`, the smallest size; the agent account is a writer on the repository it created). The hub runs `.amadan/ci.d` on every push, as for any Amadan repository. |
| -- **Equipo's Checks step.** `.equipo/gates.json` on `main` makes the base gates trusted (`base_gates.go`, `readBaseGates`): every candidate is checked by `main`'s steps, installed read-only over the candidate's copies (`installBaseGates`). With those passing, the merge gate's `trusted_base_checks` holds. |
| -- **Where they differ.** The hub runs the pushed files, the candidate's own. Equipo runs `main`'s files for the verdict and the candidate's only as a diagnostic (`judge.go`, `changedGate`). So they agree while a change leaves the steps alone and both run with what the steps need (Go, loopback). A change that edits or deletes a step can be green on the hub and red in Equipo. Equipo's verdict is the one the go-ahead uses, and the honest line (D2) reads from it. |
| +- **The hub.** Right after creating the repository, the runner turns hosted CI on with one fixed call (`amadan ci hosted <ns>/<repo> on`, the smallest size; the agent account is a writer on the repository it created). The hub runs `.amadan/ci.d` on every push. |
| +- **Equipo's Checks step.** `.equipo/gates.json` on `main` makes the base gates trusted (`base_gates.go`, `readBaseGates`): every candidate is checked by `main`'s steps, installed read-only over the candidate's copies (`installBaseGates`), in the existing checks sandbox. With those passing, the merge gate's `trusted_base_checks` holds. |
| +- **Where they differ.** The hub runs the pushed files, the candidate's own; Equipo runs `main`'s for the verdict and the candidate's only as a diagnostic (`judge.go`, `changedGate`). A change that edits or deletes a step can be green on the hub and red in Equipo. Equipo's verdict is the one the go-ahead and the honest line (D2) use. |
| ### A3. The app contract |
| -What CARLOS runs and checks, and what this design adds on top. Engineering's dispatch carries it as a separate note when the project's kind is `go_app` (like the first-look note, jobs plan Task 3.3, never in the brief): |
| +Engineering's dispatch carries it as a separate note when the project's kind is `go_app` (like the first-look note, jobs plan Task 3.3, never in the brief): |
| -- **CARLOS's own contract** (cli.md, "What an instance is started with" and `carlos vet --boot`): the binary is started as `<binary> --socket <path> --db <path>`, serves HTTP on that unix socket, and answers `GET /healthz` with 200 within ten seconds. Its database is the SQLite file at `--db`. Files beside it go in its working directory. |
| -- **This design's choices:** the app creates its schema itself on first start (app spec 14.1); `GET /version` answers 200 with a body of exactly the first 12 hexadecimal characters of the Go build's `vcs.revision` (`runtime/debug.ReadBuildInfo`), and nothing else. The runner's build sets that by building with `-buildvcs=true` from a checkout at exactly that commit. The same 12 characters are the release's `--version` (C3). CARLOS's build probe matches a whole whitespace-separated token, never a prefix (`carlos/platform/deploy.go`, the probe's matcher), so the two are equal by construction, and the runner checks the same equality itself. App spec 14.2 asks for a version endpoint, not this one. The app builds with `CGO_ENABLED=0` for linux on amd64 and arm64 (7.5), with its pages and assets inside the binary (6.2), and its pages work with scripts off (12.5), which app previews rely on (B1). |
| +- **CARLOS's own contract** (cli.md, "What an instance is started with", and `carlos vet --boot`): the binary is started as `<binary> --socket <path> --db <path>`, serves HTTP on that unix socket, and answers `GET /healthz` with 200 within ten seconds. Its database is the SQLite file at `--db`. |
| +- **This design's choices:** the app creates its schema itself on first start (app spec 14.1); `GET /version` answers 200 with a body of exactly the first 12 hexadecimal characters of the Go build's `vcs.revision` (`runtime/debug.ReadBuildInfo`). The runner builds with `-buildvcs=true` from a checkout at exactly that commit, and passes the same 12 characters as the release's `--version` (C3). CARLOS's build probe matches a whole whitespace-separated token (`carlos/platform/deploy.go`, the probe's matcher), so the two agree by construction, and the runner checks the same equality itself. The app builds with `CGO_ENABLED=0` for linux on amd64 and arm64 (app spec 7.5), with its pages and assets inside the binary (6.2). |
| ### A4. Repositories that already exist without checks |
| -`recipes`, and any other repository Equipo created before this ships. The first task Equipo runs on such a repository, for any reason, adds the starter checks for its kind as part of that task's change. That one change is judged by its own candidate steps (uncertified, as today). From its merge on, `main` holds trusted checks. The person is not asked separately (Q6). |
| +`recipes`, and any other repository Equipo created before this ships. The first task Equipo runs on such a repository adds the starter checks for its kind as part of that task's change. That one change is judged by its own candidate steps (uncertified, as today); from its merge on, `main` holds trusted checks (Q6). |
| ## 5. App previews |
| -### B1. Where an app preview runs (v1) |
| +### B1. What a preview is |
| -On the person's own primary runner, on Linux only, as a devbox link on their private network. That matches the places ruling that temporary sites default to the docs-t1 devbox, tailnet only, until CARLOS can host temporary apps (P4). CARLOS temporary deploys don't cover apps today: cli.md says `--temporary` is for static sites, and `--kind binary` is refused with it (request P-A). A Mac runner runs no app preview in v1: its seatbelt profile is proven for checks, not for a long-running server, and it has no cgroups or network namespaces. The honest line says the app can't be tried before it goes live (D2). |
| +An ordinary CARLOS binary app, one per preview, in the **previews place**: a place of kind `app_preview` (places spec §1's records), confirmed once by an owner, naming one console and one account **dedicated to previews** (for Paul, a new Carloku account such as `paulca-previews`). The places spec already requires a dedicated account for public temporary sites (§1, "CARLOS temporary sites"); the same reasons apply here, and one more: a preview runs model-written code on a public address, and keeping it out of the account that serves the person's live apps keeps its cookies and pages away from theirs (Q2). |
| -A new preview mode, `app`, beside today's static export: |
| +- **Evidence.** Review reports `has_app_preview` when `main` at the candidate's base holds a valid `release/app.json` (strict JSON, at most 4 KiB, `build` is `go`, `package` a clean relative path) and the candidate doesn't change it (A1). `schedulePreview` treats it as it treats `release/preview.json`: the same `authorizePreview`, the project's "Publish previews publicly" setting (a preview is public), digest and once-per-candidate rules, and the person's `build` ability (C8). |
| +- **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). |
| +- **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. |
| -- **Evidence.** Review reports `has_app_preview` when `main` at the candidate's base holds a valid `release/app.json` (strict JSON, at most 4 KiB, `build` is `go`, `package` and the optional `seed` are clean relative paths inside the tree) and the candidate doesn't change it (A1). `schedulePreview` treats it as it treats `release/preview.json`, under the same `authorizePreview`, digest and once-per-candidate rules. |
| -- **Scan.** Before anything runs, the candidate's tree and its seed file go through the same secret scan static exports get (`preview_security.go`, gitleaks rules). A scan that can't run fails the preview with `preview_scanner` (jobs spec K6), never runs it unscanned. |
| -- **Build.** In the checks sandbox (the same `Gate.Run` and dependency stage as Checks): `CGO_ENABLED=0 GOTOOLCHAIN=local GOFLAGS=-mod=readonly go build -trimpath -buildvcs=true -o <private>/app ./<package>` from a checkout at the candidate, for the runner's own platform, with modules from the dependency stage, read-only. The binary's SHA-256 is the preview's digest, recorded and bound to the reviewed candidate as the export digest is today. |
| -- **Run** (B3 sets the confinement). The binary is started as CARLOS starts it: `app --socket /run/app.sock --db /data/app.db`, with `HOME` empty and `TZ=UTC` the only other variables. |
| -- **Proxy, and scripts off.** A small proxy in the runner's own process listens on a socket of its own and forwards to the app's socket. It is the only way in. CSP alone can't stop a page's script from navigating the whole tab to another origin with data in the address, so an app preview runs with **scripts off**, as the family's pages are meant to work (app spec 12.5): |
| - - every response carries the static preview headers (`previewHeaders`) with `script-src 'none'`, `worker-src 'none'`, `form-action 'self'` and `connect-src 'none'`, plus `Cross-Origin-Opener-Policy: same-origin`, overwriting any the app sent; |
| - - in HTML responses the proxy rewrites every URL that leaves the preview's origin, in `href`, `src`, `srcset`, `action`, `formaction`, `poster`, `<meta http-equiv="refresh">` and CSS `url()`, to the proxy's own page `/_leaving`, which shows the address as plain text and links nowhere (DRAFT line below); |
| - - it refuses a redirect whose `Location` leaves the origin, removes the HTTP `Refresh` header unless its URL is the preview's own origin, removes `Link` headers, drops any `Set-Cookie` with a `Domain` attribute, and caps request bodies at 1 MiB and responses at 10 MiB; |
| - - a response it can't parse as HTML when it says it is HTML is replaced by a plain error page; |
| - - only these types are served as they are: `text/html` (rewritten as above), `text/css` (its `url()` and `@import` rewritten), `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `font/woff2`, `application/json` and `text/plain`, all with `nosniff`. Anything else, `image/svg+xml` and XML included (both can carry links that navigate without scripts), is served as `application/octet-stream` with `Content-Disposition: attachment`, so the browser downloads it and never renders it. |
| - |
| - So nothing on the page can load from, post to or navigate to another origin; the person would have to copy an address by hand. Forms that post back to the app work. Parts of an app that need scripts don't run in the trial, and the pill says so (D2). If the proxy can't start, the preview fails closed. |
| -- **One origin per attempt.** `carlos devbox share --socket <proxy socket> eq-app-<task>-<attempt>` publishes the proxy, never the app. A new attempt gets a new name, so cookies and storage from an earlier attempt don't carry over. |
| -- **Proof.** The preview counts as up once `GET <health>` through the link answers 200 and `GET /version` names the candidate. That replaces the static preview's marker file. |
| -- **Data.** Each preview starts from an empty database. If `seed` is set, its SQL (from the reviewed candidate, scanned, at most 1 MiB) runs once, inside the same confinement, before the first request. A preview never gets a copy of live data, even for a change to an app that is already live (Q11). The data directory is deleted when the preview ends. |
| -- **Upgrade check, for a change to a live app.** In the B3 confinement, the runner builds the release that is actually live (the binding's `deployed_sha`, C3, not `main`, which may hold merged work that never went live) and the candidate. The live release starts on a fresh database with the seed. Then the candidate starts on that database, then the live release again. Each time `/healthz` answers 200 and every entry in `release/app.json`'s `"reads"` list answers 200 with its expected text in the body. An entry is `{"path": "<relative path>", "expect": "<text>"}`, at most 20, written by Engineering for pages that show stored records, where `expect` is text the seed put in the database (a recipe's title, say). So a page that loads but has lost its records fails. That shows the candidate reads the live release's records, and the live release can still read them after the candidate ran (app spec 14.1, 14.3). It covers only what the seed and the listed pages exercise. The "existing data" line (D2) is shown only when a seed and at least one `reads` entry exist and pass; without them the check is just "it starts on the live release's database", and D2 says the existing data wasn't checked. It is part of the deploy's own checks (C3), so it runs whether or not an interactive preview is possible. A failure is a finding for the fix round, like a failing check. |
| -- **First looks.** A request for an app still starts with a first look: one static page, as jobs spec K13 and K14 set out, through the existing static preview, within the two-minute target. The app preview follows once the full build is approved. Base shows "See the first look" first and "Try your app" once the app preview is up (section 7). |
| +### B2. Who may create and delete preview apps |
| -### B2. Lifetime, retries, limits and cost |
| +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: |
| -| what | rule | |
| -|---|---| |
| -| life | 24 hours from start, or until its job is done, dropped or replaced by a newer candidate's preview (Q3) | |
| -| idle | stopped after 2 hours with no request | |
| -| after it stops | the runner reports the preview as ended (a new preview phase `ended`, with reason `lifetime`, `idle`, `job_ended`, `superseded` or `limits`). The instance records the end on the step, so `taskPreview` stops offering the link and `previewRetryCheck` (`chat/preview_retry.go`), which refuses a preview still recorded as up, now allows Try again. Try again is the existing person's retry (`retryPreview`): the same preview step's next attempt for the same candidate, idempotent by card revision and key like every K2 action. A newer candidate withdraws it | |
| -| at once, per runner | 3 running app previews; a fourth waits, and the pill says it is waiting its turn | |
| -| size | 512 MiB of memory, one CPU's share, 64 processes, 1 GiB for `/data` (B3) | |
| -| logs | the last 1 MiB of the app's output, kept with the step and deleted with it | |
| -| build | the Checks step's time limit (`MaxStep`) | |
| +- 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-`; |
| +- 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. |
| + |
| +An account-wide `publish` credential for the previews account could replace the login later; it could create and delete every app there, which is why the account is dedicated. |
| -The cost is the person's own machine time: no CARLOS app, no hosted minutes, no model use. Hosted CI from A2 runs on the hub at the namespace's own CI terms (Q9). |
| +### B3. Expiry, deletion and the sweep |
| -### B3. Safety |
| +| what | rule | |
| +|---|---| |
| +| life | 7 days from deploy, 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 | |
| +| 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 | |
| +| a delete that fails | retried by the next tick and the next sweep; after 24 hours of failures, an operator alert (jobs spec O8) | |
| -A preview runs code a model wrote, so the confinement is its own profile, not a reuse of the checks profile's word: |
| +**Trade-offs, said plainly.** |
| -- **Only after Review** approved that exact candidate, and only on a runner whose sandbox is proven and has never run checks outside it (`markTainted`). Never on the hub or on CARLOS in v1. |
| -- **Processes.** bubblewrap with new user, PID, IPC, UTS and network namespaces (`--unshare-all`, no `--share-net`), seccomp as for checks, no capabilities, `--die-with-parent`, and a systemd user scope (`systemd-run --user --scope`) with `MemoryMax=512M`, `TasksMax=64` and `CPUQuota=100%`. A runner that can't create that scope with those limits runs no app preview. |
| -- **Files.** Mounted: the built binary, read-only; `/data`, a tmpfs of 1 GiB (so its size is the disk quota); `/tmp`, a tmpfs of 64 MiB; `/run` holding only the app's socket; nothing else of the runner's or the person's. No credential file of any kind is reachable (they already sit outside every sandbox mount, `previewCredentialPlace`). |
| -- **Network.** None: the network namespace has only loopback, so the app can't reach the internet, the tailnet or the machine's services. The proxy's socket is the only way in, and the proxy forwards to nothing else. |
| -- **The browser.** Scripts and workers are off, and the proxy rewrites every address that leaves the preview (B1), so a page can't load from, post to, frame, redirect to or navigate to another origin, and can't reach the visitor's own local services. Each attempt has its own origin. The one thing left is a person copying an address shown on `/_leaving` by hand. |
| -- **The link.** Private to the person's network (devbox `--allow` set to the person's login where the devbox supports it). Never public in v1. |
| -- **Clean-up.** The runner records each running preview (step, scope, socket, data directory) in its state. On start it stops and deletes any it finds from before a crash or reboot, before taking new work. |
| -- **Audit.** Every start, stop and digest: `preview.app.started`, `preview.app.stopped`, as for static previews. |
| +- **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. |
| +- **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. |
| -### B4. Later: previews on CARLOS |
| +### B4. What previews don't do in v1 |
| -Once CARLOS ships P-A (temporary binary apps with a throwaway database) and P4 (a scope for temporary apps only), the `app` mode gains a CARLOS adapter: `carlos deploy --temporary --kind binary --ttl 1d` in a dedicated previews account, inside CARLOS's own tenant sandbox, reachable away from the person's network, with the same proxy rules applied at the edge (P-A asks for that too). For a change to an app that is already live, `carlos canary` gives a preview on a host of its own with its own config bundle (`--environment`). That needs P-C and P-D: a deploy credential that may promote `canary/<name>`, and a canary that is sure to get an empty database of its own. Until then, changes to a live app are previewed on the runner like new ones. |
| +- **No upgrade check against live data.** A change to a live app gets a preview with an empty database, so nothing shows it still reads the live app's records. The honest line says so (D2). Review's instructions for an app with a place add: "a schema change must leave data the previous release can still read (app spec 14.3)". |
| +- **No seed data.** Previews start empty. |
| +- **No preview for a candidate that changes the build contract** (A1). |
| ## 6. App go-live |
| @@ -127,258 +130,230 @@ Once CARLOS ships P-A (temporary binary apps with a throwaway database) and P4 ( |
| 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, may tap it: today's rule for merging (`answerMerge`, `isOwner`) and for publishing (`publishRefusal`). Nobody else can put another person's work live today, and this design adds no way to (abilities spec Q4). So a member who isn't an owner gets no "Put it live" at all: their app job ends at "Ready to try" with the line "Only an owner of this Base can put apps live for now." (DRAFT), and keeps the preview, Drop it and Dismiss. `go_live` only narrows this; it never lets anyone use an owner's login. |
| -- **What the tap is bound to.** The card stores a snapshot, as a publish card does: the candidate SHA, the place id and its revision, the project binding and its revision, the destination hash (console, account, app, region) and the deploy mode (`setup` for an app with none yet, `deploy` for one with its credential). 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 only when the merged commit's tree is exactly the approved candidate's tree, which is always so for a new repository. Otherwise, for example when someone else's change landed in between, the merged commit gets Checks, Review and the boot check of its own, and then a second card asks for the merged result: a Publish-style card, one per merged commit, as `offerPublish` does for sites, answered by the same creator under the same rules. When those checks fail, the job stops with Fix it (D1). A candidate that changed the build contract is the one case where the merged result is checked 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 says. `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 where every merge is decided: `autoMerge`, `authorizeMerge` and `authorizeMergeLease`, so a merge already queued when a project gains an app place is refused before its request goes. The person's own tap still merges. |
| +- **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. |
| +- **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. |
| ### C2. Where the app lives |
| -The places spec gains a kind beside `site`: **`app`**, a CARLOS binary app on one console and account. It uses the same records (`chat_places`, `chat_project_places`), the same owner-only confirmation, and the same team default and project override. |
| +The places spec gains a kind beside `site`: **`app`**, a CARLOS binary app on one console and account, with the same records (`chat_places`, `chat_project_places`), owner-only confirmation, team default and project override. |
| -- **Account.** The team's default place for apps, else the site default. By Paul's rulings that is Carloku account `paulca` for `paulca/` projects and `oficina` for oficina projects. The person's Base or Oficina account maps to these through the places chooser; code never guesses (Q4). |
| -- **Region.** Chosen when the place is confirmed, from the regions the console offers, and recorded on the place. Every command names it (C3), because otherwise CARLOS picks a new app's region from the runner's timezone (cli.md, "deploy"). |
| -- **Target.** Recorded in CARLOS's spelling, `linux-arm64` (the platform's default for `--target`), unless the place records another. The runner derives Go's `GOOS` and `GOARCH` from it by splitting at the dash and refuses any value outside a fixed list (`linux-arm64`, `linux-amd64`). |
| -- **Name.** Minted by code from the project name: lower case letters, digits and dashes, at most 30 characters (`recipes`). When the account already holds that name, a dash and four random letters and digits are added (`recipes-k3x9`). The platform also refuses a name whose address is taken (cli.md, `apps create`); the runner tries a new suffix at most three times. A model never names the app. |
| +- **Account.** The team's default place for apps, else the site default. By Paul's rulings that is Carloku account `paulca` for `paulca/` projects and `oficina` for oficina projects (Q1). |
| +- **Region.** Chosen when the place is confirmed and recorded on it. Every command names it (C3); otherwise CARLOS picks a new app's region from the runner's timezone (cli.md, "deploy"). |
| +- **Target.** In CARLOS's spelling, `linux-arm64` (the platform's default `--target`), unless the place records another. The runner derives `GOOS` and `GOARCH` by splitting at the dash and refuses anything outside `linux-arm64` and `linux-amd64`. |
| +- **Name.** Minted by code from the project name: lower case letters, digits and dashes, at most 30 characters (`recipes`). If the account holds it, a dash and four random letters and digits are added (`recipes-k3x9`), at most three tries. A model never names the app. |
| ### C3. Deploying: one fixed path, one at a time |
| -**Command environment.** Every CARLOS command in this section runs as `site.go`'s do: from the runner's process, never a sandbox, in an empty private directory that is also `HOME`, with `CARLOS_CONFIG` naming a runner-written config that holds exactly the snapshot's destination, so no repository `.carlos/config` or default can steer it. Each command names `--console`, `--account-id` and `--app` explicitly. The runner refuses a dispatch whose console, account, app, region or target differs from the place it holds a login or credential for. |
| - |
| -**The artifact, and the boot check.** The deploy builds twice from the merged commit, in the checks sandbox, with the package from `main`'s `release/app.json` (A1), `-trimpath -buildvcs=true` and the same module set: |
| - |
| -- the **shipped artifact**, for the place's target (`linux-arm64` by default, built with `GOOS=linux GOARCH=arm64`). Its SHA-256 is the step's digest. The runner checks it statically: an ELF executable for that architecture, statically linked, within the size cap; |
| -- a **native twin** for the runner's own platform, the same commit, package and flags, differing only in `GOARCH`. The runner can't run an arm64 binary on an x86 machine, so the twin is what it runs: in the B3 confinement it starts it as CARLOS will, checks `/healthz` and that `/version` is the 12-character version, and, for a change to a live app, runs the upgrade check (B1). |
| - |
| -The shipped artifact's first run on its real architecture is CARLOS's own, and the build probe (below) is the proof it works. `carlos vet --boot` can't stand in for the boot check: it reads a deployment store directly, takes no console or account, and runs the binary with the caller's environment and access (`carlos/platform/internal/vet/vet.go`), so the runner never calls it (P-F). Because the boot check needs B3's confinement, that confinement is part of phase 3, not only of previews (section 10). A runner that can't confine (a Mac, or no user scope) can't deploy apps either; the job says why (D2). |
| +**Command environment.** Every CARLOS command here and in B1 to B3 runs as `site.go`'s do: from the runner's process, never a sandbox, in an empty private directory that is also `HOME`, with `CARLOS_CONFIG` naming a runner-written config holding exactly the snapshot's destination, so no repository `.carlos/config` can steer it. Each command names `--console`, `--account-id` and `--app`. The runner refuses a dispatch whose console, account, app, region or target differs from the place it holds a login or credential for. |
| -**First deploy (mode `setup`).** As for a site's first publish (places spec §1, ruling 2), with the owner's CARLOS login on that runner, until CARLOS ships P2 and P3. Each command is behind its own final check (`authorizeAppDeploy`, C8), and the step records a phase before each: |
| +**The artifact.** Built from the merged commit in the existing checks sandbox with `main`'s `release/app.json` package, `-trimpath -buildvcs=true`, for the place's target. Its SHA-256 is the step's digest. The runner checks it statically (an ELF executable for that architecture, statically linked, within the size cap); it never runs it. What it was built from already passed `20-starts` in Checks, and, when there was one, the candidate's preview came up on CARLOS with the same target (B1). The proof that this build starts is the build probe (below). `carlos vet` isn't used: it reads a deployment store directly and runs the binary with the caller's access (`carlos/platform/internal/vet/vet.go`). |
| -1. `carlos apps create --app <app> --build-probe /version`, then `carlos apps region --app <app> --set <region>`. The build probe is set before anything is promoted, so the first deploy already proves the new process is running, not just adopted (cli.md, "build-probe"). The step records `app_created` with the app, console and account, as `site.go`'s `created` does, so a retry adopts this app and never creates another. |
| -2. `carlos deploy --kind binary --target <target> --region <region> --channel edge --timeout 5m --version <v> --no-prompt <artifact>`, `<v>` as below. It creates the first instance, ships, promotes and waits until the build probe names the version. |
| -3. `carlos services create --role deploy --app <app> --rungs edge <name>`. The runner reads the secret from the output, stores it 0600 outside every sandbox mount, and never logs it (as `site.go`). A mint that restarts before storing its key is lost, and the next deploy asks for setup again, as for sites. |
| +**First deploy (mode `setup`).** As for a site's first publish (places spec §1, ruling 2), with the owner's CARLOS login, at the owner's tap, until CARLOS ships places P2 and P3. Each command is behind its own final check (`authorizeAppDeploy`, C8), and the step records a phase before each: |
| -The owner's login is used for these steps only, and only at an owner's tap. |
| +1. `carlos apps create --app <app> --build-probe /version`, then `carlos apps region --app <app> --set <region>`. The build probe is set before anything is promoted. |
| +2. `carlos deploy --kind binary --target <target> --region <region> --channel edge --timeout 5m --version <v> --no-prompt <artifact>`. It creates the first instance, ships, promotes and waits until the build probe names `<v>`. |
| +3. `carlos services create --role deploy --app <app> --rungs edge <name>`. The runner reads the secret from the output, stores it 0600 outside every sandbox mount and never logs it (as `site.go`). A mint that restarts before storing its key is lost, and the next deploy asks for setup's mint again, as for sites. |
| -**Later deploys (mode `deploy`).** With the app's deploy credential (`CARLOS_SERVICE_TOKEN` and `CARLOS_CONSOLE` in the environment, never argv), which reaches that app's `edge` channel and nothing else: `carlos deploy --kind binary --target <target> --region <region> --channel edge --timeout 5m --version <v> --no-prompt <artifact>`, where `<v>` is the merge SHA's first 12 hexadecimal characters, then the proof below. |
| +**Later deploys (mode `deploy`).** With the app's deploy credential (`CARLOS_SERVICE_TOKEN` and `CARLOS_CONSOLE` in the environment, never argv), which reaches that app's `edge` channel and nothing else: the same `carlos deploy` line. `<v>` is the merge SHA's first 12 hexadecimal characters. |
| -**Proof.** A deploy counts as live only when `carlos deploy` reports the build probe saw `<v>` as a whole token (CARLOS's matcher) and the runner's own `GET /version` on the address answers exactly `<v>`. One answer from the address proves that some instance serves the new build, not that every instance does. Telling "all", "some" and "none" apart needs each instance's serving build (`carlos instances list` shows installed and serving builds per instance), readable with a deploy credential in a machine-readable form: request P-B. Until P-B, the outcome is one of "live" (proof above), "not changed" (refused before anything was shipped) or "not confirmed", and never "partly live" or "the version before is still running" (C6). |
| +**Proof.** A deploy counts as live only when `carlos deploy` reports the build probe saw `<v>` and the runner's own `GET /version` on the address answers exactly `<v>`. That proves some instance serves the new build, not that every instance does. Telling "all", "some" and "none" apart needs each instance's serving build, readable with a deploy credential (request P-B). Until then the outcome is "live", "not changed" (refused before anything was sent) or "not confirmed", never "partly live" or "the version before is still running" (C6). |
| **One deploy per app at a time, never older over newer.** The project binding holds a durable deploy fence: |
| - `generation`, a counter; |
| - `pending`, the deploy **step** (not attempt) holding the fence while its outcome isn't known, with `pending_generation`, the generation it allocated, and `pending_sha`, the merge SHA it sends; |
| - `deployed_sha`, the merge SHA last confirmed live; |
| -- `head_sha`, the newest merge SHA that may be serving, stored on its own, never derived from the lock: set to `pending_sha` when a step takes the fence, and moved back only by a confirmed rollback (rule 5) or by a step refused before it sent anything. Releasing the lock never moves it. |
| +- `head_sha`, the newest merge SHA that may be serving, stored on its own: set when a step takes the fence, moved back only by a confirmed rollback (rule 5) or by a step refused before it sent anything. Releasing the lock never moves it. |
| The rules, each enforced by `authorizeAppDeploy` in the transaction that decides: |
| -1. **Taking the fence** (the step's start). The card's snapshot records `seen_generation` at the tap. The step may start only when no step holds `pending`, `generation` still equals `seen_generation`, and its merge SHA is a descendant of `head_sha` (or there is no `head_sha` 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 is what stops an older change: a delayed card for a commit that isn't a descendant of what may be live is refused, whenever it was answered. The generation is what stops a tap answered before a rollback or another deploy from acting on a state it didn't see. |
| -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, because it checks the generation it allocated, not the one the tap saw. |
| -3. **Its next attempt** (Try again on the same step, C6) inherits the fence: `pending` names the step, so the attempt doesn't have to take it again, 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 to what it was), or an owner's explicit release after reconciling (below). Then `pending` is cleared. "Not confirmed" keeps it held. An owner's release keeps `head_sha` at the unconfirmed SHA, so anything deployed next must descend from it: a commit between the last confirmed one and the unconfirmed one can never overwrite it, whether or not its rollout later finishes. |
| -5. **Rollback** (C7) is the one path allowed to go backwards. It takes the fence like a deploy, needs no ancestry, and sets `head_sha` to the version it restores once confirmed. |
| +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. |
| +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, which takes the fence afresh under rule 1. |
| +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. |
| -**Recovering by phase.** The step records a phase before each command, and a restart recovers by the phase it finds: |
| +**Recovering by phase.** A restart recovers by the phase the step recorded: |
| | phase recorded | what may have happened | recovery | |
| |---|---|---| |
| -| `setup_listing` (before `apps create`; the step has stored `carlos apps list`'s answer, which didn't hold the name) | nothing, or the app was created and the answer lost | list again: absent, go on; present with no releases and no instances, created after the stored listing, adopt it as this step's (the name is code-minted with a random suffix, so another writer choosing it is unlikely, and an app with releases or instances is never adopted); anything else, pick a new suffix and start again | |
| -| `setup_created` | the app exists, the region may not be set | run `apps region --set` again (setting the same region twice is harmless) | |
| -| `deploy_sent` (first or later) | a rollout may be under way | reconcile with reads only (below) | |
| -| `minting` | the key may have been minted and lost | as for sites: a lost key; the next deploy asks for setup's mint again | |
| +| `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_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 | |
| -**Reconciling.** A step restarted in `deploy_sent`, or one 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`, and it may run while the switch is off. The instance re-runs it every 10 minutes for 24 hours while the step holds the fence. If it sees `<v>`, the step is live and releases the fence. If it doesn't, the outcome stays "not confirmed": before P-B, not seeing the version proves neither that nothing changed nor that a slow rollout won't finish. After 24 hours reconciling stops; the job keeps "Not confirmed" and gains Open in Equipo (jobs spec K6's rows for stops only Equipo's pages can clear), where an owner can either send the same version again (Try again, under `go_live`) or release the lock after reading what CARLOS's console shows (audited as `app.deploy.released_unknown`; `head_sha` stays, rule 4). |
| +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. |
| -### C4. The address |
| - |
| -The first deploy prints the app's platform address, `https://<app>.<account>.<apps domain>/` (cli.md, `apps create`). The runner reports it with the step's result, and the instance stores it on the project binding, as a site's address is stored. It is then: |
| +**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). |
| -- the job card's link, rel empty, label "Open your app" (DRAFT): `jobSite` reads app bindings too, so a done job's pill and job view carry it (Base's `Card.Go`); |
| -- in the Assistant's `team_status` and `team_update` lines, with the approved "It is live at %s", so the reply says where it is; |
| -- on Equipo's Places page. |
| +### C4. The address |
| -Custom domains are later (Q8): attaching one needs a `publish` or `instance` credential and DNS (`carlos domains attach`; P7 for reading them with a deploy credential), and Base's domain-buying flow is its own design. |
| +The first deploy prints the app's platform address, `https://<app>.<account>.<apps domain>/` (cli.md, `apps create`). The runner reports it and the instance stores it on the project binding, as a site's address is stored. It is then the job card's link (rel empty, label "Open your app", DRAFT; `jobSite` reads app bindings too, so Base's `Card.Go` draws it), in the Assistant's `team_status` and `team_update` lines with the approved "It is live at %s", and on Equipo's Places page. Custom domains are later (Q8). |
| ### C5. Data and backups |
| -A binary instance gets its own SQLite database (`--db`), replicated off the box continuously by the platform (`carlos routes`: replication `default` syncs on every change). Backups are that replica's history. An owner can read a copy at any point the platform keeps (`carlos db pull --at`) without touching the live app. What a host failure could lose is in the platform's declaration (app spec 8.1). Equipo records the region and the replication setting on the place; Base says nothing about either unless asked. Deleting the app is an owner's act on Equipo's Places page, never the Assistant's. It says the app moves to the Trash for 30 days (cli.md, `apps delete`), so retiring and destroying stay distinct (app spec 16.1). |
| +A binary instance gets its own SQLite database (`--db`), replicated off the box continuously by the platform (`carlos routes`: replication `default` syncs on every change). Backups are that replica's history; an owner can read a copy at any point the platform keeps (`carlos db pull --at`). What a host failure could lose is in the platform's declaration (app spec 8.1). Base says nothing about this unless asked. Deleting a live app is an owner's act on Equipo's Places page, never the Assistant's, and it says the app moves to the Trash for 30 days (cli.md), so retiring and destroying stay distinct (app spec 16.1). |
| -### C6. Later changes, and when a deploy fails |
| +### C6. When a deploy fails |
| -Every later change to a live app's code goes the same way: checks by `main`'s trusted steps, Review, an app preview with the upgrade check (B1), then "Put it live?" (C1). The app handles its own migrations (app spec 14.1). Review's instructions for an app with a place add: "a schema change must leave data the previous release can still read (app spec 14.3)". |
| - |
| -What a failed deploy means depends on where it stopped, so the step reports one of these, after reconciling: |
| - |
| -| where it stopped | what is known about what serves | job (D1) | next step offered | fence | |
| +| where it stopped | what is known | job (D1) | next step offered | fence | |
| |---|---|---|---|---| |
| -| refused before ship (a check, the artifact, `authorizeAppDeploy`) | unchanged | Didn't go live | Try again | released | |
| +| 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 | |
| -| shipped or promoted, proof not seen | unknown | Not confirmed | reconciling every 10 minutes for 24 hours (reads only); Try again sends the same version again as the same step's next attempt | held | |
| -| proof seen | the new build, on at least one instance | Done | none | released | |
| -| superseded (C3) | whatever is newer | Done, if its change is in what is live; else a new card asks | per the new card | not taken | |
| +| sent, proof not seen | unknown | Not confirmed | reconciling (reads only); Try again sends the same version again as the step's next attempt | 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 | |
| -Once P-B lands, the "not confirmed" row splits by each instance's serving build into "live", "partly live" (cli.md: a box whose build fails keeps its other instances on the build they were serving) and "nothing changed", and only then can the pill say "The version before is still running." (D1). |
| +Once P-B lands, "not confirmed" can split into "live", "partly live" and "nothing changed", and only then may the pill say "The version before is still running." |
| ### 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 (P-E if the deploy role can't), audited and gated by `go_live`. It takes the deploy fence like a deploy, moves `generation` (so every deploy queued from an earlier tap is refused and re-asked, C3) and sets `deployed_sha` back once confirmed. It never touches data. Base offers no rollback button 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 (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). |
| ### C8. The `go_live` and `build` gates, and the last checks |
| -Following abilities spec §6.3 and §6.4, with the same boundary: a switch is checked where each action is decided, and an action already past its last check finishes. |
| +Following abilities spec §6.3 and §6.4: a switch is checked where each action is decided, and an action past its last check finishes. |
| -- `build` covers every step of the job, as abilities §6.3 says, so starter checks, app previews and the upgrade check included: `Store.Authorize` refuses a preview step's start when the person lacks `build`. A preview already running when `build` goes off keeps running until it ends by its own rules (B2); no new one starts, and Try again is refused. |
| -- `go_live` covers "Put it live" (the merge and the deploy as one decision), the second card for a changed merged result, every deploy step, Try again on a failed deploy, and rollback. |
| -- `authorizeAppDeploy` is the last check, 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 still 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 (no step holds the fence, the generation is the one the tap saw, ancestry against `head_sha`); for every later command and every later attempt of the step, C3 rule 2 (the fence is this step's and the generation is the one it allocated); the creator holding `go_live`. It runs at the step's start and again, each in the transaction that decides, before every command that changes CARLOS: `apps create`, `apps region --set`, `deploy` and the mint, with purposes `setup`, `region`, `deploy` and `mint`. The region purpose also checks the place's recorded region is still the snapshot's. Every decision is audited. |
| -- So the switch going off after the tap but before a check refuses everything after that check. A command already sent finishes: an app already created stays (recorded, adopted by a later Try again), and a promote already sent can't be called back. Turning the switch off doesn't take an app down; that stays an owner's act. |
| -- When the merge went in and the deploy is refused for `go_live`, the job reads "Didn't go live" with the approved-pending abilities line "Putting it live is turned off for you. {Owner} can turn it on." and keeps Drop it. Turning `go_live` back on doesn't deploy by itself: the person taps Try again. |
| +- `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. |
| +- 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. |
| ## 7. What Base shows |
| ### D1. On the pill, in the job view and in the reply |
| -A merged app task isn't finished until its deploy settles. `jobState` gains an app lifecycle for a task of a project with an app place, read before its "ended means done" rule, so a merged app never reads as done early (the recipes job's "finished"): |
| +`jobState` gains an app lifecycle for a task of a project with an app place, read before its "ended means done" rule, so a merged app never reads as done early (the recipes job's "finished"): |
| -- from the tap until the deploy step reports, the job is working, status "Going live", and its preview stays up (`previewHeld` holds it while a deploy for its candidate is pending); |
| -- when the merged tree differs from the candidate, or the candidate changed the build contract (C1), the job is working, status "Testing it again", while the merged commit's Checks, Review and boot check run. If they pass, it goes on as C1 says. If they fail, can't run after the usual retries, or Review asks for changes, the job is stopped, "Didn't go live", with Fix it and Drop it, and its preview is released; |
| -- when the deploy settles, the job takes C6's row; only "live" or a superseded deploy whose change is live makes it done; |
| -- for a member who isn't an owner (C1), the job is ready with the owner line, and done is never reached through them. |
| +- from the tap until the deploy step reports, working, "Going live"; the preview stays up until the deploy settles (`previewHeld`), then is deleted (B3); |
| +- when the merged tree differs from the candidate, or the candidate changed the build contract, working, "Testing it again", while the merged commit's Checks and Review run; if they pass, as C1 says; if they fail, can't run after the usual retries, or Review asks for changes, stopped, "Didn't go live", with Fix it and Drop it; |
| +- when the deploy settles, C6's row; only "live", or a superseded deploy whose change is live, makes it done; |
| +- for a member who isn't an owner, ready with the owner line. |
| | moment | pill status | detail line | link | actions | |
| |---|---|---|---|---| |
| | first look up, app still building | Building it (jobs spec) | Building the full version from your first look. | See the first look | Drop it | |
| -| app preview building | Making it ready to try | Getting your app ready to try. | See the first look | Drop it | |
| -| waiting its turn for a preview | Ready soon | Waiting to start your app so you can try it. | | Drop it | |
| -| app preview up | Ready to try (approved) | the tested line (D2) | Try your app | Put it live, Not now, Drop it | |
| -| app preview ended | Ready to try | Your app's trial has ended. Try again for a fresh one. | | Try again, Put it live, Drop it | |
| +| preview being made | Making it ready to try | Getting your app ready to try. | See the first look | Drop it | |
| +| preview waiting its turn | Ready soon | Waiting for room to set up your app so you can try it. | | Drop it | |
| +| 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 | |
| | putting it live | Going live | Putting your app live. | Try your app, while up | none | |
| -| tested again after going in | Testing it again | Testing it once more, together with the latest version, before it goes live. (when another change landed) or Testing it once more, built the new way, before it goes live. (when it changed how the app is built) | Try your app, while up | Drop it | |
| +| 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 | |
| | a newer change went live first | Done | A newer version of your app is live. | Open your app | Dismiss | |
| | refused before anything changed | Didn't go live (jobs spec) | Your app didn't go live. Nothing about it changed. | | Try again, Drop it | |
| -| not confirmed | Not confirmed | Your app was sent, but it could not be confirmed. | | Try again (the same step's next attempt, holding the fence, under `go_live`); while `go_live` is off, none in Base: the line adds the abilities sentence, and the job counts as being retried (jobs spec T1) because reconciling goes on. After 24 hours: Open in Equipo, where an owner can send it again or release it (C3) | |
| -| tested again and failed | Didn't go live | It isn't live: together with the latest version, its tests failed. (tests failed) / It isn't live: it couldn't be tested again just now. (couldn't run after retries) / It isn't live: it needs changes before it can go live. (changes asked for) | | Fix it, Drop it | |
| +| not confirmed | Not confirmed | Your app was sent, but it could not be confirmed. | | Try again (under `go_live`); with `go_live` off, none in Base, the abilities line added, and it counts as being retried (jobs spec T1) while reconciling goes on; after 24 hours, Open in Equipo | |
| +| tested again and failed | Didn't go live | It isn't live: together with the latest version, its tests failed. / It isn't live: it couldn't be tested again just now. / It isn't live: it needs changes before it can go live. | | Fix it, Drop it | |
| | `go_live` off after the merge | Didn't go live | Putting it live is turned off for you. {Owner} can turn it on. (abilities register) | | Drop it | |
| -Each action names its path: Put it live is C1's tap; Try again on a preview is `retryPreview` (B2); Try again on a deploy refused before anything changed is a new deploy step through `authorizeAppDeploy` (C3 rule 1); Try again on "not confirmed" is the same step's next attempt, which holds the fence and reconciles before it sends (rules 2 and 3); Fix it, for work that went in but failed its checks afterwards (C1), is a new path `fixAfterMerge`: the person's tap records a fix task in the same job and project, its brief the failing checks' or Review's findings (as `fixRound` builds feedback), followed by the job's hand-off; the failed merged result's preview is released. Its own Put it live then follows the usual path, and ancestry (C3 rule 1) holds because the fix starts from `main`. This keeps jobs spec T1 (no dead ends): every asking or stopped row offers an action that succeeds in that state. Once P-B lands, "Partly live" ("Your app is live in some places but not others.") and "The version before is still running." join the table (C6). |
| +Paths: Put it live is C1's tap; Try again on a preview is `retryPreview` (B3); Try again on a deploy refused before anything changed is a new deploy step (C3 rule 1); Try again on "not confirmed" is the same step's next attempt (rules 2 and 3); Fix it is a new `fixAfterMerge`: the person's tap records a fix task in the same job and project from the failing findings (as `fixRound` builds feedback), followed by the job's hand-off. Every asking or stopped row offers an action that succeeds in that state (jobs spec T1). |
| The Assistant's reply after it goes live uses the approved "It is live at %s". `jobNote` lines name the address when there is one and never say how. |
| ### D2. Honest status: what was tested, and what wasn't |
| -The go-ahead card and the ready pill carry one line saying what was checked. It is read from the Checks result and the preview of the candidate the card asks about, never from an older candidate's, in instance copy, and it never names a tool or a step: |
| +The go-ahead card and the ready pill carry one line, read from the Checks result and the preview of the candidate the card asks about, never an older candidate's, in instance copy: |
| | what holds | line (DRAFT) | |
| |---|---| |
| -| checks passed, app started, preview up | Tested: it builds, its tests pass and it starts. You can try it before it goes live. | |
| -| as above, a change to a live app, upgrade check passed with a seed and `reads` | Tested: its tests pass, it starts, and it still shows your existing records (checked with sample data). You can try it before it goes live. | |
| -| as above, a change to a live app, no seed or `reads` | Tested: its tests pass and it starts, but whether it keeps your existing data wasn't checked. | |
| -| checks passed, preview up, but the proxy has seen a `<script>` in one of its pages | Tested: its tests pass and it starts. In the trial, parts that need scripts don't run. | |
| -| checks passed, no preview possible (`other` kind) | Its tests pass, but you can't try it before it goes live here. | |
| -| no confinement on the person's machine (a Mac, or no user scope) | Its tests pass, but it can't be tried or put live from this computer yet. | |
| +| checks passed, preview up | Tested: it builds, its tests pass and it starts. You can try it before it goes live. | |
| +| as above, a change to an app that is already live | Tested: its tests pass and it starts. You can try it, but with none of your existing data. | |
| +| checks passed, no previews place confirmed, or the public-preview setting off | Its tests pass, but you can't try it before it goes live yet. | |
| +| checks passed, `other` kind | Its tests pass, but you can't try it before it goes live here. | |
| | the candidate changes how the app is built (A1) | It changes how the app is built, so it will be tested again before it goes live. | |
| | no checks at all (`none`) | It hasn't been tested: there are no tests for it yet. | |
| | checks failed and fix rounds used | Its tests still fail, so it can't go live as it is. | |
| | checks need the network (`needs_network`) | Its tests couldn't run here because they need the internet. | |
| | 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 couldn't run (`checks_unavailable`, `base_gate_unavailable`) or the scan couldn't run (`preview_scanner`) | It couldn't be tested just now. We'll try again shortly. | |
| -| the preview failed to start | It passed its tests but didn't start, so you can't try it yet. | |
| -| the preview ended (expired or idle) | (D1 "app preview ended" line) | |
| -| waiting for a free slot | (D1 "waiting its turn" line) | |
| +| 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 approved merge wording ("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 in its place on the card, before the question "Your app is ready. Put it live?". |
| +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?". |
| ### D3. Base changes |
| -- `internal/equipo`: `CleanAt` already keeps job links with an empty rel and `first_look` links (jobs plan Task 1.15). No new field is needed: the address is the job's link and the line is the card's detail. |
| -- Templates and `ask.js`: "Open your app" on a done pill is the existing `.Go` drawing. |
| -- Native app: draws from the same fields. |
| -- The Assistant's `base_apps` lists apps installed on Base, not apps Equipo built. The Assistant's operation notes say to read the job, not `base_apps`, for "where is my app" (model-facing, not copy). Showing built apps on Base's Home is a separate question (Q10). |
| +- `internal/equipo`: `CleanAt` already keeps job links with an empty rel and `first_look` links (jobs plan Task 1.15). No new field: the address and the preview are job links, the line is the card's detail. |
| +- Templates, `ask.js` and the native app draw the existing `.Go` link and detail. |
| +- The Assistant's `base_apps` lists apps installed on Base, not apps Equipo built; its operation notes say to read the job for "where is my app" (model-facing). Built apps on Base's Home are a separate question (Q10). |
| + |
| +## 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`: |
| -## 8. Platform requests (CARLOS; nothing filed) |
| +- **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. |
| -Places spec P2 to P7 stand. They cover first deploys without a person, consent credentials, a temporary-only scope, the devbox domain, JSON listings, and reading domains with a deploy credential. In addition: |
| +Not filed, and why: |
| -- **P-A. Temporary binary apps.** `carlos deploy --temporary --kind binary --ttl <1h..30d>`: a `tmp-` app with one instance, a database that is never replicated beyond the app's life and is purged with it, the smallest size by default, its own cap separate from the 20 static temporary apps, `carlos gate` allowed on it, and edge-set response headers like the static `_headers` (so B1's proxy rules hold there too). Today `--kind binary` is refused with `--temporary` (cli.md). |
| -- **P-B. Per-instance serving builds, readable by a deploy credential, as JSON.** `carlos instances list` already shows each instance's installed and serving build. Let an app-scoped `deploy` credential read that for its own app, and give `deploy` a JSON result with the address, version, each box's rollout result and whether the build probe confirmed the new process (extends P6). Until then Equipo can say only "live", "nothing changed" or "not confirmed" (C6). |
| -- **P-C. Deploy credentials and canaries.** Let a `deploy` credential for one app promote to, list and remove that app's `canary/<name>` channels and their instances, and nothing more. |
| -- **P-D. A canary's data.** State, and enforce, that a canary instance starts with an empty database of its own and can never be pointed at the live instance's; allow a lease shorter than seven days. |
| -- **P-E. Rollback with a deploy credential.** Confirm that `carlos rollback --app <app> edge` works with an app-scoped `deploy` credential on its own rungs, or allow it. |
| -- **P-F. A scoped verification of a release.** `carlos vet` today reads a deployment store directly (`CARLOS_DEPLOYMENT_BUCKET` or `CARLOS_DEPLOYMENT_DIR`), takes no console or account, and `--boot` runs the binary with the caller's environment and access (`carlos/platform/internal/vet/vet.go`). Ask for a console API that verifies one app's shipped release (manifest and artifact digests) for a `deploy` credential, and runs the boot check on CARLOS's own boxes in the tenant sandbox, on the release's real architecture. Until then the runner never calls `vet`; its native-twin boot check (C3) and the build probe stand in. |
| -- **P-G. Document the build probe's match rule.** The code matches a whole whitespace-separated token (`carlos/platform/deploy.go`); cli.md doesn't say so. A3 relies on it, so it should be the documented contract. |
| +- **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. |
| ## 9. The stale go-ahead (shipped separately) |
| -Equipo branch `stale-goahead-card`, from `origin/main` 57f370c5. A go-ahead whose work has landed now closes itself. `landed(task)` is true once the task is done and isn't an exploration built as another task. Once it holds, the outcome card reads "This no longer needs an answer." with the result "Finished." (both already approved), whether the person's tap, Equipo's own merge or a hand merge on the hub put it in. `touchOutcomes` refills ended cards, so an answered go-ahead closes when the merge is confirmed. No go-ahead is raised for work that has already landed. The minute's housekeeping tick repairs cards an older Equipo left asking, Paul's included. Equipo's release inventory accepts no new copy without a review status, so the branch ships with approved words only; "This went ahead." is proposed for copy review as the better closed line. |
| +Equipo branch `stale-goahead-card` (tip 25cd15d8, hub CI green). A go-ahead whose work has landed closes itself: the outcome card reads "This no longer needs an answer." with the result "Finished." (both approved), however the work went in; no go-ahead is raised for work already in; the housekeeping tick repairs cards an older Equipo left asking. "This went ahead." is proposed for copy review as the better closed line. |
| ## 10. Phases |
| -1. **Starter checks (S).** `create_project` `kind`, the three templates, hosted CI on at creation, A4 for existing repositories. Equipo runner and instance, one protocol bump. |
| -2. **Honest status (S).** D2's lines from Checks and preview outcomes, in instance copy, on the go-ahead and the ready pill. Equipo only. |
| -3. **App go-live (M to L).** The B3 confinement (the boot check and upgrade check need it), the `app` place kind, the `app_place` merge criterion, C1 to C8, `authorizeAppDeploy`, the deploy fence, D1's app lifecycle, the address on the job. Equipo instance and runner, Linux runners only. Paul's login on docs-t1 for first deploys (places ruling 2). Finish line: `recipes` (after A4) goes live at its address from one tap in Base. |
| -4. **App previews on the runner (M).** The rest of B1 and B2 on top of phase 3's confinement: the proxy, devbox links per attempt, lifetime and the ended report. |
| -5. **App previews on CARLOS (S, after P-A, P4, P-C, P-D).** B4. |
| +1. **Starter checks (S).** `create_project` `kind`, the three templates, hosted CI on at creation, A4. |
| +2. **Honest status (S).** D2's lines on the go-ahead and the ready pill. |
| +3. **App go-live (M).** The `app` place kind, the `app_place` criterion, C1 to C8, the deploy fence, D1's lifecycle, the address on the job. Paul's login on docs-t1 for first deploys (places ruling 2). Finish line: `recipes` (after A4) goes live at its address from one tap in Base. |
| +4. **App previews (S to M).** The `app_preview` place kind and its dedicated account, B1 to B3: create, deploy, the delete timer and the sweep. It reuses phase 3's templates, command environment and recovery. |
| -Phases 1 and 2 each take about a day and fix "could not be fully tested". Phase 3 gives the address. Phase 4 lets the person try the app first. Phase 3 doesn't wait for phase 4: until a preview exists, the honest line says the app can't be tried before it goes live. |
| +Phases 1 and 2 fix "could not be fully tested". Phase 3 gives the address. Phase 4 lets the person try the app first; until it ships, the honest line says the app can't be tried before it goes live. |
| ## 11. Tests |
| Equipo: |
| -- `TestStartDefaultTemplates`: each kind's first commit is deterministic and holds exactly its files; `other` is today's empty tree; a retry recognises its own `main`; someone else's `main` is left alone (the `start_default_test.go` cases, per template). |
| -- `TestStarterGoChecks` (runner, real Go): a minimal app that follows A3 passes `10-go` and `20-starts`; missing `go.mod`, no tests, a vet error, a failing test, an arm64 build failure, no `/healthz`, a wrong `/version`, a crash on start, and replacing or truncating its database file across a restart each fail with a plain reason (deleting records inside the file is the app's own tests' to catch, A1); the steps never reach the network. |
| +- `TestStartDefaultTemplates`: each kind's first commit is deterministic and holds exactly its files; `other` is today's empty tree; a retry recognises its own `main`; someone else's `main` is left alone. |
| +- `TestStarterGoChecks` (real Go): a minimal app that follows A3 passes `10-go` and `20-starts`; missing `go.mod`, no tests, a vet error, a failing test, an arm64 build failure, no `/healthz`, a wrong `/version`, a crash on start, and replacing or truncating the database file across a restart each fail with a plain reason; the steps never reach the network. |
| - `TestStarterSiteChecks`: a broken local link, a missing title and an `http:` script each fail; a clean folder passes. |
| -- `TestTrustedStarterChecks`: on a `go_app` repository, a candidate that deletes `10-go` or changes `release/app.json`'s package is judged by `main`'s steps; `BaseChecksSHA` is set; `trusted_base_checks` holds. `TestHubAndChecksDiverge`: the same candidate is green on a hub fake running its own files and red in Equipo, and D2 reads Equipo's verdict. |
| +- `TestTrustedStarterChecks`: on a `go_app` repository, a candidate that deletes `10-go` or changes `release/app.json` is judged by `main`'s steps; `trusted_base_checks` holds. `TestHubAndChecksDiverge`: green on a hub fake running the candidate's files, red in Equipo; D2 reads Equipo's verdict. |
| - `TestHostedCIOnAtCreate`: one fixed call after `Forge.Create`, none for an adopted repository. |
| -- `TestAppPreviewConfinement` (Linux): the process sees no credential file, no network but loopback, only its four mounts and three variables; writing past 1 GiB in `/data`, a fork bomb past 64 tasks and an allocation past 512 MiB are each stopped; the seed runs inside the same limits; a runner that can't create the scope, a tainted runner and a Mac runner run none. |
| -- `TestAppPreviewProxy` (headless browser against a hostile fixture app): every response carries the headers; inline and same-origin scripts don't run, so a `window.location` navigation with data in the address never happens; a service worker can't register; links, forms, `srcset`, CSS `url()` and a meta refresh to another origin all land on `/_leaving`, which links nowhere; a cross-origin redirect, an HTTP `Refresh: 0; url=<another origin>?<posted values>` answered to a same-origin form post, a `Link` preload, an SVG or XML document with an outbound link returned to a form post (downloaded, never rendered), a `Set-Cookie` with `Domain` and an oversized body are stopped; same-origin forms work; a second attempt's origin sees none of the first's cookies or storage; no proxy, no preview. |
| -- `TestAppPreviewScan`: a secret in the tree or the seed refuses the preview; a scanner that can't run fails it as `preview_scanner`. |
| -- `TestAppPreviewLifetime`: stopped at 24 h, after 2 h idle, at job end and when a newer candidate's preview starts, each followed by the `ended` report that takes the link off the card and lets `previewRetryCheck` allow Try again; data deleted each time; the fourth waits; Try again starts the next attempt once per tap and is refused after a newer candidate; a crash leaves nothing running after the runner restarts. |
| -- `TestAppUpgradeCheck`: run against `deployed_sha`, not `main`, when merged work never went live; a candidate whose `reads` page loads but no longer shows the seed's `expect` text fails; one that adds a table passes; without a seed or `reads`, D2 shows the narrower line; it runs in the deploy's checks with no interactive preview. |
| -- `TestAppBuildContract`: a candidate that changes `release/app.json` gets no preview and a Put it live with the contract line; the person's tap merges it through `answerMerge`; the merged commit is checked under the new contract and, passing, deploys on the same tap without a second card; failing, the job stops with Fix it; checks, preview and deploy build the same package throughout. |
| -- `TestAppRecoveryByPhase`: a restart in each C3 phase recovers as its row says; an app found after a lost `apps create` answer is adopted only with no releases and no instances; a restart after the region command sets it again; reconciling never runs for a setup phase. |
| -- `TestAppNotConfirmedAfterADay`: with the clock past 24 hours, reconciling has stopped, the job offers Open in Equipo, and both owner actions there succeed; the release keeps `head_sha`, so a commit between the last confirmed one and the unconfirmed one is refused. |
| -- `TestAppPackageMove`: a candidate that adds `cmd/app`, points `release/app.json` at it and keeps `.` building passes and, merged, is tested again built the new way; one that also deletes `.` fails the old contract and goes to a fix round. |
| -- `TestFixAfterMerge`: Fix it records one fix task in the same job from the failing findings, idempotent per tap; its own Put it live passes ancestry. |
| -- `TestAppArtifacts`: the shipped artifact is a static ELF for the place's target and is never executed on the runner; the native twin from the same commit and flags passes the boot check; a twin that fails stops the deploy before anything is sent. |
| -- `TestAppVersionToken`: `/version`, the release `--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. |
| +- `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. |
| - `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`; the person's tap merges. |
| -- `TestPutItLiveOneTap`: one tap merges and deploys when the trees match; with another change landed in between, the merged commit gets Checks and Review, then a second card. |
| -- `TestAppDeployFence`: two merged changes whose deploys run in reverse order leave the newer live and settle the older as superseded; a delayed second card for an older commit, answered after a newer one went live, is refused by ancestry; a newer deploy that is "not confirmed" keeps the fence and an older one is refused; a rollback moves the generation and a deploy tapped before it is refused and re-asked; a first deploy's own start doesn't fail its region, deploy and mint checks; Try again on "not confirmed" inherits the fence; a duplicate tap starts one deploy; a restart while a command's outcome is unknown only reconciles; reconciling runs with `go_live` off and sends nothing; an owner's release after 24 hours is audited. |
| -- `TestAppFirstDeploy` (fake carlos, its argument parsing taken from the real CLI's flag sets): `apps create --build-probe`, `apps region --set`, `deploy`, `services create`, in order, each behind its own final check; `go_live` off between create and region refuses the region; `CARLOS_CONFIG` names the runner's config and a hostile repository `.carlos/config` changes nothing; a region or target mismatch is refused; the secret only goes to the 0600 file; a taken name gets a suffix, at most three tries; a restart after `apps create` adopts the app. |
| -- `TestAppRedeploy` (fake carlos): `deploy` with the deploy credential in the environment, never argv; `vet` is never called; each C6 row from its fake outcome, including an unconfirmed probe, and a restart mid-step that only reconciles. |
| -- `TestAppDeployAbilityOff`: `go_live` off before each of `authorizeAppDeploy`'s checks refuses everything after it; a command already sent finishes; turning it back on deploys nothing until Try again; `build` off stops a new preview and leaves a running one to its end. |
| -- `TestJobGoingLive`: a merged app task reads "Going live" until its deploy settles, "Testing it again" while a changed merged result is tested, keeps its preview up meanwhile, and is done only once confirmed; every D1 row's actions succeed in that state (extend jobs spec T1); a member's job ends at the owner line; 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, always for the card's own candidate, never an older one's. |
| +- `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. |
| +- `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. |
| -Base: |
| +Base: `internal/browsertest`: a done job draws "Open your app" on the pill and in the job view, opens in a new tab and survives a reload; a ready job draws "Try your app"; light and dark screenshots. |
| -- `internal/browsertest`: a done job with an app address draws "Open your app" on the pill and in the job view, opens in a new tab and survives a reload; a going-live job draws "Try your app"; light and dark screenshots. No other Base code changes. |
| - |
| -Staging (after phase 3): from Base, "Can you create a simple app for sharing recipes?" ends with one "Put it live" tap and an address whose `/version` names the merged commit, recorded in `docs/live-check.md`. |
| +Staging (after phase 4): from Base, "Can you create a simple app for sharing recipes?" shows "Try your app" on a preview, then one "Put it live" tap gives an address whose `/version` names the merged commit, and the preview app is gone from the previews account within a minute; recorded in `docs/live-check.md`. |
| ## 12. Open questions, with recommendations |
| -- **Q1. One tap for an app to go live (merge and deploy), or two?** Recommended: one tap, "Put it live", when the merged result is exactly what was approved; a second card, after checks and review of the merged result, only when something else landed in between. Two taps for one decision is what left Paul with no address. |
| -- **Q2. Where app previews run until CARLOS can host temporary apps.** Recommended: on the person's own Linux machine, in the B3 confinement behind the B1 proxy, as a private link on their network, matching the ruling for temporary sites. No public app previews until P-A and P4; none on Mac runners in v1. |
| -- **Q3. How long an app preview lives.** Recommended: 24 hours, stopped after 2 idle hours, Try again for a fresh one. It runs on the person's machine, so shorter than a static preview's 7 days. |
| -- **Q4. Which account a person's app goes in, and who may put it live.** Recommended: the places default (Carloku `paulca` for Paul's projects, `oficina` for oficina's), confirmed once by an owner. Only an owner who created the task puts it live, as for merging and publishing today; a member's app job ends at Ready to try with the line "Only an owner of this Base can put apps live for now." Per-member accounts and a "put it live for them" action are later designs (abilities spec Q4). |
| -- **Q5. A repository whose kind is neither a Go app nor a site.** Recommended: no starter checks, and the honest line "It hasn't been tested: there are no tests for it yet." Add kinds when one comes up. |
| -- **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). For `recipes`, Equipo opens that task when phase 1 ships, so phase 3's finish line has trusted checks. |
| -- **Q7. Rollback from Base.** Recommended: not in v1. An owner can roll back from Equipo's task page. Revisit once apps with real data are live. |
| -- **Q8. Custom domains.** Recommended: later, with the domain-buying flow. v1 gives every app its platform address. |
| -- **Q9. Hosted CI cost.** Recommended: on at creation at the smallest size. An owner can turn it off per repository; Equipo's Checks step still runs. |
| -- **Q10. Apps Equipo built on Base's Home.** Recommended: yes, as a separate small design, read from Equipo's jobs and places (Base stores nothing). Until then the job's link is the way back to the app. |
| -- **Q11. Data in previews.** Recommended: always an empty database plus the reviewed seed file, if there is one. Never a copy of live data, even for a change to a live app. |
| -- **Q12. Only Go apps in v1?** Recommended: yes. The app spec wants one compiled binary (12.1), and the family builds in Go. Other languages get the honest line until a template exists. |
| -- **Q13. Scripts off in app previews.** Recommended: yes, until previews run on CARLOS behind edge-set protections (P-A). With scripts on, a page could send what the person types to another site by moving the tab there, and no header can stop that. The family's pages work without scripts anyway (app spec 12.5); the honest line says when a trial is missing script-driven parts. |
| -- **Q14. Apps from a Mac runner.** Recommended: not in v1. The boot check and previews need Linux confinement; a person whose only runner is a Mac sees "it can't be tried or put live from this computer yet". A Mac profile for long-running servers is its own design. |
| +- **Q1. Which account a live app goes in.** Recommended: the places default (Carloku `paulca` for Paul's projects, `oficina` for oficina's), confirmed once by an owner. |
| +- **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. |
| +- **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. |
| +- **Q9. Hosted CI cost.** Recommended: on at creation at the smallest size; an owner can turn it off. |
| +- **Q10. Apps Equipo built on Base's Home.** Recommended: yes, as a separate small design read from Equipo's jobs and places. |
| +- **Q11. Data in previews.** Recommended: always empty; never a copy of live data. Sample data from the repository can come later. |
| +- **Q12. Only Go apps in v1.** Recommended: yes (app spec 12.1). Other languages get the honest line until a template exists. |
| +- **Q13. Kinds other than a Go app or a site.** Recommended: no starter checks and the honest "It hasn't been tested: there are no tests for it yet." |
| ## Copy register (all DRAFT, for copy review) |
| @@ -392,7 +367,7 @@ Equipo instance copy, shown in Base: |
| | `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 | |
| -| `assistant.job.detail.app_waiting` | Waiting to start your app so you can try it. | |
| +| `assistant.job.detail.app_waiting` | Waiting for room to set up your app so you can try it. | |
| | `assistant.job.detail.app_trial_ended` | Your app's trial has ended. Try again for a fresh one. | |
| | `assistant.job.status.going_live` | Going live | |
| | `assistant.job.detail.going_live` | Putting your app live. | |
| @@ -402,95 +377,52 @@ Equipo instance copy, shown in Base: |
| | `assistant.job.status.app_testing_again` | Testing it again | |
| | `assistant.job.detail.app_testing_again` | Testing it once more, together with the latest version, before it goes live. | |
| | `assistant.job.detail.app_testing_again_built` | Testing it once more, built the new way, before it goes live. | |
| -| `assistant.job.detail.app_not_live_kept` | Your app didn't go live. The version before is still running. (after P-B) | |
| -| `assistant.job.status.app_partly` | Partly live (after P-B) | |
| -| `assistant.job.detail.app_partly` | Your app is live in some places but not others. (after P-B) | |
| | `assistant.job.status.app_unconfirmed` | Not confirmed | |
| | `assistant.job.detail.app_unconfirmed` | Your app was sent, but it could not be confirmed. | |
| -| `assistant.job.app_preview` | Try your app | |
| -| `assistant.job.app_open` | Open your app | |
| -| `assistant.tested.all` | Tested: it builds, its tests pass and it starts. You can try it before it goes live. | |
| -| `assistant.tested.upgrade` | Tested: its tests pass, it starts, and it still shows your existing records (checked with sample data). You can try it before it goes live. | |
| -| `assistant.tested.upgrade_unchecked` | Tested: its tests pass and it starts, but whether it keeps your existing data wasn't checked. | |
| | `assistant.job.detail.app_failed_after` | It isn't live: together with the latest version, its tests failed. | |
| | `assistant.job.detail.app_untested_after` | It isn't live: it couldn't be tested again just now. | |
| | `assistant.job.detail.app_changes_after` | It isn't live: it needs changes before it can go live. | |
| | `assistant.job.option.fix` | Fix it | |
| +| `assistant.job.app_preview` | Try your app | |
| +| `assistant.job.app_open` | Open your app | |
| +| `assistant.tested.all` | Tested: it builds, its tests pass and it starts. You can try it before it goes live. | |
| +| `assistant.tested.live_change` | Tested: its tests pass and it starts. You can try it, but with none of your existing data. | |
| +| `assistant.tested.no_preview_yet` | Its tests pass, but you can't try it before it goes live yet. | |
| | `assistant.tested.no_preview` | Its tests pass, but you can't try it before it goes live here. | |
| -| `assistant.tested.scripts_off` | Tested: its tests pass and it starts. In the trial, parts that need scripts don't run. | |
| -| `assistant.tested.no_confinement` | Its tests pass, but it can't be tried or put live from this computer yet. | |
| | `assistant.tested.contract_changed` | It changes how the app is built, so it will be tested again before it goes live. | |
| -| `preview.leaving` (the preview's `/_leaving` page) | This link goes outside the trial, to: {address}. Links outside are switched off while you try your app. | |
| | `assistant.tested.none` | It hasn't been tested: there are no tests for it yet. | |
| | `assistant.tested.failing` | Its tests still fail, so it can't go live as it is. | |
| | `assistant.tested.needs_network` | Its tests couldn't run here because they need the internet. | |
| | `assistant.tested.needs_macos` | Its tests need a Mac, and none was free to run them. | |
| | `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, so you can't try it yet. | |
| -| `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." until this is reviewed) | |
| +| `assistant.tested.no_start` | It passed its tests but didn't start when we tried it, so you can't try it yet. | |
| +| `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.") | |
| -Reused, already approved: "Ready to try", "Done", "Finished.", "It is live at %s", "Not now". Reused from the jobs spec's DRAFT register: "Building it", "Building the full version from your first look.", "See the first look", "Didn't go live", "Try again", "Drop it". From the abilities register: "Putting it live is turned off for you. {Owner} can turn it on." |
| +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." |
| -Equipo-only copy (Places page; reviewed with Equipo's copy): "Apps go to {console}, account {account}, in {region}.", "{Project}: {app}, live at {address}.", "Its data is kept in {region} and backed up as it changes." |
| +Reused, already approved: "Ready to try", "Done", "Finished.", "It is live at %s", "Not now". From the jobs spec's DRAFT register: "Building it", "Building the full version from your first look.", "See the first look", "Didn't go live", "Try again", "Drop it", "Dismiss". From the abilities register: "Putting it live is turned off for you. {Owner} can turn it on." |
| -Model-facing (not copy, reviewed as code): the app contract note (A3), Review's migration line (C6), and the Assistant's "read the job, not base_apps" note (D3). |
| +Equipo-only copy (Places page): "Apps go to {console}, account {account}, in {region}.", "Previews go to {console}, account {account}.", "{Project}: {app}, live at {address}.", "Its data is kept in {region} and backed up as it changes." |
| + |
| +Model-facing (reviewed as code): the app contract note (A3), Review's migration line (B4), the Assistant's "read the job" note (D3). |
| ## Review |
| -**Astra, round 1 (2026-11-28): not ready, 8 P1, 6 P2, 1 P3.** All addressed in revision 2: |
| - |
| -1. P1, browser exfiltration from a preview: the proxy with the static preview headers, cookie and redirect rules, body caps, and the secret scan of tree and seed; fail closed (B1, B3). |
| -2. P1, confinement not established: its own profile, Linux only, explicit namespaces, mounts, tmpfs quota, `TasksMax`, memory and CPU limits, bounded logs, crash clean-up; seed inside it; no Mac previews in v1 (B1, B2, B3). |
| -3. P1, `vet` can't check an unshipped binary: the runner's own boot check before a first deploy; ship, vet, promote for later ones; P-F rewritten (C3, §8). |
| -4. P1, app places didn't stop automatic merges: a new `app_place` criterion checked in `autoMerge`, `authorizeMerge` and `authorizeMergeLease` (C1). |
| -5. P1, publish authority and binding: creator who is an owner; the card's snapshot; `authorizeAppDeploy` with `publishRefusal`'s rules, checked before each command (C1, C8). |
| -6. P1, stale or out-of-order deploys and a changed merged result: one deploy per app, `deployed_sha` and the descendant rule, reconcile-only restarts; a changed merged tree gets Checks and Review before the second card (C1, C3). |
| -7. P1, "the version before is still running" was not guaranteed: C6's table of where a deploy stopped; the line only when confirmed (C6, D1). |
| -8. P1, first deploy not proven: build probe set at `apps create`, `/version` from `vcs.revision`, the runner's own check of the address; P-G (A3, C3, §8). |
| -9. P2, starter checks too weak: tests must exist, both architectures, `/version`, data kept across a restart; the upgrade check for later changes (A1, B1). |
| -10. P2, hub and Equipo differ: said where and why; a test (A2, §11). |
| -11. P2, ability boundary: abilities §6.3 and §6.4's boundary stated per check; `build` covers every step (C8). |
| -12. P2, job lifecycle: "Going live" until the deploy settles, preview held, switch-off after merge (D1, C8). |
| -13. P2, preview retry and status rows: `retryPreview` named; D2 rows for failing, unavailable, expired and waiting, bound to the card's candidate (B2, D2). |
| -14. P2, region and destination isolation: region on the place and every command; `CARLOS_CONFIG` and the explicit destination; refusal on mismatch (C2, C3). |
| -15. P3, attribution and register: CARLOS's contract separated from this design's choices; Trash from cli.md; every new line in the register. |
| - |
| -**Astra, round 2 (2026-11-28): not ready, 7 P1, 5 P2.** Round 1's fixes held except where listed. Addressed in revision 3: |
| - |
| -1. P1, `vet` reads a deployment store and runs the binary unconfined: the runner never calls it; P-F asks for a scoped, CARLOS-side verification (C3, §8). |
| -2. P1, an arm64 artifact can't boot on an x86 runner, and phase 3 needed phase 4's confinement: a native twin from the same commit and flags is boot-checked; the shipped artifact is checked statically and proven by the build probe; the confinement moves into phase 3; no Mac deploys in v1 (C3, §10, Q14). |
| -3. P1, same-origin scripts could navigate away with data: app previews run with scripts and workers off, the proxy rewrites every outbound address to `/_leaving`, one origin per attempt (B1, B3, Q13). |
| -4. P1, `/version` and the release version disagreed: both are the commit's first 12 hexadecimal characters, matched as a whole token as CARLOS's probe does; tested against the real matcher (A3, C3, §11). |
| -5. P1, the build contract wasn't pinned through preview and deploy: all three read `release/app.json` from `main`; a candidate that changes it is checked again after merge and asked again (A1, B1, C3). |
| -6. P1, `channels` isn't per-instance evidence: C6 says only "live", "nothing changed" or "not confirmed" until P-B, which now asks for per-instance serving builds readable by a deploy credential (C3, C6, §8). |
| -7. P1, `deployed_sha` couldn't fence out stale deploys: a durable generation and pending-attempt fence on the binding, moved at send time and by rollback, released only when the outcome is known (C3, C7, C8). |
| -8. P2, the upgrade check used `main` and only `/healthz`: it uses the live release and the app's listed read pages, and runs in the deploy's own checks (B1). |
| -9. P2, the persistence and test-existence checks were weak: the same database file kept across a restart, stated as exactly that; test functions counted, not package lines (A1). |
| -10. P2, idle expiry and the post-merge recheck had no states: the `ended` report and "Checking it again", with actions per D1 row (B2, D1). |
| -11. P2, the member line named an action nobody has: members get "Only an owner of this Base can put apps live for now." and no Put it live (C1, D1, Q4). |
| -12. P2, the region change had no final check: purpose `region` (C8, §11). |
| - |
| -**Astra, round 3 (2026-11-28): not ready, 5 P1, 4 P2.** Round 2's fixes 1, 2, 4, 6, 11 and 12 held; the rest held in part. Addressed in revision 4: |
| - |
| -1. P1, the HTTP `Refresh` header could navigate away after a form post: the proxy removes it unless same-origin, and removes `Link` headers; a browser test for exactly that (B1, §11). |
| -2. P1, generation equality didn't stop an older commit: ancestry against `head_sha` (what may be serving) is checked when a deploy takes the fence; rollback is the only path backwards (C3 rules 1 and 5). |
| -3. P1, a deploy invalidated its own generation: the tap's `seen_generation` is checked once, at the start; later commands check the generation the step allocated (C3 rules 1 and 2). |
| -4. P1, reconciling wasn't executable: a read-only reconcile (`GET /version`, later P-B) that needs only the fence, not `go_live`; the fence belongs to the step, so Try again is its next attempt; after 24 hours an owner may send again or release, audited (C3, C6, D1). |
| -5. P1, a contract-changing candidate had no merge path: its card still offers Put it live with the contract line; the tap merges, the merged commit is checked under the new contract, and the deploy follows on the same tap (A1, C1). |
| -6. P2, target spelling: CARLOS's `linux-arm64`, with `GOOS` and `GOARCH` derived (C2, C3). |
| -7. P2, failed checks after merge: "Didn't go live" with Fix it (`fixAfterMerge`) and Drop it, preview released (C1, D1). |
| -8. P2, the upgrade line could pass on an empty database: `reads` entries carry expected seed text, and the line is shown only with a seed and reads; otherwise a narrower line (B1, D2). |
| -9. P2, the persistence test promised too much: narrowed to replacing or truncating the file (§11). |
| - |
| -**Astra, round 4 (2026-11-28): not ready, 4 P1, 3 P2.** Round 3's fixes 1, 6, 7, 8 and 9 held; 2 to 5 held in part. The review cap for this spec is four rounds, so the changes below were made after round 4 and **have not been re-reviewed by Astra**: |
| - |
| -1. P1, SVG and other non-HTML documents could carry navigating links: the proxy serves only a short list of types and downloads everything else (B1, §11). |
| -2. P1, C8 still stated the old fence rule: it now names C3 rule 1 for the start and rule 2 for every later command and attempt (C8). |
| -3. P1, releasing an unconfirmed deploy forgot what may be serving: `head_sha` is stored on its own, set when a deploy takes the fence and kept on release, so nothing older can follow it (C3 rules 1 and 4). |
| -4. P1, moving the app's package had no merge path: contract changes are staged, with the old package still building until a later change removes it (A1, §11). |
| -5. P2, setup crashes were treated as rollouts: recovery by recorded phase, including a lost `apps create` answer (C3, §11). |
| -6. P2, after 24 hours "not confirmed" was a dead end: it gains Open in Equipo, where an owner can send again or release (C3, D1, §11). |
| -7. P2, the post-merge lines named machinery or misstated the cause: "Testing it again" and one line per cause, without "went in" or "checks" (D1, register). |
| - |
| -**Still open after round 4** (for the implementation plan's review, or Paul): everything in the list above, until a reviewer confirms it; Q1 to Q14. |
| +**Rounds 1 to 4 (2026-11-28, revisions 1 to 5).** 8, 7, 5 and 4 P1s; the round cap was reached at revision 5. Revision 6 re-checked every P1 against the smaller design: |
| + |
| +| round | P1 | in revision 6 | |
| +|---|---|---| |
| +| 1.1, 2.3, 3.1, 4.1 | preview pages reaching other origins from the browser | gone with runner previews; previews are ordinary public CARLOS apps in a dedicated account, so a preview's pages share no account with the person's live apps; whether they can share cookies depends on the apps domain's place on the Public Suffix List, which Q2 asks to confirm (B1, Q2) | |
| +| 1.2 | runner confinement not established | gone: no code runs on the runner beyond today's Checks | |
| +| 1.3, 2.1 | `vet` | not used (C3) | |
| +| 1.4 | automatic merges for apps | kept: `app_place` (C1) | |
| +| 1.5 | authority and binding | kept: creator who is an owner, snapshot, `authorizeAppDeploy` (C1, C8); previews get `authorizeAppPreview` (C8) | |
| +| 1.6, 2.7, 3.2, 3.3, 4.2, 4.3 | out-of-order deploys and the fence | kept: C3 rules 1 to 5 | |
| +| 1.7, 2.6 | claims about what is serving | kept: three outcomes until P-B (C3, C6) | |
| +| 1.8, 2.4 | proving the first deploy | kept: build probe at `apps create`, the 12-character token (A3, C3) | |
| +| 2.2 | an arm64 build can't boot on an x86 runner | resolved differently: nothing is booted on the runner; `20-starts` in Checks, the preview on CARLOS's real target, and the build probe (B1, C3) | |
| +| 2.5, 3.5, 4.4 | the build contract and its changes | kept: read from `main`, staged changes (A1) | |
| +| 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. |