carlos / platform Public

census: record-write re-pins for member backups slice 1 (#898)

memberBackups1WriteCensusInventory, layered on
linkedDeploymentsSlice1WriteCensusInventory: re-digests instancesCommand,
Server.handleAppInstance, var linkedPolicies and var routeDecls, and adds
backupsShow (the CLI's GET of the backups door). No record write added;
no class or kind changes. A reason per unit is in the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 216773f5ca508a713c40f43e10e40e19fb3b2b6d parent dabd213
2 files changed, +56 −1
  • internal/provision/member_backups_1_census_test.go +55 −0
  • internal/provision/plan9_b8_census_test.go +1 −1

Intent

diff --git a/internal/provision/member_backups_1_census_test.go b/internal/provision/member_backups_1_census_test.go
new file mode 100644
index 000000000..cde1bf15c
--- /dev/null
+++ b/internal/provision/member_backups_1_census_test.go
@@ -0,0 +1,55 @@
+package provision
+
+// memberBackups1WriteCensusInventory is the member backups slice 1 review
+// of the record-write census (#898, design
+// docs/superpowers/specs/2026-11-11-member-backups-design.md), layered on
+// linkedDeploymentsSlice1WriteCensusInventory. It re-digests four units and
+// adds one; no record write is added and no class or kind changes:
+// - instancesCommand (cli.go, Task 5): the instances command tree gains
+// raw("backups", cust, runInstancesBackups) beside list and delete. A
+// subcommand registration only. key-site / lit:instances, as before.
+// - Server.handleAppInstance (Task 4): after the page's existing reads it
+// sets detail.Backups from s.instanceBackups, which reads the instance's
+// record (readRecord) and the copy's listing to build the Backups
+// section. Reads only; no record, registry row or object is written.
+// key-site / lit:instances, as before.
+// - var linkedPolicies (Task 3): one more pattern,
+// GET /api/cli/apps/{account}/{app}/instances/{host}/backups, mapped to
+// linkedRefuse. A map entry, no record path built from it. key-site /
+// lit:instances,lit:sidecars, as before.
+// - var routeDecls (Task 3): one kindCLI door,
+// GET /api/cli/apps/{account}/{app}/instances/{host}/backups (Deploy and
+// Operate allowed, handleAPIInstanceBackups, read only). A declaration,
+// no record path. key-site / lit:instances,lit:sidecars, as before.
+//
+// New unit:
+// - backupsShow (instances_backups.go, Task 5): the CLI side of
+// `carlos instances backups`; resolves the instance (resolveDBInstance)
+// and GETs the console's "/instances/{host}/backups" door, then prints
+// or passes the JSON through. The literal is a console API path, not a
+// record key; it writes nothing. key-site / lit:instances, as the other
+// CLI instance verbs (apiSession.instanceGatePass, runInstances).
+func memberBackups1WriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), linkedDeploymentsSlice1WriteCensusInventory()...)
+ repins := []censusEntry{
+ {"cli.go", "instancesCommand", "key-site", "lit:instances", "853d812fe20ca0549e84f11ea2e4e48f11c44fc0eee58e83bae185c3efa8649f"},
+ {"internal/console/instancepage.go", "Server.handleAppInstance", "key-site", "lit:instances", "aee1f045b7b79923b409d05f0372a3fb70e7b14268e710edf7894dab9d9df40e"},
+ {"internal/console/linkedpolicy.go", "var linkedPolicies", "key-site", "lit:instances,lit:sidecars", "e2d2ea5dc6e800302890d1870bfdabd3841b0b2ef4391da0c91bb46a44d8037d"},
+ {"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "1623af4688d9888e1bb0045908d039f6ce49b35d7064d9fab72150e307ef3e47"},
+ }
+ 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("member-backups-1 census: classification changed for " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("member-backups-1 census: re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return append(entries, censusEntry{"instances_backups.go", "backupsShow", "key-site", "lit:instances", "518a32e4eb95c5b6067a9d6ef3175ab4ee00a1c56bf67a25a80356d123566d30"})
+}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 9f059ae49..ce4f9b244 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 := linkedDeploymentsSlice1WriteCensusInventory()
+ inventory := memberBackups1WriteCensusInventory()
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 "))