carlos / platform Public

member backups 2b: fix CI after rebase onto main

- demo_claim_footer_test: re-pin the claim page digests and base style
  hash; the only cause is 2b's .tile-warn rule in the console chrome CSS
  (reverting that rule alone brings the old digests back).
- svcroutes_test: the closed-door walk counts GET /api/cli/system/backups,
  102 doors, eleven system doors.
- verifyreader: rename the verdict index byHost to verdictsByHost; main's
  TestRemoteFactsOneAccessor reserves byHost for remoteFacts.
- group_names_test: add Record.RegionChangedAt to the field inventory,
  classified as a timestamp that names nothing.
- hibernate_verify_stamp_test: the legacy round trip is cut as a box older
  than 2b cuts it (no region_changed_at), the case where the bytes can
  still come back identical and only the stamp sees the change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 48cd02517e21305c0a16cd393a44a649fdd7672d parent 73fad1d
5 files changed, +58 −37
  • internal/console/demo_claim_footer_test.go +14 −13
  • internal/console/svcroutes_test.go +2 −2
  • internal/console/verifyreader.go +17 −17
  • internal/host/group_names_test.go +6 −1
  • internal/ops/hibernate_verify_stamp_test.go +19 −4
diff --git a/internal/console/demo_claim_footer_test.go b/internal/console/demo_claim_footer_test.go
index c23234b12..5afa4413d 100644
--- a/internal/console/demo_claim_footer_test.go
+++ b/internal/console/demo_claim_footer_test.go
@@ -11,21 +11,22 @@ import (
"testing"
)
-// The digests are the claim page with no footer, retaken when the page itself
-// or its script changes (the script tag carries the asset hash; last: the
-// claim-picker-rows review fixes). With neither item configured (or both
-// invalid) the page is these exact bytes.
-const demoClaimFooterBaseStyleHash = "'sha256-jbEMQSC7VKnO3PowM9lc1xx5+TuvoIMmes/XPpn9IEM='"
+// The digests are the claim page with no footer, retaken when the page itself,
+// its script or the console chrome's CSS changes (the script tag carries the
+// asset hash; last: the .tile-warn rule member backups 2b added to the
+// chrome). With neither item configured (or both invalid) the page is these
+// exact bytes.
+const demoClaimFooterBaseStyleHash = "'sha256-VcClWuJxRJ9RoxIxo86MojoN2XfkXt2ui8g5v8Qpc30='"
var demoClaimFooterBaseDigests = map[string]string{
- "template-zero": "307ae622a5541a738bd6d7117eaf00c2058afbc914e9a0f2e48157b3983356f2",
- "template-missing": "c54a88efef115981799be2d80c0c47326d1fc2e7407cbcd6c96793be1026d8e1",
- "template-error": "bc32157b2db3b29a739b840e0e9fc6c77c1ed9f7e93341b2a8caa06d41c6cf79",
- "template-claimed": "fe5aef8746a63ac522ee05652393de418ced5bebc3b2e6894a0f7c4484fa070d",
- "template-proof": "3c22418e10842d8cfad9a96518e011de43bf6c780b4db67546c2760c6dd81318",
- "error-page": "d503dc9f496c8eaa8cf34e0ed15862ddf11ac91125d7dfc3451da6f8b13ab0ac",
- "get-claim": "0d044d6e85e3f8db1a33c19e5e3844f76c7fe6dad9a1fd70da71a9aaeeca00e5",
- "get-kept": "b7b65fb23266019375e2ec0a8764f15183fcc3450b0f69d0d3c5b218345bc6c5",
+ "template-zero": "c911c3466bc78c136ee04bbccf0a8e08b876ad30ff783ecbead9aa2fc3270bbc",
+ "template-missing": "3e7b0a796e966c26d30161b698c23a220e0414bd4e95df3088cdf476313d98cd",
+ "template-error": "a49ba730c659ba4cdecbf32c30595a015a6589b9d00e0d235cd1bbac959e6b9f",
+ "template-claimed": "5f9c597911627798e931e7ed590aca67271e3ca214e40aa27aeb567c7943e103",
+ "template-proof": "0fcad79d49b5de2b052a2832fc3b3f938d23294cb26353143817aeb1466a6ccd",
+ "error-page": "faeda6bf43481d6e3d0e1d487cf9730bad83621cdfca4e79a01eb958bb1dc191",
+ "get-claim": "506513ae098ebcbeb629cf3ee2aa53912177fc4ea21b48ad29afec68ffc80bc5",
+ "get-kept": "26a877042107a98b471e8d1369dedd09045c9374b9eda652a1a902cbbc16d6b9",
}
const (
diff --git a/internal/console/svcroutes_test.go b/internal/console/svcroutes_test.go
index d6ea70b83..92f52295a 100644
--- a/internal/console/svcroutes_test.go
+++ b/internal/console/svcroutes_test.go
@@ -1749,8 +1749,8 @@ func TestEveryClosedDoorRefusesAServiceCredential(t *testing.T) {
}
seen++
}
- if seen != len(closedDoors) || seen != 101 {
- t.Errorf("walked %d closed doors, want all %d (and 101 today: three domain purchase doors, two managed admission doors, the fleet show door, two managed configuration doors, three environment ownership doors, instance-token, three door-key doors, the routes door, the regional placements write, instances-manifest, the app update policy, sidecars-manifest, the route-channel move, three instance update settings doors, two db replica doors, the forwarded db read, seven fleets, the fleet secrets key door, the two person link doors (list and unlink), the six home link doors, four services, two email credentials, email pause, the build probe, the swap policy, the copy count, the interactive setting, the interactive session door, two app policy doors, two app region doors, the live tenancy read, the layout read, the activation-cancel door, ten system doors, three deployment-wide antivirus, the PDF status door, three platform geoip doors, two pointer digest doors, the hostname history status, the channel resign, two release authorize doors, four store-entitlement doors, two account plan doors, two billing problem doors, the billing revenue and payments doors, the billing house door, three account subdomain doors, the subdomain inventory, and the claimed source door)",
+ if seen != len(closedDoors) || seen != 102 {
+ t.Errorf("walked %d closed doors, want all %d (and 102 today: three domain purchase doors, two managed admission doors, the fleet show door, two managed configuration doors, three environment ownership doors, instance-token, three door-key doors, the routes door, the regional placements write, instances-manifest, the app update policy, sidecars-manifest, the route-channel move, three instance update settings doors, two db replica doors, the forwarded db read, seven fleets, the fleet secrets key door, the two person link doors (list and unlink), the six home link doors, four services, two email credentials, email pause, the build probe, the swap policy, the copy count, the interactive setting, the interactive session door, two app policy doors, two app region doors, the live tenancy read, the layout read, the activation-cancel door, eleven system doors, three deployment-wide antivirus, the PDF status door, three platform geoip doors, two pointer digest doors, the hostname history status, the channel resign, two release authorize doors, four store-entitlement doors, two account plan doors, two billing problem doors, the billing revenue and payments doors, the billing house door, three account subdomain doors, the subdomain inventory, and the claimed source door)",
seen, len(closedDoors))
}
}
diff --git a/internal/console/verifyreader.go b/internal/console/verifyreader.go
index 0d196ba07..80049a344 100644
--- a/internal/console/verifyreader.go
+++ b/internal/console/verifyreader.go
@@ -101,9 +101,9 @@ type verifyReader struct {
// newest decided verdict read from that box. It outlives the verdict
// leaving the box's record, so a host reassigned between boxes keeps
// its last test until the new box tests it. Lost on restart.
- seen map[string]map[string]dbverify.Verdict
- byHost map[string][]boxVerdict
- badLogged map[string]bool // ref + etag of a skipped record already logged
+ seen map[string]map[string]dbverify.Verdict
+ verdictsByHost map[string][]boxVerdict
+ badLogged map[string]bool // ref + etag of a skipped record already logged
}
func newVerifyReader(store release.Store, watch *release.ChangeWatch, now func() time.Time) *verifyReader {
@@ -111,18 +111,18 @@ func newVerifyReader(store release.Store, watch *release.ChangeWatch, now func()
now = time.Now
}
return &verifyReader{
- store: store,
- watch: watch,
- gate: release.NewReadGate(watch, verifyReadMaxAge),
- now: now,
- boxes: map[string]*verifyBox{},
- gens: map[string]uint64{},
- nextTry: map[string]time.Time{},
- absentAt: map[string]uint64{},
- gone: map[string]uint64{},
- seen: map[string]map[string]dbverify.Verdict{},
- byHost: map[string][]boxVerdict{},
- badLogged: map[string]bool{},
+ store: store,
+ watch: watch,
+ gate: release.NewReadGate(watch, verifyReadMaxAge),
+ now: now,
+ boxes: map[string]*verifyBox{},
+ gens: map[string]uint64{},
+ nextTry: map[string]time.Time{},
+ absentAt: map[string]uint64{},
+ gone: map[string]uint64{},
+ seen: map[string]map[string]dbverify.Verdict{},
+ verdictsByHost: map[string][]boxVerdict{},
+ badLogged: map[string]bool{},
}
}
@@ -146,7 +146,7 @@ func (r *verifyReader) Loaded() bool {
func (r *verifyReader) For(host string) []boxVerdict {
r.mu.RLock()
defer r.mu.RUnlock()
- src := r.byHost[host]
+ src := r.verdictsByHost[host]
if len(src) == 0 {
return nil
}
@@ -564,7 +564,7 @@ func (r *verifyReader) settleLocked(now time.Time) {
return bvs[i].V.VerifiedAt.Before(bvs[j].V.VerifiedAt)
})
}
- r.byHost = idx
+ r.verdictsByHost = idx
}
// sameVerdict reports whether a remembered verdict adds nothing beside a
diff --git a/internal/host/group_names_test.go b/internal/host/group_names_test.go
index 79332b2d8..207a499be 100644
--- a/internal/host/group_names_test.go
+++ b/internal/host/group_names_test.go
@@ -259,7 +259,7 @@ func TestGroupNameClassCensus(t *testing.T) {
fields string
}{
{registry.Route{}, "DemoID DemoHost DemoLifetime DemoExpiresAt ClaimOwnership WakeIncarnation Host Slug Kind Socket Addr Addrs Health Status HoldOp Incarnation ServingSeq SeedSource ImportGate AssetsOff AssetGen PagesOff LastError Stateless FleetBoxes Copies ReplicaRevision ReplicaIncarnation DBPath Version PrevVersion GoodVersion GoodDigest GoodDemand ServingVersion App Pool Region Channel Environment Tunnel FleetBox FleetLabel Assigned Moved Caps Hibernate HA Runtime Gate RateLimit Canary Replication NextDue StatusNamed Backing Unit Platform Provisioned Seed Args IdleSeconds MaxRunSeconds DNSStatus DNSCheckedAt CertExpiresAt Account Steering UpdateSettings EgressAllow Size PolicyExpiresAt BuildState Replicas Replica CreatedAt"},
- {provision.Record{}, "DemoClaim Demo ReplicaAssignment Coordinator ReplicaDeploy RecordSeq Acquisition Maintenance Schema Host Slug App Account Pool Region Channel CreatedAt CreatedBy FleetBox FleetBoxAt FleetBoxMoved HA Move LastMove ActiveRun Interactive RunKeys Seed Kind Addr Unit Hibernate Runtime Environment StatusNamed Addrs Health Steering Assets AssetGen Pages Gate Incarnation IncarnationMigrating MoveSeq Retired RateLimit Role Replicas Updates Major Pin InstallRequest"},
+ {provision.Record{}, "DemoClaim Demo ReplicaAssignment Coordinator ReplicaDeploy RecordSeq Acquisition Maintenance Schema Host Slug App Account Pool Region Channel CreatedAt CreatedBy FleetBox FleetBoxAt FleetBoxMoved HA Move LastMove RegionChangedAt ActiveRun Interactive RunKeys Seed Kind Addr Unit Hibernate Runtime Environment StatusNamed Addrs Health Steering Assets AssetGen Pages Gate Incarnation IncarnationMigrating MoveSeq Retired RateLimit Role Replicas Updates Major Pin InstallRequest"},
{edgeHost{}, "Role Platform Alias Replica Wildcard Account App Stamp Incarnation ServingSeq TargetHost Assets DNSPointing"},
{domains.Claim{}, "Acquisition RecordIncarnation OwnershipState Schema Host Account App Route CreatedAt CreatedBy Wildcard Catchall Paths Instances AccountNamespace RetiredAt Revision Placements Pending PendingUntil"},
{registry.RouteAlias{}, "Alias Host Account App DNSStatus DNSCheckedAt CertExpiresAt CreatedAt"},
@@ -452,6 +452,11 @@ func (p *haIngressProjection) publishAliases(names map[string]Route) { p.aliases
// AppsDomain, writes account_namespaces, keeps an unread namespace's
// recorded rows and treats a not-found namespace body as a decision.
//
+// Member backups 2b keeps the existing name classes:
+// - provision.Record.RegionChangedAt is a timestamp: when a write outside a
+// guarded move last changed the record's region. No producer reads it
+// for a name; it derives, publishes or renames nothing.
+//
// TestHAIngressNamesWithoutLocalRow, TestHAIngressAliasBinding and
// TestHAIngressStartupNames exercise these existing name classes end to end.
var groupNameProducerInventory = map[string]string{
diff --git a/internal/ops/hibernate_verify_stamp_test.go b/internal/ops/hibernate_verify_stamp_test.go
index 6c1aaffba..3abb459a3 100644
--- a/internal/ops/hibernate_verify_stamp_test.go
+++ b/internal/ops/hibernate_verify_stamp_test.go
@@ -9,6 +9,7 @@ import (
"strconv"
"sync"
"testing"
+ "time"
"github.com/carlosframework/platform/internal/activator"
"github.com/carlosframework/platform/internal/dbdoor"
@@ -80,14 +81,26 @@ var _ release.StampedGetter = (*versionedStore)(nil)
// legacy move makes, as the box's move pass applies them (SetRecordMove):
// request, ready, cutting, and MoveComplete, which flips Region and clears
// Move and writes no LastMove.
+//
+// The cut is the one a box older than member backups 2b writes. Since 2b
+// MoveComplete also stamps RegionChangedAt (wall clock), so a round trip by
+// a current box changes the record's bytes. An older box's MoveComplete has
+// no such field, and its decode and rewrite drop region_changed_at, so its
+// round trip can still bring the bytes back exactly. That is the case the
+// bracket must still catch while such boxes run, so the fixture writes it.
func (fx *drillFx) legacyMove(host, to string) {
fx.t.Helper()
ctx := context.Background()
+ preRegionChangedAtComplete := func(rec *provision.Record) error {
+ err := provision.MoveComplete()(rec)
+ rec.RegionChangedAt = time.Time{}
+ return err
+ }
for _, mut := range []func(*provision.Record) error{
provision.MoveRequest(to, fx.clock.Now()),
provision.MovePromoteReady(fx.clock.Now()),
provision.MoveMarkCutting(),
- provision.MoveComplete(),
+ preRegionChangedAtComplete,
} {
if _, err := provision.SetRecordMove(ctx, fx.store, fxAccount, fxApp, host, mut); err != nil {
fx.t.Fatalf("legacy move of %s to %s: %v", host, to, err)
@@ -168,9 +181,11 @@ func (fx *drillFx) dropStaging(host string) {
}
}
-// A legacy round trip (uk -> us -> uk) with the returning move's staged
-// copy promoted over the replica under test and its staging dropped, all
-// inside the host's test. The old and new replicas are distinct lineages.
+// A legacy round trip (uk -> us -> uk), cut by a box older than member
+// backups 2b (legacyMove: a current box's cut stamps RegionChangedAt and so
+// changes the bytes), with the returning move's staged copy promoted over
+// the replica under test and its staging dropped, all inside the host's
+// test. The old and new replicas are distinct lineages.
// Whether the restore read the old copy before the round trip (a stale
// pass), the promoted new copy after it, or reported damage from a mixed
// read, the verdict is unverified, record_changed: never passed, never