Spec: apps Equipo builds get tested, previewed and put live
An addendum to the jobs design, from Paul's recipes app (2026-11-28): merged with no checks, no way to try it, no address, and a go-ahead that kept asking. Starter checks in .amadan/ci.d on main's first commit (trusted base gates, hosted CI on); app previews built and run in the checks sandbox on the person's runner, shared as a private devbox link with an empty database; one-tap "Put it live" that merges and deploys a CARLOS binary app in a confirmed place, with a per-app deploy credential and the address on the job; honest lines for what wasn't tested. Platform requests P-A to P-F, twelve open questions with recommendations, and a DRAFT copy register.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+300
−0
docs/superpowers/specs/2026-11-28-apps-go-live-design.md+300 −0
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 === [90m10:59PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m10:59PM[0m [32mINF[0m [1m1 commits scanned.[0m [90m10:59PM[0m [32mINF[0m [1mscanned ~2882837 bytes (2.88 MB) in 329ms[0m [90m10:59PM[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 11.053s 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.667s amadan.net/oficina/base/internal/webtest receipt: slow package 678ms amadan.net/oficina/base/internal/issuer receipt: slow package 639ms amadan.net/oficina/base/internal/equipo receipt: slow package 614ms amadan.net/oficina/base/internal/operations receipt: slow package 232ms amadan.net/oficina/base/internal/consumer receipt: slow test 1.52s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.14s 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 520ms 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| new file mode 100644 |
| index 0000000..839979a |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-28-apps-go-live-design.md |
| @@ -0,0 +1,300 @@ |
| +# 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. |
| + |
| +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. |
| + |
| +## 1. The problem |
| + |
| +Paul asked Base: "Can you create a simple app for sharing recipes?" Equipo made a new repository, `amadan.net/paulca/recipes` (`main.go`, `store.go`, `templates/`, `go.mod`), and merged it to `main` at 18:52:39 as 336405a. Base's card said "This is ready: it could not be fully tested. Go ahead?". After the go-ahead the Assistant said: "The recipe sharing app is finished, but I don't have a web address for it yet, and it isn't in your list of apps." There was no address, and the card went on reading as a question. |
| + |
| +What the runner's own records show (read-only, docs-t1, 2026-11-28): one Engineering step (18:48), Checks (18:50, outcome `none`), Review (approve), and a merge step dispatched at 18:52:38 whose report (merge SHA 336405a, strategy merge, source hub) the instance acknowledged. The merge record's phase is `merged`. |
| + |
| +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. So 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. So after the merge the card still read "…Go ahead?". The fix is on Equipo branch `stale-goahead-card` (section 9). It is separate from this design. |
| + |
| +## 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 certifies each change against them. An approved Go app gets a preview the person can try: it is built and run on the person's own machine in the same sandbox checks use, with an empty database of its own and no secrets, and 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", which merges the work and deploys it as a CARLOS app in the confirmed place. 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 address goes on the job and into the Assistant's reply. 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, for the first time and for every later change, is a tap, gated by `go_live`. Nothing here lets the Assistant, housekeeping or merge authority deploy on its own. |
| +- **Previews stay behind Review** (jobs spec O5, ruled). An app preview runs only for a candidate that 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 or app. |
| + |
| +## 4. Starter checks |
| + |
| +### A1. What a new repository starts with |
| + |
| +`create_project` gains `kind`: `go_app`, `site` or `other` (runner protocol bump; an older runner drops it and gets `other`). The Coordinator sets it from what it is about to build. The instance stores it on the project and checks it against the fixed list. `StartDefault` then writes `main`'s first commit from a fixed, versioned template for that kind instead of the empty tree. The commit stays deterministic per template (fixed dates, as today), so a retried start still recognises its own `main`. |
| + |
| +| kind | files on `main`'s first commit | what the steps do | |
| +|---|---|---| |
| +| `go_app` | `.equipo/gates.json` (`{"version":1,"files":[]}`), `.amadan/ci.d/10-go`, `.amadan/ci.d/20-starts` | `10-go`: refuses without `go.mod`; `gofmt -l` is empty; `CGO_ENABLED=0 go build ./...`; `go vet ./...`; `go test -count=1 ./...`. `20-starts`: builds the binary, starts it with `PORT` on a free loopback port and `CARLOS_DB` in a fresh temporary directory, waits up to 10 s for `GET /healthz` to answer 200 and `GET /` to answer below 500, then stops it. | |
| +| `site` | `.equipo/gates.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 (section 7). | |
| + |
| +The `go_app` template also writes a short `README.md` with the app's CARLOS declaration headings (app spec §0.5) left for Engineering to fill, and an `AGENTS.md` line with the app contract below. These are files on the first commit, not checks. |
| + |
| +### A2. The same checks in both places |
| + |
| +- **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 then 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 against `main`'s steps, installed read-only over the candidate's copies (`installBaseGates`). A candidate that edits a step is run under the base step for the verdict, and its own step only as a diagnostic, as today. With the base checks passing, the merge gate's `trusted_base_checks` holds, so merge authority's rules can apply instead of always asking. |
| +- Both run the same files, so a green hub and a green Checks step mean the same thing. |
| + |
| +### A3. The app contract |
| + |
| +A Go app that is meant to go live follows a short contract, which `20-starts` checks and Engineering's dispatch carries as a separate note (like the first-look note, jobs plan Task 3.3, never in the brief): |
| + |
| +- listen on `$PORT`, default `127.0.0.1:8080` (app spec 12.4); |
| +- keep its data in SQLite at `$CARLOS_DB`, and create the schema itself on first start (app spec 14.1); |
| +- answer `/healthz` with 200 and no data (app spec 15.1), and report its build at `/version` (14.2); |
| +- build with `CGO_ENABLED=0` for linux on amd64 and arm64 (7.5), with no assets outside 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 checked by its own candidate steps (uncertified, as today); from its merge on, `main` holds trusted checks. The person is not asked separately (open question Q6). |
| + |
| +## 5. App previews |
| + |
| +### B1. Where an app preview runs (v1) |
| + |
| +On the person's own primary runner, 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 safely (P4). CARLOS temporary deploys don't cover this today: cli.md says `--temporary` is for static sites, and `--kind binary` is refused with it. That is request P-A. |
| + |
| +A new preview mode, `app`, beside today's static export: |
| + |
| +- **Evidence.** Review reports `has_app_preview` when the candidate holds `release/app.json`: strict JSON, at most 4 KiB, `{"build": "go", "package": "<clean relative path>", "health": "/healthz"}`, with an optional `"seed": "<clean path>"`. The `go_app` template writes it. `schedulePreview` treats it as it treats `release/preview.json`, under the same `authorizePreview`, digest and once-per-candidate rules. |
| +- **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 -o <private>/app ./<package>` 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.** The binary starts in a fresh sandbox namespace with the checks profile: no network but loopback; `HOME` empty; an environment of exactly `PORT`, `CARLOS_DB=/data/app.db` and `TZ=UTC`; `/data` a new private directory; nothing else of the runner's mounted. The runner's sandbox helper forwards one unix socket from outside into the namespace's loopback port. `carlos devbox share --socket <that socket> eq-app-<task>` publishes it. The marker check that proves a static preview serves its export becomes a `GET <health>` through the link that answers 200 and a `GET /version` that names the candidate. |
| +- **Data.** Each preview starts from an empty database. If `seed` is set, its SQL (from the reviewed candidate, at most 1 MiB) runs once 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. |
| +- **First looks.** A request for an app still starts with a first look: one static page, as jobs spec K13 and K14 set out. That goes 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, limits and cost |
| + |
| +| what | limit | |
| +|---|---| |
| +| an app preview's 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; the link then reads as expired, and Try again starts a fresh one (jobs spec K11, fourth case) | |
| +| 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, 1 GiB of disk for `/data`, enforced by the sandbox helper's cgroup; over it, the process is stopped and the preview reads as "couldn't start" | |
| +| build | the Checks step's time limit (`MaxStep`) | |
| + |
| +The cost is the person's own machine time and nothing else: no CARLOS app, no hosted minutes, no model use. Hosted CI from A2 runs on the hub at the namespace's own CI terms. |
| + |
| +### B3. Safety |
| + |
| +A preview runs code a model wrote. So: |
| + |
| +- It runs only after Review approved that exact candidate (first-look review for first looks, full review for builds; jobs spec K14), and never on the hub or on CARLOS in v1. |
| +- It runs in the checks sandbox profile. On Linux that is bubblewrap with a private network namespace and seccomp. On a Mac it is seatbelt, and a Mac runner whose sandbox isn't proven (`ReasonSandboxUnproven`) runs no app preview at all. A runner that has ever run checks outside the sandbox (`markTainted`) runs no app preview either. |
| +- No secret is ever present: no forge credential, no CARLOS login or deploy credential, no model keys, no preview credential file (already outside every sandbox mount, `previewCredentialPlace`), and no person's data. |
| +- No outbound network: loopback only, so a preview can't reach the internet, the tailnet or the machine's other services. The forwarded socket is the only way in. |
| +- The link is private to the person's network (devbox `--allow` set to the person's login where the devbox supports it). It is never public in v1. |
| +- Every preview's start, stop and digest is audited (`preview.app.started`, `preview.app.stopped`), as static previews are. |
| + |
| +### B4. Later: previews on CARLOS |
| + |
| +Once CARLOS ships P-A (temporary binary apps with a throwaway database) and P4 (a scope for temporary apps only), the same `app` mode gains a CARLOS adapter: `carlos deploy --temporary --kind binary --ttl 1d` in a dedicated previews account, run inside CARLOS's own tenant sandbox, reachable away from the person's network. 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 guaranteed an empty database of its own. Until then, changes to a live app are previewed on the runner like new ones. |
| + |
| +## 6. App go-live |
| + |
| +### C1. One tap: Put it live |
| + |
| +For a job whose project is a `go_app` with an `app` place (C2), the go-ahead card asks "Your app is ready. Put it live?" with "Put it live" and "Not now" (DRAFT). One tap merges the approved candidate and then deploys the merged commit. The tap is bound to the candidate, as `answerMerge` is today. The deploy goes ahead 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, a Publish-style card asks again for the merged result (`offerPublish`'s rule for sites, per merged commit). |
| + |
| +Merge authority never merges an app task on its own while the project has an app place: `main` ships, so `CritShips` fails and the gate asks (`mergegate/gate.go`, "it goes live as soon as it goes in"). That is today's rule applied to apps, not a new one. |
| + |
| +### 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. |
| + |
| +- **Account.** The team's default place for apps, or 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.** `carlos deploy --region` from the place (the console's nearest by default). The place records it, so the Places page can say where the data lives. |
| +- **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 refuses a name whose address is taken (cli.md, `apps create`), and the runner tries a new suffix at most three times. A model never names the app. |
| + |
| +### C3. The first deploy, and the credential |
| + |
| +As for a site's first publish (places spec §1, ruling 2), until CARLOS ships P2 and P3: |
| + |
| +1. At the person's tap, the runner holding the owner's CARLOS login on that console and account runs one fixed template: `carlos deploy --kind binary --target linux-arm64 --account-id <sqid> --console <o> --app <app> --env PORT=8080 --channel edge --timeout 5m --version <merge sha> --no-prompt <binary>`. It creates the app and its first instance, ships and promotes, and waits until the address serves the version (cli.md, "deploy"). The binary is built from the merged commit in the checks sandbox, as in B1, for `linux-arm64` (the platform's default target) or the place's recorded target. |
| +2. Right after, still with that login: `carlos apps build-probe --app <app> /version`, so later deploys prove the new process is running and not just adopted (cli.md, "build-probe"); then `carlos services create --role deploy --app <app> --rungs edge <name>`, whose secret the runner reads from the output, stores 0600 outside every sandbox mount, and never logs (as `site.go`). |
| +3. Before the deploy, `carlos vet` checks the built release against the platform contract. A refusal stops the deploy, and the pill says it couldn't go live, with Try again. |
| + |
| +The owner's login is used only for these steps and only at a tap. Every later deploy uses 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. |
| + |
| +### 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 in the step's result. The instance stores it on the project's place 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 places 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. |
| + |
| +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. |
| + |
| +### C5. Data and backups |
| + |
| +A binary instance gets its own SQLite database (`CARLOS_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, and it says it moves the app to the Trash for 30 days (app spec 16.1). |
| + |
| +### C6. Later changes |
| + |
| +Every later change to a live app's code goes the same way: checks against `main`'s trusted steps, Review, an app preview, then "Put it live?" (C1). The deploy is `carlos deploy --kind binary --app <app> --channel edge --version <merge sha> --no-prompt <binary>` with the deploy credential. The app handles its own migrations (app spec 14.1). The starter checks can't prove a migration is safe to roll back, so 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)". |
| + |
| +If the deploy's wait fails, the earlier version keeps serving (cli.md: "the previous build keeps serving"). The pill reads "Didn't go live" with "The version before is still running." and Try again (jobs spec K6 row `causeGoingLive`). |
| + |
| +### 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 never touches data. Base offers no rollback button in v1 (Q7). |
| + |
| +### C8. The `go_live` and `build` gates |
| + |
| +Following abilities spec §6.3 and §6.4: |
| + |
| +- `build` covers starter checks, previews (building and running them) and Try again on a preview. |
| +- `go_live` covers "Put it live" (the merge and the deploy as one decision), the first deploy, the build probe and the credential mint, every redeploy, a publish-style re-ask, Try again on a failed deploy, and rollback. |
| +- The last check is a new `authorizeAppDeploy`, beside `authorizePublish`. It runs at the deploy step's start and again right before the runner runs `carlos deploy`, in the transaction that decides, and refuses `ability_off`. A tap followed by the switch going off deploys nothing. A merge already sent to the hub still finishes, as abilities spec §6.4 says. The job then reads "Ready to try" with the approved-pending line "Putting it live is turned off for you. {Owner} can turn it on." (abilities register). |
| + |
| +## 7. What Base shows |
| + |
| +### D1. On the pill, in the job view and in the reply |
| + |
| +| 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 | |
| +| app preview up | Ready to try (approved) | the tested line (D2) | Try your app | |
| +| waiting its turn for a preview | Ready soon | Waiting to start your app so you can try it. | | |
| +| putting it live | Going live | Putting your app live. | | |
| +| live | Done (approved) | Your app is live. | Open your app | |
| +| deploy failed | Didn't go live (jobs spec) | Your app didn't go live. The version before is still running. | Try again | |
| + |
| +The Assistant's reply after it goes live uses the approved "It is live at %s". The `noteDirection` and `jobNote` lines already say nothing of how; they gain the address when there is one. |
| + |
| +### 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 comes from the newest Checks result and the preview's outcome, in instance copy, and never names a tool or a step: |
| + |
| +| 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. | |
| +| checks passed, no preview possible (`other` kind, sandbox unproven, runner busy past 24 h) | Its tests pass, but you can't try it before it goes live here. | |
| +| no checks at all (`none`) | It hasn't been tested: there are no tests for it yet. | |
| +| 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. | |
| +| the preview failed to start | It passed its tests but didn't start, 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 replaces "could not be fully tested" on the card. The question "Your app is ready. Put it live?" follows it. |
| + |
| +### 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 detail line is the card's detail. |
| +- Templates and `ask.js`: the "Open your app" link on a done pill uses the existing `.Go` drawing, so nothing new is drawn. |
| +- Native app: draws from the same fields, so nothing changes. |
| +- The Assistant's `base_apps` lists apps installed on Base; it does not list apps Equipo built. The Assistant's instructions say to read the job, not `base_apps`, for "where is my app" (operation note, not copy). Showing built apps on Base's Home is a separate question (Q10). |
| + |
| +## 8. Platform requests (CARLOS; nothing filed) |
| + |
| +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, and `carlos gate` allowed on it. Today `--kind binary` is refused with `--temporary` (cli.md). |
| +- **P-B. `carlos deploy --json`.** One object with the address, version, app, instance and whether the build probe confirmed the new process, so the runner parses no human output (extends P6). |
| +- **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. Also allow a canary 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. `carlos vet` for a deploy credential.** Machine-readable output, usable before the first deploy (no app yet) and with a deploy credential afterwards. |
| + |
| +## 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. |
| + |
| +## 10. Phases |
| + |
| +1. **Starter checks (S).** `create_project` `kind`, the three templates, hosted CI on at creation, and 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, C1 to C8, the address on the job (C4), `authorizeAppDeploy`. 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. Equipo runner (sandbox helper, socket forward, devbox share) and instance (`release/app.json` evidence, preview mode `app`). |
| +5. **App previews on CARLOS (S, after P-A, P4, P-C, P-D).** B4. |
| + |
| +Phases 1 and 2 can ship in a day each and fix Paul's "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. |
| + |
| +## 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`; a `main` of someone else's is left alone (the existing `start_default_test.go` cases, for each template). |
| +- `TestStarterGoChecks` (runner, real Go): a minimal app that follows A3 passes `10-go` and `20-starts`; missing `go.mod`, a vet error, a failing test, no `/healthz` and a crash on start 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 repository started with `go_app`, a candidate that deletes `10-go` or `go.mod`'s check is judged by `main`'s steps; `BaseChecksSHA` is set; the gate's `trusted_base_checks` holds. |
| +- `TestHostedCIOnAtCreate`: one fixed call after `Forge.Create`, none for an adopted repository. |
| +- `TestAppPreviewSandbox`: the preview process sees no credential files, no network but loopback, only the three environment variables, and its own `/data`; the socket forward is the only listener outside; a fork bomb and an over-memory process are stopped; a tainted or unproven runner runs none. |
| +- `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 preview waits. |
| +- `TestAppPreviewNeedsReview`: no preview without Review's approval of that candidate; `release/app.json` is refused when malformed, oversized or naming a path outside the tree. |
| +- `TestPutItLiveOneTap`: one tap merges and deploys when the merged tree equals the candidate's; with another change landed in between, a second card asks; merge authority never merges an app task with a place. |
| +- `TestAppFirstDeploy` (fake carlos): the fixed templates in order (vet, deploy, build-probe, services create); the secret goes only to the 0600 file; a taken name gets a suffix, at most three tries; the owner's login is used for nothing else. |
| +- `TestAppRedeploy`: later deploys use the deploy credential in the environment, never argv; a failed wait leaves the job "Didn't go live" with Try again. |
| +- `TestAppDeployAbilityOff`: `go_live` off between the tap and the deploy deploys nothing; `build` off stops previews; abilities spec T-cases for publish apply to app deploys. |
| +- `TestJobShowsAppAddress`: the done job's link is the address, label "Open your app"; `team_status` says "It is live at …"; nothing names machinery (extend `TestContractAssistantLaneLeaksNoMachinery`). |
| +- `TestHonestStatusLines`: each D2 row from its Checks and preview inputs. |
| + |
| +Base: |
| + |
| +- `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, survives a reload; 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 that serves the app's `/healthz`, 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 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 machine, in the checks sandbox, as a private link on their network (B1), matching the ruling for temporary sites. No public app previews until P-A and P4. |
| +- **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.** Recommended: the places default (Carloku `paulca` for Paul's projects, `oficina` for oficina's), confirmed once by an owner. For other members of a Base, the same team place, with the member as the creator; per-member accounts later if someone asks. |
| +- **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. |
| + |
| +## Copy register (all DRAFT, for copy review) |
| + |
| +Equipo instance copy, shown in Base: |
| + |
| +| Key | Text | |
| +|---|---| |
| +| `assistant.outcome.app_question` | Your app is ready. Put it live? | |
| +| `assistant.outcome.option.go_live` | Put it live | |
| +| `assistant.outcome.option.not_now` | Not now (approved, reused) | |
| +| `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.status.going_live` | Going live | |
| +| `assistant.job.detail.going_live` | Putting your app live. | |
| +| `assistant.job.detail.app_live` | Your app is live. | |
| +| `assistant.job.detail.app_not_live` | Your app didn't go live. The version before is still running. | |
| +| `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.no_preview` | Its tests pass, but you can't try it before it goes live here. | |
| +| `assistant.tested.none` | It hasn't been tested: there are no tests for it yet. | |
| +| `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.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`) | |
| + |
| +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". From the abilities register: "Putting it live is turned off for you. {Owner} can turn it on." |
| + |
| +Equipo-only copy (Places page; reviewed with Equipo's copy): "Apps go to {console}, account {account}.", "{Project}: {app}, live at {address}.", "Its data is kept in {region} and backed up as it changes." |
| + |
| +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). |