Census for the direct-mode deployment key check (branch review R1)
9B8: Server.PublishMovesConsole re-pinned, same class (nonrecord) and kind (sel:PutReplace): it publishes the same record with the moves switch off too when the console has a secrets key. Root reads: the . and internal/moves envelopes re-pinned by census-propose; no unit's claim changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+12
−4
docs/superpowers/notes/census-proposal-fleet-secrets-key.md+1 −1internal/provision/fleet_secrets_key_census_test.go+8 −1internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv+3 −2
Intent
Attributed to this commit: 30.1 g CO₂e (3,853,147 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-fleet-secrets-key, 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/docs/superpowers/notes/census-proposal-fleet-secrets-key.md b/docs/superpowers/notes/census-proposal-fleet-secrets-key.md| index 55941305b..a1a4d4e40 100644 |
| --- a/docs/superpowers/notes/census-proposal-fleet-secrets-key.md |
| +++ b/docs/superpowers/notes/census-proposal-fleet-secrets-key.md |
| @@ -6,7 +6,7 @@ Ruling `census-ruling-fleet-secrets-key`. The independent reviewer approves or r |
| |---|---|---|---| |
| | `internal/registry/fleets.go` `Registry.migrateFleets` | sites | +file:Exec ×4, +registry:sql ×4 | fleet secrets key (#366): four more idempotent migration statements: ALTER TABLE fleets ADD COLUMN for secrets_pubkey, secrets_key_fp, secrets_key_set_at, secrets_key_set_by (duplicate column ignored) and CREATE UNIQUE INDEX IF NOT EXISTS fleets_secrets_key_fp ON fleets (secrets_key_fp) WHERE secrets_key_fp != ''; CREATE TABLE IF NOT EXISTS fleet_secrets_key_fps (fp primary key, fleet, account, at), the permanent reservation of every registered fingerprint to its fleet, and an idempotent backfill INSERT ... SELECT of the fleets rows' current non-empty fingerprints ON CONFLICT(fp) DO NOTHING; fixed SQL, no new read of any input | |
| -Envelopes re-pinned: `.`, `internal/appconfig`, `internal/hostops`, `internal/objstore`, `internal/registry`, `internal/release`. |
| +Envelopes re-pinned: `.`, `internal/appconfig`, `internal/hostops`, `internal/moves`, `internal/objstore`, `internal/registry`, `internal/release`. |
| 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. Reject 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. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
diff --git a/internal/provision/fleet_secrets_key_census_test.go b/internal/provision/fleet_secrets_key_census_test.go| index 96129f4f3..5791c24d0 100644 |
| --- a/internal/provision/fleet_secrets_key_census_test.go |
| +++ b/internal/provision/fleet_secrets_key_census_test.go |
| @@ -6,7 +6,7 @@ package provision |
| // author against the source; the census approval is recorded on #280 with the |
| // root-read card (docs/superpowers/notes/census-proposal-fleet-secrets-key.md). |
| // |
| -// One new unit, nine re-pins. No re-pin changes a class or a site kind: each |
| +// One new unit, ten re-pins. No re-pin changes a class or a site kind: each |
| // is a guard, a lock or a parameter type added around an existing site. |
| // |
| // New: |
| @@ -44,6 +44,11 @@ package provision |
| // - Server.registerCLIRoutes (console): registers PUT |
| // /api/cli/fleets/{account}/{fleet}/secrets-key with the zero svcrole.Set |
| // (people only); the route writes no record. |
| +// - Server.PublishMovesConsole (console): publishes the same record at the |
| +// same key (control/moves-console.json, PutReplace) with the moves switch |
| +// off too when the console has a secrets key, so direct-mode secrets set |
| +// can check the deployment key (branch review R1); its gate moves into |
| +// publishesConsoleRecord. The body, a moves.ConsoleRecord, is unchanged. |
| func fleetSecretsKeyWriteCensusInventory() []censusEntry { |
| entries := append([]censusEntry(nil), freshBox446WriteCensusInventory()...) |
| repins := []censusEntry{ |
| @@ -65,6 +70,8 @@ func fleetSecretsKeyWriteCensusInventory() []censusEntry { |
| {"internal/console/apiinstances.go", "Server.handleAPIInstanceList", "key-site", "lit:instances", "f02c1a1d7f835fc7bcbb8cb80ffe4d43c04736cfb434c3b7db6797b7ae478b6a"}, |
| // fleet secrets key #366: registers PUT /api/cli/fleets/{account}/{fleet}/secrets-key with the zero svcrole.Set; the route writes no record. |
| {"internal/console/authcli.go", "Server.registerCLIRoutes", "key-site", "lit:instances,lit:sidecars", "6b6b1472de8779943c3cd1b4a34845b3b600aa5bb48bc6ae28c627e64655e56b"}, |
| + // fleet secrets key #366 (branch review R1): publishes with the moves switch off too when the console has a secrets key (publishesConsoleRecord); the same moves.ConsoleRecord PutReplace at control/moves-console.json. |
| + {"internal/console/server.go", "Server.PublishMovesConsole", "nonrecord", "sel:PutReplace", "abac1f8d1da7273e7dc17636557acfdc2f31ba8715569d4df615212408787511"}, |
| } |
| for _, r := range repins { |
| found := false |
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv b/internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv| index 3305cb38e..239eb5551 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-fleet-secrets-key.tsv |
| @@ -1,5 +1,5 @@ |
| # Census overlay fleet-secrets-key, written by census-propose (#369). census-ruling-fleet-secrets-key, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fleet-secrets-key.md. |
| -# 0 body, 1 sites, 6 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 0 body, 1 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 7 new dispositions: 3 reads re-frozen at their disposition with the claim, 3 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other. |
| @legacy f9c2900ec613a7dd46763c06b817c318cfd473157b4ef1d50413cf928f91fbf4 appconfig_cli.go secretsKeyFingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-secrets-key;basis=new, carlos secrets fingerprint: reads the host.env-style file the operator names with --file (default /etc/carlos/host.env) as the invoking user, parses CARLOS_SECRETS_KEY and prints only the public key's fingerprint; never prints the key, makes no network call, runs with the caller's own privileges file:ReadFile@71 81e7a852a7279707cb84e34f6e7753730eed0f6a0a6639b6b311d2c0dc31989e |
| @legacy cc0ddc5060560c72b01bb26a51f6ae0fecf69208ed71326ab6a85c20a9fef776 fleets.go readFleetPubKeyFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-secrets-key;basis=new, carlos fleets secrets-key --file: reads the file the owner names, as the invoking user, for a CARLOS_SECRETS_PUBKEY= line or a bare public key; the key is parsed locally and sent to the console file:ReadFile@69 8920560a8682de1b72fc92f945bb50eccc74cd6f145be0606600846bd12759c6 |
| @@ -14,9 +14,10 @@ internal/registry/fleets.go Registry.GetFleet legacy accepted-legacy accepted-le |
| internal/registry/fleets.go Registry.ListFleets legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-fleet-secrets-key;basis=reads the four new secrets key columns of the fleet rows it already reads file:Query@279,registry:Account@570,registry:Bucket@582,registry:CreatedAt@593,registry:Fleets@157,registry:Name@561,registry:SecretsKeyFP@622,registry:SecretsKeySetAt@639,registry:SecretsKeySetBy@659,registry:SecretsPub@607,registry:remote@55,registry:remote@87,whole:Fleet@161,whole:Fleet@717,whole:Fleet@730,whole:Fleet@735,whole:Fleet@749,whole:remoteClient@57,whole:remoteClient@89 2d29f4ff2c69bc9a421fecd54b328c4385c1059cb1be9ca42035a643093ad548 |
| internal/registry/remote_dispatch.go Registry.dispatchRemote hint E2 rev3=census-ruling-self-serve-moves-1;basis=the registry child (carlos __registry-child, the service user a root pass forks): plan14-root-reads-e's mixed declaration (E2 adds only the ArtifactHosts read; every other arm is the local method of the same name), with three more write arms, SetHoldIfSeq, ReleaseHoldSeq and InstallLifetimeIf, each calling the local setter; no read operation added; self-serve moves 1 Task 7;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry child (carlos __registry-child, the service user a root pass forks);basis=#328/#329 plan 1 Task 4: one more write arm, SetPolicy, calling the local Registry.SetPolicy with the request's Host, EgressAllow, Size and PolicyExpiresAt (remoteRequest fields sent by the remote handle's holder); the new kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, plus one more registry:Host site, all of the request; no read operation added; the read-only worker never reaches it (serveRemote's method gate); no production root pass sends SetPolicy;rev3=census-ruling-region-ha-p1a;basis=the registry child (carlos __registry-child, the service user a root pass forks): one more write arm, SetHA, calling the local Registry.SetHA with the request's Host (+registry:Host); no read operation added; only the provision pass sends it;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 8: two new remote methods, UpsertUnlessRootfs (carlos add's guarded write) and ResidentInstances (the residency sweep's list), each calling the same-named Registry method;rev3=census-ruling-fleet-secrets-key;basis=one new case, SetFleetSecretsKey, reading the request's Name, Pub, KeyFP, By and At fields and calling SetFleetSecretsKey registry:A@7106,registry:Account@4234,registry:Accounts@2896,registry:Addr@4811,registry:Addrs@4819,registry:Alias@7154,registry:Alias@7218,registry:Alias@7306,registry:Aliases@7028,registry:Alive@8848,registry:Args@6730,registry:AssetGen@4961,registry:AssetsOff@4948,registry:At@2232,registry:At@6102,registry:At@7237,registry:At@7315,registry:At@8596,registry:Attempts@8618,registry:B@2281,registry:Backing@4630,registry:BuildState@5198,registry:By@2226,registry:Changed@1996,registry:Changed@3319,registry:Changed@3406,registry:Changed@3495,registry:Changed@3566,registry:Changed@3670,registry:Changed@3757,registry:Changed@3850,registry:Changed@3932,registry:Changed@8528,registry:Channel@4294,registry:Channel@5543,registry:Channel@5947,registry:CheckedAt@6028,registry:Class@4749,registry:DoneBefore@8857,registry:Due@6431,registry:Due@6495,registry:Due@8640,registry:EgressAllow@5101,registry:Env@5611,registry:Env@5858,registry:Env@5958,registry:ExcludeHosts@8323,registry:ExcludeHosts@8418,registry:ExpectGood@6227,registry:ExpectOp@3374,registry:ExpectOp@3624,registry:ExpectPair@3804,registry:Expected@1250,registry:Expected@289,registry:Expected@762,registry:Expected@939,registry:F@1968,registry:F@2029,registry:Fleet@2054,registry:Fleet@2339,registry:Fleet@2421,registry:Fleet@2502,registry:Fleet@2595,registry:FleetBoxes@2556,registry:Fleets@2112,registry:From@4405,registry:From@4466,registry:FromDB@4541,registry:FromOp@3462,registry:FromSock@4551,registry:Hash@5417,registry:Health@4828,registry:Host@1024,registry:Host@1135,registry:Host@272,registry:Host@3080,registry:Host@3121,registry:Host@3274,registry:Host@3350,registry:Host@3436,registry:Host@3528,registry:Host@3600,registry:Host@3706,registry:Host@3796,registry:Host@3884,registry:Host@3976,registry:Host@4226,registry:Host@4286,registry:Host@4344,registry:Host@4397,registry:Host@4458,registry:Host@4533,registry:Host@4622,registry:Host@4676,registry:Host@4741,registry:Host@4803,registry:Host@4881,registry:Host@4940,registry:Host@5028,registry:Host@5093,registry:Host@5190,registry:Host@5255,registry:Host@5316,registry:Host@5366,registry:Host@5409,registry:Host@5470,registry:Host@5603,registry:Host@5657,registry:Host@5718,registry:Host@5780,registry:Host@6010,registry:Host@6094,registry:Host@6151,registry:Host@6219,registry:Host@6308,registry:Host@6368,registry:Host@6423,registry:Host@6487,registry:Host@6671,registry:Host@6722,registry:Host@6789,registry:Host@6864,registry:Host@6927,registry:Host@7524,registry:Host@7671,registry:Host@7959,registry:Host@8023,registry:Host@8082,registry:Host@8165,registry:Host@8248,registry:Host@8479,registry:Host@8564,registry:Host@8696,registry:Host@8777,registry:Host@8940,registry:Hosts@187,registry:Hosts@2959,registry:Hosts@5534,registry:Hosts@5849,registry:Hosts@5938,registry:Id@1244,registry:Id@1555,registry:Id@1654,registry:Id@1734,registry:Id@1885,registry:IdValue@2715,registry:Idle@6797,registry:Journal@1262,registry:Journal@1561,registry:Journal@1740,registry:Journal@442,registry:Keep@8956,registry:KeyFP@2217,registry:Kind@8785,registry:Kind@8948,registry:Label@2348,registry:Label@2430,registry:Label@2511,registry:Label@5726,registry:Limit@8314,registry:Limit@8409,registry:MaxRun@6805,registry:Method@151,registry:Ms@8612,registry:Name@1032,registry:Name@1143,registry:Name@2082,registry:Name@2202,registry:Name@2734,registry:Name@8031,registry:Name@8090,registry:Name@8173,registry:Name@8487,registry:Name@8572,registry:Name@8704,registry:Next@301,registry:NextAt@8630,registry:NextGood@6241,registry:NextValue@1814,registry:NextValue@1912,registry:Now@1167,registry:Now@6998,registry:Now@8307,registry:Now@8402,registry:Now@8495,registry:Number64@2822,registry:Number@8745,registry:Number@8816,registry:Number@8901,registry:Observed@365,registry:ObservedValue@643,registry:Old@1807,registry:Old@1905,registry:On@6376,registry:On@6872,registry:On@6935,registry:Op@3292,registry:Op@3368,registry:Op@3536,registry:Op@3618,registry:Op@3714,registry:Op@3892,registry:Op@3984,registry:Owner@280,registry:Owner@377,registry:Owner@660,registry:P@7625,registry:Pair@3636,registry:Pair@3720,registry:Pair@3818,registry:Path@7856,registry:Paths@7553,registry:PolicyExpiresAt@5124,registry:Prefix@7679,registry:Prev@6166,registry:Pub@2210,registry:RateLimit@5478,registry:Registration@1040,registry:Registration@1151,registry:Registration@8181,registry:Registration@8580,registry:Replica@5324,registry:Replicas@5263,registry:Retirement@1891,registry:Route@3057,registry:Routes@3015,registry:Routes@4010,registry:Routes@6529,registry:Routes@6596,registry:Routes@6965,registry:Rows@7967,registry:Seed@6679,registry:Size@5116,registry:Sqid@2726,registry:Sqid@2789,registry:Sqid@2868,registry:Status@1056,registry:Status@2520,registry:Status@3282,registry:Status@3358,registry:Status@3444,registry:Status@3608,registry:Status@4352,registry:Status@6018,registry:Status@7227,registry:Status@8602,registry:Status@8712,registry:Steering@4889,registry:StringMap@2632,registry:T@757,registry:T@7907,registry:T@851,registry:T@934,registry:TValue@3162,registry:TValue@3229,registry:Tags@2439,registry:Target@5788,registry:Targets@453,registry:Text@1460,registry:Text@1607,registry:Text@2836,registry:Text@7712,registry:Text@7775,registry:Timer@709,registry:Timer@7995,registry:Timer@891,registry:Timers@8218,registry:Timers@8277,registry:Timers@8366,registry:Times@8990,registry:To@4413,registry:To@4474,registry:ToDB@4563,registry:ToOp@3454,registry:ToSock@4571,registry:TokenHash@2357,registry:Tunnel@5665,registry:Unit@4684,registry:UpdateSettings@5036,registry:Ver@6159,registry:Ver@6316,registry:W@7458,registry:Wildcards@7352,whole:Account@2900,whole:ClaimOwnership@282,whole:ClaimOwnership@379,whole:ClaimOwnership@662,whole:ClaimRow@455,whole:ClaimRowArchive@561,whole:ClaimRowArchive@571,whole:ColdRows@1809,whole:ColdRows@1816,whole:ColdRows@1907,whole:ColdRows@1914,whole:Fleet@1970,whole:Fleet@2031,whole:Fleet@2058,whole:Fleet@2116,whole:FleetBox@2283,whole:FleetBox@2560,whole:GoodBuild@6229,whole:GoodBuild@6243,whole:Pair@3638,whole:Pair@3722,whole:Pair@3806,whole:Pair@3820,whole:Route@3019,whole:Route@3061,whole:Route@3164,whole:Route@3231,whole:Route@367,whole:Route@4014,whole:Route@4169,whole:Route@4175,whole:Route@6533,whole:Route@6600,whole:Route@6969,whole:RouteAlias@7032,whole:RouteAlias@7108,whole:RoutePath@7557,whole:RoutePath@7627,whole:Timer@645,whole:Timer@713,whole:Timer@759,whole:Timer@7909,whole:Timer@7969,whole:Timer@7999,whole:Timer@8222,whole:Timer@8281,whole:Timer@8370,whole:Timer@853,whole:Timer@895,whole:Timer@936,whole:WildcardDomain@7356,whole:WildcardDomain@7460 19e3f6d66fabeb62362f617171e035f2b73d15f833209484ac15f6b5585742dd |
| internal/registry/fleets.go Registry.migrateFleets legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-fleet-secrets-key;basis=fleet secrets key (#366): four more idempotent migration statements: ALTER TABLE fleets ADD COLUMN for secrets_pubkey, secrets_key_fp, secrets_key_set_at, secrets_key_set_by (duplicate column ignored) and CREATE UNIQUE INDEX IF NOT EXISTS fleets_secrets_key_fp ON fleets (secrets_key_fp) WHERE secrets_key_fp != ''; CREATE TABLE IF NOT EXISTS fleet_secrets_key_fps (fp primary key, fleet, account, at), the permanent reservation of every registered fingerprint to its fleet, and an idempotent backfill INSERT ... SELECT of the fleets rows' current non-empty fingerprints ON CONFLICT(fp) DO NOTHING; fixed SQL, no new read of any input file:Exec@1245,file:Exec@1479,file:Exec@2017,file:Exec@2232,file:Exec@313,file:Exec@57,file:Exec@735,registry:sql@1245,registry:sql@1479,registry:sql@2017,registry:sql@2232,registry:sql@313,registry:sql@57,registry:sql@735 73d284944484a69046619c258b62095f74de7848a648e5a5afea117b7d18aaac |
| -@coverage . e976716c131b5f87f72688145943ee256ebd545ef8bafb345d8f0c1d99fd0dac |
| +@coverage . 28c7b804a9b0c2f6f9c2023ddd3b164ae033ac8498cd65dd722ea5197a18a34e |
| @coverage internal/appconfig b57757ee9304ebe30939d8f159f3b4c14d3cefa3210d7e0feef4c0989d77a731 |
| @coverage internal/hostops 74cae3c339a77e80a3e7ef19f70232a1ca35365da6d52e7752c85f89964d7b1b |
| +@coverage internal/moves aa55d647dbbd15df946db927d1b2433d7b3833f8e41e033b8da318a571723241 |
| @coverage internal/objstore a9490f43469f433ec3769c8da5c3eab02187bf491f2734961287e4429d70dadb |
| @coverage internal/registry df3ac0d8d92000f065a0e17ec090375d9319fa30e308f67b0ae6ea6f7c89e4ef |
| @coverage internal/release 3fdf3fab69865fd0dc431c89568a262bb25eac854da742d4ba254e1d227439ba |