carlos / platform Public

HA P1a #433: census update for the review fix

Re-proposes ha-p1a-433 over 85db2687. New units: addedColumn.spec and
addedRouteColumnDefaults, both pure over in-binary literals. Changed
reads: Registry.migrate and Registry.migrateClaimOwnership
(+registry:Claim, +whole:addedColumn), each running the same statements as
before from the one migration definition. The registry schema (the
struct field set) is re-pinned for addedColumn's fields. The envelope
for internal/registry is re-pinned. Seal 125c5c41 -> 4ca42e1e. Proposed,
not approved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 961f1e14bab2b3f367ead42c62a7d1022f5b64da parent 85db268
4 files changed, +27 −11
  • docs/superpowers/notes/census-ha-p1a-433-claims.md +7 −1
  • docs/superpowers/notes/census-proposal-ha-p1a-433.md +7 −4
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv +12 −5
diff --git a/docs/superpowers/notes/census-ha-p1a-433-claims.md b/docs/superpowers/notes/census-ha-p1a-433-claims.md
index 03656992a..d2a5dacf4 100644
--- a/docs/superpowers/notes/census-ha-p1a-433-claims.md
+++ b/docs/superpowers/notes/census-ha-p1a-433-claims.md
@@ -9,8 +9,14 @@ internal/instancectl/peer_linux.go:systemdEdgeMainPID root (carlos-instance-cont
# Fix 2: root reads routes before the agent migrates (registry, read-only child as carlos; read-write in the agent)
internal/registry/registry.go:Registry.List the registry's SQLite side as carlos (agent, registry child, and root's read-only registry child via openServiceRegistryReadOnly): calls readCols on the same connection before the same SELECT ... FROM routes ORDER BY host. A read-write registry gets routeCols unchanged; a read-only one gets routeCols with any column routeAddedColumns adds that the table lacks read as its migration default ("0 AS ha"), so root's egress naming and source work before the new agent migrates (#433). Decides nothing; no read added.
internal/registry/registry.go:Registry.Get same identities as List: +registry:sql is r.sql handed to readCols, the same connection the SELECT already used; same SELECT ... WHERE host = ? with the select list readCols returns (routeCols for a read-write registry). Root's instanceRegistryHostApp and instanceRegistryHostRuntime read Get through the read-only child and now work before the migration too.
-internal/registry/registry.go:Registry.migrate the ALTER TABLE list moved verbatim into the package var routeAddedColumns (same statements, same order, same duplicate-column rule); the loop ranges over it. No statement added, removed or changed; no read added.
+internal/registry/registry.go:Registry.migrate 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.
internal/registry/registry.go:Registry.readCols new; the registry's SQLite side as carlos. For a read-write registry returns routeCols and reads nothing. For a read-only one (registry:readOnly), one SELECT name FROM pragma_table_info('routes') over the registry's own mode=ro, query_only connection. The names read are only compared with the in-binary routeCols and routeAddedColumns lists, never put into SQL: the select list is built from routeCols and the in-binary defaults (the empty string literal or 0, parsed from routeAddedColumns by a fixed regexp). An agent-written table can only make a known added column read as its default, which is what the migration gives it; a missing CREATE column is not stood in for and the read fails as before.
# Fix 3: CARLOS_POOLS token (agent, carlos)
internal/host/agent.go:provisionTickConfig the agent (carlos-edge.service, user carlos) and the edges file loop's eligibility: the same CARLOS_POOLS read, now parsed by provision.ParseBoxPools (internal/provision, envelope re-pinned), the one parser boxPools also uses. "@shared" (provision.SharedPoolToken, never a valid pool name) is the shared "" pool; other tokens are literal as before; empty elements and repeats dropped. No read added.
+
+# Review r1 P2 (Astra): every migration-added column from one definition
+internal/registry/claimrows.go:Registry.migrateClaimOwnership the registry's SQLite side as carlos, on every registry open (called from migrate): the four claim ownership ALTERs for routes and timers come from routeAddedColumns' Claim-marked entries (claim_incarnation TEXT, claim_stamp INTEGER, claim_owner TEXT, claim_row_id TEXT, each NOT NULL DEFAULT the empty string or 0), as "ALTER TABLE " + table + " ADD COLUMN " + spec(): the same statements as main's inline list, same order, same tables, same duplicate-column rule. +registry:Claim is the mark, +whole:addedColumn the struct; in-binary literals only; no read added.
+internal/registry/registry.go:addedColumn.spec new; pure: joins the entry's in-binary Name, Type and Default into "<name> <type> NOT NULL DEFAULT <default>". +registry:Name/Type/Default are the struct's own fields; it reads nothing from the database, a file or an input.
+internal/registry/registry.go:addedRouteColumnDefaults new as a census unit (it replaces the regexp parse of the ALTER texts): pure, maps each routeAddedColumns entry's in-binary Name to its in-binary Default, now including the four claim ownership columns, so readCols stands their defaults in for a read-only registry that predates migrateClaimOwnership. Reads nothing from the database, a file or an input.
+# changed registry schema: the registry struct field set gains addedColumn's Name, Type, Default and Claim (an in-binary migration definition, not a table column); no route, timer or archive field changed. Re-pinned by census-propose.
diff --git a/docs/superpowers/notes/census-proposal-ha-p1a-433.md b/docs/superpowers/notes/census-proposal-ha-p1a-433.md
index 8adf3e07d..57216ea30 100644
--- a/docs/superpowers/notes/census-proposal-ha-p1a-433.md
+++ b/docs/superpowers/notes/census-proposal-ha-p1a-433.md
@@ -1,12 +1,11 @@
# Census approval: ha-p1a-433
-Ruling `census-ruling-ha-p1a-433`. The independent reviewer approves or rejects every change below, 3 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-ha-p1a-433`. The independent reviewer approves or rejects every change below, 8 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
| `internal/host/agent.go` `provisionTickConfig` | body | unchanged (2) | the agent (carlos-edge.service, user carlos) and the edges file loop's eligibility: the same CARLOS_POOLS read, now parsed by provision.ParseBoxPools (internal/provision, envelope re-pinned), the one parser boxPools also uses. "@shared" (provision.SharedPoolToken, never a valid pool name) is the shared "" pool; other tokens are literal as before; empty elements and repeats dropped. No read added. |
| `internal/registry/registry.go` `Registry.List` | body | unchanged (16) | the registry's SQLite side as carlos (agent, registry child, and root's read-only registry child via openServiceRegistryReadOnly): calls readCols on the same connection before the same SELECT ... FROM routes ORDER BY host. A read-write registry gets routeCols unchanged; a read-only one gets routeCols with any column routeAddedColumns adds that the table lacks read as its migration default ("0 AS ha"), so root's egress naming and source work before the new agent migrates (#433). Decides nothing; no read added. |
-| `internal/registry/registry.go` `Registry.migrate` | body | unchanged (16) | the ALTER TABLE list moved verbatim into the package var routeAddedColumns (same statements, same order, same duplicate-column rule); the loop ranges over it. No statement added, removed or changed; no read added. |
| `internal/registry/registry.go` `Registry.Get` | sites | +registry:sql | same identities as List: +registry:sql is r.sql handed to readCols, the same connection the SELECT already used; same SELECT ... WHERE host = ? with the select list readCols returns (routeCols for a read-write registry). Root's instanceRegistryHostApp and instanceRegistryHostRuntime read Get through the read-only child and now work before the migration too. |
Envelopes re-pinned: `internal/host`, `internal/instancectl`, `internal/provision`, `internal/registry`.
@@ -17,15 +16,19 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/agent.go` `provisionTickConfig`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input
- `internal/registry/registry.go` `Registry.List`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-instance-egress-sizes-328-329;identity=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), and now also in the read-only registry child (carlos __registry-child read-only, which root's instance control forks as the service user through openServiceRegistryReadOnly);basis=#328 plan 2 Task 13 fix (4e7bbc4b): a read-only registry (OpenReadOnly sets readOnly) lists over its own mode=ro, query_only connection (registry:sql, one site, r.sql) instead of a fresh sql.Open on its path, which opens read-write; registry:readOnly (one site) is the branch on that flag. A read-write registry keeps main's fresh connection. The same SELECT of routeCols from routes; it serves root's egress source (listRegistryReadOnly) every row; it decides nothing
-- `internal/registry/registry.go` `Registry.migrate`: legacy, task accepted-legacy. Basis: 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
- `internal/registry/registry.go` `Registry.Get`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1,J4;basis=route-and-input
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
- new `internal/instancectl/peer_linux.go:systemdEdgeMainPID`: reads +file:CommandContext; written legacy, accepted-legacy, frozen
- new `internal/registry/registry.go:Registry.readCols`: reads +file:Query, +registry:readOnly; written legacy, accepted-legacy, frozen
+- new `internal/registry/registry.go:addedColumn.spec`: reads +registry:Default, +registry:Name, +registry:Type; written legacy, accepted-legacy, frozen
+- new `internal/registry/registry.go:addedRouteColumnDefaults`: reads +registry:Default, +registry:Name, +whole:addedColumn; written legacy, accepted-legacy, frozen
+- other `changed registry schema`: closed only if it is the registry schema (re-pinned)
- quiet `internal/instancectl/peer_linux.go:productionPeerOK`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
+- reads `internal/registry/claimrows.go:Registry.migrateClaimOwnership`: +registry:Claim, +whole:addedColumn; keeps legacy, task accepted-legacy
+- reads `internal/registry/registry.go:Registry.migrate`: +registry:Claim, +whole:addedColumn; keeps legacy, task accepted-legacy
-Seal: `125c5c411cd0a04000d9652800b51bc7c066081c00753fb1c7b6ee0b6e717dbd` → `98d5c95de1a8fef7fa02aa24cf634c43a0bafe23e0842b17595f460161ed3883`.
+Seal: `125c5c411cd0a04000d9652800b51bc7c066081c00753fb1c7b6ee0b6e717dbd` → `4ca42e1ec26a040c7f60a55664510f4d96dac769469cc459216057f460f5e78b`.
Overlay: `internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index b332ef036..812180221 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -6,4 +6,4 @@ plan14-root-reads-remote-instance-metrics.tsv ed0d770a827bdb37a87d21e5c8efb259ca
plan14-root-reads-edge-asset-cache-3.tsv f723ddc14e3c03c0d55b6f0c949567a2c9325e0b5d491e0649fe548b2c0c282d
plan14-root-reads-remote-metrics-nested.tsv e923841657499fc729713abdd750cbd2d6019fc4db677b540be0fab4d2a160e4
plan14-root-reads-region-ha-p1a.tsv 125c5c411cd0a04000d9652800b51bc7c066081c00753fb1c7b6ee0b6e717dbd
-plan14-root-reads-ha-p1a-433.tsv 98d5c95de1a8fef7fa02aa24cf634c43a0bafe23e0842b17595f460161ed3883
+plan14-root-reads-ha-p1a-433.tsv 4ca42e1ec26a040c7f60a55664510f4d96dac769469cc459216057f460f5e78b
diff --git a/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv b/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv
index 057b39526..2f974d62c 100644
--- a/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv
+++ b/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv
@@ -1,21 +1,28 @@
# Census overlay ha-p1a-433, written by census-propose (#369). census-ruling-ha-p1a-433, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-ha-p1a-433.md.
-# 3 body, 1 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 3 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
+# 2 body, 1 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 8 new dispositions: 2 reads re-frozen at their disposition with the claim, 4 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 1 other.
@legacy d5186710900d37c74a217ea1c872a06c8afd634093845b390830c888dc2e6988 internal/host/agent.go provisionTickConfig legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-ha-p1a-433;basis=the agent (carlos-edge.service, user carlos) and the edges file loop's eligibility: the same CARLOS_POOLS read, now parsed by provision.ParseBoxPools (internal/provision, envelope re-pinned), the one parser boxPools also uses. "@shared" (provision.SharedPoolToken, never a valid pool name) is the shared "" pool; other tokens are literal as before; empty elements and repeats dropped. No read added. data-literal@207,data-literal@248 0321619c2abad2a9431515f92e28465a6b40aa49332fdcddf939e7b3e2a6ebe7
@legacy 4de6e4827c9e69619633552c8c373e9704097d986b8ab4ce2b07bb4952ceb460 internal/registry/registry.go Registry.List legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-instance-egress-sizes-328-329;identity=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), and now also in the read-only registry child (carlos __registry-child read-only, which root's instance control forks as the service user through openServiceRegistryReadOnly);basis=#328 plan 2 Task 13 fix (4e7bbc4b): a read-only registry (OpenReadOnly sets readOnly) lists over its own mode=ro, query_only connection (registry:sql, one site, r.sql) instead of a fresh sql.Open on its path, which opens read-write; registry:readOnly (one site) is the branch on that flag. A read-write registry keeps main's fresh connection. The same SELECT of routeCols from routes; it serves root's egress source (listRegistryReadOnly) every row; it decides nothing;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child, and root's read-only registry child via openServiceRegistryReadOnly): calls readCols on the same connection before the same SELECT ... FROM routes ORDER BY host. A read-write registry gets routeCols unchanged; a read-only one gets routeCols with any column routeAddedColumns adds that the table lacks read as its migration default ("0 AS ha"), so root's egress naming and source work before the new agent migrates (#433). Decides nothing; no read added. file:Exec@396,file:Open@212,file:Query@569,registry:Routes@145,registry:path@231,registry:readOnly@183,registry:remote@49,registry:remote@81,registry:sql@172,whole:Route@149,whole:Route@797,whole:Route@810,whole:Route@815,whole:Route@829,whole:remoteClient@51,whole:remoteClient@83 4505dd81395a06055029d52b27debb90209fd3a8aac1af4d589bee8bc33a0ba5
-@legacy 17892501064159853f2b7260b8f39c6bd104e7c9dcff679e0e46c8030b08f08a 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 ALTER TABLE list moved verbatim into the package var routeAddedColumns (same statements, same order, same duplicate-column rule); the loop ranges over it. No statement added, removed or changed; no read added. file:Exec@1593,file:Exec@2453,file:Exec@2732,file:Exec@3595,file:Exec@3771,file:Exec@51,file:Exec@538,file:Exec@862,registry:sql@1593,registry:sql@2453,registry:sql@2732,registry:sql@3595,registry:sql@3771,registry:sql@51,registry:sql@538,registry:sql@862 684418dfd7b9d26582ac94834c416aa2a0467426dd78b2407d9a54027a7b4ac9
@legacy 182fbc52eb5bd221ef5f55b07e56d5dda2b09e1b3da28e47919c521b270062e9 internal/instancectl/peer_linux.go systemdEdgeMainPID legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=root (carlos-instance-control.service): the same exec productionPeerOK's closure ran before, moved out unchanged: systemctl show -p MainPID --value carlos-edge.service, fixed argv, 3 s timeout; output that does not parse is 0 (no MainPID), which edgePeer refuses. No input from a peer, tenant or agent reaches the argv. file:CommandContext@143 f71136a6afa17f28657515e080c67d3391a21e7475b4eca3e5249f607b175a4e
@legacy 5fc36e10630d095bb775ab528335634412a33d3aea9809af9403ad998fcb7d64 internal/registry/registry.go Registry.readCols legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new; the registry's SQLite side as carlos. For a read-write registry returns routeCols and reads nothing. For a read-only one (registry:readOnly), one SELECT name FROM pragma_table_info('routes') over the registry's own mode=ro, query_only connection. The names read are only compared with the in-binary routeCols and routeAddedColumns lists, never put into SQL: the select list is built from routeCols and the in-binary defaults (the empty string literal or 0, parsed from routeAddedColumns by a fixed regexp). An agent-written table can only make a known added column read as its default, which is what the migration gives it; a missing CREATE column is not stood in for and the read fails as before. file:Query@117,registry:readOnly@63 f4b586a0331bbf958a2b957f08ef779bf7ca16a99101891ee0007cf142fa7f1b
+@legacy 90b76b74a3a96404f981c217def2e8cf6d7aaf172b67aaa3714245d6438c3cde internal/registry/registry.go addedColumn.spec legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new; pure: joins the entry's in-binary Name, Type and Default into "<name> <type> NOT NULL DEFAULT <default>". +registry:Name/Type/Default are the struct's own fields; it reads nothing from the database, a file or an input. registry:Default@92,registry:Name@45,registry:Type@60 4a0c847a4c4afc8ef279b0cf45e1d77b9f48839337222b5b2d7f9bd0d9e18078
+@legacy 7f57f26c268c831d65e4dc8ff1610d684d067dc291115463dd0f7a18efc4d480 internal/registry/registry.go addedRouteColumnDefaults legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new as a census unit (it replaces the regexp parse of the ALTER texts): pure, maps each routeAddedColumns entry's in-binary Name to its in-binary Default, now including the four claim ownership columns, so readCols stands their defaults in for a read-only registry that predates migrateClaimOwnership. Reads nothing from the database, a file or an input. registry:Default@135,registry:Name@125,whole:addedColumn@99 c1764a9b1a6df43619e98a9efd2867b81f32441b63fe23e5520d8ca177e41e47
+@legacy 84032054f14612fedfe899360fec0296d3b3a2136db23fea9ab562a23da8cace internal/registry/claimrows.go Registry.migrateClaimOwnership legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos, on every registry open (called from migrate): the four claim ownership ALTERs for routes and timers come from routeAddedColumns' Claim-marked entries (claim_incarnation TEXT, claim_stamp INTEGER, claim_owner TEXT, claim_row_id TEXT, each NOT NULL DEFAULT the empty string or 0), as "ALTER TABLE " + table + " ADD COLUMN " + spec(): the same statements as main's inline list, same order, same tables, same duplicate-column rule. +registry:Claim is the mark, +whole:addedColumn the struct; in-binary literals only; no read added. file:Exec@196,file:Exec@365,registry:Claim@152,registry:sql@196,registry:sql@365,whole:addedColumn@125 9c23e3ca20731e3eb1b11e8758ee562f121922fb024dae3b839c4e121ce924b3
+@legacy 3bbee2be2030884bb5d02ece03fd5767aa744deafebc0edffe6452901337338c 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. file:Exec@1694,file:Exec@2554,file:Exec@2833,file:Exec@3696,file:Exec@3872,file:Exec@51,file:Exec@600,file:Exec@963,registry:Claim@525,registry:sql@1694,registry:sql@2554,registry:sql@2833,registry:sql@3696,registry:sql@3872,registry:sql@51,registry:sql@600,registry:sql@963,whole:addedColumn@500 c1aa99249122d7976764fc6571eada4c1fbda98d52e96d493c64f3e39c31d5bd
@legacy c4f52621ee9b897da8526befa1450902d86770d3f07954b1b297de96cb1181f5 internal/registry/registry.go Registry.Get legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-ha-p1a-433;basis=same identities as List: +registry:sql is r.sql handed to readCols, the same connection the SELECT already used; same SELECT ... WHERE host = ? with the select list readCols returns (routeCols for a read-write registry). Root's instanceRegistryHostApp and instanceRegistryHostRuntime read Get through the read-only child and now work before the migration too. file:QueryRow@262,registry:Route@165,registry:remote@58,registry:remote@90,registry:sql@209,registry:sql@262,whole:Route@169,whole:Route@455,whole:remoteClient@60,whole:remoteClient@92 736f4a42df871f765a124ea532a38ba1c8ab8bf16375eb0c480f855ddf5c3e82
internal/host/agent.go provisionTickConfig legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-ha-p1a-433;basis=the agent (carlos-edge.service, user carlos) and the edges file loop's eligibility: the same CARLOS_POOLS read, now parsed by provision.ParseBoxPools (internal/provision, envelope re-pinned), the one parser boxPools also uses. "@shared" (provision.SharedPoolToken, never a valid pool name) is the shared "" pool; other tokens are literal as before; empty elements and repeats dropped. No read added. data-literal@207,data-literal@248 0321619c2abad2a9431515f92e28465a6b40aa49332fdcddf939e7b3e2a6ebe7
internal/registry/registry.go Registry.List legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-instance-egress-sizes-328-329;identity=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), and now also in the read-only registry child (carlos __registry-child read-only, which root's instance control forks as the service user through openServiceRegistryReadOnly);basis=#328 plan 2 Task 13 fix (4e7bbc4b): a read-only registry (OpenReadOnly sets readOnly) lists over its own mode=ro, query_only connection (registry:sql, one site, r.sql) instead of a fresh sql.Open on its path, which opens read-write; registry:readOnly (one site) is the branch on that flag. A read-write registry keeps main's fresh connection. The same SELECT of routeCols from routes; it serves root's egress source (listRegistryReadOnly) every row; it decides nothing;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child, and root's read-only registry child via openServiceRegistryReadOnly): calls readCols on the same connection before the same SELECT ... FROM routes ORDER BY host. A read-write registry gets routeCols unchanged; a read-only one gets routeCols with any column routeAddedColumns adds that the table lacks read as its migration default ("0 AS ha"), so root's egress naming and source work before the new agent migrates (#433). Decides nothing; no read added. file:Exec@396,file:Open@212,file:Query@569,registry:Routes@145,registry:path@231,registry:readOnly@183,registry:remote@49,registry:remote@81,registry:sql@172,whole:Route@149,whole:Route@797,whole:Route@810,whole:Route@815,whole:Route@829,whole:remoteClient@51,whole:remoteClient@83 4505dd81395a06055029d52b27debb90209fd3a8aac1af4d589bee8bc33a0ba5
-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 ALTER TABLE list moved verbatim into the package var routeAddedColumns (same statements, same order, same duplicate-column rule); the loop ranges over it. No statement added, removed or changed; no read added. file:Exec@1593,file:Exec@2453,file:Exec@2732,file:Exec@3595,file:Exec@3771,file:Exec@51,file:Exec@538,file:Exec@862,registry:sql@1593,registry:sql@2453,registry:sql@2732,registry:sql@3595,registry:sql@3771,registry:sql@51,registry:sql@538,registry:sql@862 684418dfd7b9d26582ac94834c416aa2a0467426dd78b2407d9a54027a7b4ac9
internal/instancectl/peer_linux.go systemdEdgeMainPID legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=root (carlos-instance-control.service): the same exec productionPeerOK's closure ran before, moved out unchanged: systemctl show -p MainPID --value carlos-edge.service, fixed argv, 3 s timeout; output that does not parse is 0 (no MainPID), which edgePeer refuses. No input from a peer, tenant or agent reaches the argv. file:CommandContext@143 f71136a6afa17f28657515e080c67d3391a21e7475b4eca3e5249f607b175a4e
internal/registry/registry.go Registry.readCols legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new; the registry's SQLite side as carlos. For a read-write registry returns routeCols and reads nothing. For a read-only one (registry:readOnly), one SELECT name FROM pragma_table_info('routes') over the registry's own mode=ro, query_only connection. The names read are only compared with the in-binary routeCols and routeAddedColumns lists, never put into SQL: the select list is built from routeCols and the in-binary defaults (the empty string literal or 0, parsed from routeAddedColumns by a fixed regexp). An agent-written table can only make a known added column read as its default, which is what the migration gives it; a missing CREATE column is not stood in for and the read fails as before. file:Query@117,registry:readOnly@63 f4b586a0331bbf958a2b957f08ef779bf7ca16a99101891ee0007cf142fa7f1b
+internal/registry/registry.go addedColumn.spec legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new; pure: joins the entry's in-binary Name, Type and Default into "<name> <type> NOT NULL DEFAULT <default>". +registry:Name/Type/Default are the struct's own fields; it reads nothing from the database, a file or an input. registry:Default@92,registry:Name@45,registry:Type@60 4a0c847a4c4afc8ef279b0cf45e1d77b9f48839337222b5b2d7f9bd0d9e18078
+internal/registry/registry.go addedRouteColumnDefaults legacy accepted-legacy accepted-legacy;rev3=census-ruling-ha-p1a-433;basis=new as a census unit (it replaces the regexp parse of the ALTER texts): pure, maps each routeAddedColumns entry's in-binary Name to its in-binary Default, now including the four claim ownership columns, so readCols stands their defaults in for a read-only registry that predates migrateClaimOwnership. Reads nothing from the database, a file or an input. registry:Default@135,registry:Name@125,whole:addedColumn@99 c1764a9b1a6df43619e98a9efd2867b81f32441b63fe23e5520d8ca177e41e47
+internal/registry/claimrows.go Registry.migrateClaimOwnership legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos, on every registry open (called from migrate): the four claim ownership ALTERs for routes and timers come from routeAddedColumns' Claim-marked entries (claim_incarnation TEXT, claim_stamp INTEGER, claim_owner TEXT, claim_row_id TEXT, each NOT NULL DEFAULT the empty string or 0), as "ALTER TABLE " + table + " ADD COLUMN " + spec(): the same statements as main's inline list, same order, same tables, same duplicate-column rule. +registry:Claim is the mark, +whole:addedColumn the struct; in-binary literals only; no read added. file:Exec@196,file:Exec@365,registry:Claim@152,registry:sql@196,registry:sql@365,whole:addedColumn@125 9c23e3ca20731e3eb1b11e8758ee562f121922fb024dae3b839c4e121ce924b3
+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. file:Exec@1694,file:Exec@2554,file:Exec@2833,file:Exec@3696,file:Exec@3872,file:Exec@51,file:Exec@600,file:Exec@963,registry:Claim@525,registry:sql@1694,registry:sql@2554,registry:sql@2833,registry:sql@3696,registry:sql@3872,registry:sql@51,registry:sql@600,registry:sql@963,whole:addedColumn@500 c1aa99249122d7976764fc6571eada4c1fbda98d52e96d493c64f3e39c31d5bd
internal/registry/registry.go Registry.Get legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-ha-p1a-433;basis=same identities as List: +registry:sql is r.sql handed to readCols, the same connection the SELECT already used; same SELECT ... WHERE host = ? with the select list readCols returns (routeCols for a read-write registry). Root's instanceRegistryHostApp and instanceRegistryHostRuntime read Get through the read-only child and now work before the migration too. file:QueryRow@262,registry:Route@165,registry:remote@58,registry:remote@90,registry:sql@209,registry:sql@262,whole:Route@169,whole:Route@455,whole:remoteClient@60,whole:remoteClient@92 736f4a42df871f765a124ea532a38ba1c8ab8bf16375eb0c480f855ddf5c3e82
@remove internal/instancectl/peer_linux.go productionPeerOK
@removed internal/instancectl/peer_linux.go productionPeerOK H3 census-ruling-ha-p1a-433;basis=root (carlos-instance-control.service): reads nothing now. The systemctl MainPID read moved verbatim to systemdEdgeMainPID, and the decision and its one-second cache moved to edgePeer.check (internal/instancectl/peer_edge.go, envelope re-pinned). Acceptance is unchanged: SO_PEERCRED uid carlos AND pid equal to the MainPID systemd reports for carlos-edge.service. New in edgePeer.check: a peer the cached answer refuses (a stale pid or a cached failure, #433) is checked once against a fresh read before the refusal, at most one forced read per 100 ms; the peer is accepted only if the fresh MainPID equals it, so nothing wider is accepted.
@coverage internal/host db881c58a6dceec3b8002c5d658631cd08e23fd75c3de250307cfcd0e06f16ef
@coverage internal/instancectl bd5c2dc71194fb61dd4dc3c34c0bc001b1f7ff3a605718161a3d68ff5e42be41
@coverage internal/provision 05aea4a7c8ec90ca00aaef6081fa4d5cfff5434eb17aa513973cd3727427e90f
-@coverage internal/registry b10ce6c8bd0f1d1228014d05c69802904f16650574700f2afbdd75e4e3e381db
+@coverage internal/registry b8ae9366d0fbd2fca77a1803444091ef7137551f6960f761f47409fd3880af08
+@fields A,Account,Accounts,AddedAt,Addr,Addrs,Alias,Aliases,Alive,AllowAbsent,App,Archives,Args,AssetGen,AssetsOff,At,Attempts,B,Backing,Bucket,BuildState,Callback,CallbackError,CallbackFailed,Canary,Caps,CertExpiresAt,Changed,Channel,CheckedAt,Claim,ClaimIncarnation,ClaimOwner,ClaimOwnership,ClaimRowID,ClaimStamp,Class,Contents,CreatedAt,DBPath,DNSCheckedAt,DNSStatus,Deadline,Default,Demand,Digest,DoneBefore,Due,DueAt,EgressAllow,Env,EnvBefore,Environment,Error,ErrorKind,ExcludeHosts,ExpectGood,ExpectOp,ExpectPair,Expected,F,Failed,FenceGen,Fleet,FleetBox,FleetBoxes,Fleets,From,FromDB,FromOp,FromSock,Gate,GoodDemand,GoodDigest,GoodVersion,HA,Hash,Health,Held,Hibernate,HoldOp,Host,Hosts,ID,Id,IdValue,Idle,IdleSeconds,ImportGate,Incarnation,Journal,Keep,Kind,Label,LastAt,LastError,LastMs,LastStatus,Limit,MaxRun,MaxRunSeconds,Method,Ms,Name,Next,NextAt,NextDue,NextGood,NextValue,Now,Number,Number64,Observed,ObservedValue,Old,On,Op,Original,Owner,Ownership,P,Pair,Path,Paths,Platform,PolicyExpiresAt,Pool,Prefix,Prev,PrevVersion,Provisioned,RateLimit,RecordKey,Region,Registration,Replica,Replicas,Replication,Retirement,Route,Routes,Row,Rows,Runtime,Seed,SeedID,SeedSource,ServingSeq,ServingVersion,Size,Slug,Socket,Spec,Sqid,State,Status,StatusNamed,Steering,StringMap,T,TValue,Tags,Target,Targets,Text,Timer,Timers,Times,To,ToDB,ToOp,ToSock,TokenHash,Tunnel,Type,Unit,UpdateSettings,Ver,Version,W,WakeIncarnation,Wildcards,closed,conn,connect,ctx,d,dec,done,enc,full,input,mu,output,path,readOnly,remote,sql,wait