console: every data-kind create writer marks its hostname first
Nearest-region never-reuse plan, Task 3 (#404). The instance, seed, import and sidecar doors mark control/hosts-used/<host>.json after every other check and immediately before persisting: before BeginAllocation with lifetimes on (createRecordWithLifetimeLocked, after step 2's record read), before the create-only write otherwise (createRecordMarked, createSidecarMarked). Static and service kinds, attach first routes and temporary apps never mark. In incomplete mode a mark already there passes; in active mode it refuses with S1, after a read that answers a landed retry with the door's own duplicate. A mark or mode read that fails refuses with S2 in every mode. The mode is read once per process. Witnesses through the real doors, lifetimes off and on, plus a source-scan guard over every record-creating call in internal/console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 files changed,
+784
−11
docs/superpowers/notes/census-proposal-nearest-region-a.md+1 −1internal/console/apiinstances.go+3 −1internal/console/apiinstances_test.go+5 −2internal/console/apiinstanceseed.go+3 −2internal/console/apisidecars.go+8 −1internal/console/apisidecars_test.go+5 −2internal/console/hostsused.go+183 −0internal/console/hostsused_writers_test.go+523 −0internal/console/lifetimes.go+4 −0internal/console/lifetimes_create.go+9 −0internal/console/server.go+3 −0internal/provision/nearest_region_a_census_test.go+34 −0internal/provision/testdata/plan14-root-reads-nearest-region-a.tsv+3 −2
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/notes/census-proposal-nearest-region-a.md b/docs/superpowers/notes/census-proposal-nearest-region-a.md| index 746b430b2..ac9bca991 100644 |
| --- a/docs/superpowers/notes/census-proposal-nearest-region-a.md |
| +++ b/docs/superpowers/notes/census-proposal-nearest-region-a.md |
| @@ -2,7 +2,7 @@ |
| Ruling `census-ruling-nearest-region-a`. Every change below keeps the disposition it already has, so it needs an approval, not a decision. |
| -Envelopes re-pinned: `internal/provision`. |
| +Envelopes re-pinned: `internal/console`, `internal/provision`. |
| Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Escalate if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. An escalation goes to the census owner as a decision. |
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go| index ae0f0cb51..ab11b4593 100644 |
| --- a/internal/console/apiinstances.go |
| +++ b/internal/console/apiinstances.go |
| @@ -1856,7 +1856,9 @@ func (s *Server) handleAPIInstanceCreate(w http.ResponseWriter, r *http.Request) |
| rec = *created |
| } |
| default: |
| - recordWriteErr = provision.CreateRecord(ctx, s.cfg.Releases, rec) |
| + // The hostname history's mark for a data kind, then the |
| + // create-only write (hostsused.go). |
| + recordWriteErr = s.createRecordMarked(ctx, rec) |
| } |
| if err := recordWriteErr; err != nil { |
| if ref, ok := lifetimeCreateRefusal(host, err, msgLifetimeCreatePending); ok { |
diff --git a/internal/console/apiinstances_test.go b/internal/console/apiinstances_test.go| index ca2c63c93..0ab0d5e14 100644 |
| --- a/internal/console/apiinstances_test.go |
| +++ b/internal/console/apiinstances_test.go |
| @@ -2024,10 +2024,13 @@ func TestAPIInstanceStoreFailure(t *testing.T) { |
| enableInstances(t, fx, "titogo", titoManifest()) |
| u := instancesURL(fx, "bab", "titogo") |
| + // An unwritable bucket now fails at the hostname history's mark, the |
| + // create's first write: 503 with S2 (nearest-region never-reuse, plan |
| + // Task 3), still with no store text in it. |
| fx.srv.cfg.Releases = brokenStore{fx.rel} |
| status, _, out := rawReq(t, http.MethodPost, u, token, `{"host":"acme.go.tito.io","region":"ie"}`) |
| - if status != http.StatusBadGateway { |
| - t.Fatalf("create against an unwritable bucket = %d %s, want 502", status, out) |
| + if status != http.StatusServiceUnavailable || ltErr(out) != msgHostUnchecked("acme.go.tito.io") { |
| + t.Fatalf("create against an unwritable bucket = %d %s, want 503 %q", status, out, msgHostUnchecked("acme.go.tito.io")) |
| } |
| if strings.Contains(out, "carlos-prod-secret-bucket") || strings.Contains(out, "ABC123") { |
| t.Fatalf("refusal leaks the store's error text: %s", out) |
diff --git a/internal/console/apiinstanceseed.go b/internal/console/apiinstanceseed.go| index eec696fbb..1126eed88 100644 |
| --- a/internal/console/apiinstanceseed.go |
| +++ b/internal/console/apiinstanceseed.go |
| @@ -79,13 +79,14 @@ type seedCreate struct { |
| // createSeedRecord writes a seed door's first record: the lifetime create |
| // when the request was admitted with lifetimes on (dispatch by the unit), |
| -// today's create-only write otherwise. |
| +// today's create-only write otherwise. Both mark the hostname first |
| +// (hostsused.go). |
| func (s *Server) createSeedRecord(ctx context.Context, c seedCreate, rec provision.Record) error { |
| if lifetimesUnit(ctx) { |
| _, err := s.createRecordWithLifetime(ctx, rec, c.lifetime) |
| return err |
| } |
| - return provision.CreateRecord(ctx, s.cfg.Releases, rec) |
| + return s.createRecordMarked(ctx, rec) |
| } |
| // seedCommonRefusal is both seed doors' shape rule: an ordinary instance. |
diff --git a/internal/console/apisidecars.go b/internal/console/apisidecars.go| index 034f91f81..9916a4a65 100644 |
| --- a/internal/console/apisidecars.go |
| +++ b/internal/console/apisidecars.go |
| @@ -393,9 +393,16 @@ func (s *Server) handleAPISidecarCreate(w http.ResponseWriter, r *http.Request) |
| return |
| } |
| } else { |
| - recordWriteErr = provision.CreateSidecarRecord(ctx, s.cfg.Releases, rec) |
| + // Always the direct writer, lifetimes on or off: the hostname |
| + // history's mark, then the create-only write (hostsused.go). |
| + recordWriteErr = s.createSidecarMarked(ctx, rec) |
| } |
| if err := recordWriteErr; err != nil { |
| + var used *hostsUsedError |
| + if errors.As(err, &used) { |
| + writeDoorRefusalJSON(w, r, &used.ref) |
| + return |
| + } |
| if errors.Is(err, release.ErrCASConflict) { |
| // A lost race against a second create for the same name, or a |
| // plain duplicate. Either way the winner's record stands. |
diff --git a/internal/console/apisidecars_test.go b/internal/console/apisidecars_test.go| index 62ff24636..5669ed431 100644 |
| --- a/internal/console/apisidecars_test.go |
| +++ b/internal/console/apisidecars_test.go |
| @@ -808,10 +808,13 @@ func TestAPISidecarStoreFailure(t *testing.T) { |
| enableSidecars(t, fx, "titogo", titoSidecarManifest()) |
| u := sidecarsURL(fx, "bab", "titogo") |
| + // An unwritable bucket now fails at the hostname history's mark, the |
| + // create's first write: 503 with S2 (nearest-region never-reuse, plan |
| + // Task 3), still with no store text in it. |
| fx.srv.cfg.Releases = brokenStore{fx.rel} |
| status, _, out := rawReq(t, http.MethodPost, u, token, `{"name":"bot","region":"ie"}`) |
| - if status != http.StatusBadGateway { |
| - t.Fatalf("create against an unwritable bucket = %d %s, want 502", status, out) |
| + if status != http.StatusServiceUnavailable || ltErr(out) != msgHostUnchecked(botHost) { |
| + t.Fatalf("create against an unwritable bucket = %d %s, want 503 %q", status, out, msgHostUnchecked(botHost)) |
| } |
| if strings.Contains(out, "carlos-prod-secret-bucket") || strings.Contains(out, "ABC123") { |
| t.Fatalf("refusal leaks the store's error text: %s", out) |
diff --git a/internal/console/hostsused.go b/internal/console/hostsused.go| new file mode 100644 |
| index 000000000..feda7a20d |
| --- /dev/null |
| +++ b/internal/console/hostsused.go |
| @@ -0,0 +1,183 @@ |
| +package console |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "log" |
| + "net/http" |
| + "os" |
| + "sync" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// The hostname history at the create doors (nearest-region never-reuse, |
| +// spec docs/superpowers/specs/2026-10-26-nearest-region-without-claims-design.md |
| +// §2, plan Task 3). Every data-kind create writer marks its hostname |
| +// (provision.MarkHostUsed) after every other check of its door and |
| +// immediately before the call that persists the record: the create-only |
| +// record write with lifetimes off and for sidecars, BeginAllocation with |
| +// lifetimes on. Exempt kinds (static, service) never mark. |
| +// |
| +// Until the history is active (Task 6's complete) a mark that is already |
| +// there passes: today's behaviour, with the history filling in. Once active |
| +// it refuses the create (S1). A store that cannot be read or written |
| +// refuses in every mode (S2): a create is never persisted unmarked. |
| + |
| +// The approved strings (docs/superpowers/notes/copy/nearest-region-never-reuse.md). |
| +func msgHostUsed(host string) string { |
| + return host + " is in use or has held an app's data before, so it can't be created. Choose another address." |
| +} |
| + |
| +func msgHostUnchecked(host string) string { |
| + return "Could not check whether " + host + " is free. Try again." |
| +} |
| + |
| +const ( |
| + msgHostsInvalidated = "New instances can't be created right now. Try again later." |
| + msgHostsActivating = "New instances can't be created during maintenance. Try again in a few minutes." |
| +) |
| + |
| +// hostsHistory is the process's copy of control/hosts-used/@mode. One |
| +// console process serves a deployment (spec §3a), so the mode is read once |
| +// per process and changed only by this process's own doors (Task 5). |
| +type hostsHistory struct { |
| + mu sync.Mutex |
| + mode string // "" until read |
| +} |
| + |
| +// hostsMode is the history mode: read from the control store the first time |
| +// it is needed, then held. A failed read is not held, so the next caller |
| +// reads again, and it is an error, never a default: the caller refuses. |
| +// A console with no control store has no records to write, and reads |
| +// incomplete. |
| +func (s *Server) hostsMode(ctx context.Context) (string, error) { |
| + s.hosts.mu.Lock() |
| + defer s.hosts.mu.Unlock() |
| + if s.hosts.mode != "" { |
| + return s.hosts.mode, nil |
| + } |
| + if s.cfg.Releases == nil { |
| + return provision.HostsModeIncomplete, nil |
| + } |
| + mode, _, err := provision.ReadHostsMode(ctx, s.cfg.Releases) |
| + if err != nil { |
| + return "", err |
| + } |
| + s.hosts.mode = mode |
| + return mode, nil |
| +} |
| + |
| +// hostsUsedError carries a mark refusal out of a create core that answers |
| +// errors (createRecordWithLifetimeLocked, createRecordMarked); |
| +// lifetimeCreateRefusal turns it back into its door refusal. |
| +type hostsUsedError struct{ ref doorRefusal } |
| + |
| +func (e *hostsUsedError) Error() string { return "console: hosts used: " + e.ref.Msg } |
| + |
| +// markResult is what one mark found. |
| +type markResult int |
| + |
| +const ( |
| + markPass markResult = iota + 1 // marked: fresh, or already there before the history is active |
| + markConflict // a mark was there already, and the history is active |
| +) |
| + |
| +// markHost is the mark step: the mode, then the create-only mark. A refusal |
| +// is the door's answer; otherwise it reports whether the create may go on. |
| +// A conflict once active is the caller's to judge (markForCreate, |
| +// markBeforeCreate). |
| +func (s *Server) markHost(ctx context.Context, u provision.HostUse) (markResult, *doorRefusal) { |
| + mode, err := s.hostsMode(ctx) |
| + if err != nil { |
| + log.Printf("console: hosts used: read the mode for %s: %v", u.Host, err) |
| + return 0, &doorRefusal{http.StatusServiceUnavailable, msgHostUnchecked(u.Host)} |
| + } |
| + switch mode { |
| + case provision.HostsModeActivating: |
| + return 0, &doorRefusal{http.StatusServiceUnavailable, msgHostsActivating} |
| + case provision.HostsModeInvalidated: |
| + return 0, &doorRefusal{http.StatusServiceUnavailable, msgHostsInvalidated} |
| + } |
| + if u.At.IsZero() { |
| + u.At = time.Now().UTC() |
| + } |
| + fresh, err := provision.MarkHostUsed(ctx, s.cfg.Releases, u) |
| + if err != nil { |
| + log.Printf("console: hosts used: mark %s: %v", u.Host, err) |
| + return 0, &doorRefusal{http.StatusServiceUnavailable, msgHostUnchecked(u.Host)} |
| + } |
| + if fresh || mode != provision.HostsModeActive { |
| + return markPass, nil |
| + } |
| + return markConflict, nil |
| +} |
| + |
| +// markForCreate marks u.Host for a create whose door has already settled |
| +// that no record of its own stands under the key (the lifetime create's |
| +// step 2). A mark already there refuses once the history is active (S1), |
| +// whoever wrote it: an earlier record's, or a concurrent create's. |
| +func (s *Server) markForCreate(ctx context.Context, u provision.HostUse) *doorRefusal { |
| + res, ref := s.markHost(ctx, u) |
| + if ref != nil { |
| + return ref |
| + } |
| + if res == markConflict { |
| + return &doorRefusal{http.StatusConflict, msgHostUsed(u.Host)} |
| + } |
| + return nil |
| +} |
| + |
| +// markBeforeCreate is the mark for a create-only writer that has not read |
| +// its own key (lifetimes off, sidecars). On a conflict once active it reads |
| +// the key: a record there is this create's own duplicate, answered as the |
| +// write would (release.ErrCASConflict), so a create retried after its record |
| +// landed gets the door's ordinary answer and not S1. Anything else is S1. A |
| +// failed read refuses (S2). The read costs nothing until a mark conflicts. |
| +func (s *Server) markBeforeCreate(ctx context.Context, u provision.HostUse, key string) error { |
| + res, ref := s.markHost(ctx, u) |
| + if ref != nil { |
| + return &hostsUsedError{*ref} |
| + } |
| + if res != markConflict { |
| + return nil |
| + } |
| + _, _, err := s.cfg.Releases.Get(ctx, key) |
| + switch { |
| + case err == nil: |
| + return release.ErrCASConflict |
| + case errors.Is(err, os.ErrNotExist): |
| + return &hostsUsedError{doorRefusal{http.StatusConflict, msgHostUsed(u.Host)}} |
| + } |
| + log.Printf("console: hosts used: read %s after a conflicting mark: %v", key, err) |
| + return &hostsUsedError{doorRefusal{http.StatusServiceUnavailable, msgHostUnchecked(u.Host)}} |
| +} |
| + |
| +// recordUse is the mark a data-kind instance record's create writes. |
| +func recordUse(rec provision.Record) provision.HostUse { |
| + return provision.HostUse{Host: rec.Host, Account: rec.Account, App: rec.App, Kind: rec.KindOrDefault(), Source: "create"} |
| +} |
| + |
| +// createRecordMarked is the lifetimes-off create of an instance record |
| +// (the instance, seed and import doors): the mark for a data kind, then |
| +// provision.CreateRecord. Exempt kinds write as before. |
| +func (s *Server) createRecordMarked(ctx context.Context, rec provision.Record) error { |
| + if rec.DataKind() { |
| + if err := s.markBeforeCreate(ctx, recordUse(rec), provision.RecordKey(rec.Account, rec.App, rec.Host)); err != nil { |
| + return err |
| + } |
| + } |
| + return provision.CreateRecord(ctx, s.cfg.Releases, rec) |
| +} |
| + |
| +// createSidecarMarked is the sidecar door's create: a sidecar is always a |
| +// data kind, marked at its host, then provision.CreateSidecarRecord. |
| +func (s *Server) createSidecarMarked(ctx context.Context, rec provision.SidecarRecord) error { |
| + u := provision.HostUse{Host: rec.Host, Account: rec.Account, App: rec.App, Kind: "sidecar", Source: "create"} |
| + if err := s.markBeforeCreate(ctx, u, provision.SidecarRecordKey(rec.Account, rec.App, rec.Name)); err != nil { |
| + return err |
| + } |
| + return provision.CreateSidecarRecord(ctx, s.cfg.Releases, rec) |
| +} |
diff --git a/internal/console/hostsused_writers_test.go b/internal/console/hostsused_writers_test.go| new file mode 100644 |
| index 000000000..2d4fdfcd0 |
| --- /dev/null |
| +++ b/internal/console/hostsused_writers_test.go |
| @@ -0,0 +1,523 @@ |
| +package console |
| + |
| +// The hostname history at every create writer (nearest-region never-reuse |
| +// plan, Task 3; spec 2026-10-26-nearest-region-without-claims-design.md §2). |
| +// Every witness goes through the real door, with lifetimes off and on, over |
| +// the fixture's bucket behind an ltStore that records and can fail calls. |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "errors" |
| + "go/ast" |
| + "go/parser" |
| + "go/token" |
| + "net/http" |
| + "os" |
| + "path/filepath" |
| + "sort" |
| + "strings" |
| + "sync" |
| + "testing" |
| + |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// markCase is one create through one door, ready to run. |
| +type markCase struct { |
| + fx *consoleFixture |
| + bucket *ltStore |
| + host string |
| + recordKey string |
| + kind string // the mark's kind |
| + created int // the door's success status |
| + duplicate string // the door's ordinary duplicate answer |
| + create func(t *testing.T) (int, string) |
| +} |
| + |
| +// markDoor builds a markCase for one door with lifetimes off or on. |
| +type markDoor struct { |
| + name string |
| + build func(t *testing.T) markCase |
| +} |
| + |
| +// lifetimesFor runs body once with lifetimes off and once on. useClock is |
| +// set before any fixture exists, as newLtOn does. |
| +func lifetimesFor(t *testing.T, body func(t *testing.T, on func(*testing.T, markCase))) { |
| + t.Run("lifetimes off", func(t *testing.T) { body(t, func(*testing.T, markCase) {}) }) |
| + t.Run("lifetimes on", func(t *testing.T) { |
| + clock := useLifetimesClock(t) |
| + body(t, func(t *testing.T, c markCase) { |
| + t.Helper() |
| + turnLifetimesOn(t, c.fx.srv, clock) |
| + }) |
| + }) |
| +} |
| + |
| +// wrapBucket puts the fixture's bucket behind an ltStore. |
| +func wrapBucket(fx *consoleFixture) *ltStore { |
| + b := <Store{Store: fx.srv.cfg.Releases} |
| + fx.srv.cfg.Releases = b |
| + return b |
| +} |
| + |
| +func postCase(fx *consoleFixture, url, token, body string) func(t *testing.T) (int, string) { |
| + return func(t *testing.T) (int, string) { |
| + t.Helper() |
| + code, _, out := rawReq(t, http.MethodPost, url, token, body) |
| + fx.srv.seedCopies.Wait() |
| + return code, out |
| + } |
| +} |
| + |
| +// markDoors is every data-kind create door, in each placement shape. |
| +var markDoors = []markDoor{ |
| + {"instance", func(t *testing.T) markCase { |
| + fx, member, domain := canaryDoorFixture(t, "code-mark-instance") |
| + host := "plain." + domain |
| + return markCase{fx: fx, bucket: wrapBucket(fx), host: host, |
| + recordKey: provision.RecordKey("bab", "titogo", host), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance " + host + " already exists", |
| + create: postCase(fx, instancesURL(fx, "bab", "titogo"), member, `{"host":"`+host+`"}`)} |
| + }}, |
| + {"addr-backed instance", func(t *testing.T) markCase { |
| + fx, member, domain := canaryDoorFixture(t, "code-mark-addr") |
| + letStateUpstreams(t, fx, "alice@keymail.dev") |
| + host := "addr." + domain |
| + return markCase{fx: fx, bucket: wrapBucket(fx), host: host, |
| + recordKey: provision.RecordKey("bab", "titogo", host), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance " + host + " already exists", |
| + create: postCase(fx, instancesURL(fx, "bab", "titogo"), member, |
| + `{"host":"`+host+`","addrs":["10.0.0.4:8080"],"hibernate":false}`)} |
| + }}, |
| + {"canary", func(t *testing.T) markCase { |
| + fx, member, domain := canaryDoorFixture(t, "code-mark-canary") |
| + host := "new-queue-titogo." + domain |
| + return markCase{fx: fx, bucket: wrapBucket(fx), host: host, |
| + recordKey: provision.RecordKey("bab", "titogo", host), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance " + host + " already exists", |
| + create: postCase(fx, instancesURL(fx, "bab", "titogo"), member, `{"host":"`+host+`","channel":"canary/new-queue"}`)} |
| + }}, |
| + {"region", func(t *testing.T) markCase { |
| + fx := leftoverFixture(t, "code-mark-region") |
| + return markCase{fx: fx.consoleFixture, bucket: wrapBucket(fx.consoleFixture), host: "acme.go.tito.io", |
| + recordKey: provision.RecordKey("bab", "titogo", "acme.go.tito.io"), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance acme.go.tito.io already exists", |
| + create: postCase(fx.consoleFixture, instancesURL(fx.consoleFixture, "bab", "titogo"), fx.token, `{"host":"acme.go.tito.io","region":"ie"}`)} |
| + }}, |
| + {"app region", func(t *testing.T) markCase { |
| + fx, token, u := fillFixture(t, "uk") |
| + return markCase{fx: fx, bucket: wrapBucket(fx), host: "a.go.tito.io", |
| + recordKey: provision.RecordKey("bab", "titogo", "a.go.tito.io"), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance a.go.tito.io already exists", |
| + create: postCase(fx, u, token, `{"host":"a.go.tito.io"}`)} |
| + }}, |
| + {"seed", func(t *testing.T) markCase { |
| + f := newFromFixture(t, 3) |
| + return markCase{fx: f.fx, bucket: wrapBucket(f.fx), host: fromHost, |
| + recordKey: provision.RecordKey("bab", fromApp, fromHost), kind: "instance", created: http.StatusAccepted, |
| + duplicate: "instance " + fromHost + " already exists", |
| + create: postCase(f.fx, f.url, f.token, fromBody)} |
| + }}, |
| + {"import", func(t *testing.T) markCase { |
| + f := newImportFixture(t) |
| + return markCase{fx: f.fx, bucket: wrapBucket(f.fx), host: importHost, |
| + recordKey: provision.RecordKey("bab", fromApp, importHost), kind: "instance", created: http.StatusCreated, |
| + duplicate: "instance " + importHost + " already exists", |
| + create: postCase(f.fx, f.url, f.token, importBody(importHost, importSHA, 4096, importAddr))} |
| + }}, |
| + {"sidecar", func(t *testing.T) markCase { |
| + fx := leftoverFixture(t, "code-mark-sidecar") |
| + return markCase{fx: fx.consoleFixture, bucket: wrapBucket(fx.consoleFixture), host: botHost, |
| + recordKey: provision.SidecarRecordKey("bab", "titogo", "bot"), kind: "sidecar", created: http.StatusCreated, |
| + duplicate: "sidecar bot already exists", |
| + create: postCase(fx.consoleFixture, sidecarsURL(fx.consoleFixture, "bab", "titogo"), fx.token, `{"name":"bot","region":"ie"}`)} |
| + }}, |
| +} |
| + |
| +// recordPresent reports whether key holds a body in the bucket under the |
| +// wrapper. |
| +func recordPresent(t *testing.T, c markCase, key string) bool { |
| + t.Helper() |
| + _, _, err := c.bucket.Store.Get(context.Background(), key) |
| + if err != nil && !errors.Is(err, os.ErrNotExist) { |
| + t.Fatal(err) |
| + } |
| + return err == nil |
| +} |
| + |
| +// markOf reads host's mark; nil when absent. |
| +func markOf(t *testing.T, c markCase) *provision.HostUse { |
| + t.Helper() |
| + raw, _, err := c.bucket.Store.Get(context.Background(), provision.HostsUsedKey(c.host)) |
| + if errors.Is(err, os.ErrNotExist) { |
| + return nil |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var u provision.HostUse |
| + if err := json.Unmarshal(raw, &u); err != nil { |
| + t.Fatal(err) |
| + } |
| + return &u |
| +} |
| + |
| +// forceHostsMode writes mode to the control store and has srv read it again, |
| +// as a console start would. |
| +func forceHostsMode(t *testing.T, srv *Server, mode string) { |
| + t.Helper() |
| + ctx := context.Background() |
| + _, etag, err := provision.ReadHostsMode(ctx, srv.cfg.Releases) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := provision.WriteHostsMode(ctx, srv.cfg.Releases, mode, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + srv.hosts.mu.Lock() |
| + srv.hosts.mode = "" |
| + srv.hosts.mu.Unlock() |
| + if got, err := srv.hostsMode(ctx); err != nil || got != mode { |
| + t.Fatalf("hostsMode = %q %v, want %q", got, err, mode) |
| + } |
| +} |
| + |
| +func eachMarkDoor(t *testing.T, body func(t *testing.T, c markCase)) { |
| + for _, d := range markDoors { |
| + t.Run(d.name, func(t *testing.T) { |
| + lifetimesFor(t, func(t *testing.T, on func(*testing.T, markCase)) { |
| + c := d.build(t) |
| + on(t, c) |
| + body(t, c) |
| + }) |
| + }) |
| + } |
| +} |
| + |
| +// TestCreateDoorsMarkBeforePersisting: the mark's Put lands while nothing of |
| +// the create is persisted (no record body, no allocation row), and the |
| +// create then persists its record. |
| +func TestCreateDoorsMarkBeforePersisting(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + markKey := provision.HostsUsedKey(c.host) |
| + var mu sync.Mutex |
| + var problems []string |
| + marked := false |
| + c.bucket.setHook(func(op, key string) error { |
| + if op != "put" { |
| + return nil |
| + } |
| + mu.Lock() |
| + defer mu.Unlock() |
| + switch key { |
| + case markKey: |
| + marked = true |
| + if _, _, err := c.bucket.Store.Get(context.Background(), c.recordKey); !errors.Is(err, os.ErrNotExist) { |
| + problems = append(problems, "the record was present when the mark was written") |
| + } |
| + if rows, err := c.fx.st.allocations(`host = ?`, c.host); err != nil || len(rows) != 0 { |
| + problems = append(problems, "an allocation row existed when the mark was written") |
| + } |
| + case c.recordKey: |
| + if !marked { |
| + problems = append(problems, "the record was written before the mark") |
| + } |
| + } |
| + return nil |
| + }) |
| + code, out := c.create(t) |
| + c.bucket.setHook(nil) |
| + if code != c.created { |
| + t.Fatalf("create = %d %s, want %d", code, out, c.created) |
| + } |
| + mu.Lock() |
| + defer mu.Unlock() |
| + if len(problems) > 0 { |
| + t.Fatal(strings.Join(problems, "; ")) |
| + } |
| + u := markOf(t, c) |
| + if u == nil || u.Host != c.host || u.Account != "bab" || u.Kind != c.kind || u.At.IsZero() { |
| + t.Fatalf("mark = %+v, want %s's, kind %s", u, c.host, c.kind) |
| + } |
| + if !recordPresent(t, c, c.recordKey) { |
| + t.Fatal("no record after the create") |
| + } |
| + }) |
| +} |
| + |
| +// TestRetryAfterLandedCreateIsDuplicate: the same create again gets the |
| +// door's ordinary duplicate answer, never S1, before and after activation. |
| +func TestRetryAfterLandedCreateIsDuplicate(t *testing.T) { |
| + for _, mode := range []string{provision.HostsModeIncomplete, provision.HostsModeActive} { |
| + t.Run(mode, func(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + if code, out := c.create(t); code != c.created { |
| + t.Fatalf("first create = %d %s", code, out) |
| + } |
| + forceHostsMode(t, c.fx.srv, mode) |
| + before, _, err := c.bucket.Store.Get(context.Background(), c.recordKey) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + code, out := c.create(t) |
| + if code != http.StatusConflict || !strings.Contains(out, c.duplicate) { |
| + t.Fatalf("retry = %d %s, want the door's 409 %q", code, out, c.duplicate) |
| + } |
| + after, _, err := c.bucket.Store.Get(context.Background(), c.recordKey) |
| + if err != nil || string(after) != string(before) { |
| + t.Fatalf("the retry changed the record (%v)", err) |
| + } |
| + }) |
| + }) |
| + } |
| +} |
| + |
| +// TestMarkErrorRefusesInIncomplete: a mark that cannot be written refuses |
| +// the create with S2 before anything is persisted. |
| +func TestMarkErrorRefusesInIncomplete(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + c.bucket.setHook(failNth("put", provision.HostsUsedKey(c.host), 1, true)) |
| + code, out := c.create(t) |
| + c.bucket.setHook(nil) |
| + if code != http.StatusServiceUnavailable || ltErr(out) != msgHostUnchecked(c.host) { |
| + t.Fatalf("create with the mark failing = %d %s, want 503 %q", code, out, msgHostUnchecked(c.host)) |
| + } |
| + if recordPresent(t, c, c.recordKey) { |
| + t.Fatal("a record was written unmarked") |
| + } |
| + if rows, err := c.fx.st.allocations(`host = ?`, c.host); err != nil || len(rows) != 0 { |
| + t.Fatalf("allocation rows = %+v %v, want none", rows, err) |
| + } |
| + }) |
| +} |
| + |
| +// TestModeReadErrorRefuses: a mode that cannot be read is never a default. |
| +func TestModeReadErrorRefuses(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + c.fx.srv.hosts.mu.Lock() |
| + c.fx.srv.hosts.mode = "" |
| + c.fx.srv.hosts.mu.Unlock() |
| + c.bucket.setHook(failNth("get", provision.HostsModeKey, 1, true)) |
| + code, out := c.create(t) |
| + c.bucket.setHook(nil) |
| + if code != http.StatusServiceUnavailable || ltErr(out) != msgHostUnchecked(c.host) { |
| + t.Fatalf("create with the mode unreadable = %d %s, want 503 %q", code, out, msgHostUnchecked(c.host)) |
| + } |
| + if recordPresent(t, c, c.recordKey) || markOf(t, c) != nil { |
| + t.Fatal("the create wrote something with its mode unread") |
| + } |
| + // The next create reads it again and goes ahead. |
| + if code, out := c.create(t); code != c.created { |
| + t.Fatalf("create once the mode reads = %d %s", code, out) |
| + } |
| + }) |
| +} |
| + |
| +// TestUsedHostRefusedEverywhereWhenActive: once active, a hostname with a |
| +// mark is refused with S1 at every door and placement, and nothing is |
| +// written. |
| +func TestUsedHostRefusedEverywhereWhenActive(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + if _, err := provision.MarkHostUsed(context.Background(), c.bucket.Store, provision.HostUse{Host: c.host, Account: "zzz", App: "gone", Kind: "instance", Source: "test"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + forceHostsMode(t, c.fx.srv, provision.HostsModeActive) |
| + code, out := c.create(t) |
| + if code != http.StatusConflict || ltErr(out) != msgHostUsed(c.host) { |
| + t.Fatalf("create of a used host = %d %s, want 409 %q", code, out, msgHostUsed(c.host)) |
| + } |
| + if recordPresent(t, c, c.recordKey) { |
| + t.Fatal("a record was written over a used host") |
| + } |
| + if rows, err := c.fx.st.allocations(`host = ?`, c.host); err != nil || len(rows) != 0 { |
| + t.Fatalf("allocation rows = %+v %v, want none", rows, err) |
| + } |
| + }) |
| +} |
| + |
| +// TestIncompleteModePassesAUsedHost: before activation a mark already there |
| +// changes nothing a user sees. |
| +func TestIncompleteModePassesAUsedHost(t *testing.T) { |
| + eachMarkDoor(t, func(t *testing.T, c markCase) { |
| + if _, err := provision.MarkHostUsed(context.Background(), c.bucket.Store, provision.HostUse{Host: c.host, Account: "zzz", App: "gone", Kind: "instance", Source: "test"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if code, out := c.create(t); code != c.created { |
| + t.Fatalf("create of a marked host before activation = %d %s, want %d", code, out, c.created) |
| + } |
| + if u := markOf(t, c); u == nil || u.Account != "zzz" { |
| + t.Fatalf("mark = %+v, want the first writer's, unchanged", u) |
| + } |
| + }) |
| +} |
| + |
| +// TestExemptCreatesDoNotMark: static and service records, the attach |
| +// doors' first routes and temporary apps write no mark. |
| +func TestExemptCreatesDoNotMark(t *testing.T) { |
| + noMarks := func(t *testing.T, st release.Store) { |
| + t.Helper() |
| + keys, err := st.List(context.Background(), provision.HostsUsedPrefix) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(keys) != 0 { |
| + t.Fatalf("marks written: %v", keys) |
| + } |
| + } |
| + lifetimesFor(t, func(t *testing.T, on func(*testing.T, markCase)) { |
| + t.Run("static and service", func(t *testing.T) { |
| + fx, member, domain := canaryDoorFixture(t, "code-exempt-kinds") |
| + letStateUpstreams(t, fx, "alice@keymail.dev") |
| + c := markCase{fx: fx, bucket: wrapBucket(fx)} |
| + on(t, c) |
| + for _, body := range []string{ |
| + `{"host":"site.` + domain + `","kind":"static"}`, |
| + `{"host":"svc.` + domain + `","kind":"service","addrs":["10.0.0.4:8080"],"hibernate":false}`, |
| + } { |
| + if code, _, out := rawReq(t, http.MethodPost, instancesURL(fx, "bab", "titogo"), member, body); code != http.StatusCreated { |
| + t.Fatalf("%s = %d %s", body, code, out) |
| + } |
| + } |
| + noMarks(t, c.bucket.Store) |
| + }) |
| + t.Run("attach first route", func(t *testing.T) { |
| + fx, member := instanceFixture(t, "code-exempt-attach") |
| + c := markCase{fx: fx, bucket: wrapBucket(fx)} |
| + on(t, c) |
| + shipVersion(t, fx, "titogo", "v1") |
| + seedChannel(t, fx, "titogo", "canary/live", "v1") |
| + code, _, out := rawReq(t, http.MethodPost, domainsURL(fx, "bab", "titogo"), member, `{"host":"fresh.example.com","kind":"static"}`) |
| + if code != http.StatusOK { |
| + t.Fatalf("attach = %d %s", code, out) |
| + } |
| + if _, err := provision.GetRecord(context.Background(), c.bucket.Store, "bab", "titogo", "fresh.example.com"); err != nil { |
| + t.Fatalf("the first route's record: %v", err) |
| + } |
| + noMarks(t, c.bucket.Store) |
| + }) |
| + t.Run("temporary app", func(t *testing.T) { |
| + fx, token := temporaryFixture(t) |
| + c := markCase{fx: fx, bucket: wrapBucket(fx)} |
| + on(t, c) |
| + if code, out := createTemporary(t, fx, token, "tmp-docs", 0); code != http.StatusOK { |
| + t.Fatalf("temporary create = %d %v", code, out) |
| + } |
| + noMarks(t, c.bucket.Store) |
| + }) |
| + }) |
| +} |
| + |
| +// createWriterSites is every call in internal/console that persists a new |
| +// record or begins one, by file and enclosing function, with whether it |
| +// must mark first (and through which call) or why it is exempt. A new |
| +// writer fails TestEveryCreateWriterMarksFirst until it is listed here. |
| +var createWriterSites = map[string]string{ |
| + // Marked: the mark call must come first in the same function. |
| + "hostsused.go Server.createRecordMarked provision.CreateRecord": "mark:markBeforeCreate", |
| + "hostsused.go Server.createSidecarMarked provision.CreateSidecarRecord": "mark:markBeforeCreate", |
| + "lifetimes_create.go Server.createRecordWithLifetimeLocked s.store.BeginAllocation": "mark:markForCreate", |
| + "domainattach.go Server.attachDomainAs provision.CreateRecord": "exempt: a first route is a static record", |
| + "lifetimes_create.go Server.allocRecordLocked provision.WriteRecord": "exempt: publishes an allocation its door marked before BeginAllocation (recovery is Task 7)", |
| + "lifetimes_create.go Server.fenceRecord provision.WriteRecord": "exempt: the fence rewrites a present body's exact bytes", |
| + "lifetimes_migrate.go Server.migrationMarkLocked provision.WriteRecord": "exempt: an in-place rewrite of a present body", |
| + "lifetimes_migrate.go Server.migrationFinishLocked provision.WriteRecord": "exempt: an in-place rewrite of a present body", |
| + "lifetimes_retire.go Server.retirementStepsLocked provision.WriteRecord": "exempt: a tombstone of a present body", |
| + "apiinstances.go Server.handleAPIInstanceCreate Server.createRecordMarked": "marks", |
| + "apiinstanceseed.go Server.createSeedRecord Server.createRecordMarked": "marks", |
| + "apisidecars.go Server.handleAPISidecarCreate Server.createSidecarMarked": "marks", |
| +} |
| + |
| +// TestEveryCreateWriterMarksFirst is a source scan of internal/console: every |
| +// call of a record-creating primitive is listed in createWriterSites, and a |
| +// marked one is preceded in its function by its mark call. |
| +func TestEveryCreateWriterMarksFirst(t *testing.T) { |
| + primitives := map[string]bool{ |
| + "provision.CreateRecord": true, "provision.CreateSidecarRecord": true, "provision.CreateRecordReplica": true, |
| + "provision.WriteRecord": true, "s.store.BeginAllocation": true, |
| + } |
| + files, err := filepath.Glob("*.go") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + fset := token.NewFileSet() |
| + seen := map[string]bool{} |
| + var problems []string |
| + for _, file := range files { |
| + if strings.HasSuffix(file, "_test.go") { |
| + continue |
| + } |
| + f, err := parser.ParseFile(fset, file, nil, 0) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, decl := range f.Decls { |
| + fn, ok := decl.(*ast.FuncDecl) |
| + if !ok || fn.Body == nil { |
| + continue |
| + } |
| + name := fn.Name.Name |
| + if fn.Recv != nil && len(fn.Recv.List) == 1 { |
| + if star, ok := fn.Recv.List[0].Type.(*ast.StarExpr); ok { |
| + if id, ok := star.X.(*ast.Ident); ok { |
| + name = id.Name + "." + name |
| + } |
| + } |
| + } |
| + calls := map[string]token.Pos{} |
| + ast.Inspect(fn.Body, func(n ast.Node) bool { |
| + call, ok := n.(*ast.CallExpr) |
| + if !ok { |
| + return true |
| + } |
| + callee := exprName(call.Fun) |
| + if _, dup := calls[callee]; !dup { |
| + calls[callee] = call.Pos() |
| + } |
| + if primitives[callee] || callee == "s.createRecordMarked" || callee == "s.createSidecarMarked" { |
| + site := file + " " + name + " " + strings.Replace(callee, "s.create", "Server.create", 1) |
| + seen[site] = true |
| + if _, listed := createWriterSites[site]; !listed { |
| + problems = append(problems, "unlisted create writer: "+site+" ("+fset.Position(call.Pos()).String()+")") |
| + } |
| + } |
| + return true |
| + }) |
| + for site, rule := range createWriterSites { |
| + parts := strings.SplitN(site, " ", 3) |
| + if parts[0] != file || parts[1] != name || !strings.HasPrefix(rule, "mark:") { |
| + continue |
| + } |
| + prim := strings.Replace(parts[2], "Server.", "s.", 1) |
| + mark, ok := calls["s."+strings.TrimPrefix(rule, "mark:")] |
| + if !ok || mark > calls[prim] { |
| + problems = append(problems, site+": its mark call does not come before it") |
| + } |
| + } |
| + } |
| + } |
| + for site := range createWriterSites { |
| + if !seen[site] { |
| + problems = append(problems, "listed but not found (moved or renamed?): "+site) |
| + } |
| + } |
| + sort.Strings(problems) |
| + if len(problems) > 0 { |
| + t.Fatal(strings.Join(problems, "\n")) |
| + } |
| +} |
| + |
| +// exprName is a call's callee as written: s.store.BeginAllocation, |
| +// provision.CreateRecord, s.createRecordMarked. |
| +func exprName(e ast.Expr) string { |
| + switch x := e.(type) { |
| + case *ast.Ident: |
| + return x.Name |
| + case *ast.SelectorExpr: |
| + if inner := exprName(x.X); inner != "" { |
| + return inner + "." + x.Sel.Name |
| + } |
| + } |
| + return "" |
| +} |
diff --git a/internal/console/lifetimes.go b/internal/console/lifetimes.go| index 51d209097..0eb8b4f04 100644 |
| --- a/internal/console/lifetimes.go |
| +++ b/internal/console/lifetimes.go |
| @@ -101,7 +101,11 @@ func (e *lifetimeAppError) Unwrap() error { return e.Err } |
| func lifetimeCreateRefusal(host string, err error, pendingMsg string) (*doorRefusal, bool) { |
| var held *hostHeldError |
| var app *lifetimeAppError |
| + var used *hostsUsedError |
| switch { |
| + case errors.As(err, &used): |
| + // The hostname history's refusal (hostsused.go), lifetimes on or off. |
| + return &used.ref, true |
| case errors.As(err, &held): |
| return &doorRefusal{http.StatusConflict, hostHeldSentence(host, held.Hold)}, true |
| case errors.Is(err, errLifetimeSettling): |
diff --git a/internal/console/lifetimes_create.go b/internal/console/lifetimes_create.go| index a5550cec6..b7921bb0b 100644 |
| --- a/internal/console/lifetimes_create.go |
| +++ b/internal/console/lifetimes_create.go |
| @@ -105,6 +105,15 @@ func (s *Server) createRecordWithLifetimeLocked(ctx context.Context, rec provisi |
| if plan.ownerStaleETag != "" { |
| a.PrevOwnerKey = provision.RecordKey(plan.ownerAccount, plan.ownerApp, host) |
| } |
| + // The hostname history (hostsused.go): a data kind marks its hostname |
| + // after every check above, step 2's record read among them, and before |
| + // anything is persisted. Nothing is durable yet, so a refusal leaves |
| + // nothing behind. |
| + if rec.DataKind() { |
| + if ref := s.markForCreate(ctx, recordUse(rec)); ref != nil { |
| + return nil, &hostsUsedError{*ref} |
| + } |
| + } |
| if err := s.store.BeginAllocation(a); err != nil { |
| return nil, fmt.Errorf("console: lifetimes: begin allocation of %s: %w", host, err) |
| } |
diff --git a/internal/console/server.go b/internal/console/server.go| index 72027db93..5cdc292a8 100644 |
| --- a/internal/console/server.go |
| +++ b/internal/console/server.go |
| @@ -902,6 +902,9 @@ type Server struct { |
| // billing is nil when billing is off (Config.Billing, plans 6a). |
| billing *billingRuntime |
| + // hosts is the hostname history's mode, read once (hostsused.go). |
| + hosts hostsHistory |
| + |
| // lapseBeforeConverge, when set (tests only), runs inside the account's |
| // grace pass just before the lapse converges (plans 4d, Astra finding 1). |
| lapseBeforeConverge func() |
diff --git a/internal/provision/nearest_region_a_census_test.go b/internal/provision/nearest_region_a_census_test.go| index e31cf42ba..44f183ba4 100644 |
| --- a/internal/provision/nearest_region_a_census_test.go |
| +++ b/internal/provision/nearest_region_a_census_test.go |
| @@ -12,9 +12,43 @@ package provision |
| // - MarkHostUsed, WriteHostsMode, WriteHostsFloor, new: each Puts one |
| // object under control/hosts-used/ (a hostname's mark, @mode, @floor). |
| // No record key, no record body: nonrecord. |
| +// - Server.createRecordMarked, Server.createSidecarMarked (console), new: |
| +// the hostname history's mark (markBeforeCreate, a create-only Put under |
| +// control/hosts-used/ through provision.MarkHostUsed), then the same |
| +// create-only CreateRecord / CreateSidecarRecord the doors called |
| +// before. On a conflicting mark once active they read the door's own |
| +// record key (RecordKey / SidecarRecordKey) to answer a duplicate as the |
| +// write would. record-writer. |
| +// - Server.handleAPIInstanceCreate, Server.createSeedRecord, |
| +// Server.handleAPISidecarCreate: their CreateRecord and |
| +// CreateSidecarRecord calls moved into the two units above, so they no |
| +// longer name a write site and leave the inventory. |
| +// - Server.createRecordWithLifetimeLocked, re-pinned: it marks a data |
| +// kind's hostname (markForCreate) before BeginAllocation. Same |
| +// RecordKey site: still key-site. |
| func nearestRegionAWriteCensusInventory() []censusEntry { |
| entries := append([]censusEntry(nil), regionLabelsWriteCensusInventory()...) |
| + for _, r := range []struct{ file, unit string }{ |
| + {"internal/console/apiinstances.go", "Server.handleAPIInstanceCreate"}, |
| + {"internal/console/apiinstanceseed.go", "Server.createSeedRecord"}, |
| + {"internal/console/apisidecars.go", "Server.handleAPISidecarCreate"}, |
| + } { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.file && e.Unit == r.unit { |
| + entries = append(entries[:i], entries[i+1:]...) |
| + found = true |
| + break |
| + } |
| + } |
| + if !found { |
| + panic("nearest-region-a removal of an unlisted unit " + r.file + ":" + r.unit) |
| + } |
| + } |
| replacements := []censusEntry{ |
| + {"internal/console/hostsused.go", "Server.createRecordMarked", "record-writer", "key:CreateRecord,key:RecordKey", "a6f3c61d177171b3b1100ac178e0f84dd195eb9294aee117b64264c2a09be12d"}, |
| + {"internal/console/hostsused.go", "Server.createSidecarMarked", "record-writer", "key:CreateSidecarRecord,key:SidecarRecordKey", "3df0c9053fcd071af9a371cf70413ab9ed99dedc9d3bc0bd69b1821cb2ab2b3a"}, |
| + {"internal/console/lifetimes_create.go", "Server.createRecordWithLifetimeLocked", "key-site", "key:RecordKey", "c3b601f16c8ceeb03f7a9512d9c079ad2eadb5414036beeeb032fd622b587a92"}, |
| {"internal/provision/hostsused.go", "MarkHostUsed", "nonrecord", "sel:Put", "439f9ca1443f2c815f2ddb18b4732285d236d745fb660de66dc3a175b4532fd3"}, |
| {"internal/provision/hostsused.go", "WriteHostsFloor", "nonrecord", "sel:Put", "c10e2e2fd57470c81785df3dddd9bb33013b416ce5381e74a9657811ec6b5c79"}, |
| {"internal/provision/hostsused.go", "WriteHostsMode", "nonrecord", "sel:Put", "21147fa65d21d7a074589ca4ea6cf2ec9852a7ab42ca3acaac429562d8f22146"}, |
diff --git a/internal/provision/testdata/plan14-root-reads-nearest-region-a.tsv b/internal/provision/testdata/plan14-root-reads-nearest-region-a.tsv| index 3dca0d3ec..33b1a9e7d 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-nearest-region-a.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-nearest-region-a.tsv |
| @@ -1,3 +1,4 @@ |
| # Census overlay nearest-region-a, written by census-propose (#369). census-ruling-nearest-region-a, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-nearest-region-a.md. |
| -# 0 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| -@coverage internal/provision 5ac7b4911e200ff8cac14e080c294da1c29b2652a19df66a86e71a174408cb66 |
| +# 0 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@coverage internal/console 4b52473b4974b697a8d9feab09f73e5cdb7fc6f16233b236c93ad6e80f8b7acf |
| +@coverage internal/provision 9f7572e1933c2dcb9d3faa27480a624c1d6581a6b76af72b2c356eb89b83a375 |