design-nearest-region
New apps get a region of their own. The console guesses the nearest one from the person's timezone (an embedded IANA zone.tab), then from GeoIP (an operator mmdb with DB-IP attribution), then falls back to home. It picks the great-circle nearest region that is positively eligible. Instances created without --region inherit the app's region, except fleet, pooled, static and replica instances. The CLI gains carlos apps create --region, carlos deploy --region and canary --region. /regions gains app_default. scripts/region-service-gate.sh is the rollout gate.
Automatic eligibility, after the final review, requires every live box in a region that reconcile would admit to be fully eligible: hibernation configured, serving the shared pool, accepting inbound, and holding the matching CARLOSSECRETSKEY fingerprint. Liveness comes from fresh status snapshots. Any incomplete or unmatched evidence makes automatic placement home-only for that request.
Copy: 123 strings in docs/superpowers/plans/2026-10-02-nearest-region-copy.json, approved by Paul on 2026-10-02 (121) and 2026-10-03 (D4 corrected, plus C15/C25 no-home fallbacks). TestApprovedCopyIsApplied pins them.
Rollout: follow README "Turning app regions on". Merge and roll with CONSOLEAPPREGIONS OFF (Paul, 2026-10-03). With the switch off, behaviour is unchanged. Turning it on waits for two things:
- the host-lifecycle claim (#199), because automatic non-home placement is outside the leftover-data rail;
- #213, so that a box without the secrets key refuses instances. Console-side checks cannot prove what reconcile admits. Boxes must hold CARLOSSECRETSKEY before they are eligible (R9). All four flagship boxes do. Related: #212 (box label collisions).
Gate at 853a3b2c, root re-run at 7d31c145: build, vet and gofmt clean; five cross-compile targets; go test ./... all ok; launchctx ok.
Nearest-region default: new apps get the region nearest their owner, behind CONSOLEAPPREGIONS (off by default). Built and final-reviewed; ready to merge with the switch off.
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- claude agent, operated by paul@keymail.dev pushed 7d31c1455 test: the fleet C13b subprocess test uses carlosTestEnv so CARLOS_DESTINATION is cleared
- claude agent, operated by paul@keymail.dev pushed 853a3b2ca copy: D4 corrected, C15/C25 no-home fallbacks, no C13b on fleet placements (Paul's copy review 2026-10-03)
- claude agent, operated by paul@keymail.dev pushed 7272df2ec console: a box with only one of its two objects is unknown liveness, so the evidence is incomplete (re-review r2, rulings A and B reversed)
- claude agent, operated by paul@keymail.dev pushed b01bab82d console: automatic non-home eligibility needs complete evidence; a partial read makes nothing non-home eligible (re-review r1)
- claude agent, operated by paul@keymail.dev pushed 9435b01fc console: only a box reconcile would admit can take a region out of automatic eligibility (Ruling F2, refined)
- claude agent, operated by paul@keymail.dev pushed 82a6369d2 geo: a malformed GeoIP location is a miss (final review)
- claude agent, operated by paul@keymail.dev pushed 0d0376ddc console: a switch-off console reports one region available, so the CLI never prints C11 for a flag it ignores (final review, C11)
- claude agent, operated by paul@keymail.dev pushed 498b19222 console test: each capability field absent or false on its own, keyed, blocks eligibility (final review Task 10)
- claude agent, operated by paul@keymail.dev pushed 9b3d374ca console: every live box in a region must qualify before it is automatically eligible (final review F2)
- claude agent, operated by paul@keymail.dev pushed f2b1b463f console: a box counts toward automatic region eligibility only while its status snapshot is fresh (final review F1)
- claude agent, operated by paul@keymail.dev pushed 7311890c6 test: short approved copy must be a whole string literal, not text in a comment (nearest-region Task 25 fix 1)
- claude agent, operated by paul@keymail.dev pushed e34f5964a test: every approved nearest-region string is applied, and the record lists the whole inventory (nearest-region Task 25)
- claude agent, operated by paul@keymail.dev pushed 6bb686070 docs: place the instances create region sentence with the create discussion (nearest-region D4)
- claude agent, operated by paul@keymail.dev pushed d56580945 docs: region flags, console env and release checklist (nearest-region D1-D10)
- claude agent, operated by paul@keymail.dev pushed d6b1b839f scripts: region gate counts version headers apart from their values; a duplicate fails (review fix 2)
- claude agent, operated by paul@keymail.dev pushed 5f2039022 scripts: region gate takes the status from curl and the version from the final response only (review fix)
- claude agent, operated by paul@keymail.dev pushed 779af1c52 scripts: region service gate, proxy-proof, proved against a real backhaul (nearest-region §17 step 6)
- claude agent, operated by paul@keymail.dev pushed 29edf1dde cli: canary --region checks with reads before any write; refuses identically on fleets and older consoles (nearest-region §11)
- claude agent, operated by paul@keymail.dev pushed 0bf304f1f cli: deploy --region checks the stored region before shipping and stops on a failed read (nearest-region §11)
- claude agent, operated by paul@keymail.dev pushed b83059298 cli: C13b is decided by the region source, not by comparing codes (nearest-region §9.6)
- claude agent, operated by paul@keymail.dev pushed d1c41c15e cli: apps create and deploy onboarding send a timezone, take --region, print the region line (nearest-region §11)
- claude agent, operated by paul@keymail.dev pushed edffc4fd9 cli: region copy, as approved
- claude agent, operated by paul@keymail.dev pushed ac1e7d4bd console: list possible placement discrepancies on start (nearest-region §5.7)
- claude agent, operated by paul@keymail.dev pushed 594cf6fb8 console: Instances tab names where new instances start, only when confirmed (nearest-region §10)
- claude agent, operated by paul@keymail.dev pushed 1f8ca0a1c console: app_default with every reason, place names, POST regions/guess (nearest-region §9.3, §9.4)
- claude agent, operated by paul@keymail.dev pushed 9e8141012 console: instance door fills the app region, proves eligibility, refuses keyless regions (nearest-region §7, R9)
- claude agent, operated by paul@keymail.dev pushed a50640734 console: new-app region picker with @auto, browser guess route (nearest-region §10, §9.5)
- claude agent, operated by paul@keymail.dev pushed 69a842241 console: switch off skips explicit-region validation; resolveNewAppRegion rejects non-region codes (nearest-region §9.6)
- claude agent, operated by paul@keymail.dev pushed 28e42e588 console: resolve the app region inside claimApp; API create takes region and timezone (nearest-region §5.5, §8.1, §9.1, R9)
- claude agent, operated by paul@keymail.dev pushed eff34e137 console: the region guess, with existence and policy invariants property-tested (nearest-region §6.4)