carlos / platform Public

census: account subdomains final fix wave

Write census (accountSubdomainsWriteCensusInventory): AttachAccountNamespace
re-pinned (answers its Put's ETag), putNamespace added (the one Put of
the four new namespace writers, always conditional on the judged
revision; nonrecord / sel:Put), Server.handleAPIInstanceList re-pinned
(q also matches public_host). No class or kind changes.

Root-read overlay re-proposed with make census-propose: only the
internal/domains envelope moved; no unit changed, seal unchanged at
165bf116. Not yet approved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b1a185d4e97279368a9e333750353eca02256a30 parent f5efc87
2 files changed, +24 −3
  • internal/provision/account_subdomains_census_test.go +23 −2
  • internal/provision/testdata/plan14-root-reads-account-subdomains.tsv +1 −1

Intent

Attributed to this commit: 8.50 g CO₂e (1,065,242 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-account-name-hosts, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/provision/account_subdomains_census_test.go b/internal/provision/account_subdomains_census_test.go
index 64c09fa79..fc44cfedc 100644
--- a/internal/provision/account_subdomains_census_test.go
+++ b/internal/provision/account_subdomains_census_test.go
@@ -112,6 +112,26 @@ package provision
// this branch's four subdomain declarations. key-site /
// lit:instances,lit:sidecars, as before.
//
+// The final review fix wave (spec rev 4, §4.3: remove retires the name)
+// re-digests two units and adds one; no record write is added, moved or
+// removed, and no class or kind changes:
+// - AttachAccountNamespace (re-pinned): the same create-only Put at
+// domains.ClaimKey("*.<name>.<apps-domain>"), now also answering the
+// ETag that Put returned, so the console's rollback is conditioned on
+// its own write (Astra P2-3). nonrecord / sel:Put, as before.
+// - putNamespace (new): the one Put of the four new namespace writers
+// (RetireAccountNamespace, UnretireAccountNamespace,
+// ReplaceRetiredAccountNamespace, RestoreRetiredAccountNamespace), at
+// the same claim key, always conditional on the ETag of the revision
+// the writer read and judged (never create-only, never unconditional);
+// a lost CAS writes nothing. A domains/ claim key, never a record key or
+// prefix. nonrecord / sel:Put, the class of AttachAccountNamespace.
+// - Server.handleAPIInstanceList (re-pinned again): the q filter also
+// matches the row's public_host (recordPublicHost, computed once per
+// row and reused for the answer) as the page filter does (Astra
+// P2-5). Display only; the listing and the instances-literal sites are
+// unchanged. key-site / lit:instances, as before.
+//
// The create, import and seed doors answer through publicRecordView too;
// the census does not count those functions as units, so they need no pin.
func accountSubdomainsWriteCensusInventory() []censusEntry {
@@ -120,7 +140,7 @@ func accountSubdomainsWriteCensusInventory() []censusEntry {
{"internal/console/apidomains.go", "Server.handleAPIDomainAttach", "key-site", "lit:instances", "3e0501dbc4e79c6f51274c3e02ac34853d20557474e57dbcae8d30e7742e9b9d"},
{"internal/console/domainattach.go", "Server.attachDomainAs", "record-writer", "key:CreateRecord", "cad4da6801d2d1fae6381a9420beda4b881ffdc237c84c05877ac68ba509f609"},
// Task 6.
- {"internal/console/apiinstances.go", "Server.handleAPIInstanceList", "key-site", "lit:instances", "f7cc7f1c2c5a38e1bf3a04f47ce9d3655bce99004aed885a309c0fe80d7672b4"},
+ {"internal/console/apiinstances.go", "Server.handleAPIInstanceList", "key-site", "lit:instances", "533e9bbe969670811273fdf6aa4c024fdea89205711d19feb893176eeb6050e0"},
{"internal/console/apiinstances.go", "Server.handleAPIInstanceUpdate", "record-writer", "key:UpdateRecord", "88e986f3e2974be31856296d319d74ffb88733c0840283c3ba410fa557e279ec"},
{"internal/console/channelmove.go", "Server.handleAPIInstanceChannel", "record-writer", "key:UpdateRecord", "ddbabf888417ae76dfdd381d936248585e937698521cdec43a4207427cf0bffc"},
{"internal/console/instancepage.go", "Server.handleAppInstance", "key-site", "lit:instances", "b9339349258fbdc24c9516d42c833148003aead7207d49308775339285e07d00"},
@@ -160,7 +180,8 @@ func accountSubdomainsWriteCensusInventory() []censusEntry {
}
}
return append(entries,
- censusEntry{"internal/domains/namespace.go", "AttachAccountNamespace", "nonrecord", "sel:Put", "cca934a1385e98ad1decbf49f968a447a54f6983f4d277da7706b16773acd486"},
+ censusEntry{"internal/domains/namespace.go", "AttachAccountNamespace", "nonrecord", "sel:Put", "c405dc149245152972435cdc60936088f1b4d1bbe3bbb12526cdbf2d0e1ba10a"},
+ censusEntry{"internal/domains/namespace.go", "putNamespace", "nonrecord", "sel:Put", "4c78aa1db56b33c61478bd28dcdc582108c0d802343a959588faf19827765606"},
censusEntry{"internal/provision/recordhost.go", "declaredRecordKeys", "key-site", "lit:instances", "f396f0bd46328f209ff9f0d966d735a9c25fc3f691298e8815cd29e2ee47c2cf"},
censusEntry{"internal/provision/recordhost.go", "RecordHostDeclaredUnder", "key-site", "key:ParseRecordKey", "d465d7382b20167ed49b28f4c9c59f45bfe3debea6882aefb4233a443fc9f162"},
censusEntry{"internal/console/subdomains.go", "pinnedClaimStore.Put", "nonrecord", "def:Put,sel:Put", "a7d301a0ea7fd1f7b48bfa8cd2687a000b38f311715d3458acba4fc35e6500b2"},
diff --git a/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv b/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
index a627fbca0..55f44c80d 100644
--- a/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
+++ b/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
@@ -31,7 +31,7 @@ internal/domains/reconcile.go StampHealth legacy accepted-legacy accepted-legacy
internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source.;rev3=census-ruling-agent-start-demo-1;basis=Existing SELECT reads four more demo columns; only a marked row adds them to the hash, so ordinary hashes remain unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Four additive projection columns join the existing routes SELECT and hash only when nonzero; no new query or file read. merge of origin/main 6be08467: Union main demo identity and expiry with replica columns in the same SELECT and hash; merge-only body change.;rev3=census-ruling-agent-start-demo-3;basis=Hash moved-notice wire bytes so notice-only changes invalidate an edge route snapshot. Census read-site delta: +file:QueryRow.;rev3=census-ruling-edge-page-cache-1;basis=selects the new pages_off column with the rest and folds "pages_off=1" into the hash only when set, as assets_off, so a registry that never sets it fingerprints as before; same routes SELECT, no new table; read sites unchanged (34); no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: hashes link_channels (link_id, account, token_hash, status, generation; connected, seen_at, seq and created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no links digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision; linked deployments slice 1 Task 7: also folds home_link (id, serving_url, tunnel_url, the token's sha256 never the token, account, apps_domain, box_label, conn_gen; state and created_at not) and home_link_apps (name, home_account, home_app, home_host) through fingerprintHomeLink over the same fresh connection, each section marker written only when a row exists, so a registry with no link digests as before; no file path read; a digest, never a decision;rev3=census-ruling-account-subdomains;basis=hashes account_namespaces (name, account) over the same fresh connection, with a section marker written only when a row exists, so a registry with no held names digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision file:Exec@284,file:Open@188,file:Query@10785,file:Query@11707,file:Query@12810,file:Query@368,file:Query@6655,file:Query@7134,file:Query@8120,file:Query@8816,file:Query@9728,file:QueryRow@13727,registry:ClaimIncarnation@1729,registry:ClaimIncarnation@5563,registry:ClaimIncarnation@5640,registry:ClaimOwner@1773,registry:ClaimOwner@5764,registry:ClaimOwner@5829,registry:ClaimRowID@1792,registry:ClaimRowID@5856,registry:ClaimRowID@5922,registry:ClaimStamp@1754,registry:ClaimStamp@5673,registry:ClaimStamp@5737,registry:Incarnation@1848,registry:Incarnation@6143,registry:Incarnation@6207,registry:ServingSeq@1867,registry:ServingSeq@6234,registry:ServingSeq@6297,registry:Text@158,registry:path@207,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 a52e0bc25d555bbf22f35655c54c0fa3aca6cedec5f0b6b80157d9d95f921a29
internal/registry/registry.go Registry.migrate legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), on every registry open; a box CLI verb that opens the registry directly runs it as whoever runs the verb: census-ruling-seeded-instances's body with two more columns added to routes (incarnation and serving_seq, INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule); self-serve moves 1 Task 7;rev3=census-ruling-rootfs-apps-2;basis=one more ALTER TABLE, routes ADD COLUMN runtime TEXT NOT NULL DEFAULT '', beside main's rate_limit, assets_off, asset_gen, incarnation and serving_seq (the last four from the merges of origin/main 3c33f2eb and 953b9fda); the same sixteen sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 4: three more ALTER TABLE statements in the existing loop, routes ADD COLUMN egress_allow, size and policy_expires_at, each TEXT NOT NULL DEFAULT '' and idempotent through the duplicate-column rule; the same sixteen sites, no read added.;rev3=census-ruling-region-ha-p1a;basis=one more ALTER TABLE in the existing loop: routes ADD COLUMN ha INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule; the same sixteen sites, no read added;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child; a box CLI verb that opens the registry directly runs it as whoever runs it), on every registry open: the ALTER TABLE routes statements are now built from the one migration definition routeAddedColumns (addedColumn name, type, default; review r1 P2): for each entry without the Claim mark, "ALTER TABLE routes ADD COLUMN " + spec(), byte for byte the statements main runs, in main's order, under the same duplicate-column rule. +registry:Claim is that mark, +whole:addedColumn the struct. Every name, type and default is an in-binary literal; no statement added, removed or changed; no read added.;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: one more CREATE TABLE IF NOT EXISTS regional_domains (host TEXT PRIMARY KEY, target, account, app, region TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL DEFAULT 0), beside wildcard_domains; the added sites are that statement (+file:Exec, +registry:sql), an in-binary literal; additive, no existing statement changed;rev3=census-ruling-region-ha-p1b3b-t;basis=Create local HA duty/replay tables and revision triggers in the existing registry connection; no new database path.;rev3=census-ruling-agent-start-demo-3;basis=Create moved-notice storage as a single (id, wire) row; fingerprints include the stored wire bytes. Census read-site delta: +file:Exec, +registry:sql.;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: calls migrateLinks after migrateHADuties (one CREATE TABLE IF NOT EXISTS link_channels, an in-binary literal); additive, no existing statement changed; linked deployments slice 1 Task 7: also runs migrateHomeLink (CREATE TABLE IF NOT EXISTS home_link and home_link_apps) after migrateLinks; additive, the box's own registry database, as carlos;rev3=census-ruling-account-subdomains;basis=one more CREATE TABLE IF NOT EXISTS account_namespaces (name TEXT PRIMARY KEY, account TEXT NOT NULL), an in-binary literal (+file:Exec, +registry:sql); additive, no existing statement changed file:Exec@1124,file:Exec@1855,file:Exec@212,file:Exec@2409,file:Exec@3057,file:Exec@3822,file:Exec@4101,file:Exec@4964,file:Exec@51,file:Exec@5140,file:Exec@761,registry:Claim@686,registry:sql@1124,registry:sql@1855,registry:sql@212,registry:sql@2409,registry:sql@3057,registry:sql@3822,registry:sql@4101,registry:sql@4964,registry:sql@51,registry:sql@5140,registry:sql@761,whole:addedColumn@661 0c5fdaf1215e8f81c156a1fc1576cb075c2a52238bde75fc8320d49472fd117d
@coverage . d6ae7a91a51bf9a28f5d8979e3150816eb8b9e943e796ae8a5192b4773df4a41
-@coverage internal/domains be259af4d007f9f06e6d827eb2fa775710788821cc1bbac3215ec1c9b67780fc
+@coverage internal/domains 71a6098db9d7817644ef75d9674ca22b6524e7f3c30f2cb31de55f0b61126c57
@coverage internal/edge 2f9527a8be433bf2d560cd1293ea04e8e357898ed7241a5854bc403a79cd9aad
@coverage internal/host 9388ccee0b3287e82898e47c0b6da2991fe9a20ff3c0c600e59dbf2ed89210d3
@coverage internal/provision 8b7747ecb67234457618a5ab9f2454823520065ddac23360be60fd93d26ec131