carlos / platform Public

census: record-write entries for cert-import-1429

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev bb8f6429cd29471c736a960aad7ff0b9b8a165ee parent 0bf403d
2 files changed, +46 −1
  • internal/provision/cert_import_1429_census_test.go +45 −0
  • internal/provision/plan9_b8_census_test.go +1 −1
diff --git a/internal/provision/cert_import_1429_census_test.go b/internal/provision/cert_import_1429_census_test.go
new file mode 100644
index 000000000..d6bbe337a
--- /dev/null
+++ b/internal/provision/cert_import_1429_census_test.go
@@ -0,0 +1,45 @@
+package provision
+
+// Record-write census entries for cert-import-1429 (imported TLS
+// certificates), layered on dpaAcceptanceWriteCensusInventory (the inventory
+// TestPlan9B8RecordWriteCensus used before this branch). Two new sites, both
+// "nonrecord": neither writes a provision record, a sidecar or an app
+// record key.
+// - domains.WriteImport (internal/domains/certimport_invariant.go) puts
+// control/certs/<host>+import, the imported TLS certificate entry, in
+// the same certificate area as the certsync.go putCAS row. It builds no
+// record key.
+// - certMirror.reconcileLocalImport (internal/edge/certimport.go) writes
+// the edge's local autocert cache file for an imported certificate, the
+// way certMirror.reconcileLocal does for an issued one. The Put it
+// calls is the cache's, not a store record write.
+//
+// Two key-site tables are re-pinned, class and kinds unchanged: var
+// routeDecls (routedecls.go) and var linkedPolicies (linkedpolicy.go) gained
+// the certificate import routes and their policy rows. The instances and
+// sidecars literals are the same; no record key is built or written.
+func certImport1429WriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), dpaAcceptanceWriteCensusInventory()...)
+ repins := []censusEntry{
+ {"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "ab0e68b6178465afad159e26147aeceebe9a7c07d3e293cd0177b8490a11a9ee"},
+ {"internal/console/linkedpolicy.go", "var linkedPolicies", "key-site", "lit:instances,lit:sidecars", "2e185fc69d8984d7b04b5baf88fa0b4406ff7b2a139dd4f065187ac85917f28d"},
+ }
+ 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("cert-import-1429 re-pin changes the class or kinds of " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("cert-import-1429 re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return append(entries,
+ censusEntry{"internal/domains/certimport_invariant.go", "WriteImport", "nonrecord", "sel:Put", "7504f93cc5c8c1c265cf268a384509edd8e1abe6d9b3b370131a914b0b754648"},
+ censusEntry{"internal/edge/certimport.go", "certMirror.reconcileLocalImport", "nonrecord", "sel:Put", "75389fc8111a3d299a0b87861136af4f0284fb5b43edcdaf05548f1a768e9f3e"},
+ )
+}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 7e118928d..48e48cf01 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 := dpaAcceptanceWriteCensusInventory()
+ inventory := certImport1429WriteCensusInventory()
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 "))