carlos / platform Public

provision: re-pin the record-write census for routeDecls

The console's route literals moved from registerCLIRoutes,
registerMovesPhase1Routes and NewServer into the routeDecls list, so
the 9B8 inventory drops those three key-site units and lists var
routeDecls as a key-site with the same kinds. No record write is added
or removed. Layered on edgePageCache1WriteCensusInventory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 22012e0a82b24141713a2ab5deeac74495f29a8f parent e9d1a97
2 files changed, +45 −1
  • internal/provision/parity_guard_census_test.go +44 −0
  • internal/provision/plan9_b8_census_test.go +1 −1

Intent

Attributed to this commit: 13.5 g CO₂e (1,700,085 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-parity-guard, 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/provision/parity_guard_census_test.go b/internal/provision/parity_guard_census_test.go
new file mode 100644
index 000000000..da52a8112
--- /dev/null
+++ b/internal/provision/parity_guard_census_test.go
@@ -0,0 +1,44 @@
+package provision
+
+// Record-write census entries for the parity guard slice 3 (console route
+// declarations), layered on edgePageCache1WriteCensusInventory. No record
+// write is added or removed and no class or kind changes: the console's
+// route registrations move, unchanged, from three registration functions
+// into one declaration list, and the list carries the route literals the
+// functions carried.
+// - var routeDecls (internal/console/routedecls.go, new): every console
+// route as a routeDecl, registered by Server.registerDecls. It holds the
+// /instances/ and /sidecars/ route patterns Server.registerCLIRoutes
+// held, so it is a key-site with the same kinds,
+// lit:instances,lit:sidecars. Like the functions it replaces it writes
+// nothing itself: each handler's own writes are listed under the
+// handler.
+// - Server.registerCLIRoutes (authcli.go): deleted; its registrations are
+// elements of routeDecls.
+// - Server.registerMovesPhase1Routes (apiinstancemove.go): deleted; its one
+// route is an element of routeDecls under gateMoves.
+// - NewServer (server.go): its registerRoute calls became elements of
+// routeDecls and it calls registerDecls instead, so it no longer names
+// an /instances/ route literal and has no write site to list.
+func parityGuardWriteCensusInventory() []censusEntry {
+ removed := []struct{ file, unit string }{
+ {"internal/console/authcli.go", "Server.registerCLIRoutes"},
+ {"internal/console/apiinstancemove.go", "Server.registerMovesPhase1Routes"},
+ {"internal/console/server.go", "NewServer"},
+ }
+ entries := append([]censusEntry(nil), edgePageCache1WriteCensusInventory()...)
+ for _, r := range removed {
+ found := false
+ for i, entry := range entries {
+ if entry.File == r.file && entry.Unit == r.unit {
+ entries = append(entries[:i], entries[i+1:]...)
+ found = true
+ break
+ }
+ }
+ if !found {
+ panic("parity guard removal of an unlisted unit " + r.file + ":" + r.unit)
+ }
+ }
+ return append(entries, censusEntry{"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "f4bc18c9add976e612d1509bb1de84130173e824b9f1396b2225c9ff976f493f"})
+}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 9c5716635..7199cccb4 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 := edgePageCache1WriteCensusInventory()
+ inventory := parityGuardWriteCensusInventory()
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 "))