# 0040 - The plan: every acceptance entry green, released by CI to prod and stable Status: the only plan in flight (owner, 2026-11-17); docs/plans/0001-0039 and NEXT.yaml are history. How to run, hold and debug CI by hand: `docs/ci-debug.md`. The state before this work: main e39097c2 (2026-11-12). State (2026-11-22; updated by the lead; older history is in Findings and in git): - Main: stable v0.0.1 = main 324f69a1 (promote 14, v0.0.1-rc3, green 08:39Z 11-21; amd64 394445f3). Roll two, main 7b0afc69: `release` green, `test` RED `gate: staging: 45 of 47 PASS` (19:38Z 11-21), `promote` refused at its first step; channel rc never moved, prod untouched. - STAGING IN CI: 45 of 47 at 7b0afc69 (red); last green 47 of 47 at 324f69a1. The list is 48 with this pull. - PROD IN CI: 31 of 31 PASS at 324f69a1 (promote 14, as prod bob and alice). - ROLLS: 0 green in a row. Two consecutive greens are owed; between them only the colored help of decision 74. - Decision 78: no roll while a known cause of gate failure is unfixed. The causes found since roll two are fixed on five branches, each reviewed, merged as `stack6` 1c028e5d (the Go tree is that of `stack5`), plus the dumbpipe bump (decision 79): this pull's tree is `bump6` cf34bc81 = `stack6` + the bump. It lands: - `health-pid` 8e49c3a0 (tests only): `bidder.health` reads the current core process only (roll two's 0008:run counted the old process's shutdown errors), `logs.fetchRuns` takes its absolute dir, 0014:exhausted counts a capacity decline. Proven: hand cycle 47 of 47 (stg-031952); in the stack5 cycle 0008:run read errors 0 for a bidder whose previous (rc186) core logged an ERROR at its stop (0007:fence, 03:45Z 11-22). - `bid-capacity` c26c0927: the room is decided once per RFP, when its bid is created, on every intake path (submitRfp and the market stream); a recorded decline is what a later submitRfp answers; the requester's accept replacement budget is per waiting round and a 409 past it waits for capacity; the ssh gateway's sign-in ends only once the account's link exists (`bus.AwaitLink`). Proven: on stg-033371 the stream brought every RFP first and a full bidder never bid (0014:giveup 5 of 5, 0014:wait 7 of 8, the one FAIL a sign-in timeout); all ten 0014 entries PASS in the stack5 cycle. NOT proven: the ssh sign-in wait closes a window: 0 refusals in 30 sign-ins on the fix, but main 7b0afc69 gave 0 in 40 too (failure not reproduced; worst session wait on main 5.5 s against the 5 s settle). - `ingress-rereg` ce2ec862, with the new staging entry `0007:ingress`: a replaced ingress listener's publications are re-registered, Ready only once dumbpipe listens, no stored build-specific dumbpipe path, no xrpc fallback for a named IngressProxy that is not registered yet. Proven on stg-033371: 0007:ingress PASS twice and FAIL on main 7b0afc69 as it must, 0007:upgrade and 0007:fence PASS, 0 ERROR lines in 11 bidder core processes; PASS in the stack5 cycle. A switch between two dumbpipe pins: the bump's proof below. NOT proven: the crash-restart path. - `signin-retry` ae1db64f: a transient createSession failure (timeout, refused or reset connection, 5xx, 429) keeps the MarketIdentity Pending and is retried; Failed stays for a refused credential, a DNS not-found and a certificate error; the core passes its network client, so the intended 10 s per call applies (a 5 s client cut it). Proven on a local market only (a proxy holding createSession). NOT exercised on staging: 0 retry lines in the stack5 cycle (no sign-in was slow). - `stage-budget` 1c028e5d (tests only): a host script states its budget and the test host waits that long plus 120 s (it cut every script at 120 s; the stack5 cycle's one FAIL: the 0007:upgrade stage fetch of the 594 MB from binary took 119 s). Proven by a local harness (old code cut at 120.0 s, new code completes) and by 0007:upgrade, 0007:fence, 0007:restart, 0006:run, 0008:run by hand on stg-277608 (all PASS). NOT exercised there: a fetch (the from binary was already on both bidders); why that fetch was slow is not established. In the stack6 cycle 0007:upgrade fetched for real (17 s at 33 MiB/s, 40 s at 14 MiB/s) and PASSED. - the bump (`bump6` cf34bc81, reviewed): dumbpipe 0.39.0 -> 0.40.1 (pins, guest image 7e5dc836 with 0.40.1 baked, the cloud-init default); the guest's setup-iroh fetch is limited to 3 tries of 10 s when the image has a dumbpipe (worst case 34 s, then the image's own runs) and is main's loop when it has none. Why: in the stack6 cycle `iroh.service` restarted once on bidder-2 (07:12:33Z) and once on the gateway VM (07:29:38Z), each "Endpoint dropped without calling Endpoint::close", both survived; the claim to check in the stack7 cycle is 0 such restarts. Proven on stg-113817 (`~/.tmp/ingress-rereg/slot6/`): both bidders 0.39.0 -> 0.40.1 with 0 ERROR; 0007:upgrade 324f69a1 <-> bump PASS, the old core listening 8.9 and 8.1 s after its start; 0007:run and 0007:restart PASS; a guest of the bump requester on a bump bidder fetched nothing and runs dumbpipe 0.40.1. - Hand cycles of the combined tree (full list, fresh network, CI's default input): - stack4 7b0f1bc3 (stg-033371): 44 of 48. FAIL 0007:upgrade, 0007:ingress, 0014:giveup, 0014:wait, all four from earlier heads of `ingress-rereg` and `bid-capacity`, each root-caused and corrected (Findings). - stack5 df3b1c2c (stg-277608): `gate: staging: 47 of 48 PASS`, wall 7311 s (`~/.tmp/cycle-stack5/saved/final/`). FAIL 0007:upgrade (the 120 s cut; `stage-budget`). - stack6 1c028e5d (stg-113817): gate: staging: 48 of 48 PASS, wall 7347 s, `~/.tmp/cycle-stack6/saved/final/` - stack7 43297eda (bump6 + cli-help), stg-513391: stopped as a survey at 10 of 48 done, 9 PASS, 1 FAIL (09:01Z; `~/.tmp/cycle-stack7/saved/final/`); iroh.service restarts 0 and "Endpoint dropped" 0 on all four VMs in 54 min. FAIL 0006:run: one start-up ERROR on bidder-1's first start, "the HostProcess supervisor stopped; starting it again" (sets `provider` and `applications` both apply APIBinding `policy`; kcp refuses one when they overlap; healed 2 s later). On main since 2026-10-21; first hit. Fix (owner: a healed retry is not an ERROR): `bind-label` 287b641c: WARN while retrying, ERROR once a failing streak lasts the set apply's deadline (1 min). The four network VMs fetched dumbpipe v0.40.1 in 0 to 1 s each at stand-up. - stack8 70321d69 (bind-label + cli-help), stg-858914: stopped as a survey at 3 of 48 done, 2 PASS, 1 FAIL (0006:run on bob3: that line; 09:33Z; `~/.tmp/cycle-stack8/results.txt`). Seen at its start: one start-up ERROR on bidder-2's first start, "Failed to watch ... the server could not find the requested resource ... *v1alpha1.Service" (the exposures virtual workspace serves discovery about 0.6 s before it serves the resource; the reflector retried and healed in 0.4 s). Fix: `start-warn` 00e47278: that reflector line logs WARN while its streak is under the cache-sync deadline (2 min), ERROR after. No timing shift from the bump was found (10 local starts each on the stack6 and stack8 release builds); the races follow host load. Sweep of every saved journal: no other ERROR within 600 s of a bidder core start (`~/.tmp/bind-label/sweep.txt`). - stack9 1d794a7b (this tree 00e47278 + cli-help): gate: staging: 48 of 48 PASS, wall 7632 s (stg-090117, 09:45-11:52Z; `~/.tmp/cycle-stack9/saved/final/`): iroh.service restarts 0 and "Endpoint dropped" 0 on all four VMs; dumbpipe 0.40.1 never exited under a running core (0.39.0 did 3 times under the old binaries inside 0007); the APIBinding race fired once on bidder-1 at WARN and 0006:run passed (startupErrors 0) - one ERROR "Failed to watch ... context canceled" (controller marketbidder, an apibindings watch) 4 s after the start of an OLD-binary core (324f69a1) inside 0007:upgrade on stg-090117: no health reading counted it; first seen; the same controller code is in this tree, cause not established: being root-caused while the roll runs (lead's call, owner asleep: his order is one green roll by noon); This one cycle is the out of band run for both pulls (decision 79). - Open through the next roll: - a guest still fetches dumbpipe from GitHub at boot when its requester and its image have different versions: CI's 4 network VMs at stand-up, an old stable CLI on updated bidders, new requesters after a bidder rollback; setup-iroh's fallback to the image's own dumbpipe is proven locally only; - an installed ssh gateway re-rendering its iroh-dial HostProcess to the new dumbpipe tree across the upgrade: proven in prod's layout on hat-8 (`~/.tmp/gw-dial/`): `systemctl restart` of the `--fg` gateway re-renders the dialer onto the 0.40.1 tree (extracted before the dialer starts), dialer down about 21 s, 0 ERROR, new connections to 0.39.0 and 0.40.1 listeners PASS, rollback the same; an open session breaks at the restart as on every release; one host, no real signed-in ssh session - 0007:upgrade does not assert per-bidder iroh reachability of the from binary (follow-up); - three outer bounds of the test host shorter than their step's stated worst case (`dev up` 200 s, requester stop 120 s, page-round 900 s): latent, never observed; raising them alone was reviewed NOT SAFE (Findings); - provision StateSyncs are never deleted; the local market delivers no RFP over the market stream, so a change to RFP intake is proven on staging only. - Next: the roll of this pull (release, test, promote); then `cli-help` (decision 74) for the second roll. - Landed without CI (docs, site): the site from `site/` with `/install.sh`, white pages, build-time highlighting, the lexicon and XRPC reference, lexicon tables and glossary generated from `lexicons/`; the flow map; plan 0053 (rename to `computer.socialweb.*` and `goat lex publish`, after Done when; decision 59). - Not in the batch: the DigitalOcean bidder (decisions 47, 68; built, never run against DigitalOcean; paused; the owner rotates the OAuth secret before it goes live). - Open, no fix yet: the guest's own release step exits 1 every time (0005); a stable build's version string holds `-rc`; 0001:run's second node that never joined (11-18); the trace's code findings (findings). - Compute: prod is hat-7, hat-8, hat-9, hat-10. The DigitalOcean OAuth client secret that sat in the old site's web root must be rotated by the owner. ## Flow Every push to main that changes code: `release`, then `test`, then `promote` (decision 43: in series; a roll is green only when both are): ``` release gate checks, the one build, publish bucket main//binaries/{..., SHA256SUMS} | green test one ephemeral staging network; every entry below (48), as staging's own accounts (drivers alice1..alice4) | green promote on the release VM, as socialweb.computer (release-workload): 1. write manifest + version vT-rcN, move channel rc 1b. this commit's `test` check first; anything but success is red (so stable never moves on a red staging test) 2. deploy the socialweb-computer droplet (gateway, ssh gateway) to the same binary 3. wait until every rc-operator bidder heartbeats rcN's sha256 (10 min): the bidders update themselves 4. prod retest: every *both* entry below against prod, as prod bob and alice 5. green: version vT on the same manifest, move channel stable, copy main// to releases/vT/ (no build) red: at once (no debug hold): move rc back to the version it pointed at before (what this promote rolled forward from), deploy its binary to the droplet, wait until every bidder heartbeats it; debug from the run's artifacts ``` A failed, cancelled or timed-out `test` is held for debug (cancelled or timed out: from step 7; before then, a Finding and a rerun) and fixed in place (`docs/ci-debug.md`) before the next CI cycle. A red, cancelled or timed-out `promote` rolls back at once (owner, 2026-11-17) and is debugged from its artifacts (`gate-runs`) and fixed before the next cycle; it ends with `rc` and the droplet on this promote's version (green) or the one it rolled forward from. Until step 15 lands, `promote.yml` runs only when asked (`asked:`), so main never releases an untested gate; with step 15 (built on branch `step-15`) it runs on every push to main with test.yml's paths. Until step 11 lands, nobody asks it: `scripts/promote.sh` on phase-2 calls the gate in a form the gate refuses (step 11). ## Decisions - Bidders follow their channel both ways; a rollback is a channel move. - A hand roll moves prod to a binary that promote did not release; there is none. A host may be reinstalled or repaired by hand at its channel's current release (e.g. hat-7 as bob). - The socialweb.computer account (`did:plc:gmlkrhimoueejcertevr4hl3`) owns every `software.release.*` record. - A bidder is on a release when its own executable's sha256 (heartbeat `version.sha256`) equals the artifact's (its CID is CIDv1 raw of that sha256). CI's rcs are main builds (`v0.0.0-rc99.0.