carlos / platform Public

nearest-region-a

What

Merge A of the nearest-region never-reuse plan (#404; spec docs/superpowers/specs/2026-10-26-nearest-region-without-claims-design.md rev 5, plan docs/superpowers/plans/2026-10-26-nearest-region-never-reuse.md, both carried here unchanged from design-nearest-region-199). Tasks 2, 3 and 4.

  • Task 2 (internal/provision/hostsused.go): a create-only mark per hostname at control/hosts-used/<host>.json; @mode (absent = incomplete) and @floor beside it; Record.DataKind (static and service exempt); WriteRecord refuses an in-place kind change (a create or a tombstone excepted), decoding the kind as record readers do, on the bytes actually written.
  • Task 3 (internal/console/hostsused.go): the instance (every placement), seed, import and sidecar doors mark after every other check and immediately before persisting (before BeginAllocation with lifetimes on). Exempt creates never mark. Incomplete mode: a mark already there passes. Active mode: S1, except a landed retry, which gets the door's own duplicate. A failed mark or mode read: S2 in every mode. Mode read once per process.
  • Task 4: GET /api/cli/system/hosts-used/status (operators, read-only) and carlos system hosts-used status.

What a user sees

Nothing new on create while the mode is incomplete, which it stays until merge B: the only change is that an unwritable bucket answers 503 S2 instead of 502. The nearest-region switch stays off. Paul can see: carlos system hosts-used status on dev shows mode incomplete and the count rising with each new data-kind instance.

Tests and review

Witnesses through the real doors with lifetimes off and on, mutation-checked; a source-scan guard over every record-creating call in internal/console. Local: touched packages with -run, vet, gofmt, linux/darwin/windows builds. CI on the tip.

Reviews (Astra, findings committed unedited under docs/superpowers/notes/reviews/):

  • Task 2: r1 NOT READY (1 P1, kind decoding vs readers' alias rules; fixed), r2 READY.
  • Task 3: r1 READY AFTER FIXES (1 P2, temporary-app witness; applied).
  • Branch (covers Task 4) and census approval: see below.
  • Branch (covers Task 4): r1 READY AFTER FIXES (1 P2, CLI witness through the built binary; applied).
  • Census: approval (envelopes ., internal/console, internal/provision; body changes to runSystem and systemVerb), Astra approved every unit and envelope, recorded on #280. No decisions.

Drafts for merge B's copy review

carlos system hosts-used status lines, and its usage entry, are plain drafts (see system_hostsused.go, system.go).

Human

Merge A of the nearest-region never-reuse plan (#404, spec rev 5 on design-nearest-region-199): Tasks 2-4. A create-only hostname mark (control/hosts-used/<host>.json) written by every data-kind create writer before it persists, record kind immutability, and carlos system hosts-used status. Mode stays incomplete; the nearest-region switch stays off.

Commits 14
Discussions 0 0 open
Tasks 5/5 done

Discussions

  • No discussions on this branch yet.

Tasks 5/5 done

  • Task 2: hostname history store, data-kind predicate, kind immutability (Astra r1 NOT READY 1 P1 fixed; r2 READY) Done
  • Task 3: mark in every data-kind create writer (Astra r1 READY AFTER FIXES, 1 P2 applied) Done
  • Task 4: hosts-used status door and CLI Done
  • Whole-branch review (covers Task 4): Astra r1 READY AFTER FIXES, 1 P2 applied Done
  • Census approval on #280 (Astra: all approve, no escalation) Done

Activity