carlos / platform Public

Merge main into stateless-replicas-3-routing

Brings in region HA P2b-1 (bb8973d1). The census chain keeps main's
region-ha-p2b line first, then this branch's overlay, re-proposed so
the internal/host envelope is pinned against the merged tree. Seal is
unchanged at 703d9a18.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev ffabeb2fb4e46cbc1a45813c51382e9a69c36f89 parent 1ed25a9parent bb8973d
80 files changed, +6,014 −685
  • cmd/console/hacapacity_test.go +251 −0
  • cmd/console/main.go +20 −3
  • docs/region-ha-runbook.md +18 −0
  • docs/site/cli.md +12 −0
  • docs/superpowers/notes/census-proposal-region-ha-p2b.md +19 −0
  • docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md +425 −0
  • docs/superpowers/reviews/REVIEW-BRIEF-REGION-HA-P2B-R1.md +92 −0
  • docs/superpowers/reviews/REVIEW-BRIEF-REGION-HA-P2B1-BRANCH-R1.md +81 −0
  • docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md +93 −0
  • docs/superpowers/reviews/REVIEW-REGION-HA-P2B1-BRANCH-R1.md +145 −0
  • internal/console/apidomainbuy.go +1 −1
  • internal/console/apidomains.go +6 −6
  • internal/console/apiinstanceimport.go +7 −7
  • internal/console/apiinstances.go +140 −98
  • internal/console/apiinstanceseed.go +13 −13
  • internal/console/apiplacements.go +20 −20
  • internal/console/apipolicy.go +9 −9
  • internal/console/apiship_rootfs.go +6 −6
  • internal/console/apisidecars.go +16 −2
  • internal/console/appcopies.go +3 −3
  • internal/console/appdomainbuy.go +1 −1
  • internal/console/appregionset.go +18 −18
  • internal/console/awsregionmetric.go +9 −1
  • internal/console/awsregionmetric_test.go +246 −0
  • internal/console/claim_first_route.go +1 −1
  • internal/console/claim_response.go +3 −3
  • internal/console/copiespublication.go +4 −4
  • internal/console/createleftovers.go +6 −6
  • internal/console/demo_data.go +1 −1
  • internal/console/demo_domains.go +3 −3
  • internal/console/domainattach.go +72 −59
  • internal/console/domainbuy.go +16 −10
  • internal/console/domainbuy_capacity_test.go +94 −0
  • internal/console/domainbuy_copy.go +4 −4
  • internal/console/domaincatchall.go +10 −10
  • internal/console/egressfleet.go +6 −6
  • internal/console/fleetfloor.go +3 −3
  • internal/console/ha_born_test.go +3 −0
  • internal/console/hacapacity.go +522 −0
  • internal/console/hacapacity_observe.go +645 −0
  • internal/console/hacapacity_observe_test.go +688 −0
  • internal/console/hacapacity_test.go +680 −0
  • internal/console/hacreate.go +1 −1
  • internal/console/hacreate_test.go +4 −1
  • internal/console/hacreatecapacity_test.go +1,000 −0
  • internal/console/hap2_wiring_test.go +2 −0
  • internal/console/hostclaimops.go +0 −9
  • internal/console/hostsused.go +19 −19
  • internal/console/lifetimes.go +6 −6
  • internal/console/lifetimes_floor.go +4 −4
  • internal/console/lifetimes_retire.go +3 −3
  • internal/console/nocapacity.go +35 −3
  • internal/console/nocapacity_test.go +1 −1
  • internal/console/plancaps.go +2 −2
  • internal/console/policylease.go +7 −7
  • internal/console/policysize.go +4 −4
  • internal/console/regioncapacity.go +59 −82
  • internal/console/regioncapacity_test.go +89 −181
  • internal/console/regionclaim.go +3 −3
  • internal/console/rootfs.go +16 −16
  • internal/console/rootfs_test.go +1 −0
  • internal/console/seedfloor.go +8 −8
  • internal/console/seedscratch.go +4 −4
  • internal/console/server.go +9 −1
  • internal/console/teamcreds.go +2 −2
  • internal/console/teamenv.go +3 −3
  • internal/console/teamfloor.go +5 −5
  • internal/console/testdata/claim-authority-sites.txt +3 −1
  • internal/edge/testdata/edges-forward-hub.json +1 −1
  • internal/host/edgesfile.go +22 −6
  • internal/host/edgesfile_pools_test.go +262 −0
  • internal/host/edgesfile_test.go +6 −6
  • internal/host/egress_nopolicy_linux_test.go +1 −1
  • internal/host/movesoffline_e2e_test.go +2 −1
  • internal/host/testdata/edges-p2b-golden.json +1 −0
  • internal/provision/demo_census_test.go +5 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-region-ha-p2b.tsv +4 −0
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv +1 −1
  • internal/release/openers_test.go +6 −4

CI passed — run details

Intent

Human

<task-notification> <task-id>a883a559d214f8c7e</task-id> <tool-use-id>toolu_01YRuLCNuxptGsQvt9di7kyd</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/a883a559d214f8c7e.output</output-file> <status>completed</status> <summary>Agent "Plan 3 final-fix scoped re-review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I1: ADDRESSED. The skew early return is gone from internal/edge/replicaprober.go. A lagging copy whose lifetime, box and boot match now counts toward fail/rise and refreshes `ObservedAt` (:246-273), and the sample keeps the hub's own revision (:260). Mismatches still go stale (:247-252), and `Live` aging is unchanged (:339-347). Review Focus 2 still holds: `TestReplicaProbeRejectsOldIdentity`, `TestReplicaProbeRevisionSkewRefreshesHealth` and `TestReplicaProbeRevisionChangeKeepsServing` pass on a targeted run. Census: APPROVE, seal 703d9a189185e2075ec088bf9349e5813257308c67187b5968680ea4f9635af1. `make census-card` reports it clean, and the census and scope tests pass. Only `replicaProber.record` and the internal/edge envelope were re-pinned. That unit still reads exactly what it read before (only the line offsets moved), and its disposition is unchanged. New breakage: none. Written to .superpowers/sdd/2026-11-01-stateless-replicas-3-routing/final-rereview.md.</result> <usage><subagent_tokens>80148</subagent_tokens><tool_uses>12</tool_uses><duration_ms>118028</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>ae035cd10aeedb36e</task-id> <tool-use-id>toolu_01EaKLUUWwfRDvm4xXxBpXKL</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/ae035cd10aeedb36e.output</output-file> <status>completed</status> <summary>Agent "F8 round 4 census review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Round 4 verdict: APPROVE.** I appended it under "## Round 4" in /home/paulca/.cache/sr-f8/census-review.md. **Seal:** `a281947807e484b1b26669df82bc967e1622899a9ec312da7fb1f43b7e30253d`. `make census-card` reports the census clean at this seal. **Tests:** in the sandbox, the two census fixture tests failed only on the read-only go cache. Outside the sandbox the provision targeted run passed (ok, 18.6s), and the host binding tests pass. The three host units and both envelopes are approved. The publisher reads only the route it is handed. It writes the existing binding object, adding only a copy of the registry incarnation, and only for unlabelled legacy stateless rows. It runs once per wake or agent start, never periodically, and reads no tenant data or secrets. Root's own provision callers still pass no evidence, so root's writer behaviour is unchanged. None of the findings blocks approval; all are minor (P3): 1. The hub's `ReconcileFleetBindings` now stamps the publishing box (`FleetBox`) on stateless unlabelled forward rows (internal/host/fleetbind.go:309,349; internal/registry/forward.go:40-47). It is not a widening, but the claims omit it and no host test covers it. 2. Bindings are authenticated per fleet, not per box: any box in the fleet can publish and take over (internal/host/fleetbind.go:111-113). This is already recorded and is not a census widening. 3. The publisher trusts the incarnation in the box's own registry row, which root's provision reconcile installs. A zero incarnation publishes nothing (internal/host/fleetbind.go:462), so it fails closed, but rollout depends on that counter being set first. 4. Outside root scope: the console's first labelling (internal/console/fleetrelabel.go:197-210) could label these records where labelling is not paused. That is the console reviewer's call. 5. The overlay and proposal correctly say approval is pending. Record this verdict on #280 with tip 5e94402b and this seal.</result> <usage><subagent_tokens>81673</subagent_tokens><tool_uses>17</tool_uses><duration_ms>241645</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a4f56ac3d04e2d274</task-id> <tool-use-id>toolu_01SLqmKEFG4uLvAxAGGeApZE</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/a4f56ac3d04e2d274.output</output-file> <status>completed</status> <summary>Agent "F8 round 4 code review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Verdict: NEEDS FIXES.** Round 4 does not fix F8 on dev. The full review is at /home/paulca/.cache/sr-f8/review-r4.md. - **Critical C1: the binding fix still never gets published in the live flow.** The new publisher only adds the record's incarnation when the box's row is already marked stateless (internal/host/fleetbind.go:461). A row only becomes stateless after a stateless release has served, and that release needs coordination first (activator.go:2243, statelessrelease.go:56-63). - **s1 stateful, then s2 `--stateless` (the r10r case):** each stateful wake overwrites the binding without the field, so the console returns 404 and s2 is abandoned every 15 s, as today. - **Stateless from birth:** the first wake needs a binding that nothing publishes before it. It only works if the box agent happens to restart in between. - **Box replacement:** works only once the target has already been released. - **Tests:** they hide this by setting `rt.Stateless = true` by hand. - **Narrowest fix:** carry the incarnation on every binding written for an eligible unlabelled row, stateful ones included. - **Critical C2: every dev fleet record has incarnation 0, and both sides refuse 0** (fleetbind.go:462, console replicacoordinator.go:63). - **Bucket check:** I read the dev bucket (read-only, `--profile kass`). The railsdemo, shop and cable records have no `incarnation` field, and `control/lifetimes-cutover.json` returns 404. - **Why new records are 0 too:** lifetimes are not switched on for dev. Only the lifetimes-on path gives a new record an incarnation (lifetimes_create.go:123); the other create path never sets it (hostsused.go:651-688). The migration that would fill it in also needs lifetimes on. - **Scope:** zero-incarnation records are those created before lifetimes existed, plus every dev create, including the F8 smoke apps. This alone blocks F8 on dev, whatever is done about C1. - **Manager's call:** - Either switch lifetimes on and migrate on dev before smoke-testing. - Or use a lifetime marker legacy records already have, such as the record's stored `created_at` compared for exact equality. The brief allowed that. On the prior findings: - **C1 (box publishes the binding):** NOT ADDRESSED in effect, for the reason above. - **I1 (renewal GETs as an accepted cost):** ADDRESSED. The commit body, census proposal and report all state it. - **No clock comparison, lifetime compared for equality:** ADDRESSED (console :63, writer check provision/replicacoordinator.go:26). - **Skewed-clock witness:** ADDRESSED. It now passes trivially, because no clock is compared. Authority is clean. Labelled, set and stateful paths are unchanged, there is no periodic publisher, and the takeover rules are unchanged. First labelling's clock check is untouched, but it can now act on the new stateless bindings (Minor n1). The targeted provision, host and console tests all pass at 5e94402b. I ran the host tests with the default TMPDIR because /tmp/g is read-only in this sandbox.</result> <usage><subagent_tokens>137007</subagent_tokens><tool_uses>60</tool_uses><duration_ms>536342</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b9bmzugxv</task-id> <tool-use-id>toolu_016LnqKnFvzg7zRSNrisGbAB</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/b9bmzugxv.output</output-file> <status>completed</status> <summary>Background command "Push final tip, post census, watch CI" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 246 g CO₂e (27,606,951 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-3-routing, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

cmd/console/hacapacity_test.go

Loading diff…

cmd/console/main.go

Loading diff…

docs/region-ha-runbook.md

Loading diff…

docs/site/cli.md

Loading diff…

docs/superpowers/notes/census-proposal-region-ha-p2b.md

Loading diff…

docs/superpowers/plans/2026-11-04-region-ha-p2b-console.md

Loading diff…

docs/superpowers/reviews/REVIEW-BRIEF-REGION-HA-P2B-R1.md

Loading diff…

docs/superpowers/reviews/REVIEW-BRIEF-REGION-HA-P2B1-BRANCH-R1.md

Loading diff…

docs/superpowers/reviews/REVIEW-REGION-HA-P2B-R1.md

Loading diff…

docs/superpowers/reviews/REVIEW-REGION-HA-P2B1-BRANCH-R1.md

Loading diff…

internal/console/apidomainbuy.go

Loading diff…

internal/console/apidomains.go

Loading diff…

internal/console/apiinstanceimport.go

Loading diff…

internal/console/apiinstances.go

Loading diff…

internal/console/apiinstanceseed.go

Loading diff…

internal/console/apiplacements.go

Loading diff…

internal/console/apipolicy.go

Loading diff…

internal/console/apiship_rootfs.go

Loading diff…

internal/console/apisidecars.go

Loading diff…

internal/console/appcopies.go

Loading diff…

internal/console/appdomainbuy.go

Loading diff…

internal/console/appregionset.go

Loading diff…

internal/console/awsregionmetric.go

Loading diff…

internal/console/awsregionmetric_test.go

Loading diff…

internal/console/claim_first_route.go

Loading diff…

internal/console/claim_response.go

Loading diff…

internal/console/copiespublication.go

Loading diff…

internal/console/createleftovers.go

Loading diff…

internal/console/demo_data.go

Loading diff…

internal/console/demo_domains.go

Loading diff…

internal/console/domainattach.go

Loading diff…

internal/console/domainbuy.go

Loading diff…

internal/console/domainbuy_capacity_test.go

Loading diff…

internal/console/domainbuy_copy.go

Loading diff…

internal/console/domaincatchall.go

Loading diff…

internal/console/egressfleet.go

Loading diff…

internal/console/fleetfloor.go

Loading diff…

internal/console/ha_born_test.go

Loading diff…

internal/console/hacapacity.go

Loading diff…

internal/console/hacapacity_observe.go

Loading diff…

internal/console/hacapacity_observe_test.go

Loading diff…

internal/console/hacapacity_test.go

Loading diff…

internal/console/hacreate.go

Loading diff…

internal/console/hacreate_test.go

Loading diff…

internal/console/hacreatecapacity_test.go

Loading diff…

internal/console/hap2_wiring_test.go

Loading diff…

internal/console/hostclaimops.go

Loading diff…

internal/console/hostsused.go

Loading diff…

internal/console/lifetimes.go

Loading diff…

internal/console/lifetimes_floor.go

Loading diff…

internal/console/lifetimes_retire.go

Loading diff…

internal/console/nocapacity.go

Loading diff…

internal/console/nocapacity_test.go

Loading diff…

internal/console/plancaps.go

Loading diff…

internal/console/policylease.go

Loading diff…

internal/console/policysize.go

Loading diff…

internal/console/regioncapacity.go

Loading diff…

internal/console/regioncapacity_test.go

Loading diff…

internal/console/regionclaim.go

Loading diff…

internal/console/rootfs.go

Loading diff…

internal/console/rootfs_test.go

Loading diff…

internal/console/seedfloor.go

Loading diff…

internal/console/seedscratch.go

Loading diff…

internal/console/server.go

Loading diff…

internal/console/teamcreds.go

Loading diff…

internal/console/teamenv.go

Loading diff…

internal/console/teamfloor.go

Loading diff…

internal/console/testdata/claim-authority-sites.txt

Loading diff…

internal/edge/testdata/edges-forward-hub.json

Loading diff…

internal/host/edgesfile.go

Loading diff…

internal/host/edgesfile_pools_test.go

Loading diff…

internal/host/edgesfile_test.go

Loading diff…

internal/host/egress_nopolicy_linux_test.go

Loading diff…

internal/host/movesoffline_e2e_test.go

Loading diff…

internal/host/testdata/edges-p2b-golden.json

Loading diff…

internal/provision/demo_census_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-region-ha-p2b.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv

Loading diff…

internal/release/openers_test.go

Loading diff…