Spec: apps go live, revision 3 after Astra's second review
Seven P1s: no vet on the runner, a native twin for the boot check and the confinement moved into phase 3, scripts off and outbound addresses rewritten in app previews, one 12-character version token, one build contract read from main, honest deploy outcomes until per-instance evidence exists, and a durable deploy fence. Five P2s applied once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+120
−63
docs/superpowers/specs/2026-11-28-apps-go-live-design.md+120 −63
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:16PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m11:16PM[0m [32mINF[0m [1m1 commits scanned.[0m [90m11:16PM[0m [32mINF[0m [1mscanned ~2914194 bytes (2.91 MB) in 349ms[0m [90m11:16PM[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 10.691s 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 9.607s amadan.net/oficina/base/internal/webtest receipt: slow package 644ms amadan.net/oficina/base/internal/equipo receipt: slow package 611ms amadan.net/oficina/base/internal/operations receipt: slow package 414ms amadan.net/oficina/base/internal/issuer receipt: slow package 230ms amadan.net/oficina/base/internal/consumer receipt: slow test 1.52s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.15s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce receipt: slow test 620ms amadan.net/oficina/base/internal/webtest TestAskUploadStalledBodyFreesItsSlot receipt: slow test 520ms amadan.net/oficina/base/internal/operations TestOperationsRefusals receipt: slow test 510ms amadan.net/oficina/base/internal/equipo TestUploadRefusals === 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 d732058..4ee11fc 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 |
| @@ -37,11 +37,13 @@ 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 exists (`go test -list` is not empty). `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` names the commit under test, stops it, starts it again on the same database, and checks `/healthz` again and that the database file is SQLite. | |
| +| `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. | |
| | `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. Naming `release/app.json` in `gates.json` pins it: a candidate can't move the package the checks and the preview build. |
| +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. |
| + |
| +**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 and no "Put it live" on its own card: once merged, the merged commit is `main`, so its own Checks run under the new contract, and the person is asked again (C1's second card). |
| ### A2. The same checks in both places, and where they differ |
| @@ -54,7 +56,7 @@ The `go_app` template also writes a short `README.md` with the app spec's declar |
| 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): |
| - **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 the commit it was built from, read from the Go build's `vcs.revision` (`runtime/debug.ReadBuildInfo`), which the runner's build sets by building with `-buildvcs=true` from a checkout at exactly that commit (app spec 14.2 asks for a version endpoint, not this one); it builds with `CGO_ENABLED=0` for linux on amd64 and arm64 (7.5), with its pages and assets inside the binary (6.2). |
| +- **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). |
| ### A4. Repositories that already exist without checks |
| @@ -68,14 +70,21 @@ On the person's own primary runner, on Linux only, as a devbox link on their pri |
| A new preview mode, `app`, beside today's static export: |
| -- **Evidence.** Review reports `has_app_preview` when the candidate 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). `schedulePreview` treats it as it treats `release/preview.json`, under the same `authorizePreview`, digest and once-per-candidate rules. |
| +- **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.** 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. On every response it sets the static preview headers (`previewHeaders`) with two changes for an app: `form-action 'self'` and `connect-src 'self'`. It drops any `Set-Cookie` with a `Domain` attribute, refuses a redirect whose `Location` leaves the preview's own origin, and caps request bodies at 1 MiB and responses at 10 MiB. Forms that post back to the app work; nothing on the page can send data to another origin through the browser. If the proxy can't start, the preview fails closed. `carlos devbox share --socket <proxy socket> eq-app-<task>` publishes the proxy, never the app. |
| +- **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, 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. |
| + |
| + 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 same confinement, the runner builds `main`'s app too, starts it on a fresh database with the seed, stops it, starts the candidate on that database (`/healthz` 200), stops it, and starts `main`'s app on it again (`/healthz` 200). That shows the candidate opens the previous release's data and leaves it readable (app spec 14.1, 14.3). It only covers what the seed exercises, so the honest line says "with sample data". A failure is a finding for the fix round, like a failing check. |
| +- **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 path in `release/app.json`'s optional `"reads"` list (at most 20 relative paths, written by Engineering for pages that show stored records) answers 200. That shows the candidate starts on the live release's data, its pages that read records still load, and the live release can still start on the result (app spec 14.1, 14.3). It covers only what the seed and the listed pages exercise, so the honest line says "checked with sample data". 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. Lifetime, retries, limits and cost |
| @@ -84,7 +93,7 @@ A new preview mode, `app`, beside today's static export: |
| |---|---| |
| | 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 link reads as expired. Try again is the existing person's preview retry (`retryPreview`, `previewRetryCheck` in `chat/preview_retry.go`): 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 | |
| +| 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 | |
| @@ -100,7 +109,7 @@ A preview runs code a model wrote, so the confinement is its own profile, not a |
| - **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.** The proxy's headers and rules (B1) stop a page from loading or sending anything to another origin, framing, or redirecting away. The visitor's own local services are out of reach because nothing on the page may connect anywhere but the preview itself. |
| +- **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. |
| @@ -115,7 +124,7 @@ 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`). A member who isn't an owner sees "Ready to try" and the line "{Owner} can put it live." (DRAFT). `go_live` only narrows this; it never lets anyone use an owner's login. |
| +- **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 and Review of its own, and then a second card asks for the merged result. That is a Publish-style card, one per merged commit, as `offerPublish` does for sites. |
| - **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. |
| @@ -133,23 +142,34 @@ The places spec gains a kind beside `site`: **`app`**, a CARLOS binary app on on |
| **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.** Built from the merged commit in the checks sandbox, as in B1, for the place's target, with `-buildvcs=true`. Its SHA-256 is the step's digest. Before anything is sent, the runner starts it in the B3 confinement and checks `/healthz` and `/version` (the same check as `20-starts`). `carlos vet --boot` can't do this beforehand: it checks a release that has already been shipped (cli.md, "carlos vet"), so it runs after ship and before promote (below). |
| +**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). 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). |
| **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: |
| 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 <merge sha, 12 hex> --no-prompt <artifact>`. It creates the first instance, ships, promotes and waits until the build probe names the version. |
| +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. |
| The owner's login is used for these steps only, and only at an owner's tap. |
| -**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 ship` the artifact with `--version <merge sha, 12 hex>`, then `carlos vet --app <app> --version <v> --boot`, then `carlos promote --app <app> <v> edge`, then wait for the build probe (P-B asks for one machine-readable result). A refused vet stops before promote, so nothing the app serves changes. |
| +**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. |
| -**Proof.** A deploy counts as live only when the build probe names the version and the runner's own `GET /version` on the address names the merge SHA. A probe-less deploy never counts. |
| +**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). |
| -**One at a time, never older over newer.** The project binding records `deployed_sha`, the merge SHA last confirmed live. The instance dispatches at most one deploy step per app at a time (a lease on the binding). Before ship and again before promote, `authorizeAppDeploy` refuses a deploy whose merge SHA is not a descendant of `deployed_sha` ("a newer version is already live"). That deploy settles as superseded and the job says it went live with the newer change (D1). So two jobs that merge in order and reach their deploys out of order leave the newer one live. |
| +**One deploy per app at a time, never older over newer.** The project binding holds a durable deploy fence: |
| -**Interrupted.** A step restarted after a phase that may have changed CARLOS only reconciles, as `siteReconcile` does: it reads `carlos channels --app <app>` and the build probe. It never sends again. What it finds decides the outcome (C6). |
| +- `generation`, a counter, moved by every deploy that may have changed what the app serves (set before its ship is sent, not after it is confirmed) and by every rollback; |
| +- `pending`, the step attempt holding the fence while its outcome isn't known; |
| +- `deployed_sha`, the merge SHA last confirmed live, kept for the upgrade check and the address. |
| + |
| +A deploy step takes the fence in the transaction that starts it, recording the generation it saw at the person's tap (on the card's snapshot). `authorizeAppDeploy` refuses it when another attempt holds `pending`, or when the generation moved since the tap ("something newer went live first"): the deploy settles as superseded, and if its change is not already in what is live, a new card asks again. So a merged older change can never replace a newer one, a retry or a late step can't undo a rollback, and two taps can't race. The fence is released only when the outcome is known: confirmed live, refused before ship, or reconciled. "Not confirmed" keeps it held; the next action on the app, whoever takes it, starts by reconciling. |
| + |
| +**Interrupted.** A step restarted after a phase that may have changed CARLOS only reconciles, as `siteReconcile` does. It reads the build probe through `carlos deploy`'s watch for `<v>` (re-promoting nothing) and the runner's own `GET /version`, and, once P-B lands, each instance's serving build. It never ships again. What it finds decides the outcome (C6). |
| ### C4. The address |
| @@ -171,20 +191,19 @@ Every later change to a live app's code goes the same way: checks by `main`'s tr |
| What a failed deploy means depends on where it stopped, so the step reports one of these, after reconciling: |
| -| where it stopped | what is serving | job (D1) | next step offered | |
| -|---|---|---|---| |
| -| before ship, or ship or vet refused | the version before (or nothing, for a first deploy) | Didn't go live | Try again | |
| -| shipped, not promoted | the version before | Didn't go live | Try again | |
| -| promoted, some boxes failed (cli.md: a failing box keeps its other instances on the build they were serving) | a mix | Partly live | Try again (`carlos promote --retry`); owners also get rollback on Equipo's task page (C7) | |
| -| promoted, probe never confirmed | unknown | Not confirmed | Try again, which reconciles first | |
| -| first deploy: app created, deploy failed | nothing yet | Didn't go live | Try again, which adopts the recorded app | |
| -| superseded by a newer change | the newer change | Done, with the newer change's address | none | |
| +| where it stopped | what is known about what serves | job (D1) | next step offered | fence | |
| +|---|---|---|---|---| |
| +| refused before ship (a check, the artifact, `authorizeAppDeploy`) | 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 | Try again, which reconciles first and ships only if the reconcile shows nothing changed | 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 | |
| -"The version before is still running." is said only when `carlos channels` shows `edge` on the earlier version on every box. |
| +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). |
| ### 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, gated by `go_live`, and it sets `deployed_sha` back. 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 (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). |
| ### C8. The `go_live` and `build` gates, and the last checks |
| @@ -192,7 +211,7 @@ Following abilities spec §6.3 and §6.4, with the same boundary: a switch is ch |
| - `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; the merge SHA a descendant of `deployed_sha`; the creator holding `go_live`. It runs at the step's start and again, each in the transaction that decides, before `apps create`, before `deploy` or `ship`, before `promote` and before the mint, with purposes `setup`, `deploy`, `promote` and `mint`. Every decision is audited. |
| +- `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; the deploy fence held by this attempt at the generation the tap saw (C3); 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. |
| @@ -200,21 +219,30 @@ Following abilities spec §6.3 and §6.4, with the same boundary: a switch is ch |
| ### D1. On the pill, in the job view and in the reply |
| -A merged app task isn't finished until its deploy settles. `jobState` treats a task of a project with an app place as working, status "Going live", from the tap until the deploy step reports, and keeps its preview up (`previewHeld`) until then. Only a confirmed deploy makes the job done. |
| - |
| -| moment | pill status | detail line | link | |
| -|---|---|---|---| |
| -| first look up, app still building | Building it (jobs spec) | Building the full version from your first look. | See the first look | |
| -| app preview building | Making it ready to try | Getting your app ready to try. | See the first look | |
| -| waiting its turn for a preview | Ready soon | Waiting to start your app so you can try it. | | |
| -| app preview up | Ready to try (approved) | the tested line (D2) | Try your app | |
| -| app preview ended | Ready to try | Your app's trial has ended. Try again for a fresh one. | | |
| -| putting it live | Going live | Putting your app live. | Try your app, while the preview is up | |
| -| live | Done (approved) | Your app is live. | Open your app | |
| -| a newer change went live first | Done | A newer version of your app is live. | Open your app | |
| -| failed (C6, first three rows) | Didn't go live (jobs spec) | Your app didn't go live. The version before is still running. (only when C6 confirms it), else Your app didn't go live. | Try again | |
| -| partly live | Partly live | Your app is live in some places but not others. | Try again | |
| -| not confirmed | Not confirmed | Your app was sent, but it could not be confirmed. | Try again | |
| +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"): |
| + |
| +- 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 (C1), the job is working, status "Checking it again", while the merged commit's Checks and Review run, then asking with the second card; |
| +- 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. |
| + |
| +| 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 | |
| +| 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 | |
| +| merged result checked again | Checking it again | Something else changed too, so it's being checked again 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 | |
| +| `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 is a new deploy step through `authorizeAppDeploy`, reconciling first while the fence is held (C3). 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). |
| 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. |
| @@ -226,7 +254,10 @@ The go-ahead card and the ready pill carry one line saying what was checked. It |
| |---|---| |
| | 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 | Tested: its tests pass, it starts, and it opens your existing data (checked with sample data). You can try it before it goes live. | |
| -| checks passed, no preview possible (`other` kind, a Mac runner, no confinement) | Its tests pass, but you can't try it before it goes live here. | |
| +| 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. | |
| +| the candidate changes how the app is built (A1) | It changes how the app is built, so it'll be checked again once it's in, 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. | |
| @@ -251,23 +282,23 @@ The approved merge wording ("This is ready: it could not be fully tested. Go ahe |
| 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: |
| - **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. Machine-readable deploy, ship and promote.** One JSON object with the address, version, app, each box's rollout result and whether the build probe confirmed the new process, so the runner parses no human output and can tell C6's rows apart (extends P6). |
| +- **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. Vet before ship.** `carlos vet --boot` for a local artifact, before any app exists, with JSON output. Until then the runner's own boot check (C3) stands in for it on a first deploy, and `vet` runs between ship and promote on later ones. |
| -- **P-G. The build probe's match rule.** Document how the probe compares the response body with the release's `--version` (prefix, substring or exact), so `/version` can be specified to match 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. |
| ## 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 went ahead." with the result "Finished.", 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. "This went ahead." is COPY REVIEW PENDING. |
| +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. |
| ## 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).** The `app` place kind, the `app_place` merge criterion, C1 to C8, `authorizeAppDeploy`, the deploy lease and `deployed_sha`, D1's going-live states, the address on the job. Equipo instance and runner. 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 to L).** B1 to B3, including the proxy, the confinement and the upgrade check. Equipo runner and instance. Linux runners 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. |
| 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. |
| @@ -282,18 +313,21 @@ Equipo: |
| - `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. |
| - `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`: every response carries the headers; a cross-origin redirect, a `Set-Cookie` with `Domain`, an oversized body and a page that fetches another origin (checked in a headless browser) are all stopped; same-origin forms work; no proxy, no preview. |
| +- `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, 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; 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`: a candidate that drops a column the previous release reads fails; one that adds a table passes. |
| +- `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 listed read page fails on the live release's data fails; one that adds a table passes; it runs in the deploy's checks with no interactive preview. |
| +- `TestAppBuildContract`: a candidate that changes `release/app.json` gets no preview and no Put it live; after its merge the merged commit is checked under the new contract and the person is asked again; checks, preview and deploy build the same package. |
| +- `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. |
| - `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. |
| -- `TestAppDeployOrder`: two merged changes whose deploys run in reverse order leave the newer live and settle the older as superseded; a duplicate tap starts one deploy; a delayed retry of an older deploy is refused. |
| -- `TestAppFirstDeploy` (fake carlos): `apps create --build-probe`, `apps region --set`, `deploy`, `services create`, in order, each behind its own final check; `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): ship, vet, promote with the deploy credential in the environment, never argv; a refused vet changes nothing served; each C6 row from its fake outcome, including a partial rollout and 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 promote 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, keeps its preview up meanwhile, and is done only once confirmed; the done job's link is the address; `team_status` says "It is live at …"; nothing names machinery (extend `TestContractAssistantLaneLeaksNoMachinery`). |
| +- `TestAppDeployFence`: two merged changes whose deploys run in reverse order leave the newer live and settle the older as superseded; a newer deploy that is "not confirmed" keeps the fence, and an older queued deploy is refused; a rollback moves the generation and every deploy queued from an earlier tap is refused and re-asked; a duplicate tap starts one deploy; a restart while a CARLOS command's outcome is unknown reconciles before anything else runs. |
| +- `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, "Checking it again" while a changed merged result is checked, 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. |
| Base: |
| @@ -307,7 +341,7 @@ Staging (after phase 3): from Base, "Can you create a simple app for sharing rec |
| - **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 waits at Ready to try for an owner. Per-member accounts and a "put it live for them" action are later designs (abilities spec Q4). |
| +- **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. |
| @@ -316,6 +350,8 @@ Staging (after phase 3): from Base, "Can you create a simple app for sharing rec |
| - **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. |
| ## Copy register (all DRAFT, for copy review) |
| @@ -325,7 +361,7 @@ Equipo instance copy, shown in Base: |
| |---|---| |
| | `assistant.outcome.app_question` | Your app is ready. Put it live? | |
| | `assistant.outcome.option.go_live` | Put it live | |
| -| `assistant.job.detail.owner_goes_live` | {Owner} can put it live. | |
| +| `assistant.job.detail.owners_only` | Only an owner of this Base can put apps live for now. | |
| | `assistant.job.status.app_preparing` | Making it ready to try | |
| | `assistant.job.detail.app_preparing` | Getting your app ready to try. | |
| | `assistant.job.status.app_waiting` | Ready soon | |
| @@ -335,10 +371,12 @@ Equipo instance copy, shown in Base: |
| | `assistant.job.detail.going_live` | Putting your app live. | |
| | `assistant.job.detail.app_live` | Your app is live. | |
| | `assistant.job.detail.app_superseded` | A newer version of your app is live. | |
| -| `assistant.job.detail.app_not_live_kept` | Your app didn't go live. The version before is still running. | |
| -| `assistant.job.detail.app_not_live` | Your app didn't go live. | |
| -| `assistant.job.status.app_partly` | Partly live | |
| -| `assistant.job.detail.app_partly` | Your app is live in some places but not others. | |
| +| `assistant.job.detail.app_not_live` | Your app didn't go live. Nothing about it changed. | |
| +| `assistant.job.status.app_checking_again` | Checking it again | |
| +| `assistant.job.detail.app_checking_again` | Something else changed too, so it's being checked again 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 | |
| @@ -346,6 +384,10 @@ Equipo instance copy, shown in Base: |
| | `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 opens your existing data (checked with sample data). You can try it before it goes live. | |
| | `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'll be checked again once it's in, 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. | |
| @@ -353,7 +395,7 @@ Equipo instance copy, shown in Base: |
| | `assistant.tested.timeout` | Its tests took too long and were stopped. | |
| | `assistant.tested.unavailable` | It couldn't be tested just now. We'll try again shortly. | |
| | `assistant.tested.no_start` | It passed its tests but didn't start, so you can't try it yet. | |
| -| `assistant.outcome.merge_done` | This went ahead. (COPY REVIEW PENDING on `stale-goahead-card`) | |
| +| `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) | |
| 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." |
| @@ -380,3 +422,18 @@ Model-facing (not copy, reviewed as code): the app contract note (A3), Review's |
| 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). |