carlos / platform Public

census: re-pin routeDecls for the billing sync routes

The record-write census pins var routeDecls' source digest. This branch
adds /fleet/billing/sync and /fleet/billing/sync/status, whose handlers
(opbilling_sync.go) write no record; kinds and class are unchanged, only
the digest moves. Chained on groupRollVerbWriteCensusInventory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 03cad7cdea686f2a910af04668422c693f4e45ad parent 9ce8c64
2 files changed, +23 −1
  • internal/provision/billing_overview_speed_census_test.go +22 −0
  • internal/provision/plan9_b8_census_test.go +1 −1

CI passed — run details

diff --git a/internal/provision/billing_overview_speed_census_test.go b/internal/provision/billing_overview_speed_census_test.go
new file mode 100644
index 000000000..f624b704e
--- /dev/null
+++ b/internal/provision/billing_overview_speed_census_test.go
@@ -0,0 +1,22 @@
+package provision
+
+// billingOverviewSpeedWriteCensusInventory is the billing-overview-speed
+// review of the record-write census, layered on
+// groupRollVerbWriteCensusInventory. The console's route table (var
+// routeDecls) gains two methodless declarations for the Billing pages'
+// background sync: /fleet/billing/sync (start, operator + CSRF) and
+// /fleet/billing/sync/status (JSON status). Their handlers
+// (opbilling_sync.go) write no record: the sync runs the existing billing
+// money pass and reads Economics and the bills. Its kinds and class are
+// unchanged; only the digest moves.
+func billingOverviewSpeedWriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), groupRollVerbWriteCensusInventory()...)
+ r := censusEntry{"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "d2fb2693d88d5c4701a900f646d6a8bfb6ad0852a58cb170d96463345a0e01c6"}
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ entries[i] = r
+ return entries
+ }
+ }
+ return append(entries, r)
+}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 9965b5636..796626fa5 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 := groupRollVerbWriteCensusInventory()
+ inventory := billingOverviewSpeedWriteCensusInventory()
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 "))