| 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 |