carlos / platform Public

HA P1a #433: census proposal ha-p1a-433

Root-read census overlay for the three #433 fixes: productionPeerOK
quiet (its read moved to systemdEdgeMainPID, new), Registry.readCols
new, Registry.List, Get and migrate re-frozen with claims,
provisionTickConfig re-frozen; envelopes re-pinned for internal/host,
internal/instancectl, internal/provision and internal/registry.
Proposed, not approved: an independent reviewer rules on #280.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev adbbf4bf1cc2b74d77a8f12ae69038f75d75e8f9 parent 0eddebc
4 files changed, +69 −0
  • docs/superpowers/notes/census-ha-p1a-433-claims.md +16 −0
  • docs/superpowers/notes/census-proposal-ha-p1a-433.md +31 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv +21 −0
diff --git a/docs/superpowers/notes/census-ha-p1a-433-claims.md b/docs/superpowers/notes/census-ha-p1a-433-claims.md
new file mode 100644
index 000000000..03656992a
--- /dev/null
+++ b/docs/superpowers/notes/census-ha-p1a-433-claims.md
@@ -0,0 +1,16 @@
+# CLAIMS for the root-read census, branch ha-p1a-dev-pair-433 (amadan #433: P1a follow-up fixes and the shared-pool token).
+# Format (AGENTS.md "The census"): <file>:<unit><TAB><what changed>. Lines starting with # are ignored.
+# Base: fc30b421 (origin/main, carries region HA P1a fd93024a).
+
+# Fix 1: root peer check (instance-control, uid 0)
+internal/instancectl/peer_linux.go:productionPeerOK 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.
+internal/instancectl/peer_linux.go:systemdEdgeMainPID 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.
+
+# 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.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.
diff --git a/docs/superpowers/notes/census-proposal-ha-p1a-433.md b/docs/superpowers/notes/census-proposal-ha-p1a-433.md
new file mode 100644
index 000000000..8adf3e07d
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-ha-p1a-433.md
@@ -0,0 +1,31 @@
+# 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).
+
+| 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`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Escalate if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. An escalation goes to the census owner as a decision.
+
+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
+- quiet `internal/instancectl/peer_linux.go:productionPeerOK`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
+
+Seal: `125c5c411cd0a04000d9652800b51bc7c066081c00753fb1c7b6ee0b6e717dbd` → `98d5c95de1a8fef7fa02aa24cf634c43a0bafe23e0842b17595f460161ed3883`.
+
+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 60ffb8106..b332ef036 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -6,3 +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
diff --git a/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv b/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv
new file mode 100644
index 000000000..057b39526
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-ha-p1a-433.tsv
@@ -0,0 +1,21 @@
+# 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.
+@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 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 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