carlos / platform Public

provision: re-pin routeDecls in the record-write census for the DPA routes

The five DPA and /fleet/legal declarations change routeDecls' digest. The
handlers write only the console database's legal tables, no record,
sidecar or bucket object. New overlay dpaAcceptanceWriteCensusInventory
on releaseCopyWriteCensusInventory; class and kinds unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 924f12bfe94987e208449e5377f3a937852542db parent e3585c0
2 files changed, +38 −1
  • internal/provision/dpa_acceptance_census_test.go +37 −0
  • internal/provision/plan9_b8_census_test.go +1 −1

CI cancelled — superseded by a newer push — run details

diff --git a/internal/provision/dpa_acceptance_census_test.go b/internal/provision/dpa_acceptance_census_test.go
new file mode 100644
index 000000000..21ea48f31
--- /dev/null
+++ b/internal/provision/dpa_acceptance_census_test.go
@@ -0,0 +1,37 @@
+package provision
+
+// dpaAcceptanceWriteCensusInventory is the record-write census for branch
+// dpa-and-retention (DPA acceptance, slice 1), layered on
+// releaseCopyWriteCensusInventory. Reviewed by the branch author against
+// the source. No record write is added, moved or reclassified; one key-site
+// table is re-pinned:
+//
+// - var routeDecls (console): five new declarations. POST
+// /a/{sqid}/dpa/accept (handleDPAAccept, dpapane.go) and GET
+// /a/{sqid}/settings/dpa (handleDPARecord, dparecord.go) for account
+// members; GET /fleet/legal, /fleet/legal/publish and
+// /fleet/legal/letterhead (oplegal.go) for operators. The writes go to
+// the console database's own legal tables (legal_store.go); none reads
+// or writes an app record, a sidecar or a bucket object. The instances
+// and sidecars literals are unchanged: still key-site.
+func dpaAcceptanceWriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), releaseCopyWriteCensusInventory()...)
+ repins := []censusEntry{
+ {"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "d702644e8e2fd590b75d5c4352ad90a18b0dc5a94d2470c15173b88ba4b8ed8f"},
+ }
+ 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("dpa-acceptance re-pin changes the class or kinds of " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("dpa-acceptance re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return entries
+}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index f62e55e66..7e118928d 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 := releaseCopyWriteCensusInventory()
+ inventory := dpaAcceptanceWriteCensusInventory()
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 "))