spec: release preview deploys rev 2 (Astra round 1 folded in)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+242
−168
docs/superpowers/specs/2026-11-11-equipo-release-preview.md+202 −168docs/superpowers/specs/CODEX-FINDINGS-RELEASE-PREVIEW.md+40 −0
CI passed — run details
Intent
diff --git a/docs/superpowers/specs/2026-11-11-equipo-release-preview.md b/docs/superpowers/specs/2026-11-11-equipo-release-preview.md| index dde592ab..523bcc90 100644 |
| --- a/docs/superpowers/specs/2026-11-11-equipo-release-preview.md |
| +++ b/docs/superpowers/specs/2026-11-11-equipo-release-preview.md |
| @@ -1,210 +1,244 @@ |
| # Release slice: preview deploys |
| -Status: 2026-11-11, revision 1, for Astra review. Drafted by Claude (Opus |
| -5.5) on `release-preview` from main 2096af3. This slice of |
| +Status: 2026-11-11, revision 2. Drafted by Claude (Opus 5.5) on |
| +`release-preview` from main 2096af3. This slice of |
| `2026-11-11-equipo-release.md` runs ahead of the others, at Paul's |
| request: "Can we unblock it from being able to get me mockups and deploy |
| -them / the app?" Not implemented. |
| +them / the app?" |
| + |
| +Revision 1 (3bc1909) drew NOT READY from Astra in its one round. The |
| +findings are in `CODEX-FINDINGS-RELEASE-PREVIEW.md`; revision 2 takes |
| +every one, marked **(astra N)**, mostly by cutting scope. |
| + |
| +The main cut is that v1 builds nothing. A preview is the committed files |
| +of one output directory, read from git objects. Running a build command |
| +moves to v2, with the release plan's prefetch. |
| ## 0. Why, and the finish line |
| Engineering can build clickable mockups on a task branch, but Paul has |
| -no way to see them. A preview is a Carloku **temporary static site** |
| -(`tmp-*.oncarlos.com`, carlos/platform |
| -`docs/superpowers/specs/2026-09-25-temporary-static-sites-design.md`): |
| -public, self-expiring after 7 days, platform host only, at most 20 live |
| -per account. |
| +no way to see them. A preview is a Carloku **temporary static site**: a |
| +public `tmp-<name>.<region>.oncarlos.com` that moves to the Trash after 7 |
| +days. It gets the platform host only, and an account holds at most 20 |
| +(carlos/platform `docs/superpowers/specs/2026-09-25-temporary-static-sites-design.md`). |
| **Finish line:** |
| -- An approved candidate of a task whose branch has `release/preview.json` |
| - is built in the checks sandbox and published to `tmp-<task id>`. |
| -- The task card says "Preview: <link> (expires in 7 days)", and each |
| - newer approved candidate replaces it in place. |
| -- Demo: the barber mockups task (`tk5fen4uajpn`, paulca/threatmin), once |
| +- An approved candidate whose `release/preview.json` names an output |
| + directory is published to `tmp-<task id>`. |
| +- The task card says "Preview: <link> (expires in 7 days)". |
| +- A newer approved candidate replaces the preview in place. |
| +- Demo: the barber mockups task (`tk5fen4uajpn`, paulca/threatmin) once |
| Paul retries it. |
| -A preview is never called shipped, deployed or live. It is a preview. |
| +A preview is never called shipped, deployed or live. |
| ## 1. Rules |
| -1. **What can be previewed: an approved candidate only.** Equipo |
| - schedules a preview only after Review approves a candidate, and only |
| - when Engineering reported that the candidate has a valid |
| - `release/preview.json`. |
| +1. **Approved candidates only.** Equipo schedules a preview once per |
| + candidate, only after Review approves it, and only when Review's |
| + report says the candidate has `release/preview.json` |
| + (`has_preview`). |
| + - `has_preview` is scheduling evidence, not authority **(astra 3)**: |
| + the preview step reads the config again from the candidate. |
| - **Why approval, not "Paul asked":** a preview is published to the |
| open internet under Paul's account. Approval means a second model |
| - has read the change, including its preview config, before anything |
| - is built or published. |
| - - **No coordinator trigger:** the coordinator cannot ask for a |
| - preview, because its words are never authority (merge authority's |
| - rule). |
| - - **v2, "Paul asked":** a person-only Preview button on an unapproved |
| - candidate. It needs a control and copy of its own, so it is moved |
| - to v2 (§6). |
| -2. **Config.** `release/preview.json` holds `{"output": "<dir>", |
| - "build": ["argv", ...] | null}`. |
| - - `output` is a clean relative path inside the repository. |
| - - `build` is optional, at most 16 arguments, and absent for plain |
| - HTML mockups. |
| - - The runner reads the file from the candidate's tree, at most 4 KiB, |
| - decoded strictly. A file that is invalid means no preview, and the |
| - Engineering report says so. |
| -3. **Build, contained.** When `build` is set, it runs in the checks |
| - containment (`provider.BuildCheckPolicy`): no network, no provider |
| - home, no credentials, and the read-only Go root and module cache that |
| - checks get. The tree is the candidate's, in a fresh workspace. A |
| - build that fails or times out (10 minutes) ends the step `failed` |
| - with its output tail. No network means a Node build that downloads |
| - packages cannot run here. Plain files and offline builds work. |
| -4. **What crosses out.** Only the output directory crosses out, read |
| - through `os.OpenRoot` (no path leaves the tree): |
| - - regular files only; symlinks, devices and other special files are |
| - refused; |
| - - at most 2,000 files, 10 MiB each and 50 MiB in total; |
| - - the files are copied to a runner-owned staging directory outside |
| - every namespace. |
| - |
| - The runner adds `equipo-preview.json`, holding the task, candidate, |
| - tree digest and attempt. The tree digest is the SHA-256 of the |
| - sorted lines `<path> <sha256>`. The digest and counts go in the |
| - record. |
| -5. **Deploy: fixed commands, from the runner, outside the sandbox.** The |
| - credential file (`EQUIPO_PREVIEW_CREDENTIAL_PATH`, 0600) holds the |
| - Carloku service token, the console, the account and the account's |
| - platform domain. No preview is offered without it. The commands are |
| - built from these templates only, with `CARLOS_SERVICE_TOKEN` in the |
| - environment: |
| - - **First preview of the task:** `carlos deploy --temporary --ttl 7d |
| - --app <task id> --account <a> --console <c> --kind static |
| - --version <cand7>-<attempt> --no-prompt <staging dir>`. This |
| - creates `tmp-<task id>`. |
| - - **Later previews:** `carlos deploy --app tmp-<task id> --account <a> |
| - --console <c> --kind static --version <cand7>-<attempt> --no-prompt |
| - <staging dir>`, then `carlos apps ttl --app tmp-<task id> --account |
| - <a> --console <c> 7d`. |
| - |
| - Anything else is refused by the executor, before it runs. That |
| - includes delete, keep, domains, gate, assets, env, secrets and any |
| - app outside `tmp-<task id>`. A temporary app has no gate, so the |
| - deploy watch never asks for a gate pass. |
| -6. **Verified, not assumed.** After the deploy, the runner fetches |
| - `https://tmp-<task id>.<domain>/equipo-preview.json` for up to 2 |
| - minutes and requires its digest and attempt. Only then does the step |
| - report `deployed`, with the URL and an expiry 7 days from the ttl |
| - call. If the fetch never matches, the step ends `failed` |
| - (`preview_unconfirmed`), with no retry. |
| -7. **One preview per task, replaced in place.** The app name is |
| - `tmp-<task id>`. |
| - - A newer approved candidate redeploys the same app and resets its |
| - expiry, so a task never holds two previews. |
| - - If the app has expired and sits in the Trash (3 days), the next |
| - preview is refused as name taken, and the step ends `failed` |
| - (`preview_expired`). v1 does not invent a second name. |
| - - If the account holds 20 live temporary apps, the step ends `failed` |
| - (`preview_cap`), and nothing is evicted. |
| -8. **Authority before each mutation.** Before each `carlos` mutation, |
| - the runner sends a `LeaseCheck` with purpose `preview`. The |
| - instance's `authorizePreview` decides it in the write transaction and |
| - writes one audit row. It holds only when all of these are true: |
| - - the step is the current attempt and not withdrawn; |
| - - the task is not cancelled; |
| - - the candidate is still the task's newest candidate, with Review's |
| - `approve` on it; |
| - - the task's creator is still an owner on the roster; |
| - - this attempt's tree digest is the one the step reported after the |
| - build. |
| - |
| - A refusal ends the step `cancelled`, and nothing is published. |
| + has read the change and its config first. |
| + - The coordinator cannot trigger a preview. |
| + - A person's Preview button for an unapproved candidate is v2 (§6). |
| +2. **Config.** `release/preview.json` holds `{"output": "<dir>"}`. It is |
| + read from git objects, at most 4 KiB, decoded strictly. |
| + - `output` is a clean relative path that is not `.git`, and none of |
| + its parts start with `.`. |
| + - Any other field, `build` included, refuses the preview in v1 |
| + **(astra 4, cut)**. |
| +3. **Export from git objects, never the working tree (astra 4).** |
| + - The runner fetches the candidate into a private git directory, as |
| + checks do, and lists `git ls-tree -r -l <candidate> -- <output>`. |
| + - Only regular blobs (modes 100644 and 100755) are taken. A symlink |
| + (120000), a submodule, any path with a part starting with `.` |
| + (`.carlos/` included) and the reserved `equipo-preview.json` all |
| + refuse the preview. |
| + - Caps: at most 2,000 files, 10 MiB each and 50 MiB in total, all |
| + checked against the listing before any read. |
| + - Each blob is written with `git cat-file blob`, its size checked |
| + while copying, to a fresh file in a new 0700 staging directory |
| + under the runner's state, outside every workspace and namespace. |
| + No repository code runs. |
| + - The digest is the SHA-256 of the sorted lines `<path> <sha256>`. |
| + The marker `equipo-preview.json` (task, full candidate, step, |
| + attempt, digest) is written after it and is not part of it. |
| + - Every `carlos` command runs with its working directory in a fresh, |
| + empty directory. |
| +4. **Steps and authority (astra 3, 8).** The preview step runs on the |
| + primary. |
| + - **Start:** the start authorization (`LeaseCheck`) for a preview step |
| + holds only for the current attempt, not withdrawn, of a task not |
| + cancelled, whose newest candidate is the step's, approved, and |
| + whose creator is still an owner. |
| + - **Built:** after export the runner reports `preview{phase: built, |
| + digest, files, bytes}` and the instance records the digest. This |
| + report must arrive before publishing: the publish check below |
| + requires the recorded digest. |
| + - **Publish:** before each mutation, the runner sends a `LeaseCheck` |
| + with purpose `preview_publish` and the digest (a new field). The |
| + instance's `authorizePreview` repeats the start conditions, and |
| + requires the digest to equal the recorded one. It writes an audit |
| + row. |
| + - Below protocol 8 the runner never sends a preview check, so it is |
| + never downgraded into an ordinary lease. The instance places |
| + previews only on a primary at 8. |
| + - **The commitment point is the promote.** A refusal before it ends |
| + the step `cancelled`, and nothing of this candidate is served. A |
| + refusal after it cannot unpublish, and the step says so. |
| +5. **Mutations: one at a time, fixed templates (astra 1, 2, 6).** Every |
| + command runs with `CARLOS_SERVICE_TOKEN` in the environment and the |
| + account and console from the credential file. Each mutation is |
| + preceded by its own publish check, and its intent is written to the |
| + runner's step state first. |
| + |
| + | Phase | Command | |
| + |---|---| |
| + | read state | `carlos apps list`: the `tmp-<task>` line is missing, live with an expiry, live with no expiry (kept), or trashed. Anything unparseable is unknown and ends the step | |
| + | create (missing) | `carlos deploy --temporary --ttl 7d --app <task> --kind static --version p0-<step7> --no-prompt <placeholder dir>`. It creates the app, mints its host and serves a runner-written placeholder page, never repository content. Its watch probes only that page, which has no `_redirects` | |
| + | renew (live) | `carlos apps ttl --app tmp-<task> 7d`, before any content changes. The platform's printed expiry is recorded | |
| + | ship | `carlos ship --app tmp-<task> --kind static --version p-<step7>-<attempt> --no-prompt <staging dir>`. Serves nothing | |
| + | promote | `carlos promote --app tmp-<task> --no-prompt p-<step7>-<attempt> <channel>`. The channel is read from `carlos channels` | |
| + |
| + - **Refused states:** kept, trashed or unknown. Trashed ends |
| + `preview_expired`, and the step does not invent another name. |
| + - **Refusals and their reasons:** a create refused at the cap is |
| + `preview_cap`. Carloku's create budget is 50 attempts per principal, |
| + counted in memory **(astra 9)**. A refused create is reported, never |
| + retried. |
| + - **Never run:** delete, keep, domains, gate, assets, env and secrets. |
| + - **Never on another app:** no command touches any app but |
| + `tmp-<task>`. |
| + - **Versions:** each includes the preview step's id, and the record |
| + keeps the full candidate **(astra 7)**. |
| +6. **Verified, without following anything (astra 2).** After the promote, |
| + the runner fetches `https://tmp-<task>.<domain>/equipo-preview.json`. |
| + - The request refuses redirects, sends no credential, is capped at |
| + 64 KiB and retries for at most 2 minutes. |
| + - It needs HTTP 200, the task, the full candidate, the step, the |
| + attempt and the digest. |
| + - Then the step is done (`deployed`), with the URL and the platform's |
| + expiry. |
| + - Otherwise it is done with the outcome `unconfirmed` **(astra 5)**, |
| + and it is never retried. |
| +7. **Restarts (astra 5).** |
| + - A preview step that stopped before its first mutation fails |
| + `runner_restarted`, as today. |
| + - One stopped after a mutation intent was written runs again in a |
| + reconcile phase. That phase rebuilds nothing and sends nothing: it |
| + fetches the marker (rule 6), and ends `deployed` or |
| + `unconfirmed`. |
| + - **Rolling a runner back below 8:** the instance stops placing |
| + previews, every preview step settles, and the outbox drains first. |
| +8. **Ancillary (astra 7).** Preview steps never drive a task: the |
| + progress Equipo computes skips them. A failed preview leaves the task |
| + where it was, with no Needs you. |
| 9. **Audit and spend.** |
| - - Every authorization, deploy result and refusal is an audit row |
| - (`preview.authorize`, `preview.deployed`, `preview.failed`), with |
| - the task, step, candidate, app and digest, and no credential. |
| - - A preview runs no model, so its spend is no tokens. The step |
| - records its wall time and bytes, and each first preview uses one of |
| - the account's 50 temporary creates a day. |
| + - Audit rows for every check (`preview.authorize`, allowed or |
| + refused) and outcome (`preview.deployed`, `preview.unconfirmed`, |
| + `preview.failed`), with the task, step, candidate, app and digest, |
| + and no credential. |
| + - A preview runs no model, so it spends no tokens. The step records |
| + its wall time and bytes. A first preview uses one of the |
| + principal's temporary create attempts. |
| ## 2. States and the card |
| -- **The step:** a new specialist, `preview`, runs on the primary. On the |
| - timeline it shows "Built" once the output crossed out, with files, |
| - size and digest, then "Preview deployed" with the link once verified. |
| - Failures read "Preview not deployed: <reason>". |
| -- **The task card:** it gains a line from the newest deployed preview, |
| - "Preview: [tmp-….oncarlos.com](https://…) (expires in 7 days)", with |
| - the days counted down. An expired preview's line is dropped. |
| -- **Wording:** no line says shipped, deployed to production or live. |
| - |
| -## 3. Wire and versions |
| - |
| -- **Protocol 8,** `wire.ProtocolPreview`, adds: |
| - - `StepReport.has_preview` (Engineering); |
| - - `StepReport.preview` (`{app, url, version, digest, files, bytes, |
| - expires_at, phase}`, where phase is `built` or `deployed`); |
| - - the `preview` specialist and lease purpose. |
| -- **Downgrade:** `Encode` drops both fields below 8. |
| -- **Scheduling:** the instance schedules a preview only on a primary at |
| - 8, and confirms it at every lease. A primary that reconnects lower |
| - while one is queued has it settled `cancelled`, with reason |
| - `runner_outdated`, at that connection, so the queue never holds a |
| - dispatch it cannot send. |
| -- **Runner rollback:** a runner rolled back below 8 must first deliver |
| - its outbox, the rule from slice 1. |
| +- **The timeline:** "Prepared 12 files (340 KiB)." once built, then |
| + "Preview ready" with the link. An unconfirmed outcome reads "Preview |
| + could not be confirmed". A failure reads "Preview not ready: <reason>". |
| +- **The task card:** the newest `deployed` preview whose expiry is still |
| + ahead gives "Preview: <link> (expires in 7 days)". |
| + |
| +## 3. Wire |
| + |
| +**Protocol 8,** `wire.ProtocolPreview`, adds: |
| +- `StepReport.has_preview` (Review); |
| +- `StepReport.preview` (`{phase, app, url, version, digest, files, |
| + bytes, expires_at, outcome}`); |
| +- `LeaseCheck.digest`; |
| +- the `preview` specialist and the `preview_publish` purpose. |
| + |
| +**Downgrade:** |
| +- `Encode` drops the fields below 8. |
| +- A preview dispatch is never encoded below 8: `Encode` refuses it with |
| + `ErrProtocol`. |
| +- **The fence (astra 8):** when a primary connects below 8, its queued |
| + and running preview steps settle `cancelled` with `runner_outdated` |
| + (`fenceOldRunner`'s pattern), and their pending dispatch commands are |
| + retired. |
| ## 4. Permissions |
| | What | Who holds it | Paul's action | |
| |---|---|---| |
| -| Carloku credential that can create, update, ttl and read temporary apps | the primary runner, a 0600 file, never mounted into a namespace | **C6, carlos/platform#935:** a `temporary` role limited to exactly that. Until then: a dedicated Carloku account for previews, holding no other app, and an account-scoped `publish` service credential in it, used only through the executor's templates | |
| -| `EQUIPO_PREVIEW_CREDENTIAL_PATH` on the runner unit | Paul | one env line on the staging runner unit | |
| +| A Carloku credential that can create, update and ttl temporary apps | the primary runner, from a 0600 file (`EQUIPO_PREVIEW_CREDENTIAL_PATH`) never mounted into a namespace | **C6, carlos/platform#935**, asks for a `temporary` role. Until then, see below | |
| +| The runner setting | Paul | one `EQUIPO_PREVIEW_CREDENTIAL_PATH` line in the staging runner's `service.env` | |
| + |
| +**Until C6:** |
| +- **The account:** a Carloku account used only for previews. |
| +- **The credential:** `carlos services create --role publish --account |
| + <previews account> equipo-previews`. |
| +- **The file:** the token, console, account and the account's platform |
| + domain (for example `bds.oncarlos.com`). |
| -The `deploy` role cannot create apps (temporary creates need `publish`, |
| -`authcli.go:598`), so it cannot serve here. The dedicated account is the |
| -blast-radius limit until C6 lands. |
| +This credential is broad: it could also create permanent apps or keep |
| +one **(astra 1)**. The executor's templates are the only limit, and the |
| +dedicated account bounds what it can reach. A `deploy` credential cannot |
| +create apps (`authcli.go:598`), so it cannot serve here. |
| ## 5. Tests, failing first |
| -- **wire:** the downgrade below 8, decoded strictly at 7. |
| +- **wire:** the downgrade below 8, strict at 7, and a preview dispatch |
| + refused below 8. |
| - **runner:** |
| - - the config: strict decoding, its bounds, and bad paths; |
| - - the export: symlinks, special files, counts and sizes, the digest, |
| - no path leaving the tree; |
| - - the build in containment, with a fake; |
| - - the executor: the exact argv for a first and a later preview, every |
| - other verb refused, the token only in the environment; |
| - - verification, both match and mismatch; |
| - - a lease refusal before each mutation; |
| - - cap, expired and failed deploys. |
| -- **thintest contracts:** |
| - - approve with `has_preview` schedules a preview; without it, or |
| - without approval, nothing is scheduled; |
| - - a newer approved candidate replaces it; |
| - - `authorizePreview`, each condition on its own; |
| - - the card line and the timeline states; |
| + - **config:** strict decoding, unknown fields, bad paths; |
| + - **export:** symlink, submodule and dot paths, the reserved name, the |
| + caps, the digest, and the marker kept out of it; |
| + - **executor:** the exact argv of each phase, the token only in the |
| + environment, the working directory, each state of `apps list`, a |
| + publish check refused before each mutation; |
| + - **verification:** a match, a mismatch, and a redirect refused; |
| + - **reconcile:** after a restart. |
| +- **thintest:** |
| + - an approval with `has_preview` schedules one preview, and only one |
| + per candidate; without either, none; |
| + - a newer approved candidate schedules another; |
| + - each start and publish condition, one at a time; |
| + - the digest is bound; |
| + - a preview never sets Needs you or moves the stage; |
| + - the card line and the timeline; |
| - the audit rows; |
| - - a protocol 7 primary gets no preview. |
| -- **Mutations:** each rule 8 condition, the export bounds, the allowlist |
| - and the verification are broken once, and each test is seen to fail. |
| + - the fence for a protocol 7 primary. |
| +- **Mutations:** each authority condition, each export guard, the |
| + allowlist, the verification checks and the ancillary rule are broken |
| + once, and each test is seen to fail. |
| -## 6. Out of scope, and v2 |
| +## 6. Out of scope, v2 |
| -- A person's Preview button for an unapproved candidate. |
| -- Builds that need the network (Node installs, for example): they need |
| - the release plan's prefetch slice. |
| +- Build commands, which need the release plan's prefetch and contained |
| + build. |
| +- A person's Preview button. |
| - A second name after an expired preview. |
| -- Deleting a preview when its task ends: it expires on its own. |
| -- Previews of binary apps. |
| +- Deleting a preview when its task ends; it expires on its own. |
| -## 7. Copy (for delegated review) |
| +## 7. Copy (Astra's delegated verdicts applied) |
| | Key | Text | |
| |---|---| |
| | `work.specialist.preview` | Preview | |
| -| `work.tl.preview_built` | Built %d files (%s). | |
| -| `work.tl.preview_deployed` | Preview deployed | |
| +| `work.tl.preview_built` | Prepared %d files (%s). | |
| +| `work.tl.preview_ready` | Preview ready | |
| +| `work.tl.preview_unconfirmed` | Preview could not be confirmed | |
| +| `work.tl.preview_failed` | Preview not ready: %s. | |
| | `work.card.preview` | Preview: %s (expires in %s) | |
| -| `work.reason.preview_cap` | the account already holds 20 previews | |
| +| `work.reason.preview_cap` | the account already has 20 previews | |
| | `work.reason.preview_expired` | this task's preview expired and its name is still taken | |
| -| `work.reason.preview_unconfirmed` | the preview did not answer with this build | |
| -| `work.reason.preview_build` | the preview build failed | |
| -| `work.reason.preview_too_large` | the preview is larger than 50 MiB or 2,000 files | |
| -| `work.reason.runner_outdated` | the runner is too old for previews | |
| +| `work.reason.preview_config` | release/preview.json is not one this version can use | |
| +| `work.reason.preview_too_large` | the preview exceeds 2,000 files, 10 MiB per file or 50 MiB in total | |
| +| `work.reason.preview_state` | Equipo could not read the preview's state | |
| +| `work.reason.runner_outdated` | the runner needs an update for previews | |
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-RELEASE-PREVIEW.md b/docs/superpowers/specs/CODEX-FINDINGS-RELEASE-PREVIEW.md| new file mode 100644 |
| index 00000000..f13a9ade |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-RELEASE-PREVIEW.md |
| @@ -0,0 +1,40 @@ |
| +NOT READY |
| + |
| +Read-only review of HEAD `3bc1909`. No files changed, tests run, network access, or other reviewers. |
| + |
| +1. **Critical: the command allowlist does not enforce mutation authority.** `deploy` can enable instances and create a route, beyond create/upload/promote ([platform/deploy.go:1081](/home/paulca/amadan.net/carlos/platform/deploy.go:1081)). Upload and promotion happen inside one invocation, without another Equipo authorization ([platform/deploy.go:502](/home/paulca/amadan.net/carlos/platform/deploy.go:502)). Withdrawal during upload can therefore precede publication. Replace the composite command with explicit, individually authorized operations. Define authorization immediately before publication as the commitment point; cancellation afterward cannot guarantee “nothing is published.” |
| + |
| + The dedicated-account `publish` credential is acceptable as a temporary, explicitly broad credential **after these executor fixes**. It grants permanent creation and `keep`, too; the server does not enforce the proposed temporary-only restriction ([platform/authcli.go:593](/home/paulca/amadan.net/carlos/platform/internal/console/authcli.go:593)). |
| + |
| +2. **Critical: repository redirects can reach the runner’s network.** Static `_redirects` supports external destinations and forced redirects over existing files ([platform/redirects.go:19](/home/paulca/amadan.net/carlos/platform/internal/edge/redirects.go:19)). Deploy’s watch uses an HTTP client with default redirect following ([platform/deploy.go:1728](/home/paulca/amadan.net/carlos/platform/deploy.go:1728)). A repository can redirect its probe to a runner-local service. Cut deploy’s watch; use a bounded, credential-free marker fetch that refuses redirects, requires HTTP 200, and checks task, full candidate, attempt and digest. |
| + |
| +3. **Important: authorization before building is underspecified.** The proposed digest condition cannot hold before the build, while ordinary start authorization checks assignment/withdrawal but not preview approval ([runners.go:584](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/equipo/chat/runners.go:584)). Specify a start check for the exact approved candidate, followed by publication authorization against its persisted, acknowledged build digest. Re-read config from that candidate; Engineering’s `has_preview` is scheduling evidence, not authority. |
| + |
| +4. **Important: export needs an explicit safe sequence.** `os.OpenRoot(outputPath)` follows symlinks in the root path itself; root methods also follow internal symlinks ([Go root.go:41](/usr/local/go/src/os/root.go:41), [root.go:79](/usr/local/go/src/os/root.go:79)). Open the trusted workspace root first, reject symlinks in every output-path component, and export only after proven namespace termination. `runGate` exposes that proof separately from exit code ([judge.go:485](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/runner/thin/judge.go:485)). Enforce byte limits while copying, create fresh files in a private staging directory outside every mounted tree, and keep CLI working-directory/config discovery outside repository content. Reserve the marker filename and exclude it explicitly from its own digest. |
| + |
| +5. **Important: failure does not establish nonpublication.** Promotion precedes CLI verification ([platform/deploy.go:508](/home/paulca/amadan.net/carlos/platform/deploy.go:508)); recovery currently turns ordinary interrupted steps into `runner_restarted` ([step.go:380](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/runner/thin/step.go:380)). Persist mutation intent and immutable artifact identity before sending. After timeout, cancellation or restart, reconcile through reads; do not rebuild or blindly republish. Keep an explicit unconfirmed outcome, including for withdrawn attempts. An empty outbox alone is insufficient for rollback: stop dispatch, settle active previews and host processes, then drain reports before replacing the binary. |
| + |
| +6. **Important: lifecycle handling must precede replacement.** TTL renewal is needed for sliding expiry and safely refuses permanent/trashed apps ([platform/apitemporary.go:262](/home/paulca/amadan.net/carlos/platform/internal/console/apitemporary.go:262)). But renewing **after** publication can fail after content changed. Check lifecycle first, renew before publication, and use the platform’s returned expiry; initial creation has no separate TTL call. Refuse kept apps despite their `tmp-` name. Distinguish missing, live, Trash and unknown states; never infer absence from an error. The 20 cap applies to creation, not replacement ([apitemporary.go:165](/home/paulca/amadan.net/carlos/platform/internal/console/apitemporary.go:165)). |
| + |
| +7. **Important: version names and scheduling need uniqueness.** Attempts belong to steps, so `<cand7>-<attempt>` is not globally unique within a task. Carloku refuses changed bytes under an existing version ([platform/release.go:807](/home/paulca/amadan.net/carlos/platform/internal/release/release.go:807)). Use the preview step ID plus attempt, retaining the full candidate in the record. Schedule once per candidate. Keep previews ancillary: advancement currently depends on the last step completing, so a failed preview could block merge progression ([review.go:182](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/equipo/chat/review.go:182)). |
| + |
| +8. **Important: protocol 8 needs refusal semantics, not just field stripping.** `LeaseCheck` has no digest field ([frames.go:361](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/wire/frames.go:361)); define its binding to the acknowledged build record. Refuse preview execution on either peer below 8, including an already-running attempt. Never downgrade preview authority into an ordinary lease. Fence queued **and running** steps and retire pending dispatch commands before replay, following [mergeauth.go:458](/home/paulca/amadan.net/oficina/equipo-release-preview/internal/equipo/chat/mergeauth.go:458). Test reconnect, held dispatch and rollback, alongside strict field downgrade. |
| + |
| +9. **Minor: correct the budget claim.** It is 50 create **attempts per principal**, including refused requests, not 50 successful creates per account ([platform/authcli.go:124](/home/paulca/amadan.net/carlos/platform/internal/console/authcli.go:124)). The limiter is in memory, so it is not a durable daily spending guarantee ([authcli.go:216](/home/paulca/amadan.net/carlos/platform/internal/console/authcli.go:216)). Describe that limit accurately and handle refusal without automatic retries. |
| + |
| +Copy verdicts for section 7: |
| + |
| +| Key | Verdict | |
| +|---|---| |
| +| `work.specialist.preview` | ACCEPT | |
| +| `work.tl.preview_built` | “Prepared %d files (%s).” | |
| +| `work.tl.preview_deployed` | “Preview ready” | |
| +| `work.card.preview` | ACCEPT, using confirmed expiry | |
| +| `work.reason.preview_cap` | “the account already has 20 previews” | |
| +| `work.reason.preview_expired` | ACCEPT, only after confirming Trash/name occupancy | |
| +| `work.reason.preview_unconfirmed` | “we could not confirm the preview” | |
| +| `work.reason.preview_build` | ACCEPT | |
| +| `work.reason.preview_too_large` | “the preview exceeds 2,000 files, 10 MiB per file or 50 MiB in total” | |
| +| `work.reason.runner_outdated` | “the runner needs an update for previews” | |
| + |
| +Also replace section 2’s “Preview not deployed” with “Preview could not be confirmed” for uncertain publication outcomes. |
| \ No newline at end of file |