carlos / platform Public

census: re-pin Edge.serveDemoTraffic in the record-write census (#962)

CI's TestPlan9B8RecordWriteCensus refused the demo geo answer's change
to Edge.serveDemoTraffic: the source no longer matched its reviewed
digest. A new layer, staticSiteGeo962WriteCensusInventory, re-pins it
on memberBackups2aWriteCensusInventory. No record write is added and
the class and kind are unchanged (nonrecord / sel:Put, the gzip writer
back to sync.Pool); the geo answer writes to no store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4e1465803a40c7dac6dccee6e2e34e9e9b4d7877 parent 9d210aa
2 files changed, +36 −1
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/static_site_geo_962_census_test.go +35 −0

CI passed — run details

diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 5070f0d32..b7b0ae72f 100644
--- a/internal/provision/plan9_b8_census_test.go
+++ b/internal/provision/plan9_b8_census_test.go
@@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) {
if len(got) < 100 {
t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root)
}
- inventory := memberBackups2aWriteCensusInventory()
+ inventory := staticSiteGeo962WriteCensusInventory()
problems := append(censusDiff(inventory, got), censusPolicy(inventory)...)
if len(problems) > 0 {
t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n "))
diff --git a/internal/provision/static_site_geo_962_census_test.go b/internal/provision/static_site_geo_962_census_test.go
new file mode 100644
index 000000000..ed4907633
--- /dev/null
+++ b/internal/provision/static_site_geo_962_census_test.go
@@ -0,0 +1,35 @@
+package provision
+
+// staticSiteGeo962WriteCensusInventory is the static-site geo review
+// (discussion #962) of the record-write census, layered on
+// memberBackups2aWriteCensusInventory.
+//
+// One unit is re-digested; no record write is added and no class or kind
+// changes:
+// - Edge.serveDemoTraffic: a demo request for /.carlos/geo is answered by
+// serveGeoAnswer (the visitor's country from the request's geo answer,
+// no-store JSON) after the demo's admission, import-gate and lapse
+// refusals, and skips the observer defer and the guard state. It writes
+// nothing to any store. Its one sel:Put is still the gzip writer going
+// back to sync.Pool, not a record store. nonrecord / sel:Put, as before.
+func staticSiteGeo962WriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), memberBackups2aWriteCensusInventory()...)
+ repins := []censusEntry{
+ {"internal/edge/demo_traffic.go", "Edge.serveDemoTraffic", "nonrecord", "sel:Put", "da278b352dc5a3a7bcf00e894a6b2e2cf16415584ee704c2555f90e9e66614d1"},
+ }
+ for _, r := range repins {
+ found := false
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ if e.Class != r.Class || e.Kinds != r.Kinds {
+ panic("static-site-geo-962 census: classification changed for " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("static-site-geo-962 census: re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return entries
+}