0
0
plan 0040 rewritten
docs/plans/0040-release-pipeline.md+80−315
| @@ -1,343 +1,108 @@ | ||
# 0040 - Release pipeline: main to staging, rc, self-updating bidders, prod, stable | ||
| ||
Status: in progress (owner, 2026-11-16: "yes you're supposed to be building plan 0040"): step 1 built, step 2 built. The decisions are the owner's (2026-11-15); open questions are at the end. | ||
Status: approved by the owner; steps 1-8 built, 9-12 open (2026-11-17) | ||
| ||
## Flow | ||
| ||
``` | ||
push main | ||
│ | ||
├─ release (plan 0042): gate checks ─► the one build ─► publish: bucket main/<sha>/binaries/{…, SHA256SUMS} | ||
│ | ||
├─ test (plan 0042): one staging network, every acceptance entry | ||
│ │ all green | ||
│ ▼ | ||
├─ release composition (runner side, as socialweb.computer), the last part of `test` on main: | ||
│ 1. start watching heartbeats of the rc operators' bidders | ||
│ 2. write manifest, version vN.N.N-rcNNN, move channel "rc" to it | ||
│ 3. ssh-deploy the socialweb.computer droplets (gateway, ...) to the same binary | ||
│ 4. wait until every expected bidder heartbeats the new version (10 min, else: failed) | ||
│ 5. prod acceptance, every rental's bidderDids = the expected bidders | ||
│ 6. green: move channel "stable" to a new vN.N.N version of the same manifest | ||
│ red: move channel "rc" back to the previous version; ssh-deploy the previous binary | ||
│ | ||
└─ bidders (hats, never deployed by CI) follow their channel: | ||
running vN.N.N-rcNNN follows "rc"; running vN.N.N follows "stable" | ||
channel moves → download, verify CID + size, install, restart in place → heartbeat shows the version | ||
``` | ||
| ||
## Decisions | ||
| ||
- Bidders follow the channel pointer, in both directions. A rollback is a channel move. | ||
- Binaries stay in the bucket. The manifest points at them by URL, CID and size. | ||
- The `socialweb.computer` account (`did:plc:gmlkrhimoueejcertevr4hl3`) owns every `software.release.*` record. | ||
- CI never deploys the hats. They update themselves from the channel. | ||
- CI deploys the socialweb.computer droplets over ssh: a key on each droplet's root, its private half a knotless secret. | ||
- Stable is cut automatically when prod acceptance passes on an rc. | ||
- Auto-rollback on red. | ||
- Discovery is always relay, jetstream or firehose. `bidderDids` only limits who gets accept records (step 1). | ||
| ||
## Version numbers | ||
| ||
``` | ||
target stable = last stable vX.Y.Z → vX.Y.(Z+1); no stable yet → v0.0.0 | ||
rc = rcs of the target exist → vT-rc(max+1); none → vT-rc0 | ||
``` | ||
| ||
- An rc of the target exists only after a rollback. A green rc becomes the stable, so the next run targets the next | ||
patch. | ||
- Stable `vT` is a new `software.release.version` pointing at the green rc's manifest. Channel `stable` moves to it. | ||
- First run: there is no stable, so the target is v0.0.0. rcs up to v0.0.0-rc167 were git tags only. Seed | ||
`software.release.version/socialweb-computer:v0.0.0-rc168`, the rc rolled by hand, so the first CI rc is v0.0.0-rc169. | ||
| ||
``` | ||
v0.0.0-rc168 (seeded) ─► CI: v0.0.0-rc169 ─► red, rolled back ─► v0.0.0-rc170 ─► green ─► stable v0.0.0 | ||
│ | ||
next push: target v0.0.1 ─► v0.0.1-rc0 ─► green ─► stable v0.0.1 ◄──────────────────────────┘ | ||
``` | ||
| ||
## Operators and droplets | ||
| ||
Every prod bidder runs as bob (owner, 2026-11-15). | ||
| ||
| Host | Operator | | ||
|---|---| | ||
| hat-7 | bob (runs john's bidder today: reinstall as bob after the rc168 prod gate) | | ||
| hat-8 | bob | | ||
| hat-9 | bob | | ||
| hat-10 | bob (suspended until the qemu SGX fix lands) | | ||
| ||
The droplets CI deploys over ssh, from `docs/infra/inventory.md`: | ||
| ||
| Droplet | Runs | | ||
|---|---| | ||
| `socialweb-computer` | the gateway, ssh gateway, knotless runner | | ||
| `atproto-reverse-proxy` | fedproxy.com: the ingress relay, ssh relay, atirc | | ||
| `mini-cloud-0002` | the atproto relay | | ||
| `qr-fedfork-com` | the QR associator | | ||
| ||
`softwaresecurityalignment-l7-lb-0001` is not part of this project. | ||
| ||
## Steps | ||
| ||
### 1. `bidderDids` filters discovery, never replaces it | ||
| ||
Today `internal/market/requester/market.go` `discover()` uses the named DIDs as the whole candidate set when a | ||
contract names `bidderDids`: relay sources are skipped, and named DIDs skip the fresh-heartbeat check. | ||
| ||
Change: always discover through the relay sources and heartbeats, then keep only the discovered bidders whose DID is | ||
in `bidderDids`. `denyBidderDids` stays a filter on the same set. | ||
| ||
Composition test (`tests/compositions/`, in `gate.sh` and CI): a dev net with bidders A and B, where A publishes no | ||
offering to the relay. A rental naming `bidderDids: [A, B]` sends its RFP and accept only to B, and never contacts A. | ||
| ||
Built (2026-11-15): `internal/market/requester/market.go` `discover` takes the relay sources always and keeps the named DIDs | ||
among them (a named DID no longer skips the heartbeat check); composition 0019 (`docs/acceptance/0019-bidderdids-discovery.md`, | ||
in `gate.sh` and CI's suite) names [the second bidder, the requester's own DID]. The CLI, ssh gateway and k8s paths share | ||
`discover`. Port parity, read 2026-11-15: the atlibs requester module (`atlibs-socialweb-computer-requester`, | ||
`modules/requester/src/input.rs` `bidders`) does not discover at all: its `bidders` input (DIDs) is required and is the whole | ||
set. It needs discovery first (relay sources, heartbeats, offerings), then the same `bidderDids` filter: a step of its own. | ||
| ||
Proven: composition 0019 PASS on staging (cycle 12, 27171b07). | ||
| ||
Same for every requester that takes `bidderDids`: the CLI, the ssh gateway, k8s nodes (`providermain/nodes.go`, Infra, | ||
nodemarket). Port parity: the atlibs requester module filters the same way. | ||
| ||
### 2. The heartbeat names the running version | ||
| ||
`com.publicdomainrelay.temp.market.heartbeat` (rkey `self`) gains `version`: | ||
| ||
```json | ||
{ | ||
"$type": "com.publicdomainrelay.temp.market.heartbeat", | ||
"offering": { "uri": "at://did:plc:…/com.publicdomainrelay.temp.market.offering/…", "cid": "bafy…" }, | ||
"version": { "version": "v0.0.0-rc168", "commit": "6dc81d099d2a…", "sha256": "c484e00c…" }, | ||
"createdAt": "2026-11-15T02:00:00Z" | ||
} | ||
``` | ||
| ||
A bidder writes it at start, so a restart after an update announces the new version. | ||
| ||
Built (2026-11-16): lexicon `heartbeat#runningVersion` {version, commit, sha256}; `market.BuildHeartbeat` takes it; the bidder's | ||
`Config.RunningVersion` (`internal/services/bidder/wiring.go`: `buildstamp.Identity()` and `selfexe.Sum()`) goes into every beat. | ||
| ||
### 3. Release records | ||
| ||
All in the `socialweb.computer` repo. | ||
Every push to main that changes code, in order. No hand roll. | ||
| ||
```sh | ||
# project (once) | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.project/socialweb-computer | ||
| ||
# per rc | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.manifest/<tid> | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.version/socialweb-computer:v0.0.0-rc168 | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.channel/socialweb-computer:rc | ||
| ||
# per stable | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.version/socialweb-computer:v0.1.0 | ||
at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.channel/socialweb-computer:stable | ||
``` | ||
| ||
Manifest, one `httpArtifact` per binary. The CID is CIDv1 raw sha2-256 of the binary, derived from `SHA256SUMS`: | ||
| ||
```json | ||
{ | ||
"$type": "software.release.manifest", | ||
"project": "at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.project/socialweb-computer", | ||
"artifacts": [ | ||
{ | ||
"$type": "software.release.defs#httpArtifact", | ||
"name": "socialweb-computer-linux-amd64", | ||
"url": "https://socialweb-computer-kcp.sfo3.digitaloceanspaces.com/main/6dc81d099d2a…/binaries/socialweb-computer-linux-amd64", | ||
"cid": "bafkrei…", | ||
"size": 617000000, | ||
"target": { "os": "linux", "arch": ["amd64"] } | ||
} | ||
] | ||
} | ||
``` | ||
| ||
Written 2026-11-16 (as socialweb.computer): | ||
| ||
| Record | rkey | CID | | ||
|---|---|---| | ||
| project | `socialweb-computer` | bafyreidnbxkyomi6gm6zaef2a5jn5xihw6repfzezje32rqxpvzwafkwke | | ||
| manifest (rc169, releases/v0.0.0-rc169/binaries) | `3n2hdqpz65ksv` | bafyreif6jxta5bkq6yx6j5cxxfntqfue6cfawzkv6nrxw55sjpfrcv2ddu | | ||
| version | `socialweb-computer:v0.0.0-rc169` | bafyreiclcz3szlchdf2wzaxectswaqvbqqyg2yfojwmwfffjetnerjhl7q | | ||
| channel rc | `socialweb-computer:rc` | bafyreigve67ht3cyizva5kf5i45si3glntcamy5uxuccqf2nsbwd2hgp2a | | ||
| ||
Prod (gateway, hat-7/8/9/10) rolled by hand to rc169 the same day; every bidder logs `releasefollow_on channel rc` and its | ||
heartbeat names `v0.0.0-rc169`. From here a move of the rc channel upgrades prod. | ||
| ||
Lexicons (built 2026-11-16): `lexicons/software/release/{project,defs,manifest,version,channel}.json`, Go types in | ||
`internal/atproto/release` (lexgen). | ||
| ||
Version and channel: | ||
| ||
```json | ||
{ "$type": "software.release.version", "project": "at://…/software.release.project/socialweb-computer", | ||
"version": "v0.0.0-rc168", "manifest": { "uri": "at://…/software.release.manifest/<tid>", "cid": "bafy…" } } | ||
| ||
{ "$type": "software.release.channel", "project": "at://…/software.release.project/socialweb-computer", | ||
"name": "rc", "version": { "uri": "at://…/software.release.version/socialweb-computer:v0.0.0-rc168", "cid": "bafy…" } } | ||
release gate checks, the one build, publish bucket main/<sha>/binaries/{..., SHA256SUMS} | ||
| | ||
test one ephemeral staging network; EVERY tests/gate.sh entry, as staging's own alice and bob | ||
| green | ||
promote on the release VM, as socialweb.computer (release-workload): | ||
1. write manifest + version vT-rcN, move channel rc | ||
2. deploy the socialweb.computer droplet (gateway, ssh gateway) to the same binary | ||
3. wait until every rc-operator bidder heartbeats rcN (10 min): the bidders update themselves | ||
4. prod retest: EVERY tests/gate.sh entry against prod, as prod bob and alice | ||
5. green: version vT on the same manifest, move channel stable; the bidders that follow stable update | ||
red: move rc back to the previous version, deploy its binary to the droplet; the bidders follow rc back | ||
``` | ||
| ||
### 4. Bidder self-update | ||
| ||
A bidder is on a release when it runs the binary of the release's artifact (CIDv1 raw sha2-256 of its own executable | ||
equals the artifact's CID), not when version strings match: CI's rcs are main builds (`v0.0.0-rc99.0.<time>-<sha>`), so | ||
a name like `v0.0.1-rc0` is never a binary's own version. The channel is the `release-channel` option (an installed bidder's `--bidder-spec-file`: `options: [{name: release-channel, value: rc|stable}]`; the release repo the same way, `release-repo`), default `rc` for a version with `-rc`, else `stable`. | ||
| ||
The standard kcp pattern: an `AtprotoRecordWatch` on | ||
`at://did:plc:gmlkrhimoueejcertevr4hl3/software.release.channel/socialweb-computer:<rc|stable>`, fed by the relay and | ||
firehose. A new controller reacts to a change of that record: | ||
| ||
1. It resolves channel, then version, then manifest, checking each strongRef's CID. | ||
2. It picks the artifact whose `target` matches the host. | ||
3. It downloads to `bin/<sha256>/`, verifies the CID and size, and switches `bin/current`. | ||
4. It restarts in place, with no drain, the same procedure as today's manual roll. The new process writes its heartbeat. | ||
| ||
The channel comes from the running version: `-rcNNN` follows `rc`; plain `vN.N.N` follows `stable`. | ||
| ||
Design (2026-11-16): | ||
| ||
``` | ||
installed bidder core | ||
MarketBidder composes AtprotoRecordWatch repo socialweb.computer, collection software.release.channel, | ||
rkey socialweb-computer:<rc|stable> (only when installed: bin/current exists) | ||
updater controller watch status changes -> channel -> version -> manifest (each strongRef CID checked) | ||
-> the artifact whose target is this GOOS/GOARCH -> download to bin/.incoming/<sha256> | ||
-> size and CID checked -> install.Upgrade (sha256, self-check, bin/previous, bin/current, | ||
restart in place) ; a version equal to the running one does nothing | ||
``` | ||
A failed `test` or `promote` is held for debug and fixed in place (plans 0044, 0048) before the next CI cycle. | ||
| ||
- The channel's repo is the MarketBidder spec option `release-repo` (a `--bidder-spec-file` option, never argv), default | ||
`did:plc:gmlkrhimoueejcertevr4hl3`; the rkeys are `socialweb-computer:rc` and `socialweb-computer:stable`. | ||
- Proof (composition 0020, staging only, as 0013's `install requester` entry): a staging VM bidder installed with `install bidder` (dev nets run no installed bidder, and `install.Upgrade` | ||
works on an install's `bin/`), following a channel in a staging account: move it forward, the heartbeat shows the | ||
new version; move it back, the previous one. | ||
## Decisions | ||
| ||
Built (2026-11-16): `internal/releasefollow` (contract `internal/contract/release`), the watch | ||
`deploy/apps/market-bidder/release-channel-watch.prod.yaml` (set phase `release-channel-watch@prod-qr`), and | ||
`internal/stack/bidder/release.go` `followRelease` started from the installed core's `Members` (off for a dev build or a | ||
core without `bin/current`; `rc` for a version with `-rc`, else `stable`). Not yet proven. | ||
- Bidders follow their channel pointer both ways; a rollback is a channel move. CI never deploys the hats. | ||
- The socialweb.computer account (`did:plc:gmlkrhimoueejcertevr4hl3`) owns every `software.release.*` record. | ||
- Binaries stay in the bucket; a manifest points at them by URL, CID (CIDv1 raw sha2-256) and size. | ||
- A bidder is on a release when its own executable's CID equals the artifact's (CI's rcs are main builds, | ||
`v0.0.0-rc99.0.<time>-<sha>`, never named `vT-rcN`). | ||
- Stable is cut only by a green prod retest. Never shrink the retest or the staging suite to get a green. | ||
- Accounts (owner, 2026-11-17): `test` = the staging network's throwaway alice and bob (`tests/compositions/staging/target.sh`). | ||
Prod retest = prod alice (`aliceoa.bsky.social`) and bob (`bobvmbuilder.bsky.social`); in CI their app passwords are knotless | ||
secrets sealed to `refs/heads/main` (`knotless secret set`), never printed, logged, committed or put in an artifact. | ||
- Discovery is always relay, Jetstream or firehose; `bidderDids` only filters it (step 1). | ||
| ||
Composition 0020 (staging only; modelled on 0013 entry `c`): | ||
## Versions | ||
| ||
``` | ||
root.putBinary the run's build on a staging VM | ||
install bidder --market-network-file (profile market-network), pdsAccount as the run's account, | ||
--bidder-spec-file with option release-repo = the account's DID | ||
release.put project, manifest (the other build: url, CIDv1 raw sha2-256, size), version, channel rc | ||
heartbeat the bidder's heartbeat version becomes the other build's (10 min) | ||
release.put channel rc back to a version of the run's build | ||
heartbeat back to the run's version | ||
uninstall bidder --purge; the records deleted | ||
target T = last stable vX.Y.Z -> vX.Y.(Z+1); no stable -> v0.0.0 | ||
rc = rcs of T exist -> vT-rc(max+1); none -> vT-rc0 | ||
``` | ||
| ||
Both builds must have the follower: the other build is an input (`otherBuild {version, url, sha256, size}`), a published | ||
main build from 6f7f2391 on (`main/<sha>/binaries/`). Order: the first `rc` channel | ||
target must be a build that has the follower (rc169 or later): a bidder that follows rc168 (53cad0e3, no follower) stops | ||
following. | ||
| ||
### 5. k8s gateway: `bidderDids` through its rentals | ||
| ||
The gateway's NodeClaim and Infra rentals take a bidder DID allowlist from their spec and pass it to the contract, | ||
filtered as in step 1. Prod acceptance's k8s entries (0012, 0013) name the expected bidders through it. | ||
Records (2026-11-17): versions v0.0.0-rc169 (seeded by hand), rc170, rc172, rc173, rc175 (CI, red), rc171 (the bootstrap, | ||
by hand), rc174 (CI, cancelled before its gate); channel `rc` -> rc174; no stable yet. Next: rc176, target v0.0.0. | ||
| ||
As built: the allowlist is the requester's, not each claim's: every rental of a requester (an Infra's, a NodeClaim's) | ||
is a contract of that requester, whose `spec.bidderDids` filters discovery (step 1). The gateway's is `GatewaySpec.bidderDids` | ||
(its spec file), `run requester`'s `-- --bidder-dids` (`option-map.yaml` market-requester, with `--with-gateway` the | ||
nodes' too). 0012 and 0013 start their requester with the target's bidders (`steps::bidder_dids`, the test host's | ||
`requester.start` input `bidderDids`) on a target outside a market network (prod); a network child gets the network's | ||
bidders from the network (`run requester` refuses `--bidder-dids` there). | ||
| ||
### 6. Two compositions | ||
| ||
- `socialweb-computer-cicd`: today's VM rental. Every workflow on every branch and fork uses it. | ||
- `socialweb-computer-release`: built on `socialweb-computer-cicd` and adds the release machinery of the flow above. | ||
It declares the `software.release.*` scopes, so its OAuth sign-in as `socialweb.computer` asks for them: | ||
Record keys, all in the socialweb.computer repo: | ||
| ||
``` | ||
repo:software.release.project repo:software.release.manifest?action=create | ||
repo:software.release.version?action=create repo:software.release.channel?action=create&action=update | ||
``` | ||
| ||
Only main's `release` executor binding names `socialweb-computer-release`. Staging, branches and forks never have the | ||
release session. | ||
| ||
How it runs (the runner calls `computer.socialweb.cicd.workload.run` once per step, with the run's env and no state between | ||
calls, and stops at the first failed step, so the whole release is one step): | ||
| ||
- `release-workload` (atlibs-socialweb-computer-requester `modules/release-workload`) implements `workload.run`. A step | ||
whose script is `release <promote command>` runs in the module; any other step goes to `cicd-workload` unchanged. | ||
- `release`: on the VM `scripts/release-artifacts.sh $KNOTLESS_RUN_SHA` prints the build's artifacts (url, sha256, size, | ||
version); the module (session `release`, as socialweb.computer) computes the rc (Version numbers), writes the manifest | ||
and version and moves `rc`; on the VM the promote command (`scripts/promote.sh`: droplets, rc operators' heartbeats, | ||
prod gate) runs with `RELEASE_VERSION`; exit 0: the module writes the stable version and moves `stable`; else it | ||
moves `rc` back and runs `scripts/promote.sh rollback` on the VM, and the step fails. | ||
- `.knotless/workflows/promote.yml`: push main, `after: [test]`, `executor: release`, secrets `PROD_DEPLOY_SSH_KEY` | ||
and `ATIRC_AGENT_CONFIG`, one step `release bash scripts/promote.sh`. | ||
- The prod gate in promote runs as the release VM's guest requester r2 (as `scripts/ci-test.sh` runs staging: `SWC_REPO`, | ||
the installed binary and meshd), the entries r2 drives (the staging suite's: `GATE_R2_ENTRIES` in promote.sh); its run | ||
dumps are the run's artifacts (`gate-runs`). The entries that need a password account (a second requester, an owner | ||
sign-in: 0001, 0002, 0004, 0009, 0011, ...) are the full gate, `tests/gate.sh <prod target> --account bob,alice` on | ||
hat-8, where those credentials are (they never go into CI). | ||
| ||
### 7. rc operators | ||
| ||
`deploy/release/rc-operators.json`: | ||
| ||
```json | ||
{ | ||
"operators": [ | ||
{ "handle": "bobvmbuilder.bsky.social", | ||
"bidders": ["did:plc:… (hat-7)", "did:plc:… (hat-8)", "did:plc:… (hat-9)", "did:plc:7fj5jk5jxadrqtc5txp7xitp (hat-10)"] } | ||
], | ||
"updateWithin": "10m" | ||
} | ||
software.release.project/socialweb-computer | ||
software.release.manifest/<rkey> per rc (artifacts: url, cid, size, target os/arch) | ||
software.release.version/socialweb-computer:<v> per rc and per stable | ||
software.release.channel/socialweb-computer:rc and :stable | ||
``` | ||
| ||
The release composition waits for every listed bidder's heartbeat to show the new version. Prod acceptance passes the | ||
listed DIDs as every rental's `bidderDids`. | ||
## Operators | ||
| ||
### 8. Droplet deploy | ||
`deploy/release/rc-operators.json`: bob's bidders `did:plc:2l2wdry77c7jtucbslstagkj` (hat-8), `did:plc:4vcig7s43z3nyqrnepmcfzqt`, | ||
`did:plc:7fj5jk5jxadrqtc5txp7xitp`, and john's `did:plc:7q5lnitxv4meizdon5fmhzrq` (step 12). The others run on hat-7, hat-9 and | ||
hat-10; which DID is which host is unverified. `updateWithin: 10m`. | ||
| ||
- The release composition ssh-deploys each socialweb.computer droplet to the published binary, as root, with a key | ||
that is a knotless secret sealed to `refs/heads/main`. | ||
- It keeps the previous binary for rollback, the same `bin/previous` the manual roll uses. | ||
| ||
## Order of work | ||
## Steps | ||
| ||
1. Step 1 (`bidderDids`), with its composition test. | ||
2. Step 2 (heartbeat `version`). | ||
3. Step 4 (self-update), proven on a dev net: a local channel record moves, bidders update, then move back. | ||
4. Step 3 records and step 6 composition, first against a dev-net PDS, then as socialweb.computer. | ||
5. Steps 5, 7 and 8. | ||
6. The main workflow, end to end, with one deliberately red rc to prove the rollback. | ||
1. `bidderDids` filters discovery, never replaces it (`internal/market/requester/market.go` `discover`). Proven: 0019. | ||
2. The heartbeat names the running version (`heartbeat#runningVersion` {version, commit, sha256}). Built. | ||
3. Release records and lexicons (`lexicons/software/release/*`, `internal/atproto/release`). Built. | ||
4. Bidder self-update: MarketBidder composes an AtprotoRecordWatch on the channel (`release-channel-watch@<profile>`), | ||
`internal/releasefollow` resolves channel -> version -> manifest (CIDs checked), downloads, `install.Upgrade`, restarts | ||
in place. Channel option `release-channel` (`rc|stable`; default `rc` for a version with `-rc`), repo option | ||
`release-repo`, both in `--bidder-spec-file`. Proven: 0020 in CI; prod: all four bidders followed rc172 -> rc171 and | ||
rc174 (2026-11-17). | ||
5. `bidderDids` through every rental: a requester's `spec.bidderDids` (`GatewaySpec.bidderDids`, `run requester -- --bidder-dids`, | ||
with `--with-gateway` the nodes too); a market network sets its children's. 0012 and 0013 pass the target's bidders | ||
outside a network. Proven: 0012, 0013 on staging. | ||
6. Release composition `socialweb-computer-release` (requester repo `modules/release-workload`, session `release` with the | ||
scopes `repo:software.release.project`, `manifest?action=create`, `version?action=create`, `channel?action=create&action=update`). | ||
Only main's `release` executor binding names it. A step `release <cmd>` runs `scripts/release-artifacts.sh`, writes the rc, | ||
runs `<cmd>` (`scripts/promote.sh`), then stable or the rollback (`scripts/promote.sh rollback`). Built; rollback proven | ||
(rc170, rc172, rc173, rc175). | ||
7. `.knotless/workflows/promote.yml`: `after: [test]`, executor `release`, secrets `PROD_DEPLOY_SSH_KEY`, `ATIRC_AGENT_CONFIG`, | ||
artifacts `gate-runs` (the gate's run dumps). Built. | ||
8. Droplet deploy: `scripts/deploy.sh` ships the binary (sha256 checked before the move, 3 tries) and keeps `bin/previous`. | ||
CI deploys the socialweb-computer droplet only; the relays (`atproto-reverse-proxy`, `mini-cloud-0002`) and the QR | ||
associator are deployed by their own scripts. Built. | ||
9. `test` runs every entry: `scripts/ci-test.sh` `input_default` = the full `tests/gate.sh` list (today 17 of 44), each | ||
failure root-caused and fixed (plan 0052). Open. | ||
10. The prod retest as prod bob and alice: their app passwords as main-sealed secrets, `promote.sh` runs | ||
`tests/gate.sh <prod target> --account bob,alice` with the full list (remove `GATE_R2_ENTRIES`), `AGENTS.md` records the | ||
secret exception. Open. | ||
11. Hold promote for debug: a red gate keeps its failed entries' VMs and the release VM frozen (`GATE_FREEZE_TTL`, attachable) | ||
before the rollback; `scripts/promote.sh --dry-run` (everything but records, deploys and the gate's writes) rehearsed by | ||
hand on a VM with the release image before every promote change. Open. | ||
12. hat-7's bidder operated by bob, as the other three (`rc-operators.json` one operator). Open. | ||
| ||
## Order | ||
| ||
1. Steps 9, 10, 11 (each rehearsed by hand first), then a green CI cycle. | ||
2. Step 12. | ||
| ||
## Done when | ||
| ||
Prod is rolled by CI, twice, never by hand. In order: | ||
| ||
1. Rollback proven: a red rc on main (promote) moves `rc` back to the previous version and redeploys the droplets to the | ||
previous binary. Done 2026-11-17: main 3edb3744's promote, rc170 red (the hats on rc169 never heartbeat it), `rc` back to | ||
rc169, the droplets back on its binary (adff492b). | ||
2. Bootstrap, once: the hats run rc169, which has no `release-channel` watch (plan 0044 finding 81), so no channel move can | ||
reach them. A hand release of a green main build that has it (6fea8416 on): its manifest and version (the next rc), `rc` | ||
moved to it, then the hats and the droplets rolled to it. `rc` must name it first: bidders follow the channel both ways, | ||
and a hat on the new build with `rc` still at rc169 would install rc169 and lose the watch again. This is the last hand | ||
roll; `roll-prod.sh` is not used again. Done 2026-11-17: rc171 (main 3edb3744) by hand, `rc` moved, the hats and the droplets rolled; every | ||
bidder applied `release-channel-watch@prod-qr`. | ||
3. CI roll 1: the next green main runs promote: it writes the rc, moves `rc`, deploys the droplets, every rc operator's | ||
bidder updates itself (heartbeat names the rc), the prod gate passes and `stable` moves to the target version. | ||
4. CI roll 2: a small code change (a CLI help text wording), so promote's paths filter releases it: a second release (next | ||
target, rc0) to stable, with this section recording roll 1. Done. | ||
| ||
## Open questions | ||
1. staging: every `tests/gate.sh` entry passes in CI `test` (owner-approved SKIPs only: 0010 iOS paused). "N of M". | ||
2. prod: the full gate passes in CI `promote` (prod bob, alice) and by hand on hat-8. "N of M" each. | ||
3. Two green CI rolls of prod through the flow: stable moved each time, every rc-operator bidder updated itself, no hand | ||
roll. The second is a small CLI help-text change. | ||
| ||
1. Seed rc168 (first CI rc is rc169) or rc167 (first CI rc is rc168)? | ||
2. The bidder DIDs for `rc-operators.json`, read from the offerings after hat-7 is reinstalled as bob. Seen on prod today: | ||
`did:plc:4vcig7s43z3nyqrnepmcfzqt` (8 vCPU), `did:plc:2l2wdry77c7jtucbslstagkj` (16 vCPU, hat-8) and | ||
`did:plc:7q5lnitxv4meizdon5fmhzrq` (12 vCPU). | ||
Each with the knotless workflow log that shows it. | ||