oficina / base Public

Spec: apps go live, revision 4 after Astra's third review

Five P1s: the Refresh header stripped in previews, ancestry against what
may be serving, the step's own generation for its later commands, a
read-only reconcile that owns the fence by step, and a merge path for a
candidate that changes how the app is built. Four P2s applied once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 0bc7912c6655ece0e959d2a182b17ca187a8fbd2 parent ce40c35
1 file changed, +50 −23
  • docs/superpowers/specs/2026-11-28-apps-go-live-design.md +50 −23

CI passed — run details

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

receipt: test step 10.202s 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.376s amadan.net/oficina/base/internal/webtest
receipt: slow package 924ms amadan.net/oficina/base/internal/issuer
receipt: slow package 628ms amadan.net/oficina/base/internal/equipo
receipt: slow package 593ms amadan.net/oficina/base/internal/operations
receipt: slow package 195ms amadan.net/oficina/base/internal/consumer
receipt: slow test 1.52s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot
receipt: slow test 1.09s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce
receipt: slow test 660ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp
receipt: slow test 610ms amadan.net/oficina/base/internal/webtest TestAskUploadStalledBodyFreesItsSlot
receipt: slow test 520ms amadan.net/oficina/base/internal/operations TestOperationsRefusals
=== native ===
strings: copy review's strings.json is not here (git-ignored); its comparison skipped
strings: 120 in the catalog, 117 used
worktree-lib_test: ok
diff --git a/docs/superpowers/specs/2026-11-28-apps-go-live-design.md b/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
index fe905c3..7a6f6ab 100644
--- a/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
+++ b/docs/superpowers/specs/2026-11-28-apps-go-live-design.md
@@ -1,6 +1,6 @@
# Apps Equipo builds get tested, previewed and put live with an address
-Date: 2026-11-28. Paul approved the direction on 2026-11-28. Design only: nothing here is built, merged or deployed. Revision 3, after Astra's second review (see Review, at the end).
+Date: 2026-11-28. Paul approved the direction on 2026-11-28. Design only: nothing here is built, merged or deployed. Revision 4, after Astra's third review (see Review, at the end).
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.
@@ -43,7 +43,7 @@ Every repository Equipo creates starts with checks that fit what it holds: 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).
+**One build contract for checks, preview and deploy.** Naming `release/app.json` in `gates.json` pins it in Equipo's Checks: the verdict always comes from `main`'s copy. The preview (B1) and the deploy (C3) read `release/app.json` from the same place, `main` at the candidate's base, never from the candidate, so the package checked is the package tried and shipped. A candidate that changes `release/app.json` gets no app preview, because nothing trusted says how to build it yet. Its card still offers "Put it live", with the line "It changes how the app is built, so it'll be checked again once it's in, before it goes live." (D2). The tap merges it. The merged commit is then `main`, so its Checks, Review and the boot check run under the new contract as trusted ones ("Checking it again", D1). If they pass, the deploy follows on the same tap, bound to the same snapshot; if they fail, the job stops with Fix it (D1). The person isn't asked twice for the same decision.
### A2. The same checks in both places, and where they differ
@@ -77,14 +77,14 @@ A new preview mode, `app`, beside today's static export:
- **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;
+ - it refuses a redirect whose `Location` leaves the origin, removes the HTTP `Refresh` header unless its URL is the preview's own origin, removes `Link` headers, drops any `Set-Cookie` with a `Domain` attribute, and caps request bodies at 1 MiB and responses at 10 MiB;
- a response it can't parse as HTML when it says it is HTML is replaced by a plain error page.
So nothing on the page can load from, post to or navigate to another origin; the person would have to copy an address by hand. Forms that post back to the app work. Parts of an app that need scripts don't run in the trial, and the pill says so (D2). If the proxy can't start, the preview fails closed.
- **One origin per attempt.** `carlos devbox share --socket <proxy socket> eq-app-<task>-<attempt>` publishes the proxy, never the app. A new attempt gets a new name, so cookies and storage from an earlier attempt don't carry over.
- **Proof.** The preview counts as up once `GET <health>` through the link answers 200 and `GET /version` names the candidate. That replaces the static preview's marker file.
- **Data.** Each preview starts from an empty database. If `seed` is set, its SQL (from the reviewed candidate, scanned, at most 1 MiB) runs once, inside the same confinement, before the first request. A preview never gets a copy of live data, even for a change to an app that is already live (Q11). The data directory is deleted when the preview ends.
-- **Upgrade check, for a change to a live app.** In the B3 confinement, the runner builds the release that is actually live (the binding's `deployed_sha`, C3, not `main`, which may hold merged work that never went live) and the candidate. The live release starts on a fresh database with the seed. Then the candidate starts on that database, then the live release again. Each time `/healthz` answers 200 and every 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.
+- **Upgrade check, for a change to a live app.** In the B3 confinement, the runner builds the release that is actually live (the binding's `deployed_sha`, C3, not `main`, which may hold merged work that never went live) and the candidate. The live release starts on a fresh database with the seed. Then the candidate starts on that database, then the live release again. Each time `/healthz` answers 200 and every entry in `release/app.json`'s `"reads"` list answers 200 with its expected text in the body. An entry is `{"path": "<relative path>", "expect": "<text>"}`, at most 20, written by Engineering for pages that show stored records, where `expect` is text the seed put in the database (a recipe's title, say). So a page that loads but has lost its records fails. That shows the candidate reads the live release's records, and the live release can still read them after the candidate ran (app spec 14.1, 14.3). It covers only what the seed and the listed pages exercise. The "existing data" line (D2) is shown only when a seed and at least one `reads` entry exist and pass; without them the check is just "it starts on the live release's database", and D2 says the existing data wasn't checked. It is part of the deploy's own checks (C3), so it runs whether or not an interactive preview is possible. A failure is a finding for the fix round, like a failing check.
- **First looks.** A request for an app still starts with a first look: one static page, as jobs spec K13 and K14 set out, through the existing static preview, within the two-minute target. The app preview follows once the full build is approved. Base shows "See the first look" first and "Try your app" once the app preview is up (section 7).
### B2. Lifetime, retries, limits and cost
@@ -126,7 +126,7 @@ For a job whose project is a `go_app` with a confirmed `app` place (C2), the go-
- **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.
+- **Merge, then deploy.** The deploy follows the merge on the same tap only when the merged commit's tree is exactly the approved candidate's tree, which is always so for a new repository. Otherwise, for example when someone else's change landed in between, the merged commit gets Checks, Review and the boot check of its own, and then a second card asks for the merged result: a Publish-style card, one per merged commit, as `offerPublish` does for sites, answered by the same creator under the same rules. When those checks fail, the job stops with Fix it (D1). A candidate that changed the build contract is the one case where the merged result is checked again without a second card (A1): what the person approved is unchanged, only how it is built.
- **No automatic merges for apps.** `mergegate` gains a criterion, `app_place`, that fails for every task of a project with an `app` place, whatever its merge policy says. `CritShips` alone isn't enough: it reads `Policy.MainShips`, which a project may have set to `no` before it had an app (`mergegate/gate.go`, `changeCriteria`). The criterion is checked where every merge is decided: `autoMerge`, `authorizeMerge` and `authorizeMergeLease`, so a merge already queued when a project gains an app place is refused before its request goes. The person's own tap still merges.
### C2. Where the app lives
@@ -135,7 +135,7 @@ The places spec gains a kind beside `site`: **`app`**, a CARLOS binary app on on
- **Account.** The team's default place for apps, else the site default. By Paul's rulings that is Carloku account `paulca` for `paulca/` projects and `oficina` for oficina projects. The person's Base or Oficina account maps to these through the places chooser; code never guesses (Q4).
- **Region.** Chosen when the place is confirmed, from the regions the console offers, and recorded on the place. Every command names it (C3), because otherwise CARLOS picks a new app's region from the runner's timezone (cli.md, "deploy").
-- **Target.** `linux/arm64`, the platform's default (`--target`), unless the place records another.
+- **Target.** Recorded in CARLOS's spelling, `linux-arm64` (the platform's default for `--target`), unless the place records another. The runner derives Go's `GOOS` and `GOARCH` from it by splitting at the dash and refuses any value outside a fixed list (`linux-arm64`, `linux-amd64`).
- **Name.** Minted by code from the project name: lower case letters, digits and dashes, at most 30 characters (`recipes`). When the account already holds that name, a dash and four random letters and digits are added (`recipes-k3x9`). The platform also refuses a name whose address is taken (cli.md, `apps create`); the runner tries a new suffix at most three times. A model never names the app.
### C3. Deploying: one fixed path, one at a time
@@ -144,7 +144,7 @@ The places spec gains a kind beside `site`: **`app`**, a CARLOS binary app on on
**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;
+- the **shipped artifact**, for the place's target (`linux-arm64` by default, built with `GOOS=linux GOARCH=arm64`). Its SHA-256 is the step's digest. The runner checks it statically: an ELF executable for that architecture, statically linked, within the size cap;
- a **native twin** for the runner's own platform, the same commit, package and flags, differing only in `GOARCH`. The runner can't run an arm64 binary on an x86 machine, so the twin is what it runs: in the B3 confinement it starts it as CARLOS will, checks `/healthz` and that `/version` is the 12-character version, and, for a change to a live app, runs the upgrade check (B1).
The shipped artifact's first run on its real architecture is CARLOS's own, and the build probe (below) is the proof it works. `carlos vet --boot` can't stand in for the boot check: it reads a deployment store directly, takes no console or account, and runs the binary with the caller's environment and access (`carlos/platform/internal/vet/vet.go`), so the runner never calls it (P-F). Because the boot check needs B3's confinement, that confinement is part of phase 3, not only of previews (section 10). A runner that can't confine (a Mac, or no user scope) can't deploy apps either; the job says why (D2).
@@ -163,13 +163,22 @@ The owner's login is used for these steps only, and only at an owner's tap.
**One deploy per app at a time, never older over newer.** The project binding holds a durable deploy fence:
-- `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.
+- `generation`, a counter;
+- `pending`, the deploy **step** (not attempt) holding the fence while its outcome isn't known, with `pending_generation`, the generation it allocated, and `pending_sha`, the merge SHA it sends;
+- `deployed_sha`, the merge SHA last confirmed live;
+- `head_sha`, the newest merge SHA that may be serving: `pending_sha` while a step holds the fence, else `deployed_sha`.
-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.
+The rules, each enforced by `authorizeAppDeploy` in the transaction that decides:
-**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).
+1. **Taking the fence** (the step's start). The card's snapshot records `seen_generation` at the tap. The step may start only when no step holds `pending`, `generation` still equals `seen_generation`, and its merge SHA is a descendant of `head_sha` (or there is no `head_sha` yet). In the same transaction it sets `generation = generation + 1`, `pending` to itself, `pending_generation` to the new value and `pending_sha` to its merge SHA. Ancestry is what stops an older change: a delayed card for a commit that isn't a descendant of what may be live is refused, whenever it was answered. The generation is what stops a tap answered before a rollback or another deploy from acting on a state it didn't see.
+2. **Every later command of that step** (region, deploy, mint) requires `pending` to be this step and `generation == pending_generation`. A step's own start never invalidates it, because it checks the generation it allocated, not the one the tap saw.
+3. **Its next attempt** (Try again on the same step, C6) inherits the fence: `pending` names the step, so the attempt doesn't have to take it again, and still checks rule 2.
+4. **Releasing.** Only when the outcome is known: confirmed live (`deployed_sha = pending_sha`), refused before any command that changes CARLOS was sent, or an owner's explicit release after reconciling (below). Then `pending` is cleared. "Not confirmed" keeps it held.
+5. **Rollback** (C7) is the one path allowed to go backwards. It takes the fence like a deploy, needs no ancestry, and sets `head_sha` to the version it restores once confirmed.
+
+A refused start settles the step as superseded. If its change is already in what is live, the job is done with the address; if not, a new card asks again, which takes the fence afresh under rule 1.
+
+**Reconciling.** A step restarted after a phase that may have changed CARLOS, or one left "not confirmed", reconciles with **reads only**, as `siteReconcile` does with its marker (`site.go`): the runner's own `GET /version` on the address and, once P-B lands, each instance's serving build. It sends nothing, so it needs only the fence (rule 2), not `go_live`, and it may run while the switch is off. The instance re-runs it every 10 minutes for 24 hours while the step holds the fence. If it sees `<v>`, the step is live and releases the fence. If it doesn't, the outcome stays "not confirmed": before P-B, not seeing the version proves neither that nothing changed nor that a slow rollout won't finish. After 24 hours the job keeps "Not confirmed", and an owner can, on Equipo's task page, either send the same version again (Try again, under `go_live`) or release the fence after reading what CARLOS's console shows (audited as `app.deploy.released_unknown`).
### C4. The address
@@ -195,7 +204,7 @@ What a failed deploy means depends on where it stopped, so the step reports one
|---|---|---|---|---|
| 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 |
+| shipped or promoted, proof not seen | unknown | Not confirmed | reconciling every 10 minutes for 24 hours (reads only); Try again sends the same version again as the same step's next attempt | held |
| proof seen | the new build, on at least one instance | Done | none | released |
| superseded (C3) | whatever is newer | Done, if its change is in what is live; else a new card asks | per the new card | not taken |
@@ -222,7 +231,7 @@ Following abilities spec §6.3 and §6.4, with the same boundary: a switch is ch
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 merged tree differs from the candidate, or the candidate changed the build contract (C1), the job is working, status "Checking it again", while the merged commit's Checks, Review and boot check run. If they pass, it goes on as C1 says. If they fail, can't run after the usual retries, or Review asks for changes, the job is stopped, "Didn't go live", with Fix it and Drop it, and its preview is released;
- when the deploy settles, the job takes C6's row; only "live" or a superseded deploy whose change is live makes it done;
- for a member who isn't an owner (C1), the job is ready with the owner line, and done is never reached through them.
@@ -239,10 +248,11 @@ A merged app task isn't finished until its deploy settles. `jobState` gains an a
| 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 |
+| not confirmed | Not confirmed | Your app was sent, but it could not be confirmed. | | Try again (the same step's next attempt, holding the fence, under `go_live`); while `go_live` is off, none in Base: the line adds the abilities sentence, and the job counts as being retried (jobs spec T1) because reconciling goes on |
+| merged, then its checks or review failed | Didn't go live | It went in, but it didn't pass its checks afterwards, so it isn't live. | | Fix it, Drop it |
| `go_live` off after the merge | Didn't go live | Putting it live is turned off for you. {Owner} can turn it on. (abilities register) | | Drop it |
-Each action names its path: Put it live is C1's tap; Try again on a preview is `retryPreview` (B2); Try again on a deploy 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).
+Each action names its path: Put it live is C1's tap; Try again on a preview is `retryPreview` (B2); Try again on a deploy refused before anything changed is a new deploy step through `authorizeAppDeploy` (C3 rule 1); Try again on "not confirmed" is the same step's next attempt, which holds the fence and reconciles before it sends (rules 2 and 3); Fix it, for work that went in but failed its checks afterwards (C1), is a new path `fixAfterMerge`: the person's tap records a fix task in the same job and project, its brief the failing checks' or Review's findings (as `fixRound` builds feedback), followed by the job's hand-off; the failed merged result's preview is released. Its own Put it live then follows the usual path, and ancestry (C3 rule 1) holds because the fix starts from `main`. This keeps jobs spec T1 (no dead ends): every asking or stopped row offers an action that succeeds in that state. Once P-B lands, "Partly live" ("Your app is live in some places but not others.") and "The version before is still running." join the table (C6).
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.
@@ -253,7 +263,8 @@ The go-ahead card and the ready pill carry one line saying what was checked. It
| what holds | line (DRAFT) |
|---|---|
| checks passed, app started, preview up | Tested: it builds, its tests pass and it starts. You can try it before it goes live. |
-| as above, a change to a live app, upgrade check passed | Tested: its tests pass, it starts, and it opens your existing data (checked with sample data). You can try it before it goes live. |
+| as above, a change to a live app, upgrade check passed with a seed and `reads` | Tested: its tests pass, it starts, and it still shows your existing records (checked with sample data). You can try it before it goes live. |
+| as above, a change to a live app, no seed or `reads` | Tested: its tests pass and it starts, but whether it keeps your existing data wasn't checked. |
| checks passed, preview up, but the proxy has seen a `<script>` in one of its pages | Tested: its tests pass and it starts. In the trial, parts that need scripts don't run. |
| checks passed, no preview possible (`other` kind) | Its tests pass, but you can't try it before it goes live here. |
| no confinement on the person's machine (a Mac, or no user scope) | Its tests pass, but it can't be tried or put live from this computer yet. |
@@ -308,22 +319,23 @@ Phases 1 and 2 each take about a day and fix "could not be fully tested". Phase
Equipo:
- `TestStartDefaultTemplates`: each kind's first commit is deterministic and holds exactly its files; `other` is today's empty tree; a retry recognises its own `main`; someone else's `main` is left alone (the `start_default_test.go` cases, per template).
-- `TestStarterGoChecks` (runner, real Go): a minimal app that follows A3 passes `10-go` and `20-starts`; missing `go.mod`, no tests, a vet error, a failing test, an arm64 build failure, no `/healthz`, a wrong `/version`, a crash on start and losing its data across a restart each fail with a plain reason; the steps never reach the network.
+- `TestStarterGoChecks` (runner, real Go): a minimal app that follows A3 passes `10-go` and `20-starts`; missing `go.mod`, no tests, a vet error, a failing test, an arm64 build failure, no `/healthz`, a wrong `/version`, a crash on start, and replacing or truncating its database file across a restart each fail with a plain reason (deleting records inside the file is the app's own tests' to catch, A1); the steps never reach the network.
- `TestStarterSiteChecks`: a broken local link, a missing title and an `http:` script each fail; a clean folder passes.
- `TestTrustedStarterChecks`: on a `go_app` repository, a candidate that deletes `10-go` or changes `release/app.json`'s package is judged by `main`'s steps; `BaseChecksSHA` is set; `trusted_base_checks` holds. `TestHubAndChecksDiverge`: the same candidate is green on a hub fake running its own files and red in Equipo, and D2 reads Equipo's verdict.
- `TestHostedCIOnAtCreate`: one fixed call after `Forge.Create`, none for an adopted repository.
- `TestAppPreviewConfinement` (Linux): the process sees no credential file, no network but loopback, only its four mounts and three variables; writing past 1 GiB in `/data`, a fork bomb past 64 tasks and an allocation past 512 MiB are each stopped; the seed runs inside the same limits; a runner that can't create the scope, a tainted runner and a Mac runner run none.
-- `TestAppPreviewProxy` (headless browser against a hostile fixture app): every response carries the headers; inline and same-origin scripts don't run, so a `window.location` navigation with data in the address never happens; a service worker can't register; links, forms, `srcset`, CSS `url()` and a meta refresh to another origin all land on `/_leaving`, which links nowhere; a cross-origin redirect, 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.
+- `TestAppPreviewProxy` (headless browser against a hostile fixture app): every response carries the headers; inline and same-origin scripts don't run, so a `window.location` navigation with data in the address never happens; a service worker can't register; links, forms, `srcset`, CSS `url()` and a meta refresh to another origin all land on `/_leaving`, which links nowhere; a cross-origin redirect, an HTTP `Refresh: 0; url=<another origin>?<posted values>` answered to a same-origin form post, a `Link` preload, a `Set-Cookie` with `Domain` and an oversized body are stopped; same-origin forms work; a second attempt's origin sees none of the first's cookies or storage; no proxy, no preview.
- `TestAppPreviewScan`: a secret in the tree or the seed refuses the preview; a scanner that can't run fails it as `preview_scanner`.
- `TestAppPreviewLifetime`: stopped at 24 h, after 2 h idle, at job end and when a newer candidate's preview starts, each followed by the `ended` report that takes the link off the card and lets `previewRetryCheck` allow Try again; data deleted each time; the fourth waits; Try again starts the next attempt once per tap and is refused after a newer candidate; a crash leaves nothing running after the runner restarts.
-- `TestAppUpgradeCheck`: run against `deployed_sha`, not `main`, when merged work never went live; a candidate whose 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.
+- `TestAppUpgradeCheck`: run against `deployed_sha`, not `main`, when merged work never went live; a candidate whose `reads` page loads but no longer shows the seed's `expect` text fails; one that adds a table passes; without a seed or `reads`, D2 shows the narrower line; it runs in the deploy's checks with no interactive preview.
+- `TestAppBuildContract`: a candidate that changes `release/app.json` gets no preview and a Put it live with the contract line; the person's tap merges it through `answerMerge`; the merged commit is checked under the new contract and, passing, deploys on the same tap without a second card; failing, the job stops with Fix it; checks, preview and deploy build the same package throughout.
+- `TestFixAfterMerge`: Fix it records one fix task in the same job from the failing findings, idempotent per tap; its own Put it live passes ancestry.
- `TestAppArtifacts`: the shipped artifact is a static ELF for the place's target and is never executed on the runner; the native twin from the same commit and flags passes the boot check; a twin that fails stops the deploy before anything is sent.
- `TestAppVersionToken`: `/version`, the release `--version` and the runner's check are the same 12 characters, and CARLOS's real probe matcher (a test against `carlos/platform`'s matcher, not a fake) accepts it and rejects an 11- or 13-character variant.
- `TestPutItLiveAuthority`: only the creator who is an owner may tap; a member sees the owner line; the snapshot binds the deploy; a place change, a binding change, the creator losing ownership and a lost credential between tap, setup, deploy and mint each refuse the next command.
- `TestAppPlaceNeverAutoMerges`: with an app place, `autoMerge` asks even with `MainShips` `no`; a merge queued before the place was confirmed is refused at `authorizeMergeLease`; the person's tap merges.
- `TestPutItLiveOneTap`: one tap merges and deploys when the trees match; with another change landed in between, the merged commit gets Checks and Review, then a second card.
-- `TestAppDeployFence`: two merged changes whose deploys run in reverse order leave the newer live and settle the older as superseded; a 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.
+- `TestAppDeployFence`: two merged changes whose deploys run in reverse order leave the newer live and settle the older as superseded; a delayed second card for an older commit, answered after a newer one went live, is refused by ancestry; a newer deploy that is "not confirmed" keeps the fence and an older one is refused; a rollback moves the generation and a deploy tapped before it is refused and re-asked; a first deploy's own start doesn't fail its region, deploy and mint checks; Try again on "not confirmed" inherits the fence; a duplicate tap starts one deploy; a restart while a command's outcome is unknown only reconciles; reconciling runs with `go_live` off and sends nothing; an owner's release after 24 hours is audited.
- `TestAppFirstDeploy` (fake carlos, its argument parsing taken from the real CLI's flag sets): `apps create --build-probe`, `apps region --set`, `deploy`, `services create`, in order, each behind its own final check; `go_live` off between create and region refuses the region; `CARLOS_CONFIG` names the runner's config and a hostile repository `.carlos/config` changes nothing; a region or target mismatch is refused; the secret only goes to the 0600 file; a taken name gets a suffix, at most three tries; a restart after `apps create` adopts the app.
- `TestAppRedeploy` (fake carlos): `deploy` with the deploy credential in the environment, never argv; `vet` is never called; each C6 row from its fake outcome, including an unconfirmed probe, and a restart mid-step that only reconciles.
- `TestAppDeployAbilityOff`: `go_live` off before each of `authorizeAppDeploy`'s checks refuses everything after it; a command already sent finishes; turning it back on deploys nothing until Try again; `build` off stops a new preview and leaves a running one to its end.
@@ -382,7 +394,10 @@ Equipo instance copy, shown in Base:
| `assistant.job.app_preview` | Try your app |
| `assistant.job.app_open` | Open your app |
| `assistant.tested.all` | Tested: it builds, its tests pass and it starts. You can try it before it goes live. |
-| `assistant.tested.upgrade` | Tested: its tests pass, it starts, and it opens your existing data (checked with sample data). You can try it before it goes live. |
+| `assistant.tested.upgrade` | Tested: its tests pass, it starts, and it still shows your existing records (checked with sample data). You can try it before it goes live. |
+| `assistant.tested.upgrade_unchecked` | Tested: its tests pass and it starts, but whether it keeps your existing data wasn't checked. |
+| `assistant.job.detail.app_failed_after` | It went in, but it didn't pass its checks afterwards, so it isn't live. |
+| `assistant.job.option.fix` | Fix it |
| `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. |
@@ -437,3 +452,15 @@ Model-facing (not copy, reviewed as code): the app contract note (A3), Review's
10. P2, idle expiry and the post-merge recheck had no states: the `ended` report and "Checking it again", with actions per D1 row (B2, D1).
11. P2, the member line named an action nobody has: members get "Only an owner of this Base can put apps live for now." and no Put it live (C1, D1, Q4).
12. P2, the region change had no final check: purpose `region` (C8, §11).
+
+**Astra, round 3 (2026-11-28): not ready, 5 P1, 4 P2.** Round 2's fixes 1, 2, 4, 6, 11 and 12 held; the rest held in part. Addressed in revision 4:
+
+1. P1, the HTTP `Refresh` header could navigate away after a form post: the proxy removes it unless same-origin, and removes `Link` headers; a browser test for exactly that (B1, §11).
+2. P1, generation equality didn't stop an older commit: ancestry against `head_sha` (what may be serving) is checked when a deploy takes the fence; rollback is the only path backwards (C3 rules 1 and 5).
+3. P1, a deploy invalidated its own generation: the tap's `seen_generation` is checked once, at the start; later commands check the generation the step allocated (C3 rules 1 and 2).
+4. P1, reconciling wasn't executable: a read-only reconcile (`GET /version`, later P-B) that needs only the fence, not `go_live`; the fence belongs to the step, so Try again is its next attempt; after 24 hours an owner may send again or release, audited (C3, C6, D1).
+5. P1, a contract-changing candidate had no merge path: its card still offers Put it live with the contract line; the tap merges, the merged commit is checked under the new contract, and the deploy follows on the same tap (A1, C1).
+6. P2, target spelling: CARLOS's `linux-arm64`, with `GOOS` and `GOARCH` derived (C2, C3).
+7. P2, failed checks after merge: "Didn't go live" with Fix it (`fixAfterMerge`) and Drop it, preview released (C1, D1).
+8. P2, the upgrade line could pass on an empty database: `reads` entries carry expected seed text, and the line is shown only with a seed and reads; otherwise a narrower line (B1, D2).
+9. P2, the persistence test promised too much: narrowed to replacing or truncating the file (§11).