spec: Equipo release plan rev 2 (Astra round 1 findings)
Contained build and smoke as data, so the release host runs no repository code; a fixed executor command allowlist. A per-project release lock taken by merge and release dispatch, authorizeRelease before every mutation, approvals bound to target, digests and grant revision, and reconciliation of unknown outcomes. Production gets the staging-verified bytes, never a rebuild. Four release steps with a frozen runner set and one timeout table. Corrected wire.Encode claim. Rollback only with compatibility proof. Scope cut and v2 list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+349
−290
docs/superpowers/specs/2026-11-11-equipo-release.md+349 −290
CI failed — run details
diff --git a/docs/superpowers/specs/2026-11-11-equipo-release.md b/docs/superpowers/specs/2026-11-11-equipo-release.md| index a667cb66..90c334ba 100644 |
| --- a/docs/superpowers/specs/2026-11-11-equipo-release.md |
| +++ b/docs/superpowers/specs/2026-11-11-equipo-release.md |
| @@ -1,8 +1,10 @@ |
| # Equipo release, thin v1: plan for approval |
| -Status: 2026-11-11, plan only, nothing built. Drafted by Claude (Opus 5.5) |
| -on `release-plan` from main d4b1414. Every security-sensitive slice below |
| -gets its own spec and Astra review before it is built. Builds on merge |
| +Status: 2026-11-11, revision 2, plan only, nothing built. Drafted by |
| +Claude (Opus 5.5) on `release-plan` from main d4b1414. Revision 1 |
| +(339c9e8) drew NOT READY from Astra round 1; §9 maps each finding. Every |
| +security-sensitive slice gets its own spec and Astra review before it is |
| +built. Builds on merge |
| authority (`2026-11-11-equipo-merge-authority.md`), thin v1 §3 and §8, |
| and Mac runners (`2026-11-07-equipo-mac-runners.md`). |
| @@ -49,10 +51,12 @@ failures. |
| modules are not the main problem (docs-t1's cache holds main's modules |
| and the pinned tools): Equipo's gate is a hosted-CI gate and cannot |
| pass offline as written. |
| -2. **Engineering cannot run Go tests at all.** Its namespace has no Go |
| - root and no module cache. Its relay allows only the provider host |
| - (`egress/policy.go:35`, which answers 403 to any other host). The |
| - branch's `docs/project-rename-delivery.md` records this. |
| +2. **Engineering cannot fetch modules.** It can run what needs nothing |
| + downloaded (the branch's `docs/project-rename-delivery.md` records a |
| + standalone template test passing), but its namespace has no module |
| + cache and its relay allows only the provider host |
| + (`egress/policy.go:35`; any other host gets 403), so package suites |
| + that need modules could not run. |
| **How releases happen today.** Entirely by hand, by a controller agent |
| using Paul's owner login. |
| @@ -75,9 +79,12 @@ using Paul's owner login. |
| lives. |
| **Runner updates and compatibility today.** |
| -- **Protocol:** each side speaks the lower of the two (`wire.Spoken`); |
| - `wire.Encode` strips unknown fields. `ProtocolCurrent` is 4; automatic |
| - merges need 4. |
| +- **Protocol:** each side speaks the lower of the two (`wire.Spoken`). |
| + `wire.Encode` (`wire/runners.go:365`) removes only the fields each |
| + explicit downgrade step names; it does not strip unknown fields, and |
| + `wire.Strict` (`wire/api.go:461`) rejects them. So a new frame field |
| + without a protocol bump and a downgrade step can break a connection. |
| + `ProtocolCurrent` is 4; automatic merges need 4. |
| - **Mac:** `macUpdater` follows `Welcome.Release` (the instance's |
| BuildVersion), fetches the manifest and binary from the instance, |
| checks the SHA-256 from that same manifest (no signature), swaps under |
| @@ -91,9 +98,19 @@ using Paul's owner login. |
| - **Migrations:** forward-only, at boot. An older binary ignores newer |
| applied migrations (rastrillo `migrate/apply.go:119`), so a binary |
| rollback is safe only when the new migrations are additive. |
| -- **The rename change across versions:** a new instance with an old |
| - runner never offers the tool; an old instance with a new runner |
| - refuses it as unknown. Harmless, but the feature needs both new. |
| +- **The rename change across versions:** the tool travels in the |
| + existing tool-call envelope (a name string), so no frame changes. A |
| + new instance with an old runner never offers the tool; an old instance |
| + with a new runner refuses it as unknown. Harmless, but the feature |
| + needs both new. |
| +- **Carloku `deploy` role:** ship, promote and rollback on its rungs, |
| + the reads `carlos deploy` needs, and also assets purge and the deploy |
| + watch's gate pass (`internal/console/authcli.go:784`). No logs, env, |
| + secrets, database or `stable`. |
| +- **Amadan hosted CI has no per-run artifacts.** The only artifact path |
| + is a tagged release, which needs a writer token inside the job |
| + (`internal/hub/releases_api.go`). So it cannot hand Release a build |
| + without giving repository code a credential. |
| ## 2. Proposed design |
| @@ -105,299 +122,341 @@ using Paul's owner login. |
| | Checked | checks `passed` on that SHA | `chat_steps.checks` | |
| | Reviewed | `approve` on that SHA | `chat_steps.verdict` | |
| | Merged | the hub merged it | `chat_tasks.merged_sha`, `chat_merge_audit` | |
| -| Deployed | a target serves a release that contains the merge, and its `/api/version` says so | `chat_release_targets` (new) | |
| -| Verified | that target's smoke checks passed and every connected runner reports the version | `chat_release_targets` (new) | |
| - |
| -The task stage `done` keeps meaning merged; no new stages. The card shows |
| -a derived line ("Merged, not released yet", "On staging, verified", |
| -"Live, verified"). The words "shipped" and "live" come only from a |
| -verified production target. Copy goes through copy review. |
| - |
| -### 2.2 The Release specialist and its authority |
| - |
| -One coordinator. Release is a specialist like Checks and Merge: its |
| -steps are code the runner runs, outside every namespace, after a pure |
| -instance gate `releasegate.Decide` (the mergegate pattern: code decides, |
| -no model output can make it deploy, every call writes one audit row). |
| -Its model (preference: the coordinator's family, low effort) only words |
| -the release notes and failure reports from the record; it has no tools |
| -that change anything. |
| - |
| -Release may, within its grants: build a SHA that is on main; deploy and |
| -roll back `equipo-staging`; run staging smoke checks; ask for production. |
| -It may never: build a task branch; deploy without a passing release |
| -record; change env, secrets or app settings; deploy production without |
| -an approval for that release. The deploy credential stays in a 0600 file |
| -read by the runner process and is never mounted into a namespace. |
| -Engineering holds no release capability, and no specialist may own both |
| -a step that writes code and the `release` step. |
| - |
| -`releasegate.Decide` inputs: SHA reachable from the forge's main; hosted |
| -CI `passed` on that exact SHA; every task merged since the target's last |
| -known-good has a `merged` audit row from `authorizeMerge`; no merge step |
| -queued or running and no other release in flight for the target (§10a); |
| -migration class; wire class; grants; approvals. `never` on any missing |
| -fact; `ask` for production, breaking migrations or a wire change without |
| -a protocol bump; `act` otherwise. |
| - |
| -### 2.3 The release record |
| - |
| -Migration, additive: `chat_releases` (id, project, SHA, version, the |
| -tasks it contains, hosted CI run and result, the merge audit ids, the |
| -artifact digests from `staged-artifacts.py` (instance, Linux runner, |
| -tool proxy, Mac runner, manifest), provenance (`vcs.revision`, |
| -`vcs.modified`), migrations added since last known-good with their |
| -class, `ProtocolCurrent`, wire class, notes); `chat_release_targets` (release, |
| -target `staging|production`, state, previous version, restore point, |
| -runner versions seen, smoke results, timestamps); `chat_release_audit` |
| -(append only, kinds `decision`, `approval`, `deploy`, `verify`, |
| -`rollback`, `grant`). Last known-good for a target is its newest |
| -`verified` release. |
| - |
| -Migration class: only `CREATE TABLE`, `CREATE INDEX` and |
| -`ALTER TABLE ... ADD COLUMN` count as additive; anything else, or a file |
| -the classifier cannot read, is `breaking`. Wire class: a generated |
| -`internal/wire/surface.json` (tools, frames, fields), checked in CI; |
| -changed between last known-good and the SHA without a protocol bump |
| -means `mixed_window`, stated on the card. |
| - |
| -### 2.4 Staging first, with smoke tests |
| - |
| -1. A merge lands. Release waits for hosted CI on main's head (the forge |
| - reports per branch head, so a newer head supersedes an older one). |
| - Red means no release; the card says what failed and that nothing |
| - changed. |
| -2. Build: `release-isolated.sh` as today, from a fresh clone at the SHA; |
| - once 1b lands, inside the offline check profile with the prefetched |
| - module cache. Digests and provenance go into the record. |
| -3. Deploy: `carlos deploy --app equipo-staging --target linux-arm64 |
| - --swap hold --version <v>` with the staging `deploy` credential, no |
| - env or secret changes. Staging is where Paul works, so the gate's "no |
| - merge or release in flight" holds; turns carry on across the swap. |
| - State `deploying`. |
| -4. Instance check: `/api/version` equals the version, `/healthz` ok, |
| - within 2 minutes. State `verifying`. |
| -5. Smoke: a `smoke` scenario set in `internal/headless` (minutes, not |
| - the 90-minute suite) as the suite person, plus any staging scenario |
| - the change itself added and Review approved. The rename change adds |
| - one (§5). |
| -6. Runners follow (2.5). Verified when smoke passed and every connected |
| - staging runner reports the version. |
| -7. Failure at 3 or 4 with nothing promoted: `failed`, what serves now is |
| - read back and reported. Failure at 4 to 6 after promote: rollback |
| - (2.7). No automatic retry of a deploy, ever; Retry is a person's tap. |
| - |
| -### 2.5 Instance and runner ordering, protocol |
| - |
| -Instance first, then runners, always. Runners follow the instance's |
| -release (`Welcome.Release`), up and down, so a runner is never newer than |
| -its instance for long. Linux self-update (the queued item, folded in |
| -here) is `macUpdater`'s shape plus four things: the runner tells the |
| -instance it is updating, and the instance stops placing new steps and |
| -turns on it; it waits for running attempts and turns to end, never |
| -kills them, and reports "waiting for a step" after 30 minutes; the new |
| -binary's `verify-installed` must pass before the switch; the unit runs |
| -`releases/current/equipo-runner` (a symlink swapped atomically), exits 75 |
| -and systemd restarts it. The previous release stays on disk. A runner not |
| -back at the version within 10 minutes leaves the target at `deployed, |
| -runners behind`, never `verified`. The release step itself runs on the |
| -owner's staging runner, which the release updates: the step ends at |
| -`deployed` before that runner updates, and the instance, not the |
| -runner, marks `verified` when the runners' hellos report the version. |
| - |
| -Protocol stays "lower of the two". A wire change with a protocol bump is |
| -gated as today (capability named in code); `mixed_window` is allowed only |
| -when additive (a new tool, an optional field) and the card says the |
| -feature works once runners update. |
| - |
| -Pinned Claude Code and Codex versions (the queued item): an ordinary |
| -Equipo task bumps the pins in the manifest. Its runner update refuses at |
| -`verify-installed` until the host has the new CLI, and the card says |
| -which binary to install where. |
| - |
| -### 2.6 Production gating |
| - |
| -Target: Carloku app `equipo`, account `oficina`, console |
| -`console.carloku.com`, channel `edge`, host `equipo.bds.oncarlos.com`; |
| -runner `equipo-runner.service` on docs-t1, plus the Mac worker when |
| -connected. Production needs, in order: the thin cutover done (decision |
| -D1); Paul's approval of the `release.production` capability and the |
| -production credential; and, in v1, an approval card per release: |
| -"Release 9f3c1a2 to Equipo production? Verified on staging at 15:40: |
| -smoke 9 of 9, runners 2 of 2. Contains: Add project rename. Migrations: |
| -none. [Release] [Not now]". Then the staging steps 2 to 6 against |
| -production, with production smoke read-only: version, health, runners at |
| -the version, and, until production has a test person (D5), Paul's one |
| -tap confirming the behaviour. |
| - |
| -### 2.7 Rollback and migrations |
| - |
| -- Last known-good is kept per target, and its artifacts stay in the |
| - instance's release list and on the runner's disk. |
| -- Fails after promote, migrations `none` or `additive`: Release promotes |
| - the last known-good version explicitly (`carlos promote --app <a> <v> |
| - edge`, a `deploy` door), runners follow back, Release checks |
| - `/api/version` and runner versions, state `rolled_back`. Once; the |
| - failed release is not retried. |
| -- Migrations `breaking`: the gate asks before deploying and the card says |
| - rollback means restoring the database. On failure, no automatic |
| - rollback: Paul gets a card. A database restore is the platform's |
| - (instance restore #658, inert today; until then `db pull --at` and a |
| - restore by hand). |
| -- Every failure report says what failed, where it stopped, what is |
| - serving now and what Equipo did about it. A fix is proposed as a task, |
| - never started on its own. |
| - |
| -### 2.8 UI states |
| - |
| -One release card per release and target in the conversation of each |
| -task creator it contains, updated by revision, headed with project, |
| -task and version: "Equipo · Add project rename · release 9f3c1a2 · |
| -staging" (the version is main's SHA at the merge, not the task's). States: queued, building, deploying, verifying (n of m), |
| -deployed (runners k of n), verified, failed, rolled back (to v). Task |
| -cards carry the lifecycle line of 2.1. The project page gains "Releases": |
| -last known-good per target and the last five releases with reasons. |
| - |
| -### 2.9 Specialists as data |
| - |
| -Table `chat_specialists`: name, brief (<= 2 KB), steps it owns (from a |
| -code list; v1 assignable: `release`), tools (from the code's tool menu), |
| -model preference, capabilities (from the menu), state `proposed | |
| -active | retired`, revision, `approved_by`. Engineering, Review and |
| -Checks stay in code and are shown in the same shape, read only. |
| - |
| -Capability menu (code, fixed): `release.build`, `release.staging` |
| -(deploy and roll back staging), `release.smoke_staging`, |
| -`release.production` (each use needs an approval), `runner.update` |
| -(announce a release to runners). Nothing else exists to grant. |
| - |
| -Tool `propose_specialist{...}`: the instance validates every field |
| -against the menus and refuses anything outside them, then posts an |
| -ask-once card with the capabilities in plain words, "Add a Release |
| -specialist to Equipo? It may build releases of oficina/equipo from main, |
| -deploy them to equipo-staging and roll staging back, and must ask you |
| -before production. [Add] [Not now]". Only an owner's Add makes it active |
| -and writes `chat_capability_grants` (specialist, capability, scope, |
| -granted_by, at, revoked_at) with an audit row. The coordinator may |
| -narrow, never widen (merge policy's rule). Every use of a capability |
| -writes an audit row. A proposal naming a step the code cannot run is |
| -refused with a plain reason. |
| +| Deployed | a target serves a release containing the merge, with the recorded version and instance digest | `chat_release_targets` (new) | |
| +| Verified | that target passed every release step of §2.4 | `chat_release_targets` (new) | |
| + |
| +Task stage `done` keeps meaning merged; no new stages. Cards show a |
| +derived line ("Merged, not released yet", "On staging, verified", "Live, |
| +verified"). "Shipped" and "live" come only from a verified production |
| +target. Copy goes through copy review. |
| + |
| +### 2.2 Two rules: no repository code with credentials, one door |
| + |
| +**Isolation.** The release host never runs repository-controlled code. |
| +- **Build** runs inside the existing checks containment |
| + (`provider.BuildCheckPolicy`): no network, no provider home, no |
| + credentials, read-only Go root and a prefetched module set (§2.7), the |
| + pinned provider binaries mounted read-only for the manifest pins, and |
| + one writable output directory. It runs `make release-in-tree` at the |
| + SHA in a fresh clone. Only files in the output directory cross out; |
| + the executor hashes them and checks `go version -m` (`vcs.revision` |
| + is the SHA, `vcs.modified` false) outside. |
| + Preferred later: hosted CI builds on single-use machines, which needs |
| + per-run artifacts from amadan (request A1, §3). |
| +- **Feature smoke** is data, not code: `release/smoke.json` in the |
| + repository lists API v1 requests (method, path, body, expected status |
| + and JSON fields) made as the staging suite person. The executor |
| + interprets this fixed format, against the staging origin only, and |
| + runs nothing from the repository. |
| +- **The executor** runs only these commands, built from fixed templates |
| + with the release record's values: `carlos deploy --app <target> |
| + --account oficina --target linux-arm64 --swap hold --version <v> |
| + --timeout 5m --no-prompt <artifact>`, `carlos promote --app <target> |
| + <v> edge`, `carlos channels`, `carlos releases`, and GETs of |
| + `/api/version`, `/healthz` and a new `/api/version/digest` (the |
| + instance's own executable digest). Never assets purge, gate pass, env, |
| + secrets or anything else, though the `deploy` role admits the first |
| + two (request C4 narrows it). |
| + |
| +**One door.** `authorizeRelease(release, target, action)` runs in the |
| +write transaction immediately before every external mutation (deploy, |
| +promote, rollback, runner update announcement), like `authorizeMerge` |
| +(`mergeauth.go:401`). It rebuilds the inputs and writes one audit row. |
| +It requires, all at once: |
| +- this release holds the project's release lock (§2.3); |
| +- the SHA is reachable from the forge's main, and hosted CI passed on |
| + that exact SHA in the project's own repository (§2.7); |
| +- every task merged since the target's last known-good has a `merged` |
| + audit row from `authorizeMerge`; |
| +- the artifact digests equal the record's, and for production equal the |
| + digests staging verified; |
| +- the Release grant is active at the revision the approval names, the |
| + approver is still an owner, nothing was revoked; |
| +- for production, an approval bound to target (app, account, host, |
| + instance id), artifact digests, release id and grant revision. |
| + |
| +Any difference refuses the action and the release stops where it is. |
| +No model output reaches this function. |
| + |
| +### 2.3 Lock, record and uncertain outcomes |
| + |
| +**Release lock.** One row per project, `chat_release_locks(project_id, |
| +holder_kind merge|release, holder_id, taken_at)`. Merge dispatch and |
| +release dispatch both take it in their dispatch transaction and refuse |
| +when another holds it. A merge holds it until the merge step settles; a |
| +release holds it from its first mutation until it ends `verified`, |
| +`failed`, `rolled_back`, or until Paul resolves an `uncertain` one. The |
| +lock replaces "no merge in flight" (merge authority §10a). |
| + |
| +**Release record** (additive migration): `chat_releases` (project, SHA, |
| +version, contained tasks, hosted CI repository, run and result, merge |
| +audit ids, artifact digests for instance, Linux runner, tool proxy, Mac |
| +runner and manifest, provenance, migration class, compatibility |
| +evidence (§2.6), protocol, required runner set) and |
| +`chat_release_targets` (target, state, previous version, restore |
| +evidence, step results, timestamps). Plus `chat_release_audit`, append |
| +only. Last known-good per target is its newest `verified` release. A |
| +seed record, made by hand once from `staged-artifacts.py record`, makes |
| +42a31cb staging's first known-good. Production gets its own after the |
| +cutover. |
| + |
| +**Unknown outcomes.** A deploy whose answer is lost, times out or is |
| +unclear is never retried. The executor reconciles by reading `carlos |
| +channels` and the instance's `/api/version` and digest. |
| +- Both show the new version and digest: continue. |
| +- Both show the previous one: `failed`, nothing changed, the lock is |
| + released. |
| +- Anything else, or reads that fail: `uncertain`. The lock is held and |
| + Paul gets a card with what each read said. |
| + |
| +A person's Retry is a new `authorizeRelease`, never a replay. |
| + |
| +### 2.4 Steps, ordering and one timeout model |
| + |
| +A release is four steps per target. Each is its own row, and a later one |
| +starts only after the earlier passed. |
| + |
| +| Step | Passes when | Limit, then | |
| +|---|---|---| |
| +| 1 Instance health | after promote, `/api/version`, digest and `/healthz` match | 2 min, then rollback or `uncertain` (§2.6) | |
| +| 2 Controller handoff | the release step ends on its runner and the instance takes over the release; nothing more runs on the releasing runner | immediate | |
| +| 3 Runner convergence | every runner in the required set reports the version in its hello | 45 min, then `runners_behind` (not verified, Paul's card, no rollback) | |
| +| 4 Feature smoke | `release/smoke.json` passes against the target | 10 min, then rollback or `uncertain` | |
| + |
| +The required runner set is frozen in the record when the release starts: |
| +the runners enrolled to the target that were connected in the previous |
| +24 hours. A runner that disconnects does not leave the set. |
| + |
| +Runners update in their own window. Each one waits for its running |
| +steps and turns, never kills them, and announces that it is updating, so |
| +the instance places nothing new on it. The 45 minutes covers that wait. |
| +The releasing runner updates last, as a short follow-up the instance |
| +owns after step 2. Feature smoke runs after convergence, because a |
| +change like rename needs both sides new. |
| + |
| +Ordering is instance first, then runners. Runners follow the instance's |
| +release, up or down. |
| +- **Staging (slice 5):** staging runners self-update the way |
| + `macUpdater` does, plus `verify-installed` before the switch and a |
| + `releases/current` symlink with exit 75. |
| +- **Until slice 5:** a person runs `staging-thin.py runner`, and step 3 |
| + checks the result the same way. |
| +- **Production v1:** runners are updated by a person with the existing |
| + recipe. Self-update waits for signing (D6). |
| + |
| +### 2.5 Compatibility |
| + |
| +- Any new or changed frame field needs a protocol bump, a downgrade step |
| + in `wire.Encode`, and mixed-version tests in both directions, as |
| + merge facts did. |
| +- New tools carried in the existing tool-call envelope need no bump. The |
| + record notes a mixed window in which the feature waits for runners. |
| +- A generated `internal/wire/surface.json` (frames, fields, tools), |
| + checked in CI, makes a field change without a bump fail CI. |
| + |
| +### 2.6 Rollback |
| + |
| +Automatic rollback (promote the last known-good, then steps 1 and 3 back |
| +at it, state `rolled_back`, once) happens only when the record proves |
| +backward compatibility. All three must hold: |
| +1. The migration class is `none`, or it is `additive` by an explicit |
| + classifier. Only `CREATE TABLE`, `CREATE INDEX` and `ADD COLUMN` |
| + count, with no new `NOT NULL` without a default and no new |
| + constraint on an existing table. Anything else is `breaking`. |
| +2. A CI test boots the previous known-good build against the new schema |
| + and passes its smoke. The evidence is bound to both SHAs. |
| +3. The runner state version (a constant stamped on the runner's state |
| + directory) is unchanged. |
| + |
| +Otherwise: |
| +- **Breaking:** a release needs restore evidence before it goes out: |
| + Paul's backup, plus a `db pull --at` restore point opened and |
| + integrity-checked. A failure goes to Paul and never rolls back |
| + automatically. |
| +- **Failed promotion or failed health:** boot migrations may already |
| + have run, so the outcome is `uncertain` unless items 1 to 3 hold. |
| +- **Every report** says what failed, where it stopped, what is serving |
| + now and what Equipo did. A fix is proposed as a task, never started on |
| + its own. |
| + |
| +### 2.7 Checks |
| + |
| +- **Hosted CI where the project has it.** Checks records hosted CI's |
| + verdict with its repository, branch, run and SHA. The verdict counts |
| + only when the repository is the project's own on the instance and the |
| + SHA is the candidate exactly; `checks_sandbox` is `hosted`. The rename |
| + task's next Checks then reports `failed`. |
| +- **Prefetch for projects without it, and for the build.** `go mod |
| + download` from the SHA's `go.mod` and `go.sum`, in a namespace whose |
| + relay allows only `proxy.golang.org` and `sum.golang.org`, with: |
| + - `GOPROXY=https://proxy.golang.org` (no `direct`) and |
| + `GOSUMDB=sum.golang.org`; |
| + - `GOPRIVATE`, `GONOSUMDB` and `GOINSECURE` empty, `GOVCS=*:off`, |
| + `GOTOOLCHAIN=local`, `GOENV=off`, `GOFLAGS=-mod=readonly`, and no |
| + `GIT_*` variables; |
| + - a cap on bytes and time. |
| + |
| + The result is a runner-owned cache mounted read-only. |
| +- **CLI pin changes** (Claude Code, Codex, bubblewrap) move provider |
| + containment assumptions, so they are security-reviewed changes, never |
| + routine. |
| + |
| +### 2.8 Release specialist, specialists as data, UI |
| + |
| +- **Release** is one specialist under the one coordinator. Its steps are |
| + the executor's code. Its model (preference: the coordinator's family, |
| + low effort) only writes reports from the record, and it has no |
| + mutating tools. |
| +- **Engineering** holds no release capability. No specialist may own |
| + both a step that writes code and `release`. |
| +- **`chat_specialists`** holds: name, brief (up to 2 KB), owned steps |
| + (from a code list; v1 can assign `release` only), tools (from the |
| + code's menu), model preference, capabilities, state, revision and |
| + approver. The built-in specialists are shown in the same shape, read |
| + only. |
| +- **The capability menu is fixed in code:** `release.build`, |
| + `release.staging` (deploy and roll back staging), `release.production` |
| + (an approval for every use) and `runner.update`. |
| +- **`propose_specialist`** validates a proposal against the menus and |
| + posts an ask-once card. Only an owner's Add writes the grants: |
| + `chat_capability_grants`, scoped and revocable, with a revision and an |
| + audit row. The coordinator can narrow a grant, never widen it. Every |
| + use is audited, with the current owner checked at use. |
| +- **UI:** |
| + - one release card per release and target in each contained task |
| + creator's conversation, headed with project, task and version (main's |
| + SHA); |
| + - the states queued, building, deploying, health, runners k of n, |
| + smoke, verified, failed, rolled back, uncertain; |
| + - task cards carry the line from §2.1; |
| + - the project page lists the last known-good per target. |
| ## 3. Permissions |
| | What | Who holds it | Where | Paul's action | |
| |---|---|---|---| |
| -| Carloku `deploy` credential, `--app equipo-staging --rungs edge` | the release runner (below) | 0600 file under that runner's root, `release/`, never in a namespace | mint: `carlos services create --role deploy --app equipo-staging --account oficina --rungs edge equipo-release-staging` | |
| -| Carloku `deploy` credential, `--app equipo --rungs edge` | the release runner | same file location, separate file | mint at the first production approval | |
| -| Forge read of hosted CI status | runner forge credential (existing) | unchanged | none; Release never pushes | |
| -| Suite person bearer for staging smoke | existing, 0600 under the staging root | unchanged | none | |
| -| Grant: Release specialist, capabilities as listed | instance, `chat_capability_grants` | staging DB, audited | approve the card | |
| -| One-time runner unit change (`releases/current`) | Paul | both user units on docs-t1 | run once per unit | |
| -| Owner backup before each production release | Paul (owner login) | `carlos db pull` | manual until P1 | |
| - |
| -The release runner is the runner of the instance Paul works in: |
| -`equipo-runner-staging.service` today, `equipo-runner.service` after the |
| -cutover (D1), when production drives releases to staging and then to |
| -itself. Credentials move with that choice, never to both. |
| - |
| -The `deploy` role reaches ship, promote and rollback on its rungs plus |
| -the reads `carlos deploy` needs; it cannot read logs, set env or secrets, |
| -pull the database, or touch `stable`. Platform requests, filed as amadan |
| -discussions on carlos/platform, not worked around: |
| -- **P1** a `deploy`-role read of replica position (transaction and time, |
| - no contents), so a release records its restore point before promote. |
| -- **P2** instance restore (#658) usable by an owner for a rollback with |
| - breaking migrations. |
| -- **P3** confirm on staging that a `deploy` credential may ship with |
| - `--swap hold`; if not, a request (or Paul sets `carlos apps set --swap |
| - hold` once per app). |
| +| Carloku `deploy`, `--app equipo-staging --rungs edge` | the release runner | 0600 file under its root, never in a namespace | `carlos services create --role deploy --app equipo-staging --account oficina --rungs edge equipo-release-staging` | |
| +| Carloku `deploy`, `--app equipo --rungs edge` | the release runner | same, separate file | mint at the first production approval | |
| +| Forge read of hosted CI | runner forge credential (existing) | unchanged | none; Release never pushes | |
| +| Staging suite person bearer | existing, 0600 under the staging root | used only by the smoke interpreter | none | |
| +| Release grant | `chat_capability_grants` | instance DB, audited | approve the card | |
| +| Staging runner units switched to `releases/current` | Paul | docs-t1 user units | once, at slice 5 | |
| +| Production backup and restore evidence | Paul (owner login) | `carlos db pull` | before a breaking production release | |
| + |
| +The release runner is the runner of the instance Paul works in: staging |
| +today, production after the cutover (D1). Credentials move with it. |
| + |
| +Requests, filed as discussions: |
| +- **A1 (amadan):** per-run hosted CI artifacts, with digests the hub |
| + records and no credential in the job. |
| +- **C1 (Carloku):** a `deploy`-role read of replica position, so a |
| + release records its restore point. |
| +- **C2 (Carloku):** owner-usable instance restore (#658). |
| +- **C3 (Carloku):** confirm that a `deploy` credential may ship with |
| + `--swap hold`. |
| +- **C4 (Carloku):** a `deploy` scope without assets purge and gate pass. |
| ## 4. Slices |
| -Each lands headless first, then UI, then staging. "Full process" means |
| -its own spec, Astra review (at most three rounds) and Paul's approval. |
| +"Full process" means a spec, Astra review (at most three rounds) and |
| +Paul's approval. |
| | Slice | Finish line | Paul approves | Full process | |
| |---|---|---|---| |
| -| 0 Decisions | D1 to D7 answered | yes | no | |
| -| 1a Hosted checks | for a project with hosted CI, Checks records hosted CI's result on the exact candidate SHA (`checks_sandbox: hosted`); the rename task's next Checks says `failed`, not `cannot_run` | the policy | yes (changes what "passed" means to the merge gate) | |
| -| 1b Module prefetch | the runner runs `go mod download` from the candidate's go.sum outside any namespace (proxy.golang.org and sum.golang.org only, `-mod=readonly`, sums verified) into a runner-owned cache mounted read-only into Checks, Engineering and the build | no | yes (new fetch, new mounts) | |
| -| 2 Lifecycle line | task cards and pages show the six states from real rows; "Done" reads "Merged" | copy | no | |
| -| 3 Specialists as data | Release proposed and approved on staging through the card; grant and audit rows exist; a widening attempt is refused | the card | yes | |
| -| 4 Release to staging | a green main SHA is built, deployed to staging, smoke-checked and verified by Equipo, with its record, and a forced smoke failure rolls back to last known-good | the staging credential | yes | |
| -| 5 Linux self-update | after slice 4's deploy both staging runners move to the version on their own, no step interrupted; a refused `verify-installed` leaves the old runner running | the unit change; D6 | yes | |
| -| 6 Production | the rename release live on `equipo`, `/api/version` and runners at the version, Paul confirms the rename | each release; the credential | yes | |
| -| 7 CLI pins | an Equipo task bumps the Claude Code pin and the release waits, with a clear card, until the host has it | no | no | |
| - |
| -Order: 1a and 2 in parallel, then 3, 4, 5, the staging demo, 6, 7. 1b |
| -can follow 4; slice 4 builds on the host as today until it lands. |
| +| 0 Decisions | D1 to D7 answered; seed known-good record | yes | no | |
| +| 1 Hosted checks | the rename task's next Checks records hosted CI's verdict on `4d28994`, bound to repository, run and SHA | the policy | yes | |
| +| 2 Lifecycle line | cards and pages show the six states from rows | copy | no | |
| +| 3 Specialists as data | Release approved on staging through the card; grant and audit rows exist; a widening is refused | the card | yes | |
| +| 4 Prefetch and contained build | a release build of a main SHA comes out of the checks containment with digests and provenance; the host runs no repository code | no | yes | |
| +| 5 Release to staging | lock, `authorizeRelease`, record, the four steps (runners by hand, §2.4), smoke data, reconciliation; a forced smoke failure on an additive release rolls back | the staging credential | yes | |
| +| 6 Staging runner self-update | after a staging release both staging runners update on their own, releasing runner last, no step interrupted | the unit change | yes | |
| +| 7 Production | after one approval, the staging-verified artifact file, digest rechecked, deployed to `equipo` (another app, so `carlos deploy`, never a rebuild); production runners updated by hand; Paul confirms the behaviour | each release, the credential | yes | |
| +| 8 CLI pins | a pin bump goes through a security review, then a release | yes | yes | |
| + |
| +Order: 1 and 2, then 3, 4, 5, 6, the staging demo, 7, 8. |
| ## 5. The demo |
| -The rename task is suitable: small, reviewed once, and it changes both |
| -the instance and the runner, so it tests ordering. Nobody touches its |
| -branch by hand; it continues through Equipo. |
| - |
| -1. Main is green (it is red today) and slice 1a is on staging. |
| -2. Paul taps Retry on the task's Checks step. Checks reports hosted CI's |
| - real result on `4d28994`: failed, size budget and two headless tests. |
| -3. Engineering's fix round fixes them and rebases onto main; it also |
| - adds a staging scenario: rename a project as the suite owner, read the |
| - title back in status and the project list, a stale revision is |
| - refused, a repeated call ID makes one event. Copy review runs on its |
| - strings. |
| -4. Checks pass, Review approves, merge authority decides (it touches the |
| - runner provider allowlist, so expect an ask card). |
| -5. Release builds main at the merge, deploys staging, smoke plus the |
| - rename scenario pass, both staging runners update, verified. Evidence: |
| - the record, digests, `/api/version`, runner versions, smoke report. |
| -6. After D1, a production approval card; Paul taps Release; live, |
| - verified, Paul confirms the rename on production. |
| - |
| -If the fix round stalls or the change grows past the merge policy's |
| -size, the substitute is a one-line copy change merged through the same |
| -path, so the release path is still proven. |
| +The rename task is a good test: small, reviewed once, and it changes |
| +both instance and runner. Nobody touches its branch by hand. |
| + |
| +1. Main is green (it is red today), and slices 1 to 5 are on staging. |
| +2. Paul taps Retry on the Checks step. Hosted CI reports `failed`: the |
| + size budget and two headless tests. |
| +3. Engineering's fix round fixes them and rebases. It adds an API route |
| + for rename if smoke needs one, plus `release/smoke.json` entries: |
| + rename a project as the suite owner, read the title back, and check |
| + that a stale revision is refused. Copy review runs on its strings. |
| +4. Checks pass, Review approves, and merge authority decides. It touches |
| + the provider allowlist, so expect an ask card. |
| +5. Release builds main at the merge inside the containment and deploys |
| + staging. Health passes. Runners converge (by hand until slice 6). |
| + Smoke passes and the release is verified. The evidence is the record, |
| + the digests, `/api/version` and digest, the runner versions and the |
| + smoke results. |
| +6. After D1, one approval card. The same digests go to `equipo`. Paul |
| + updates the production runner with the recipe and confirms the rename |
| + on production. |
| + |
| +The substitute, if the fix round stalls or outgrows policy, is a |
| +one-line copy change through the same path. |
| ## 6. Still manual or blocked |
| -- **Blocked:** main is red (`TestBrowserDraftStreamsFormatted`), and no |
| - release can start until it is green. |
| -- **Blocked:** production is not on thin. The first live deploy to |
| - `equipo` is the cutover (D1), which a person runs. |
| +- **Blocked:** |
| + - main is red (`TestBrowserDraftStreamsFormatted`); |
| + - production is not on thin, and the cutover (D1) is a person's. |
| - **Manual:** |
| - minting both deploy credentials; |
| - - the one-time runner unit change; |
| - - installing new Claude Code and Codex binaries on hosts; |
| - - the owner backup before a production release (until P1); |
| - - any database restore (until P2); |
| - - env and secret changes to either app; |
| - - Paul's confirmation of behaviour on production (until D5). |
| -- **Not covered here:** the Mac worker is enrolled but not connected, so |
| - its update path is untested live. Checks for projects without hosted CI |
| - still need 1b plus a gate that can run offline; Equipo's own gate |
| - cannot run offline (podman, Chromium, vuln.go.dev), and that is why 1a |
| - comes first. |
| - |
| -## 7. Decisions for Paul |
| - |
| -- **D1** Run the thin cutover of `equipo` yourself, at a release staging |
| - verified, before Equipo deploys there. Recommended. The alternative is |
| - to keep staging as the working instance and leave production pre-thin |
| - for now. |
| -- **D2** Make hosted CI the source of checks for projects that have it |
| - (oficina/equipo does). Recommended. |
| -- **D3** Staging releases run on their own after merge once you approve |
| - the grant. Production asks for every release in v1. Recommended. |
| -- **D4** Automatically roll back staging and production to the last |
| - known-good when migrations are additive. Breaking migrations never roll |
| - back on their own. Recommended. |
| -- **D5** A production test person for automated smoke checks. That |
| - expands access, so the recommendation is to defer it to v2 and confirm |
| - behaviour by hand meanwhile. |
| -- **D6** Linux self-update trusts the instance's digest, as the Mac |
| - updater does, or requires a release signature whose key lives on |
| - docs-t1 outside every namespace. Recommended: signing before slice 5 |
| - reaches the production runner. The runner host holds the forge |
| - credential and provider accounts. |
| -- **D7** Approve the capability menu in §2.9 as the complete list for |
| - v1. |
| + - the seed known-good record; |
| + - production runner updates; |
| + - staging runner updates until slice 6; |
| + - installing new provider CLIs on hosts; |
| + - backup and restore evidence for breaking releases (until C1); |
| + - any database restore (until C2); |
| + - env and secret changes; |
| + - Paul's behaviour check on production (D5); |
| + - resolving every `uncertain` and `runners_behind` card. |
| +- **Not covered:** the Mac worker is not connected, so its update path is |
| + untested live. |
| + |
| +## 7. Decisions for Paul (Astra's recommendations adopted) |
| + |
| +- **D1:** you run the thin cutover of `equipo`, after a verified staging |
| + release, a backup and a recovery rehearsal. |
| +- **D2:** hosted CI is the source of checks where a project has it, with |
| + exact-SHA, trusted-repository and run evidence. |
| +- **D3:** staging releases run automatically, once authority fencing |
| + (slice 5) and build isolation (slice 4) are in. Production takes one |
| + approval per release. |
| +- **D4:** rollback is automatic only with the backward-compatibility |
| + proof of §2.6. Otherwise it is your card. |
| +- **D5:** the production test person is deferred. Your behavioural |
| + confirmation stays. |
| +- **D6:** signing is required before production self-update. The keys |
| + must be inaccessible to builds, and the verification keys installed |
| + independently of the instance. |
| +- **D7:** approve the fixed menu, with scoped, revocable grants, |
| + current-owner checks, audited use and no mutating model tools. |
| + |
| +## 8. Moved to v2 |
| + |
| +- Production runner self-update (after D6 signing). |
| +- Hosted CI artifacts as the build source (after A1). |
| +- An automated production behaviour check with a test person (D5). |
| +- Data-defined specialists for steps other than `release`. |
| +- Mac worker updates driven by releases (it keeps `macUpdater`). |
| +- A per-release migration rehearsal, and restore by Equipo (after C2). |
| + |
| +## 9. Round 1 findings and where they went |
| + |
| +| Finding | Where | |
| +|---|---| |
| +| Critical: credential isolation | §2.2 contained build, smoke as data, executor allowlist; slice 4 before 5 | |
| +| Critical: authority races, uncertain outcomes | §2.2 `authorizeRelease`, bound approval; §2.3 lock and reconciliation | |
| +| Critical: production rebuild | §2.2 digests must equal staging's; slice 7 ships the same bytes | |
| +| Important: ordering | §2.4 four steps, frozen runner set, releasing runner last, one timeout table | |
| +| Important: compatibility claim | §1 corrected; §2.5 | |
| +| Important: rollback safety | §2.6 three proofs, seed record, restore evidence, boot migrations uncertain | |
| +| Important: checks and slices | §2.7; slice 5 has a manual runner bridge; pins security-reviewed (slice 8) | |
| +| Minor: Engineering claim, deploy role reach | §1 corrected; executor allowlist and request C4 | |