carlos / platform Public

census: sr-followups record-write inventory (9B8, #1061, #966)

TestPlan9B8RecordWriteCensus rejected four sites this branch changed:
labelRefusal (#1060 not-release floor line, text only),
WriteConfigAck (ETag via configAckETag, same CAS Put),
sourceFinal.configAck (comment only) and the new
ReplaceConfigAckBlind (root door-box ack: Delete then create-only Put,
no read). Re-digest the three and classify the new one nonrecord,
sel:Put, as WriteConfigAck, layered on flatPlansWriteCensusInventory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev da633a4bb87aca98b847924c6838b74a15239d2e parent e8184d0
2 files changed, +51 −1
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/sr_followups_census_test.go +50 −0
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 2e8d9ee82..caec27cc6 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 := flatPlansWriteCensusInventory()
+ inventory := srFollowupsWriteCensusInventory()
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/sr_followups_census_test.go b/internal/provision/sr_followups_census_test.go
new file mode 100644
index 000000000..9907c2a62
--- /dev/null
+++ b/internal/provision/sr_followups_census_test.go
@@ -0,0 +1,50 @@
+package provision
+
+// srFollowupsWriteCensusInventory is the sr-followups branch's (#1061,
+// #966, #1060) review of the record-write census, layered on
+// flatPlansWriteCensusInventory (main's newest at the merge of 138f2e37).
+// Self-review only; the independent #280 verdict is the reviewer's.
+//
+// No record write is added and no class or kind changes. Three units are
+// re-digested and one config-ack writer is added:
+// - labelRefusal (instances_cli.go, #1060): a floor refusal whose build is
+// not a release version (release.NotReleaseBuild) prints the new
+// labelFloorNotRelease line instead of labelFloor. Message text only;
+// key-site, lit:sidecars, as before.
+// - WriteConfigAck (internal/appconfig/configack.go, #966): its
+// read-before-write takes the existing ack's ETag through configAckETag
+// (Open, close unread when the stream carries an ETag, else read at most
+// 64 KiB and discard) instead of s.Get. Same key (ConfigAckKey under
+// control/config-ack/, or the fleet corner through a prefix store), same
+// CAS Put; nonrecord, sel:Put, as before.
+// - sourceFinal.configAck (internal/host/movesfinal.go, #966): a comment
+// only, that the root ack key is read here because moves refuse fleet
+// routes. Code unchanged; nonrecord, sel:Put, as before.
+// - ReplaceConfigAckBlind (internal/appconfig/configack.go, #966), new: a
+// Delete then a create-only Put of the same config ack body at
+// ConfigAckKey, with no read of the key. Called only by
+// configAckRootFunc (internal/host/agent.go) for the root adopt pass on
+// a door box, through configAckStore's fleets/<fleet>/ prefix store. A
+// config ack is not a host record and names no record key: nonrecord,
+// sel:Put, as WriteConfigAck.
+func srFollowupsWriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), flatPlansWriteCensusInventory()...)
+ for _, r := range []censusEntry{
+ {"instances_cli.go", "labelRefusal", "key-site", "lit:sidecars", "93375a0ff779cd42120ef29ecf389ba17dba8b12a8793ea907dd69b9d3113e28"},
+ {"internal/appconfig/configack.go", "WriteConfigAck", "nonrecord", "sel:Put", "8dba7cab65ff994109d3edc75058101c90c2998f52afdce4734d29bb8259913c"},
+ {"internal/host/movesfinal.go", "sourceFinal.configAck", "nonrecord", "sel:Put", "29eb4a6dd1944a8ba33b8cdb3b794d45336557b988976fbbcd6ff77dd1e054b3"},
+ {"internal/appconfig/configack.go", "ReplaceConfigAckBlind", "nonrecord", "sel:Put", "4abea553f02c2bd0a520e6d1d39ccb79f4563a36d5575a49c2d29513f701edea"},
+ } {
+ replaced := false
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ entries[i], replaced = r, true
+ break
+ }
+ }
+ if !replaced {
+ entries = append(entries, r)
+ }
+ }
+ return entries
+}