carlos / platform Public

ha: publish named pools in existing edges evidence

claude agent, operated by paul@keymail.dev 79176bba227ea137cd57da72db139cbc193d85bd parent ebe3681
6 files changed, +294 −14
  • 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/movesoffline_e2e_test.go +2 −1
  • internal/host/testdata/edges-p2b-golden.json +1 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>bbg4tf4kw</task-id> <tool-use-id>toolu_01KAtznu7pJzewX8CLKiTEqW</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/de069047-3c6a-40e7-ae66-85194f066976/tasks/bbg4tf4kw.output</output-file> <status>completed</status> <summary>Background command "Wait for Luna copy pass" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 19.5 g CO₂e (2,336,635 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p2b-build, 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.

diff --git a/internal/edge/testdata/edges-forward-hub.json b/internal/edge/testdata/edges-forward-hub.json
index 5a4b0ed97..b04fe7675 100644
--- a/internal/edge/testdata/edges-forward-hub.json
+++ b/internal/edge/testdata/edges-forward-hub.json
@@ -1 +1 @@
-{"v":1,"box":"hub","eip":"198.51.100.7","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"2026-10-30T00:00:00Z","hosts":{"*.bah-certonly.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-certs.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-regional.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-wild.example.com":{"role":"home","platform":false,"alias":true,"wildcard":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"bah-certonly.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"shop.bah-custom.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"shop.bah.example.com":{"role":"home","platform":true,"account":"bah","app":"shop"},"tickets.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"}}}
+{"v":1,"box":"hub","eip":"198.51.100.7","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"2026-10-30T00:00:00Z","hosts":{"*.bah-certonly.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-certs.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-regional.example.com":{"role":"wildcard","platform":false,"wildcard":true},"*.bah-wild.example.com":{"role":"home","platform":false,"alias":true,"wildcard":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"bah-certonly.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"shop.bah-custom.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"},"shop.bah.example.com":{"role":"home","platform":true,"account":"bah","app":"shop"},"tickets.example.com":{"role":"home","platform":false,"alias":true,"account":"bah","app":"shop","target_host":"shop.bah.example.com"}}}
diff --git a/internal/host/edgesfile.go b/internal/host/edgesfile.go
index 99d113ee2..f92e4108f 100644
--- a/internal/host/edgesfile.go
+++ b/internal/host/edgesfile.go
@@ -19,6 +19,7 @@ import (
"github.com/carlosframework/platform/internal/boxroles"
"github.com/carlosframework/platform/internal/edge"
"github.com/carlosframework/platform/internal/instancectl"
+ "github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
@@ -330,8 +331,9 @@ type edgesFile struct {
// an AUTOMATIC choice of this box's region; explicit requests ignore
// them. Computed from the same ReconcileConfig the reconcile pass uses
// (edgesFileEligibility), never a second reading of the environment.
- ServesSharedPool bool `json:"serves_shared_pool"`
- AcceptsInbound bool `json:"accepts_inbound"`
+ ServesSharedPool bool `json:"serves_shared_pool"`
+ AcceptsInbound bool `json:"accepts_inbound"`
+ NamedPools []string `json:"named_pools"`
// BurstNotices says this box's edge answers probe-burst notices itself
// (internal/edge burst_notice.go), so the other edges may send them
// here. Set by every pass of this build (edgesFileWriteClaims), never
@@ -951,6 +953,9 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
}
f := ident
+ if f.NamedPools == nil {
+ f.NamedPools = []string{}
+ }
f.V, f.EIP, f.Hosts, f.Generation = 1, eip, hosts, ""
f = snapshotBoxRole(f)
f.BurstNotices = true
@@ -1061,12 +1066,22 @@ func edgesFileRegion(getenv func(string) string, probedRegion string) string {
return strings.TrimSpace(probedRegion)
}
-// edgesFileEligibility derives the two published eligibility answers from
+// edgesFileEligibility derives the published eligibility answers from
// the reconcile config this box actually runs with — provisionTickConfig,
// the same parse the provision tick uses — so a spelling the reconciler
// reads one way can never be published another.
-func edgesFileEligibility(getenv func(string) string) (sharedPool, inbound bool) {
- return provisionTickConfig(getenv).SharedInstanceEligibility()
+func edgesFileEligibility(getenv func(string) string) (sharedPool, inbound bool, namedPools []string) {
+ cfg := provisionTickConfig(getenv)
+ sharedPool, inbound = cfg.SharedInstanceEligibility()
+ namedPools = make([]string, 0, len(cfg.Pools))
+ for _, pool := range cfg.Pools {
+ if pool != "" && provision.ValidPool(pool) {
+ namedPools = append(namedPools, pool)
+ }
+ }
+ slices.Sort(namedPools)
+ namedPools = slices.Compact(namedPools)
+ return
}
// edgesFileSecretsFP fingerprints the box's secrets key, read the same way
@@ -1147,7 +1162,7 @@ func edgesFileLoop(reg *registry.Registry, lifetimes bool, assets *assetPolicy)
box := metricsBoxLabel(os.Getenv, readMachineID())
// Eligibility is read once here at arm, from the reconcile config's own
// parse, never a second reading of CARLOS_POOLS or CARLOS_INBOUND.
- sharedPool, inbound := edgesFileEligibility(os.Getenv)
+ sharedPool, inbound, namedPools := edgesFileEligibility(os.Getenv)
// Region resolved once here at arm — the domains loop's read-once
// precedent (domainsLoop reads its env once before the loop and threads
// the result through every tick via cfg, never re-reading or re-probing
@@ -1170,6 +1185,7 @@ func edgesFileLoop(reg *registry.Registry, lifetimes bool, assets *assetPolicy)
HibernationConfigured: strings.TrimSpace(os.Getenv("CARLOS_HIBERNATE_BUCKET")) != "",
ServesSharedPool: sharedPool,
AcceptsInbound: inbound,
+ NamedPools: namedPools,
SecretsKeyFP: edgesFileSecretsFP(os.Getenv),
BoxID: box,
Capabilities: edgesFileCapabilities(os.Getenv),
diff --git a/internal/host/edgesfile_pools_test.go b/internal/host/edgesfile_pools_test.go
new file mode 100644
index 000000000..28537fac0
--- /dev/null
+++ b/internal/host/edgesfile_pools_test.go
@@ -0,0 +1,262 @@
+package host
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ "os"
+ "path/filepath"
+ "reflect"
+ "slices"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/boxroles"
+ "github.com/carlosframework/platform/internal/domains"
+ "github.com/carlosframework/platform/internal/edgesfile"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+func poolEvidenceIdentity(getenv func(string) string) edgesFile {
+ shared, inbound, named := edgesFileEligibility(getenv)
+ return edgesFile{Box: "leo", BoxID: "leo", ServesSharedPool: shared, AcceptsInbound: inbound, NamedPools: named}
+}
+
+func publishedNamedPools(t *testing.T, body []byte) []string {
+ t.Helper()
+ var raw map[string]json.RawMessage
+ if err := json.Unmarshal(body, &raw); err != nil {
+ t.Fatal(err)
+ }
+ var pools []string
+ if err := json.Unmarshal(raw["named_pools"], &pools); err != nil || pools == nil {
+ t.Fatalf("named_pools = %s, error %v: want an explicit array", raw["named_pools"], err)
+ }
+ return pools
+}
+
+func TestEdgesNamedPoolsPublication(t *testing.T) {
+ for _, tc := range []struct {
+ name, config string
+ want []string
+ }{
+ {"unset", "", []string{}},
+ {"shared", "@shared", []string{}},
+ {"shared-and-named", "@shared,hapair", []string{"hapair"}},
+ {"named", "cohort1,hapair", []string{"cohort1", "hapair"}},
+ {"duplicates", "hapair,cohort1,hapair,@shared,@shared", []string{"cohort1", "hapair"}},
+ {"whitespace", " , hapair , cohort1 , , ", []string{"cohort1", "hapair"}},
+ {"empty-tokens", " , , ", []string{}},
+ {"invalid", "@Shared,UPPER,abcdefghijklmnopq", []string{}},
+ {"mixed-invalid", "@Shared,hapair,UPPER,abcdefghijklmnopq,cohort1", []string{"cohort1", "hapair"}},
+ {"grammar-boundaries", "a,0,-,abcdefghijklmnop", []string{"-", "0", "a", "abcdefghijklmnop"}},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ ctx := context.Background()
+ s, reg := release.NewDirStore(t.TempDir()), edgesTestRegistry(t)
+ getenv := func(k string) string {
+ if k == "CARLOS_POOLS" {
+ return tc.config
+ }
+ return ""
+ }
+ ident := poolEvidenceIdentity(getenv)
+ var last []byte
+ if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.10", &last); err != nil {
+ t.Fatal(err)
+ }
+ body, _, err := s.Get(ctx, edgesFileKey(ident.Box))
+ if err != nil {
+ t.Fatal(err)
+ }
+ got := publishedNamedPools(t, body)
+ if !slices.Equal(got, tc.want) {
+ t.Fatalf("named_pools = %v, want %v", got, tc.want)
+ }
+
+ acct := domains.Sqid(2)
+ account := []byte(`{"id":2,"sqid":"` + acct + `","name":"Pools","created_at":"2026-11-04T12:00:00Z"}`)
+ if _, err := s.Put(ctx, "accounts/"+acct+"/account.json", account, ""); err != nil {
+ t.Fatal(err)
+ }
+ candidates := []string{"", "hapair", "cohort1", "unserved", "a", "0", "-", "abcdefghijklmnop"}
+ for i, pool := range candidates {
+ app := fmt.Sprintf("app%d", i)
+ if err := provision.PutManifest(ctx, s, acct, app, provision.Manifest{Schema: 1, App: app, Domain: "example.com", Pool: pool}); err != nil {
+ t.Fatal(err)
+ }
+ if err := provision.CreateRecord(ctx, s, provision.Record{Schema: 1, Host: app + ".example.com", Slug: app, App: app, Account: acct, Pool: pool, Channel: "stable", CreatedAt: time.Now()}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ cfg := provisionTickConfig(getenv)
+ cfg.DataDir = t.TempDir()
+ if err := provision.Reconcile(ctx, s, reg, cfg); err != nil {
+ t.Fatal(err)
+ }
+ for i, pool := range candidates {
+ route, err := reg.Get(fmt.Sprintf("app%d.example.com", i))
+ if err != nil {
+ t.Fatal(err)
+ }
+ published := slices.Contains(got, pool)
+ if pool == "" {
+ published = ident.ServesSharedPool
+ }
+ if published != (route != nil) {
+ t.Errorf("pool %q: published %v, reconciler minted %v", pool, published, route != nil)
+ }
+ }
+ })
+ }
+}
+
+func TestEdgesNamedPoolsRearmPublication(t *testing.T) {
+ ctx := context.Background()
+ base, reg := release.NewDirStore(t.TempDir()), edgesTestRegistry(t)
+ base.EnableChangeIndex()
+ s := &egressCountingStore{Store: base}
+ pools, reads := "hapair", 0
+ getenv := func(k string) string {
+ if k == "CARLOS_POOLS" {
+ reads++
+ return pools
+ }
+ return ""
+ }
+ ident := poolEvidenceIdentity(getenv)
+ var last []byte
+ pass := func() {
+ t.Helper()
+ if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.10", &last); err != nil {
+ t.Fatal(err)
+ }
+ }
+ pass()
+ wantRequests := []string{"GET " + edgesFileKey(ident.Box), "PUT " + edgesFileKey(ident.Box)}
+ if !slices.Equal(s.seen, wantRequests) {
+ t.Fatalf("first publication requests = %v", s.seen)
+ }
+ pools = "hapair,cohort1"
+ pass()
+ if !slices.Equal(s.seen, wantRequests) || reads != 1 {
+ t.Fatalf("unchanged armed identity: requests %v, config reads %d", s.seen, reads)
+ }
+ index, _, err := release.ReadChangeIndex(ctx, base)
+ if err != nil || index.Entries["control/edges"] != 1 {
+ t.Fatalf("first index = %+v, %v", index, err)
+ }
+ last = seedEdgesFileGate(ctx, base, ident.Box)
+ ident = poolEvidenceIdentity(getenv)
+ pass()
+ pass()
+ if !slices.Equal(s.seen, append(slices.Clone(wantRequests), wantRequests...)) || reads != 2 {
+ t.Fatalf("rearmed publication: requests %v, config reads %d", s.seen, reads)
+ }
+ index, _, err = release.ReadChangeIndex(ctx, base)
+ if err != nil || index.Entries["control/edges"] != 2 {
+ t.Fatalf("rearmed index = %+v, %v", index, err)
+ }
+ body, _, err := base.Get(ctx, edgesFileKey(ident.Box))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got := publishedNamedPools(t, body); !slices.Equal(got, []string{"cohort1", "hapair"}) {
+ t.Fatalf("rearmed named_pools = %v", got)
+ }
+ pools = "cohort1,hapair,cohort1"
+ ident = poolEvidenceIdentity(getenv)
+ pass()
+ if s.total() != 4 {
+ t.Fatalf("reordered membership caused requests: %v", s.seen)
+ }
+ pools = "UPPER"
+ ident = poolEvidenceIdentity(getenv)
+ pass()
+ pass()
+ body, _, err = base.Get(ctx, edgesFileKey(ident.Box))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got := publishedNamedPools(t, body); len(got) != 0 {
+ t.Fatalf("removed named pools = %v", got)
+ }
+ index, _, err = release.ReadChangeIndex(ctx, base)
+ if err != nil || index.Entries["control/edges"] != 3 || s.total() != 6 || reads != 4 {
+ t.Fatalf("removed pools: index %+v, error %v, requests %v, reads %d", index, err, s.seen, reads)
+ }
+}
+
+func TestEdgesNamedPoolsGolden(t *testing.T) {
+ ctx := context.Background()
+ s, reg := release.NewDirStore(t.TempDir()), edgesTestRegistry(t)
+ seedRoute(t, reg, "app.example.com")
+ ident := poolEvidenceIdentity(func(k string) string {
+ if k == "CARLOS_POOLS" {
+ return "hapair,cohort1,hapair"
+ }
+ return ""
+ })
+ role := &rolePublication{role: boxroles.Serve, admitted: true}
+ ident.RoleSource = role
+ ident.Region = "eu-west-1"
+ ident.DataBucket, ident.DataBucketRegion = "test-data", "eu-west-1"
+ ident.HibernationConfigured = true
+ ident.Capabilities = []string{capRegionHA1}
+ ident.SecretsKeyFP = "sha256:" + strings.Repeat("a", 64)
+ ident.Headroom = &edgeHeadroom{MemFreeMiB: 512, MemTotalMiB: 1024, DiskFreeMiB: 2048, DiskTotalMiB: 4096}
+ var last []byte
+ if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.10", &last); err != nil {
+ t.Fatal(err)
+ }
+ body, _, err := s.Get(ctx, edgesFileKey(ident.Box))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if role.reads != 1 || role.acks != 1 || role.publishedRole != boxroles.Serve || !role.publishedAdmitted || role.publishedDrained {
+ t.Fatalf("role source = %+v", role)
+ }
+ if got := publishedNamedPools(t, body); !slices.Equal(got, []string{"cohort1", "hapair"}) {
+ t.Fatalf("golden named_pools = %v", got)
+ }
+ var stamped struct{ Generation string }
+ if err := json.Unmarshal(body, &stamped); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := time.Parse(time.RFC3339, stamped.Generation); err != nil {
+ t.Fatal(err)
+ }
+ body = bytes.Replace(body, []byte(`"generation":"`+stamped.Generation+`"`), []byte(`"generation":"2026-11-04T12:00:00Z"`), 1)
+ path := filepath.Join("testdata", "edges-p2b-golden.json")
+ if *updateGoldens {
+ if err := os.WriteFile(path, body, 0644); err != nil {
+ t.Fatal(err)
+ }
+ }
+ want, err := os.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !bytes.Equal(body, want) {
+ t.Fatalf("body = %s, want golden %s", body, want)
+ }
+ decoded, err := edgesfile.Parse(want)
+ if err != nil || !decoded.HomeEligible() || decoded.Box != ident.Box || decoded.Hosts["app.example.com"].Role != edgesfile.RoleHome {
+ t.Fatalf("existing reader: %+v, %v", decoded, err)
+ }
+ withoutPools := bytes.Replace(want, []byte(`,"named_pools":["cohort1","hapair"]`), nil, 1)
+ legacy, err := edgesfile.Parse(withoutPools)
+ if err != nil || !reflect.DeepEqual(decoded, legacy) {
+ t.Fatalf("additive field changed old-reader result: %+v, %v", legacy, err)
+ }
+ if err := putReplacing(ctx, s, edgesFileKey(ident.Box), want); err != nil {
+ t.Fatal(err)
+ }
+ snapshot, err := edgesfile.ReadSnapshot(ctx, s)
+ if err != nil || !snapshot.Complete || len(snapshot.Files) != 1 {
+ t.Fatalf("snapshot reader: %+v, %v", snapshot, err)
+ }
+}
diff --git a/internal/host/edgesfile_test.go b/internal/host/edgesfile_test.go
index 43ae61091..f78ea1a44 100644
--- a/internal/host/edgesfile_test.go
+++ b/internal/host/edgesfile_test.go
@@ -327,7 +327,7 @@ func TestEdgesFileRawWireBodyMatchesSchema(t *testing.T) {
t.Fatalf("generation %q is not RFC3339: %v", probe.Generation, err)
}
- want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
+ want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
probe.Generation + `","hosts":{"app.example.com":{"role":"home","platform":false}}}`
if string(got) != want {
t.Fatalf("raw wire body =\n%s\nwant\n%s", got, want)
@@ -370,7 +370,7 @@ func TestEdgesFileRawWireBodyRegionField(t *testing.T) {
t.Fatal(err)
}
gen := genOf(t, got)
- want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
+ want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
gen + `","hosts":{"app.example.com":{"role":"home","platform":false}}}`
if string(got) != want {
t.Fatalf("raw wire body (region unset) =\n%s\nwant\n%s", got, want)
@@ -389,7 +389,7 @@ func TestEdgesFileRawWireBodyRegionField(t *testing.T) {
t.Fatal(err)
}
gen := genOf(t, got)
- want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","region":"eu-west-1","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
+ want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","region":"eu-west-1","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
gen + `","hosts":{"app.example.com":{"role":"home","platform":false}}}`
if string(got) != want {
t.Fatalf("raw wire body (region set) =\n%s\nwant\n%s", got, want)
@@ -943,7 +943,7 @@ func TestEdgesFileRawWireBodyPlacementField(t *testing.T) {
if err := json.Unmarshal(got, &probe); err != nil {
t.Fatal(err)
}
- want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","region":"eu-west-2","placement":"uk","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
+ want := `{"v":1,"box":"quiet-harbour","eip":"203.0.113.10","region":"eu-west-2","placement":"uk","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"` +
probe.Generation + `","hosts":{"app.example.com":{"role":"home","platform":false}}}`
if string(got) != want {
t.Fatalf("raw wire body (placement set) =\n%s\nwant\n%s", got, want)
@@ -1282,7 +1282,7 @@ func TestEdgesFileEligibilityFollowsTheReconcileConfig(t *testing.T) {
}
return ""
}
- shared, inbound := edgesFileEligibility(getenv)
+ shared, inbound, _ := edgesFileEligibility(getenv)
cfg := provisionTickConfig(getenv)
wantShared, wantInbound := cfg.SharedInstanceEligibility()
if shared != wantShared || inbound != wantInbound {
@@ -1785,7 +1785,7 @@ func TestEdgesFileAddrsEmptyAndUnreadable(t *testing.T) {
}
return strings.Replace(string(body), probe.Generation, "GEN", 1)
}
- const head = `{"v":1,"box":"%s","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,`
+ const head = `{"v":1,"box":"%s","eip":"203.0.113.10","hibernation_configured":false,"serves_shared_pool":false,"accepts_inbound":false,"named_pools":[],"burst_notices":true,"moves_protocol":0,"seeds_protocol":0,`
const tail = `,"generation":"GEN","hosts":{"app.example.com":{"role":"home","platform":false}}}`
r := &addrsReader{}
diff --git a/internal/host/movesoffline_e2e_test.go b/internal/host/movesoffline_e2e_test.go
index 5cc48a5e7..0a4148b5f 100644
--- a/internal/host/movesoffline_e2e_test.go
+++ b/internal/host/movesoffline_e2e_test.go
@@ -397,7 +397,7 @@ func newE2EWorld(t *testing.T, opts landOpts) *e2eWorld {
// lifetimes publishes each row's (incarnation, serving_seq).
func (w *e2eWorld) publish(b *offBox) {
w.t.Helper()
- sharedPool, inbound := edgesFileEligibility(b.getenv)
+ sharedPool, inbound, namedPools := edgesFileEligibility(b.getenv)
aws := sealIERegion
if b.region == "uk" {
aws = sealUKRegion
@@ -409,6 +409,7 @@ func (w *e2eWorld) publish(b *offBox) {
HibernationConfigured: strings.TrimSpace(b.getenv("CARLOS_HIBERNATE_BUCKET")) != "",
ServesSharedPool: sharedPool,
AcceptsInbound: inbound,
+ NamedPools: namedPools,
SecretsKeyFP: edgesFileSecretsFP(b.getenv),
Capabilities: withOfflineCapability(edgesFileCapabilities(b.getenv), b.w.cfg.OfflineCapable && b.w.cfg.Offline != nil),
}
diff --git a/internal/host/testdata/edges-p2b-golden.json b/internal/host/testdata/edges-p2b-golden.json
new file mode 100644
index 000000000..1adda0f09
--- /dev/null
+++ b/internal/host/testdata/edges-p2b-golden.json
@@ -0,0 +1 @@
+{"box_role":"serve","admitted":true,"drained":false,"v":1,"box":"leo","eip":"203.0.113.10","region":"eu-west-1","data_bucket":"test-data","data_bucket_region":"eu-west-1","hibernation_configured":true,"serves_shared_pool":false,"accepts_inbound":true,"named_pools":["cohort1","hapair"],"burst_notices":true,"secrets_key_fp":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","box_id":"leo","capabilities":["region-ha-1"],"headroom":{"mem_free_mib":512,"disk_free_mib":2048,"awake":0,"mem_total_mib":1024,"disk_total_mib":4096},"moves_protocol":0,"seeds_protocol":0,"addrs":null,"generation":"2026-11-04T12:00:00Z","hosts":{"app.example.com":{"role":"home","platform":false}}}
\ No newline at end of file