| new file mode 100644 |
| index 000000000..1feb6e3dd |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-claims-cleanup-r2.md |
| @@ -0,0 +1,69 @@ |
| +# Census approval: claims-cleanup-r2 |
| + |
| +Ruling `census-ruling-claims-cleanup-r2`. Every change below keeps the disposition it already has, so it needs an approval, not a decision. |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `system.go` `runSystem` | body | unchanged (0) | claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added | |
| +| `system.go` `systemVerb` | body | unchanged (0) | claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added | |
| + |
| +Envelopes re-pinned: `.`, `internal/host`, `internal/hostfence`, `scripts`. |
| + |
| +Removed units: the scan finds neither the declaration nor any of its sites. |
| + |
| +| unit | recorded disposition | basis | what changed | |
| +|---|---|---|---| |
| +| `internal/claimactivation/artifacts.go` `Runner.signPolicy` | authority, task F,G,J4 | rev3=census-ruling-claim-step6-artifacts;identity=explicit operator CLI uid 0 on the trusted signing host;basis=reads the published floor pair through the runner's checked store only to refuse a different, half-published or roster-unbound floor; signs with hostfloor.ArmedPolicy; writes nothing | deleted | |
| +| `internal/claimactivation/artifacts.go` `readConsole` | authority, task F,G,J4 | rev3=census-ruling-claim-step6-artifacts;identity=explicit operator CLI uid 0 on the trusted signing host;basis=reads the console artefact the root-verified pointer and digest-checked manifest name, bounded to 512 MiB; the caller requires its sha256 and build stamp before any use | deleted | |
| +| `internal/claimactivation/backfill.go` `backfillReady` | authority, task F,G,J4 | rev3=census-ruling-claim-step8-readiness;identity=explicit operator CLI uid 0 on the trusted signing host;basis=refusal up front only: the signed roster must be published with a home region, and the published floor must verify under the release key to the roster's floor digest; it reads and grants nothing else | deleted | |
| +| `internal/claimactivation/runner.go` `Runner.Run` | authority, task F,G,J4 | rev3=census-ruling-claim-step8-readiness;identity=explicit operator CLI uid 0 on the trusted signing host;basis=unchanged phases as ruled for claim-step6-artifacts; adds backfill-collect, backfill-adopt and backfill-done, whose only writable key is control/hosts-backfill.json, each write verified and read back, the dry-run overlay never calling backing Put | deleted | |
| +| `internal/claimactivation/runner.go` `checkedStore.Delete` | authority, task F,G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=trusted operator phases bind expected signed roster revision, exact deployment and actors; verify each write; dry-run overlay never calls backing Put | deleted | |
| +| `internal/claimactivation/runner.go` `checkedStore.Get` | authority, task F,G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=trusted operator phases bind expected signed roster revision, exact deployment and actors; verify each write; dry-run overlay never calls backing Put | deleted | |
| +| `internal/claimactivation/runner.go` `checkedStore.Put` | authority, task F,G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=trusted operator phases bind expected signed roster revision, exact deployment and actors; verify each write; dry-run overlay never calls backing Put | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `activationOutput.finish` | authority, task G,J4 | rev3=census-ruling-claim-step6-artifacts-fix1;identity=explicit operator CLI uid 0 on the trusted signing host;basis=writes the phase's exact bytes through the held descriptor, syncs, reads them back through it, requires mode 0600, one link and the entry still its own file, syncs the directory | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `activationOutput.ours` | authority, task G,J4 | rev3=census-ruling-claim-step6-artifacts-fix1;identity=explicit operator CLI uid 0 on the trusted signing host;basis=compares the directory entry, not followed, with the held file's device and inode; abandon removes only a match | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `consoleCounter.Read` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console --upgrade);basis=round 2, F3: passes reads through from consoleDigest's bounded reader of a held slot and counts them; no path, no decision of its own | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `consoleDigest` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console --upgrade) and the first install's slot checks through consoleSlotHolds;basis=round 2, F3: hashes a held console slot through EOF; refuses a size over 512 MiB by fstat and by the bytes read (consoleCounter), never hashing a prefix | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `consoleDir` | authority, task G,J4 | rev3=census-ruling-claim-empty-cohort-fix2;identity=explicit box installer uid 0 (claims install-console);basis=walks from / by no-follow descriptors; every component root-owned, not group or other writable and other-searchable; creates missing components 0755 and fsyncs the parent; the protected directory must be exactly 0755 root:root. Fix round 2: the walk itself (the open of /, each O_NOFOLLOW Openat, Mkdirat and Fchmodat beneath a checked parent, the parent fsync and the reopen) moved unchanged into walkNoFollowDir; consoleDir keeps its own checks, its Fstat of every component, and passes create for every component, so its behaviour is the same | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `consoleSlotSHA` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console --upgrade);basis=consoleSlotHolds's read moved here unchanged and tightened: a slot is absent, or a root:root 0755 regular file with one link, checked on the entry not followed and again on the descriptor (same device and inode) then hashed through consoleDigest, which refuses a slot over 512 MiB rather than hashing its prefix; anything else refuses. consoleSlotHolds (now no read site) compares the hash as before | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `installProtectedConsole` | authority, task G,J4 | rev3=census-ruling-claim-step6-artifacts;identity=explicit box installer uid 0 (claims install-console);basis=verifies the source bytes before creating anything; refuses foreign slots; writes .prev then current through private staging and rename, 0755 root; reads both back through hostfloor.OpenProtected and rehashes; .prev equals current (C3, install-channel A2-2); dry-run writes nothing | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `readConsoleSourceFile` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console, with or without --upgrade);basis=readConsoleSource's read moved here unchanged (round 2, F1): the source opened with no symlink followed on its path, regular file with one link, at most 512 MiB, refused unless it hashes to the identity's console sha256; it also returns the descriptor's stat so an upgrade can refuse a source that is one of its own slots. readConsoleSource (now no read site) wraps it for the first install | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `reserveOutput` | authority, task G,J4 | rev3=census-ruling-claim-step6-artifacts-fix2;identity=explicit operator CLI uid 0 on the trusted signing host;basis=checked root-owned parent; refuses any existing entry without following it; exclusive 0600 create held open, owner checked, directory synced; never removes what it created: a failure after the create keeps the file and the error asks for a new --out path; dry-run only checks the path is free | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `upgradeProtectedConsole` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console --upgrade);basis=source verified against the published identity's console sha256 before the directory is opened; a source path in the console directory refuses, and under the lock so does a source whose descriptor has the device and inode of console, console.prev or console.next (round 2, F1); directory checked as consoleDir and never created; under its exclusive flock console must hash to --from (or be absent with console.prev hashing to --from, a run cut off between its renames), console.prev may hold anything of the same shape; console already the target is Already, after fsyncing the directory on a non-dry run (round 2, F2); a leftover console.next is removed only if a regular file; writes console.next, renames console to console.prev and console.next to console, fsyncs the directory, reads both back through hostfloor.OpenProtected and consoleDigest; dry run writes nothing | deleted | |
| +| `internal/host/activation_artifacts_linux.go` `writeConsoleTemp` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit box installer uid 0 (claims install-console --upgrade);basis=exclusive no-follow create of console.next in the locked directory, writes the verified body, chmod 0755, requires root:root and one link on the descriptor, fsyncs | deleted | |
| +| `internal/host/activation_command.go` `RunSystemClaims` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=dispatches explicit operator arguments to the platform command implementation and exits on error; wrapper adds no authority checks | deleted | |
| +| `internal/host/activation_command_linux.go` `runSystemClaims` | authority, task G,J4 | rev3=census-ruling-install-console-upgrade;identity=explicit operator CLI uid 0;basis=as census-ruling-claim-step6-artifacts-fix1; install-console also takes --upgrade --from <sha256>, which upgradeFlagsRefused (no read site) admits only together and only for install-console, refusing them elsewhere as unknown flags were; without --upgrade the install path and its output are unchanged;rev3=PROPOSED-s3-change-index;identity=explicit operator CLI uid 0;basis=opens the deployment store with NewDeploymentS3StoreIn in place of NewS3StoreIn, so its deployment-bucket writes bump control/changes.json after they succeed (the bump reads and rewrites only that object and decides nothing else); read site unchanged, offset moved | deleted | |
| +| `internal/host/activation_command_other.go` `runSystemClaims` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=non-Linux command returns the activation refusal without executing any installer or signed phase | deleted | |
| +| `internal/host/activation_console.go` `activationConsoleEnvironment` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=checks roster, local enrollment, compute binding and existing environment before deriving the exact console runtime environment; rejects conflicting keys and scope | deleted | |
| +| `internal/host/activation_console_report_linux.go` `activationConsolePID` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=signed roster and identity, protected guard and configuration, live systemd MainPID plus proc boot/namespace/start/cgroup/executable; exact private box report CAS and readback; no automatic call | deleted | |
| +| `internal/host/activation_console_report_linux.go` `activationConsoleProcess` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=signed roster and identity, protected guard and configuration, live systemd MainPID plus proc boot/namespace/start/cgroup/executable; exact private box report CAS and readback; no automatic call | deleted | |
| +| `internal/host/activation_console_report_linux.go` `publishActivationConsoleReport` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=signed roster and identity, protected guard and configuration, live systemd MainPID plus proc boot/namespace/start/cgroup/executable; exact private box report CAS and readback; no automatic call | deleted | |
| +| `internal/host/activation_install.go` `activationEnvironment` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=parses environment assignments, rejecting invalid or duplicate keys, unsupported quoting, escapes and embedded controls | deleted | |
| +| `internal/host/activation_install.go` `activationUnitSettings` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=requires claims enabled and local region, defaults data and opt roots, and rejects nonabsolute, unclean or root directory paths | deleted | |
| +| `internal/host/activation_install_linux.go` `activationDir` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=requires root caller and absolute clean path; traverses root-owned non-writable directories by no-follow descriptors and fsyncs permitted directory creation | deleted | |
| +| `internal/host/activation_install_linux.go` `activationLock` | authority, task G,J4 | rev3=census-ruling-claim-harness-census;identity=explicit operator CLI uid 0;basis=opens protected activation lock at checked directory, requires root-owned mode 0600 and takes exclusive nonblocking flock; the lock name is now the activationLockName constant, unchanged | deleted | |
| +| `internal/host/activation_install_linux.go` `activationRead` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=opens checked parent directory and delegates bounded protected file reading by basename | deleted | |
| +| `internal/host/activation_install_linux.go` `activationReadAt` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=opens file relative to checked directory, verifies root ownership, non-writable mode and requested private permissions, and limits input to 64 KiB | deleted | |
| +| `internal/host/activation_install_linux.go` `installActivationConsole` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=checks protected environment and drop-in parents, permits only exact existing content or claims-off predecessor, locks writes, durably writes and reads back both files, then reloads systemd; dry-run writes nothing | deleted | |
| +| `internal/host/activation_install_linux.go` `installActivationControl` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=checks protected environment and local claim settings, refuses masked or symlinked controller unit, locks installation, prepares root retry directory, writes rendered shipped unit and verifies readback before reload; dry-run writes nothing | deleted | |
| +| `internal/host/activation_install_linux.go` `installActivationEvidenceKey` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=validates box/key binding, reads or exclusively installs private evidence key under protected directory lock, checks durable readback and expected public key, and signs the exact binding; dry-run does not generate a key | deleted | |
| +| `internal/host/activation_install_linux.go` `installActivationFenceCredentials` | authority, task G,J4 | rev3=PROPOSED-activation-tools;identity=explicit operator CLI uid 0;basis=validates private credential source against exact bucket, region and role; locks protected target, refuses different existing bytes or receipt, writes missing credentials and installation receipt with readback; dry-run writes nothing | deleted | |
| +| `internal/hostfence/activation_credentials.go` `ValidateActivationCredentials` | authority, task F,J4 | rev3=PROPOSED-activation-tools;identity=root fence service and explicit installer uid 0;basis=dedicated root fence credentials retain 0400 compatibility; 0600 needs a matching protected installation receipt; absent explicit installation keeps prior refusal | deleted | |
| +| `internal/sim/hostlife/mutate.sh` `external` | legacy, task accepted-legacy | accepted-legacy;rev3=merge-ruling-2;basis=Hostlife mutation script adds two-box simulation cases and expected witnesses; test harness is pinned by the conservative external envelope, not production root authority. | deleted | |
| +| `scripts/activation-tools-root-runner.sh` `external` | diagnostic, task G,J4 | rev3=PROPOSED-activation-tools;identity=authorized root-runner operator;basis=builds real console and CLI into test-only embedded images; serial designated runner invocation; deletes only owned build artifacts | deleted | |
| +| `scripts/plan14-console-root-runner.sh` `external` | diagnostic, task E2 | PROPOSED E54: builder identity; packages locally built console and optional archived Woodstar executable into rootrunner-only tests, invokes the separately authorized dev runner and removes its own artifacts. Not installed or called by production. | deleted | |
| + |
| +Envelopes retired: `internal/claimactivation`, `internal/sim/hostlife`. Each directory is gone from the tree. |
| + |
| +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. |
| + |
| +A removed unit's recorded disposition and basis are in its table above. For a removed unit or a retired envelope, confirm from the diff that the code is deleted and not moved: a read that moved shows on this card as a change to the unit that took it, and a unit moved whole shows as a new unit, a decision. Escalate if a check, refusal or validation that root relies on goes with the deleted code and its callers' changes on this card do not account for that. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `system.go` `runSystem`: authority, task B,C,D,F,G,J4. Basis: rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged |
| +- `system.go` `systemVerb`: authority, task B,C,D,F,G,J4. Basis: rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged |
| + |
| +Seal: `a864cf31b6bf2c30b5aa8c2647835efdc456f34f4945eea12751daab2457728e` → `a864cf31b6bf2c30b5aa8c2647835efdc456f34f4945eea12751daab2457728e`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-claims-cleanup-r2.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |