Census proposal for region HA P3b-2 group maintenance
Overlay, chain line and approval card for the SSM agent boot step, the operator policy output and the root group-maintenance verbs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/census-proposal-region-ha-p3b2.md+49 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-region-ha-p3b2.tsv+44 −0
Intent
<task-notification> <task-id>blpxt89ji</task-id> <tool-use-id>toolu_01UMs58VtRgqJPK8WswTKo1i</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/blpxt89ji.output</output-file> <status>completed</status> <summary>Background command ".superpowers/sdd/2026-11-04-region-ha-p3b-group/run-astra.sh b2bg" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a48e148a5283db844</task-id> <tool-use-id>toolu_01GTCChzza3wKLYTWFgVnv3t</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/a48e148a5283db844.output</output-file> <status>completed</status> <summary>Agent "Re-review B2b fix round 2" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Finding 1: ADDRESSED, via the brief's fallback only.** - `a.participation, a.floor = fake.participation, fake.floor` is restored at `internal/host/group_maintenance_round1_test.go:87`. The fixture sets participation at `systemapply_test.go:135`. - Nothing inside the test fails on a stray production path. That is the brief's stronger option, and it was not done. - The accepted fallback is the read-only sandbox run in the report. It shows the test fails with `permission denied` when the restore line is removed, so the sandbox does catch the leak. - I did not rerun the bwrap/read-only run. I ran `go test ./internal/host -run 'TestGroupMaintenance(ConfiguredApply|ApplyEntry|StartedAt)' -count=1` unsandboxed, and it passed. **Finding 2: ADDRESSED.** - The comment in `internal/host/group_maintenance_clock.go:14-16` and the help text at `group_maintenance_verbs.go:40` both say "up to two seconds early; compare with a generation at least two seconds later and check the edge identity has not changed". - The help assertion at `group_maintenance_round1_test.go:171` now requires the exact two-second sentence. - `TestGroupMaintenanceStartedAtLowerBound` is at `group_maintenance_prepare_test.go:~311-340`. It uses btime 1700000000, a true boot fraction of .99 s and starttime=990 ticks at 1000 Hz. It asserts the printed value is at most the true start and no earlier than true start minus 2 s, and pins the 1.98 s early offset. - The numeric bound test passes against the unchanged arithmetic, as expected for a text-only fix. **New breakage:** none. Production changes are only the comment and help text. The guard files (`group_maintenance.go`, `group_maintenance_test.go`, `group_maintenance_protocol_test.go`) are not in the diff. The new test hardcodes 8-byte auxv words, which is fine on the amd64 and arm64 targets CI builds. **Verdict: all addressed**</result> <usage><subagent_tokens>48735</subagent_tokens><tool_uses>3</tool_uses><duration_ms>25346</duration_ms></usage> </task-notification>
<task-notification> <task-id>af3a1d884ca42a2fb</task-id> <tool-use-id>toolu_016BrVjKkhrCKUe5Br3AVrcu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/e47280e8-3e59-4dc1-95d2-11de7237d34c/tasks/af3a1d884ca42a2fb.output</output-file> <status>completed</status> <summary>Agent "Review B3 (spec + quality)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Spec Compliance **Return contract table (binding)** - ✅ Standby with incomplete readiness: the member stays in Standby with no Exit and no completion. `wait_standby` (region-group-roll.py:786-797) and the Standby branch of `return_member` (:933-948) poll, then alert at 15 minutes and keep the transaction. - ✅ Standby, freshly admitted: status, then edges, then status again, requiring the same edge identity, healthy, admitted, role serve and the age bound (:613-638). `exit-intent` is journaled with process, generation and observed time, and the ≤5 s age is checked again right before `exit` (:938-943). - ✅ Exit response lost: `except Uncertain: pass; continue`, so the group is described before any other write. Exit is retried only from an observed Standby with a new readiness observation. Pending, PreInService and Pending:Proceed fall through to `require(phase in {...})` with no write (:1018). - ✅ Pending:Wait handling. CONTINUE only, by InstanceId with no token, on the configured hook (:531-535). The action key is transaction + iid + boot id + process + Exit activity (:963). There are at most 4 attempts with 1/2/4 s backoff and a describe plus readiness before each retry (:968-978). An acknowledged completion is never repeated (:965). No launch receipt is read anywhere. - ✅ Pending:Wait with admission dropped: `alert(..., failed=True)` writes the divergence flag and the journal record, then raises `FailedProbe` before any CONTINUE (:958-962). It never sends ABANDON. - ✅ InService readback happens before min is restored: same member set, desired N, every member healthy in both TGs (:950, :989-1001). Revoke is last (:1006-1010). - ❌ Provider divergence, region-group-roll.py:1011-1016. The plan row says: "If already returned, finish the pending action safely, then EnterStandby(decrement) and verify deregistration; retain the same iid in Standby." The tool instead restores min, revokes and leaves the member InService, setting only the flag. The brief's line 17 simplified this. The controller should rule on which text binds. **Task 7 and the brief** - ✅ ExitStandby and CompleteLifecycleAction are called only inside `return_member` (:943, :983; grep confirms). There is no SetDesiredCapacity, terminate or ABANDON anywhere. `minimum` passes only `--min-size`. - ✅ Refuses before any AWS write when the member is SSM-offline, the group shape is wrong, a peer is not ready, a lock or active transaction exists, the digest is malformed, or identity does not match (:640-665, :866-871). `prepare` runs before min is lowered (:858). - ✅ Phase order (:858-887): min N→N-1, then EnterStandby with decrement, then readback of Standby, min=desired=N-1, max N and deregistration from both TGs, then permit. - ✅ R10 readiness check (:842-845). ✅ R12 rollback: revoke, a new rollback permit with the same old/new pair, then `group-maintenance rollback`, with both permits journaled (:826-848). - ✅ Journal: intent fsynced before every call and the outcome after (:576-588, :246-255), with a hash chain and refusal on damage. The group flock is held for the whole run (:1052). The session count is journaled. - ✅ TTY or `--attended-by` is required (:1049). Root is required. All human-facing copy is in `TEXT`. No em dashes. - ✅ All eight mutations exist and each one runs the real scenario against an in-memory mutant (test:759-800). - ❌ **R13: apply runs bare `carlos system apply`** after sourcing host.env (region-group-roll.py:460-465). It must be `carlos system group-maintenance apply`. - ❌ **R13: `previous_result` is not handled.** `prepare` requires `request_written is True` (:807), so an already applied or rolled-back pointer refuses with the generic "prepare" text. The binary readback after apply exists only through the 15-minute local-verification wait (see Important 6). - ❌ **R14 is missing.** There is no `--allow-downgrade` and no version comparison. `prepare` returns `version`, but B2 status exposes no installed version, so this may need a box field. Ask the controller before the fix round. - ❌ **R15: the margin is wrong.** :626 uses `generation > started_at`, but R15 requires `≥ started_at + 2 s`. The fake also writes `generation = now` (test:114) and apply advances the clock by only 1 s (test:179), so the tests cannot witness the margin. - ⚠️ No cron, daemon or box credential can run it. This is enforced only by TTY or `--attended-by` plus IAM attachment. A cron job could pass `--attended-by`. That matches the brief's design but cannot be verified offline. ### Strengths - The ownership of the return contract is clean: one function, a separate return-action key, and no receipt path at all. - The remote command is `env -i … /bin/sh -c <shlex-quoted script>`. This parses correctly whether the agent runs NonInteractiveCommands via `sh -c` or splits it into argv. Every value that reaches it is regex-pinned: the sha256, the iid, the hex nonce and the base64 permit. A nonce frame carries the remote exit status, and the uid-0 check exits with 77. - The journal is built to resist damage: O_EXCL and O_NOFOLLOW, single-link 0600 files, a sequence plus hash chain, and refusal of a lost active pointer. - The mutation harness is real. It compiles a mutant in memory and re-runs the actual scenario. - The response-loss fake genuinely applies the write and then drops the response (test:80-90). The fake does ABANDON at 900 s on its clock (test:65-71). ### Issues **Critical:** none found. No path terminates, ABANDONs or blindly raises desired, and Exit or CONTINUE is never sent before a fresh current-process observation. **Important** 1. **R13/R15/R14 spec gaps (T1/I4 admission, N1 root config)**, region-group-roll.py:460-465, :626 and :807. These are listed above. Fix: - Make `apply` the bare verb `group-maintenance apply` with no shell sourcing. - Require `instant(gen) >= instant(started_at) + 2`. - Handle `previous_result` explicitly. - Add `--allow-downgrade`, which is journaled. - Make the fake publish its generation after a configurable lag behind the restart, and add a test where publication lags and the tool waits. 2. **The ≤5 s window is probably unachievable live (operability of the T1/I4 return).** The clock starts before the first SSM session (:614), and two `start-session` round-trips plus an S3 GET must all finish within 5 s (:627). The same bound also applies to every peer in preflight (:660) and in `mutation` (:818), where the contract does not require it. If sessions take about 3 s, preflight always refuses. Fix: apply the 5 s bound only before Exit and CONTINUE. Consider measuring from the first status response. Add it as a named check on the live card. 3. **One describe blip after any `exit-intent` becomes a failed probe and blocks the group (divergence-flag semantics)**, :926-929 and :1022-1024. The contract treats API loss as a failed probe only under provider divergence, meaning Pending:Wait. Here a transient describe error in the ordinary no-hook return, or even after an `exit-intent` whose Exit was never sent because the 5 s check failed (:941), writes `provider-divergence.json` and blocks further rolls. Ctrl-C has the same effect: `invoke` turns BaseException into Uncertain (:433-436), and the Exit call site swallows that (:945). Fix: fail immediately only when Pending:Wait was observed, or when Exit was acknowledged or ambiguous and the phase is unknown. Let KeyboardInterrupt propagate. 4. **Transport kills on timeout (root mutation lifetime).** A remote root `apply` or `rollback` runs inside the operator's Session Manager session with a 300 s local SIGKILL (:543). If the session is cut mid-restart, the box apply can be interrupted at an arbitrary point. The member stays safely in Standby, but the tool does not call TerminateSession or detach the work. Also, `prepare`'s local 300 s equals the box's own 5-minute deadline, so the operator side can cut first. Fix: set the local bound above the box deadline, record the session ID for TerminateSession, and consider running the verb detached on the box with a status poll. Put it on the live card. 5. **The fake proves less than the tests claim.** - `test_rev1_receipt_suppression_reaches_default_abandon` (test:441-451) exercises only the fake. No tool code runs, so it is a tautology. Mutation 6 is the real rev-1 witness; say so, or remove the test. - After ABANDON, `test_standby_exit_pending_wait_admission_loss`'s final `resume` refuses only through a 15-minute `return_phase` poll. The tool never classifies a terminated or replaced member as a failed probe (:1018), and the fake's ABANDON leaves the iid in the member set and launches no replacement (test:65-71). - The fake also does not model two AWS rules: UpdateASG MinSize > desired raises desired, and EnterStandby with decrement below min is rejected. Fix: model the provider's termination and replacement. Have `return_member` record "member terminated/replaced: failed probe" explicitly and stop. 6. **The post-apply readback is slow to fail (R13).** If apply or rollback exits 0 but installs nothing, `readiness(maintenance=True)` refuses with "process", and `wait_standby` silently retries for 15 minutes before reporting a timeout (:885-886). Fix: read status straight after the box action. A consumed permit with the wrong digest should raise `uncertain_action` immediately. **Minor** - **Second-writer hole (lock invariant).** On a fresh pass, `resume` accepts `minimum == N-1` (:863) even when this journal has no `minimum` intent. A second operator using a different host or state_dir could slip into the gap between another run's min-lower and its EnterStandby. Fix: require min N unless `self.j.last("intent", op="minimum")`. - **Clock skew can lose the Exit activity (return key).** `exit_activity` matches on `StartTime >= intent.at - 1` (:909), comparing operator time with AWS time. More than 1 s of skew on the lost-response hook path yields no match, so no CONTINUE is sent and AWS ABANDONs an admitted member. Widen the window, for example to "after the Enter activity, exactly one Exit activity for this iid". - **A successful Exit can be journaled as an error (journal fidelity).** The adapter raises Refusal on an unexpected ExitStandby response shape after the write succeeded (:529). - **`status` is blocked during a run.** It takes the group lock (:1052), so it refuses "busy" while a roll is running. A lock-free read-only journal view would fit the brief's purpose for it. - **Some environment variables are not stripped.** `AWS_CA_BUNDLE`, `AWS_CONFIG_FILE` and `AWS_SHARED_CREDENTIALS_FILE` pass through to the child process (:415-421). - **The attendant is not named on a TTY run.** `attended_by` records just "terminal" (:1053). Consider `SUDO_USER`. ### Assessment **Task quality:** Needs fixes The return transaction is sound. Exit and CONTINUE are owned only by `return_member`, there is no termination, ABANDON or blind desired path, and the journal and lock discipline are strong. But R13 (bare `system apply`), R14 (downgrade refusal) and R15 (+2 s generation margin) are not implemented. The 5 s readiness window and the divergence flag on any API blip would also make the tool fail or block a group in live use, and the fake needs to model termination and lagging publication before its tests prove the hook and admission paths.</result> <usage><subagent_tokens>159770</subagent_tokens><tool_uses>23</tool_uses><duration_ms>414572</duration_ms></usage> </task-notification>
diff --git a/docs/superpowers/notes/census-proposal-region-ha-p3b2.md b/docs/superpowers/notes/census-proposal-region-ha-p3b2.md| new file mode 100644 |
| index 000000000..62092083b |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-region-ha-p3b2.md |
| @@ -0,0 +1,49 @@ |
| +# Census approval: region-ha-p3b2 |
| + |
| +Ruling `census-ruling-region-ha-p3b2`. The independent reviewer approves or rejects every change below, 13 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `infra/modules/region-host/group-init.sh.tftpl` `external` | body | unchanged (1) | Group boot installs and enables amazon-ssm-agent from the regional AWS bucket (scanner/pdf pattern) after the IMDS fence, apt masks, Restart=no drop-in and protected staging, before chrony and any bootstrap fetch/exec; a failed install exits under set -eu before edge start (initial hook keeps its 900 s ABANDON). No new root read of a tenant/app/agent-writable path; bootstrap digest checks unchanged. | |
| +| `infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl` `external` | body | unchanged (1) | Test-only: asserts the new group_operator_policy_json output is empty in fixed mode. No runtime reads. | |
| +| `infra/modules/region-host/tests/group_user_data.tftest.hcl` `external` | body | unchanged (1) | Test-only: asserts the rendered group user data installs and enables the SSM agent in order. No runtime reads. | |
| +| `internal/host/systemapply.go` `RunSystemApply` | body | unchanged (0) | Extracts the applier construction literal so group-maintenance apply/rollback reuse it; same fields and reads. | |
| +| `internal/host/systemapply.go` `systemApplier.Run` | body | unchanged (1) | Body split: lock acquisition stays in Run, the unchanged apply body moves to runLocked so group-maintenance apply/rollback run it under the command's already-held lock. Same reads and guard calls (requireGroupMaintenance check first under the lock). | |
| +| `internal/host/systemapply.go` `systemApplier.runWithRelease` | body | unchanged (0) | Internal helper extracted for the release wrapper shared by Run and the group verbs; no read added. | |
| +| `system.go` `runSystem` | body | unchanged (0) | Dispatches carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback} to internal/host; no read of its own. | |
| +| `system.go` `systemVerb` | body | unchanged (0) | Recognizes group-maintenance as a system verb; parsing only. | |
| + |
| +Envelopes re-pinned: `.`, `infra/modules/region-host`, `infra/modules/region-host/tests`, `internal/host`. |
| + |
| +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. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `infra/modules/region-host/group-init.sh.tftpl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=New root user-data boot: operator Terraform/SSM supply scoped bootstrap object version/hash, queue, reader inventory and ingress; hash-verified bootstrap verifies signed IMDS identity. Root exclusively writes /etc/carlos/group.json, group-identity.json, region-config.json and group-ingress.json with current kernel boot ID; public address comes from protected IMDSv2, not signed document or headers. Install IMDS denial, chrony, dormant hairpin fence and protected drop-ins before bootstrap/install/start. No agent receipt is read by root; restart authority is separate maintenance permit. F1: operator-seeded SSM boot/bootstrap-object requires floor=absent-expected or required beside key/version/known_readers/deployment_aws_region; root copies it into group.json before config_digest. Missing or invalid floor refuses before bootstrap fetch; Terraform only names this SSM key and does not write the object. Agent and instance-control gain AF_NETLINK in their address-family allowlists, with no CAP_NET_ADMIN grant.;rev3=census-ruling-region-ha-p3b1-f4;basis=Move bootstrap and chrony staging to root:root 0700 /var/lib/carlos-group-boot through the existing O_NOFOLLOW walker; refuse unsafe preexisting directory. Bootstrap 0700; retain initial hash verification and rehash against a root-only captured SSM digest immediately before all three execs; named noexec refusal. Root reads only its own helper/hash and verified binary; no tenant/app/agent writable input or authority added. Final removal preserved. Round 5 adds /etc/sysctl.d to the same root-owned, non-writable, O_NOFOLLOW directory walker before its existing exclusive sysctl file write; missing directory is created, unsafe ancestors refuse. Round 6 scopes umask 022 to the verified host-env install exec in a subshell; its bootstrap/install-channel children create traversable install directories and readable unit files, matching fixed boxes. Parent umask remains 077; verify-identity is read-only and hairpin install creates only 0700/0600 private state. Explicitly chmod the freshly created instance-control drop-in directory 0755. host.env remains explicitly chmodded 0600 in unchanged released Go. No new input/read or write authority; all verification and directory trust checks remain. |
| +- `infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads.;rev3=census-ruling-region-ha-p3b;basis=Update fixed mock assertions for counted addresses and deterministic region while retaining fixed resource settings. Test-only Terraform input, never executed by root on a box. |
| +- `infra/modules/region-host/tests/group_user_data.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. Round 1 adds comments explaining that OpenTofu expect_failures selects the launch-template resource, not either individual precondition; test behavior unchanged. |
| +- `internal/host/systemapply.go` `RunSystemApply`: authority, task D,F,J4. Basis: rev3=PROPOSED-claims-on-gate-recover;identity=root apply/recovery uid 0;basis=re-pinned at its class and task, no read of its own: reads CARLOS_HOST_CLAIM from the unit environment through systemApplyGate (hostwrite.Enabled, as the agent does) to pick the update gate window, 120 s with fail-fast claims-on and 20 s unchanged claims-off. Registers local verifier and invokes census-gated release wrapper; absent census executes main apply directly even with leftover release state. TestSystemApplyReadsClaimsModeFromTheUnitEnvironment, TestClaimsOffGateIsUnchangedByAnEdgeThatListensAt22s.;rev3=census-ruling-region-ha-p1a;basis=root apply/recovery, uid 0: the systemApplier literal no longer sets regionHA (the field is deleted) and sets claims and gateWait through a.readEnvironment(os.Getenv), a new method that calls the same systemApplyGate(getenv) as before, so CARLOS_HOST_CLAIM picks the gate window exactly as it did; CARLOS_REGION_HA is no longer read here; no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 15 (Paul's console-floor ruling): new --allow-below-rootfs-floor flag; handRun is true when INVOCATION_ID is unset in root's own process environment (a hand-run apply, not a systemd unit); adds a refusal only, no new file or registry read |
| +- `internal/host/systemapply.go` `systemApplier.Run`: authority, task D,F,J4. Basis: rev3=PROPOSED-claims-on-gate-recover;identity=root apply/recovery uid 0;basis=re-pinned at its class and task; its lock-file read is unchanged. A checkGuardRecovery error wrapping errSettlementDeferred under --recover is logged and not fatal, and the end-of-run settlement is not retried after a deferral; every other refusal returns as before. root-input;kept=D,F;scope=protected-decision-only. TestRecoverDefersACensusRefusalWithNoJournalOpen, TestApplyStillFailsACensusRefusalWithNoJournalOpen. Fix round 2: a deferral that recoverIfNeeded returns after the journal was removed is consumed the same way, with no fatal error kept and no settlement retried. TestRecoverDefersARefusalAfterTheJournalIsRemoved. Fix round 3: the end-of-run marker settlement (settleMarker, settleUpdateBegun) also goes through settleWithoutJournal, so a legacy update-begun marker with no update record and no journal defers a census refusal with the recover-legacy barrier held; a barrier that cannot be written joins the run's error in every mode; every other marker failure is logged as on main. TestRecoverHoldsAcquisitionsForALegacyMarker, TestRecoverFailsALegacyMarkerWhoseBarrierCannotBeWritten.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 15: the no-op test is split so the installed build (onDiskBuild, the same read as before) is read once; a hand-run apply then refuses a candidate below the rootfs floor v0.29.0 on a box already at or above it unless the override flag is passed; the agent's pointer path is unchanged; adds a refusal only;rev3=census-ruling-region-ha-p3b;basis=Under the apply lock require the root marker-bound maintenance permit before group staging cleanup/floor/recovery work, then bind candidate digest before staging. Marker /etc/carlos/group.json is root boot output; permit /run/carlos-group-maintenance/permit.json is operator-written through root, never the agent receipt. Direct read unchanged. |
| +- `internal/host/systemapply.go` `systemApplier.runWithRelease`: authority, task D,F,J4. Basis: rev3=PROPOSED-p3;run=15;identity=root update/recovery uid 0;basis=retained floor identity permits restricted acquisition recovery; participating execution holds release exclusion; no-census effect is main Run directly |
| +- `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;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added;rev3=census-ruling-nearest-region-a;basis=adds the hosts-used family to the system dispatch (carlos system hosts-used status, one GET of a console door as the operator); every existing command branch unchanged; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops the "join" case (host.RunSystemJoin, deleted with internal/host/joinroot.go, its only caller) and its line in the usage text; every other branch unchanged; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the system verb dispatch gains named-units, routed to host.RunSystemNamedUnits; no read of its own;rev3=census-ruling-design-pdf-service;basis=add dispatch for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Adds managed-fleets operator CLI dispatch; no direct read added; existing root command branches unchanged.;rev3=census-ruling-agent-start-demo-2;basis=system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are 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;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added;rev3=census-ruling-nearest-region-a;basis=adds "hosts-used" to the verb list, routed to runSystemHostsUsedVerb; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops "join" from the verb list, so `carlos system join` now falls to the unknown-verb message; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the known-verb list gains named-units; no read of its own;rev3=census-ruling-design-pdf-service;basis=add recognition for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Recognizes managed-fleets as a CLI family; no read added.;rev3=census-ruling-agent-start-demo-2;basis=system.go:43-57 recognizes demos; parsing only, no direct read added. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `infra/modules/region-host/group_operator.tf:external`: reads +file:external; written legacy, accepted-legacy, frozen |
| +- new `infra/modules/region-host/tests/group_operator.tftest.hcl:external`: reads +file:external; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance.go:systemApplier.maintenanceUnconsumed`: reads +file:Lstat; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_clock.go:maintenanceReadProc`: reads +file:Open, +file:ReadAll; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_prepare.go:sweepMaintenancePreparation`: reads +file:ReadDir; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs.go:groupMaintenanceCommand.permitStatus`: reads +file:Lstat; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs.go:groupMaintenanceCommand.run`: reads +file:ReadAll; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs_linux.go:maintenanceBinaryDigest`: reads +file:Openat2, +file:Stat; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs_linux.go:maintenanceEdgeProcess`: reads +file:CommandContext, +file:Open, +file:ReadAll; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs_linux.go:openMaintenanceDirectory`: reads +file:Fstat ×2, +file:Openat2 ×3; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs_linux.go:openMaintenanceLock`: reads +file:Fstat, +file:Openat2; written legacy, accepted-legacy, frozen |
| +- new `internal/host/group_maintenance_verbs_linux.go:replaceMaintenancePermit`: reads +file:Openat2, +file:Read; written legacy, accepted-legacy, frozen |
| +- quiet `internal/host/group_maintenance.go:systemApplier.requireGroupMaintenance`: reads nothing now; retired while it reads nothing (or its row keeps no sites) |
| + |
| +Seal: `1daafee8030f9d370adf5541b5e87313523073c4afdc022d4238c3a7bc1a60ba` → `3dc0ae0c747b7e631ac6fd43899bb05842b10273ed4d48bb7c02f7c99615dd3f`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p3b2.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 cd8766e73..a4857c61e 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -93,3 +93,4 @@ plan14-root-reads-static-markdown-twins.tsv ec831d3206622f34511bfbc2ec0cccb131fb |
| plan14-root-reads-agent-start-demo-1-followups.tsv ec831d3206622f34511bfbc2ec0cccb131fbd3861ec4c6a33a2dc6dff9a1791e |
| plan14-root-reads-region-ha-p3b1-f4.tsv 71bbbf68863266ffab90211a00aff2f1b694bf39bb4bd62ea565c168ba884564 |
| plan14-root-reads-agent-start-demo-2.tsv 1daafee8030f9d370adf5541b5e87313523073c4afdc022d4238c3a7bc1a60ba |
| +plan14-root-reads-region-ha-p3b2.tsv 3dc0ae0c747b7e631ac6fd43899bb05842b10273ed4d48bb7c02f7c99615dd3f |
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p3b2.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p3b2.tsv| new file mode 100644 |
| index 000000000..a6afc50f3 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-region-ha-p3b2.tsv |
| @@ -0,0 +1,44 @@ |
| +# Census overlay region-ha-p3b2, written by census-propose (#369). census-ruling-region-ha-p3b2, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-p3b2.md. |
| +# 8 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 13 new dispositions: 0 reads re-frozen at their disposition with the claim, 12 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other. |
| +@legacy b74af161130fabfd0fcd478c545f50b6ec6c12eb5a1ae040d1f9324978134930 infra/modules/region-host/group-init.sh.tftpl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=New root user-data boot: operator Terraform/SSM supply scoped bootstrap object version/hash, queue, reader inventory and ingress; hash-verified bootstrap verifies signed IMDS identity. Root exclusively writes /etc/carlos/group.json, group-identity.json, region-config.json and group-ingress.json with current kernel boot ID; public address comes from protected IMDSv2, not signed document or headers. Install IMDS denial, chrony, dormant hairpin fence and protected drop-ins before bootstrap/install/start. No agent receipt is read by root; restart authority is separate maintenance permit. F1: operator-seeded SSM boot/bootstrap-object requires floor=absent-expected or required beside key/version/known_readers/deployment_aws_region; root copies it into group.json before config_digest. Missing or invalid floor refuses before bootstrap fetch; Terraform only names this SSM key and does not write the object. Agent and instance-control gain AF_NETLINK in their address-family allowlists, with no CAP_NET_ADMIN grant.;rev3=census-ruling-region-ha-p3b1-f4;basis=Move bootstrap and chrony staging to root:root 0700 /var/lib/carlos-group-boot through the existing O_NOFOLLOW walker; refuse unsafe preexisting directory. Bootstrap 0700; retain initial hash verification and rehash against a root-only captured SSM digest immediately before all three execs; named noexec refusal. Root reads only its own helper/hash and verified binary; no tenant/app/agent writable input or authority added. Final removal preserved. Round 5 adds /etc/sysctl.d to the same root-owned, non-writable, O_NOFOLLOW directory walker before its existing exclusive sysctl file write; missing directory is created, unsafe ancestors refuse. Round 6 scopes umask 022 to the verified host-env install exec in a subshell; its bootstrap/install-channel children create traversable install directories and readable unit files, matching fixed boxes. Parent umask remains 077; verify-identity is read-only and hairpin install creates only 0700/0600 private state. Explicitly chmod the freshly created instance-control drop-in directory 0755. host.env remains explicitly chmodded 0600 in unchanged released Go. No new input/read or write authority; all verification and directory trust checks remain.;rev3=census-ruling-region-ha-p3b2;basis=Group boot installs and enables amazon-ssm-agent from the regional AWS bucket (scanner/pdf pattern) after the IMDS fence, apt masks, Restart=no drop-in and protected staging, before chrony and any bootstrap fetch/exec; a failed install exits under set -eu before edge start (initial hook keeps its 900 s ABANDON). No new root read of a tenant/app/agent-writable path; bootstrap digest checks unchanged. file:external@0 5523079bb5f48e46bb0442589bf3e32d8809cec50ba396cd830744a27cb36dcd |
| +@legacy 472d0958cbbbe67b05f37fffa787efc044f65f8844a456b8f4ca76db78b1d54d infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads.;rev3=census-ruling-region-ha-p3b;basis=Update fixed mock assertions for counted addresses and deterministic region while retaining fixed resource settings. Test-only Terraform input, never executed by root on a box.;rev3=census-ruling-region-ha-p3b2;basis=Test-only: asserts the new group_operator_policy_json output is empty in fixed mode. No runtime reads. file:external@0 25100c697e19ba06cc200d87f3c645ea1b5fad7f8b76a52baae4a3893db14f89 |
| +@legacy 74743df740a1391f0b0789e0758b290d91b172e99cb4c62a5b00dfc1ac092e27 infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. Round 1 adds comments explaining that OpenTofu expect_failures selects the launch-template resource, not either individual precondition; test behavior unchanged.;rev3=census-ruling-region-ha-p3b2;basis=Test-only: asserts the rendered group user data installs and enables the SSM agent in order. No runtime reads. file:external@0 00ac4ad75fa9e5ef1fe45ef2ff92dab1ab3cc7c389f6b3805b1d6bcea316b1af |
| +@legacy a728a416b1fa53d397c9e31c7683a05479270a5248204a6573b84e13555770bf infra/modules/region-host/group_operator.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=New output only (no resource): IAM policy JSON for the attended roll operator (UpdateASG/EnterStandby/ExitStandby/CompleteLifecycleAction on the exact group ARN+tags, describes, StartSession on group-tagged instances with one approved document, own-session Terminate/Resume, OpenDataChannel, s3:GetObject on control/edges/*). Never read or executed by root on a box. file:external@0 b538fbe81e51e89ed33752f57743d801944c7944a2430e627179a7cd9448e843 |
| +@legacy 6cb712690b8fac8ea3674f7faf8595ae38ebfaed0a033941ce7724be90317543 infra/modules/region-host/tests/group_operator.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Test-only mock assertions of the exact operator policy set and document precondition. No runtime reads. file:external@0 339e10f55fd0c2c912fd29fca029e88de2cef9e24019834affc9e687bd9c4801 |
| +@legacy 2764e24f2a8b1285f611942e365a034a73ff273d66d5b2839c703a26eda67563 internal/host/group_maintenance.go systemApplier.maintenanceUnconsumed legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=The guard's existing used-<tx>-<action> Lstat moved verbatim out of requireGroupMaintenance so the permit writer shares it; same root-owned 0700 directory. file:Lstat@141 7fea484460d41555b2b9ced36a455571ecbe22af944837840b2d081af9064616 |
| +@legacy 1ca0c04b4afdc3a121069ec046824a5c0a550772bd912ce0332bdbb90dfb1eb0 internal/host/group_maintenance_clock.go maintenanceReadProc legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads fixed kernel paths /proc/stat (btime), /proc/self/auxv (AT_CLKTCK) and /proc/<edge pid>/stat for status edge.started_at; observational only. file:Open@80,file:ReadAll@160 f4a59cb75453af6dd40930c7dc24c1bedeef85b6c892993af95260a42e42639e |
| +@legacy 0d9c7a99f37d068f9dca3b59e4529685399613741667e6b93ecf4e7062647e73 internal/host/group_maintenance_prepare.go sweepMaintenancePreparation legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Lists root's own apply directory under the apply lock to remove stale .prepare-<uint32> scratch it created; skips symlinks; no agent-writable path. file:ReadDir@71 ba02dc10a5fb838a36fce101056e870a0d85bfa267870175e6e6a733546e6197 |
| +@legacy fe66ce5ab0fbe780d2dd6431c3ce96ad93789c2dc8992fbe9a55e571243c88b5 internal/host/group_maintenance_verbs.go groupMaintenanceCommand.permitStatus legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Status Lstat of the root-owned permit dir/used markers to report consumed flags; observational. file:Lstat@1135 2b0805bcc262eaffa9279515225635958dd71e2c03664ccaa45c72c8482ecdb9 |
| +@legacy d68b1083b9506b5aa2b6faaf63e06e9673513c34b18f56d28d8f5ffa0a1ff3d5 internal/host/group_maintenance_verbs.go groupMaintenanceCommand.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads the operator's permit JSON from stdin (≤4096 B) for the permit verb, validated by the guard's own validators against the verified root marker before a root-only write. file:ReadAll@1713 972c0ba3c48dfbcf8f37fd4e5a51ba055f338ba29850566fac74891e5bb50146 |
| +@legacy b06f2068aff0f0d12402e390b1df492040207a48ccca97269fd072bcf73a2ad1 internal/host/group_maintenance_verbs_linux.go maintenanceBinaryDigest legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Hashes the installed root-owned system binary through a no-symlink descriptor for status/prepare. file:Openat2@72,file:Stat@315 932de7da68f8adb0dc9e501c2b4a7d7ed9d6a3487ee55cf37c58951441c36d54 |
| +@legacy 7de9c5b2948357d25b2ec8cc86525146d8ee76cf925977b70a02469f640f7e37 internal/host/group_maintenance_verbs_linux.go maintenanceEdgeProcess legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Runs fixed /usr/bin/systemctl show carlos-edge (fixed env, timeout) and reads /proc/<pid>/stat for the edge identity; observational. file:CommandContext@150,file:Open@645,file:ReadAll@761 4385e5461f7c533ff76a931f860a26e31246c71c4923cc02cacc1a64bf279252 |
| +@legacy 128b0c18b13ecf1b27da9e103ef32564035d5cd2cbb6314494194424c951c242 internal/host/group_maintenance_verbs_linux.go openMaintenanceDirectory legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Opens /run/carlos-group-maintenance with RESOLVE_NO_SYMLINKS|BENEATH and owner/mode checks (root:root 0700); refuses otherwise. file:Fstat@1377,file:Fstat@588,file:Openat2@1126,file:Openat2@237,file:Openat2@731 eeffaf936f8e8510a8b1e6077a7d4cecd2d08a8ba1ebbaa2d322077afe48adcf |
| +@legacy 224c8f16e16e3e8c00b27764b8c30480c33c0c0d48fd9742c09babc450ae3f7b internal/host/group_maintenance_verbs_linux.go openMaintenanceLock legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Opens root's existing apply lock file without following symlinks; status does not create it. file:Fstat@394,file:Openat2@257 b8eedbbe8f77af34fdfbe895f41decc8440d8c6bc0fa78264130a72f33c109e1 |
| +@legacy 04aed3ae196d8f2a83376a99ca1b589664b72df1f9b83435a86e15fba82f9926 internal/host/group_maintenance_verbs_linux.go replaceMaintenancePermit legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads back the temp permit it just wrote in the root 0700 directory (O_EXCL random name) before rename; root-only data. file:Openat2@288,file:Read@152 8a8f2a0ebf3766f7c0c3eacc459d016a9c16e0de9efb9b3e24868eebecdb7517 |
| +infra/modules/region-host/group-init.sh.tftpl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=New root user-data boot: operator Terraform/SSM supply scoped bootstrap object version/hash, queue, reader inventory and ingress; hash-verified bootstrap verifies signed IMDS identity. Root exclusively writes /etc/carlos/group.json, group-identity.json, region-config.json and group-ingress.json with current kernel boot ID; public address comes from protected IMDSv2, not signed document or headers. Install IMDS denial, chrony, dormant hairpin fence and protected drop-ins before bootstrap/install/start. No agent receipt is read by root; restart authority is separate maintenance permit. F1: operator-seeded SSM boot/bootstrap-object requires floor=absent-expected or required beside key/version/known_readers/deployment_aws_region; root copies it into group.json before config_digest. Missing or invalid floor refuses before bootstrap fetch; Terraform only names this SSM key and does not write the object. Agent and instance-control gain AF_NETLINK in their address-family allowlists, with no CAP_NET_ADMIN grant.;rev3=census-ruling-region-ha-p3b1-f4;basis=Move bootstrap and chrony staging to root:root 0700 /var/lib/carlos-group-boot through the existing O_NOFOLLOW walker; refuse unsafe preexisting directory. Bootstrap 0700; retain initial hash verification and rehash against a root-only captured SSM digest immediately before all three execs; named noexec refusal. Root reads only its own helper/hash and verified binary; no tenant/app/agent writable input or authority added. Final removal preserved. Round 5 adds /etc/sysctl.d to the same root-owned, non-writable, O_NOFOLLOW directory walker before its existing exclusive sysctl file write; missing directory is created, unsafe ancestors refuse. Round 6 scopes umask 022 to the verified host-env install exec in a subshell; its bootstrap/install-channel children create traversable install directories and readable unit files, matching fixed boxes. Parent umask remains 077; verify-identity is read-only and hairpin install creates only 0700/0600 private state. Explicitly chmod the freshly created instance-control drop-in directory 0755. host.env remains explicitly chmodded 0600 in unchanged released Go. No new input/read or write authority; all verification and directory trust checks remain.;rev3=census-ruling-region-ha-p3b2;basis=Group boot installs and enables amazon-ssm-agent from the regional AWS bucket (scanner/pdf pattern) after the IMDS fence, apt masks, Restart=no drop-in and protected staging, before chrony and any bootstrap fetch/exec; a failed install exits under set -eu before edge start (initial hook keeps its 900 s ABANDON). No new root read of a tenant/app/agent-writable path; bootstrap digest checks unchanged. file:external@0 5523079bb5f48e46bb0442589bf3e32d8809cec50ba396cd830744a27cb36dcd |
| +infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads.;rev3=census-ruling-region-ha-p3b;basis=Update fixed mock assertions for counted addresses and deterministic region while retaining fixed resource settings. Test-only Terraform input, never executed by root on a box.;rev3=census-ruling-region-ha-p3b2;basis=Test-only: asserts the new group_operator_policy_json output is empty in fixed mode. No runtime reads. file:external@0 25100c697e19ba06cc200d87f3c645ea1b5fad7f8b76a52baae4a3893db14f89 |
| +infra/modules/region-host/tests/group_user_data.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b1-fixes;basis=Add mock plans with the saved real dev inputs, exact gzip/templatefile equality and 13107-byte limit, plus an existing release input inflated to prove the launch precondition refuses oversize data. Test-only Terraform; no runtime reads. Round 1 adds comments explaining that OpenTofu expect_failures selects the launch-template resource, not either individual precondition; test behavior unchanged.;rev3=census-ruling-region-ha-p3b2;basis=Test-only: asserts the rendered group user data installs and enables the SSM agent in order. No runtime reads. file:external@0 00ac4ad75fa9e5ef1fe45ef2ff92dab1ab3cc7c389f6b3805b1d6bcea316b1af |
| +internal/host/systemapply.go RunSystemApply authority D,F,J4 rev3=PROPOSED-claims-on-gate-recover;identity=root apply/recovery uid 0;basis=re-pinned at its class and task, no read of its own: reads CARLOS_HOST_CLAIM from the unit environment through systemApplyGate (hostwrite.Enabled, as the agent does) to pick the update gate window, 120 s with fail-fast claims-on and 20 s unchanged claims-off. Registers local verifier and invokes census-gated release wrapper; absent census executes main apply directly even with leftover release state. TestSystemApplyReadsClaimsModeFromTheUnitEnvironment, TestClaimsOffGateIsUnchangedByAnEdgeThatListensAt22s.;rev3=census-ruling-region-ha-p1a;basis=root apply/recovery, uid 0: the systemApplier literal no longer sets regionHA (the field is deleted) and sets claims and gateWait through a.readEnvironment(os.Getenv), a new method that calls the same systemApplyGate(getenv) as before, so CARLOS_HOST_CLAIM picks the gate window exactly as it did; CARLOS_REGION_HA is no longer read here; no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 15 (Paul's console-floor ruling): new --allow-below-rootfs-floor flag; handRun is true when INVOCATION_ID is unset in root's own process environment (a hand-run apply, not a systemd unit); adds a refusal only, no new file or registry read;rev3=census-ruling-region-ha-p3b2;basis=Extracts the applier construction literal so group-maintenance apply/rollback reuse it; same fields and reads. b65ec460d6f0da6ea3be4d6abed2f7f7499938135587ed34d56e295b1588ba48 |
| +internal/host/systemapply.go systemApplier.Run authority D,F,J4 rev3=PROPOSED-claims-on-gate-recover;identity=root apply/recovery uid 0;basis=re-pinned at its class and task; its lock-file read is unchanged. A checkGuardRecovery error wrapping errSettlementDeferred under --recover is logged and not fatal, and the end-of-run settlement is not retried after a deferral; every other refusal returns as before. root-input;kept=D,F;scope=protected-decision-only. TestRecoverDefersACensusRefusalWithNoJournalOpen, TestApplyStillFailsACensusRefusalWithNoJournalOpen. Fix round 2: a deferral that recoverIfNeeded returns after the journal was removed is consumed the same way, with no fatal error kept and no settlement retried. TestRecoverDefersARefusalAfterTheJournalIsRemoved. Fix round 3: the end-of-run marker settlement (settleMarker, settleUpdateBegun) also goes through settleWithoutJournal, so a legacy update-begun marker with no update record and no journal defers a census refusal with the recover-legacy barrier held; a barrier that cannot be written joins the run's error in every mode; every other marker failure is logged as on main. TestRecoverHoldsAcquisitionsForALegacyMarker, TestRecoverFailsALegacyMarkerWhoseBarrierCannotBeWritten.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 15: the no-op test is split so the installed build (onDiskBuild, the same read as before) is read once; a hand-run apply then refuses a candidate below the rootfs floor v0.29.0 on a box already at or above it unless the override flag is passed; the agent's pointer path is unchanged; adds a refusal only;rev3=census-ruling-region-ha-p3b;basis=Under the apply lock require the root marker-bound maintenance permit before group staging cleanup/floor/recovery work, then bind candidate digest before staging. Marker /etc/carlos/group.json is root boot output; permit /run/carlos-group-maintenance/permit.json is operator-written through root, never the agent receipt. Direct read unchanged.;rev3=census-ruling-region-ha-p3b2;basis=Body split: lock acquisition stays in Run, the unchanged apply body moves to runLocked so group-maintenance apply/rollback run it under the command's already-held lock. Same reads and guard calls (requireGroupMaintenance check first under the lock). file:OpenFile@523 be9fad9bd30058b2717f244be73aaa97ca1f95a927e09ffa65728b3df5bb2979 |
| +internal/host/systemapply.go systemApplier.runWithRelease authority D,F,J4 rev3=PROPOSED-p3;run=15;identity=root update/recovery uid 0;basis=retained floor identity permits restricted acquisition recovery; participating execution holds release exclusion; no-census effect is main Run directly;rev3=census-ruling-region-ha-p3b2;basis=Internal helper extracted for the release wrapper shared by Run and the group verbs; no read added. 586fed35d40a5d3df935f4e5c2c2a9393680975aa4064fa6ea54a14c5bd0a199 |
| +system.go runSystem authority B,C,D,F,G,J4 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;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added;rev3=census-ruling-nearest-region-a;basis=adds the hosts-used family to the system dispatch (carlos system hosts-used status, one GET of a console door as the operator); every existing command branch unchanged; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops the "join" case (host.RunSystemJoin, deleted with internal/host/joinroot.go, its only caller) and its line in the usage text; every other branch unchanged; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the system verb dispatch gains named-units, routed to host.RunSystemNamedUnits; no read of its own;rev3=census-ruling-design-pdf-service;basis=add dispatch for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Adds managed-fleets operator CLI dispatch; no direct read added; existing root command branches unchanged.;rev3=census-ruling-agent-start-demo-2;basis=system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are unchanged.;rev3=census-ruling-region-ha-p3b2;basis=Dispatches carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback} to internal/host; no read of its own. 2bc7c7e9526cf17de237a185defc5c0aecadacf6fb6aa1af3f43c145b3ec71b0 |
| +system.go systemVerb authority B,C,D,F,G,J4 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;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added;rev3=census-ruling-nearest-region-a;basis=adds "hosts-used" to the verb list, routed to runSystemHostsUsedVerb; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops "join" from the verb list, so `carlos system join` now falls to the unknown-verb message; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the known-verb list gains named-units; no read of its own;rev3=census-ruling-design-pdf-service;basis=add recognition for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Recognizes managed-fleets as a CLI family; no read added.;rev3=census-ruling-agent-start-demo-2;basis=system.go:43-57 recognizes demos; parsing only, no direct read added.;rev3=census-ruling-region-ha-p3b2;basis=Recognizes group-maintenance as a system verb; parsing only. c553d228e53518585ae7fca5980e9a9feb2d13959d00d244fed761de85bcad70 |
| +infra/modules/region-host/group_operator.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=New output only (no resource): IAM policy JSON for the attended roll operator (UpdateASG/EnterStandby/ExitStandby/CompleteLifecycleAction on the exact group ARN+tags, describes, StartSession on group-tagged instances with one approved document, own-session Terminate/Resume, OpenDataChannel, s3:GetObject on control/edges/*). Never read or executed by root on a box. file:external@0 b538fbe81e51e89ed33752f57743d801944c7944a2430e627179a7cd9448e843 |
| +infra/modules/region-host/tests/group_operator.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Test-only mock assertions of the exact operator policy set and document precondition. No runtime reads. file:external@0 339e10f55fd0c2c912fd29fca029e88de2cef9e24019834affc9e687bd9c4801 |
| +internal/host/group_maintenance.go systemApplier.maintenanceUnconsumed legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=The guard's existing used-<tx>-<action> Lstat moved verbatim out of requireGroupMaintenance so the permit writer shares it; same root-owned 0700 directory. file:Lstat@141 7fea484460d41555b2b9ced36a455571ecbe22af944837840b2d081af9064616 |
| +internal/host/group_maintenance_clock.go maintenanceReadProc legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads fixed kernel paths /proc/stat (btime), /proc/self/auxv (AT_CLKTCK) and /proc/<edge pid>/stat for status edge.started_at; observational only. file:Open@80,file:ReadAll@160 f4a59cb75453af6dd40930c7dc24c1bedeef85b6c892993af95260a42e42639e |
| +internal/host/group_maintenance_prepare.go sweepMaintenancePreparation legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Lists root's own apply directory under the apply lock to remove stale .prepare-<uint32> scratch it created; skips symlinks; no agent-writable path. file:ReadDir@71 ba02dc10a5fb838a36fce101056e870a0d85bfa267870175e6e6a733546e6197 |
| +internal/host/group_maintenance_verbs.go groupMaintenanceCommand.permitStatus legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Status Lstat of the root-owned permit dir/used markers to report consumed flags; observational. file:Lstat@1135 2b0805bcc262eaffa9279515225635958dd71e2c03664ccaa45c72c8482ecdb9 |
| +internal/host/group_maintenance_verbs.go groupMaintenanceCommand.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads the operator's permit JSON from stdin (≤4096 B) for the permit verb, validated by the guard's own validators against the verified root marker before a root-only write. file:ReadAll@1713 972c0ba3c48dfbcf8f37fd4e5a51ba055f338ba29850566fac74891e5bb50146 |
| +internal/host/group_maintenance_verbs_linux.go maintenanceBinaryDigest legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Hashes the installed root-owned system binary through a no-symlink descriptor for status/prepare. file:Openat2@72,file:Stat@315 932de7da68f8adb0dc9e501c2b4a7d7ed9d6a3487ee55cf37c58951441c36d54 |
| +internal/host/group_maintenance_verbs_linux.go maintenanceEdgeProcess legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Runs fixed /usr/bin/systemctl show carlos-edge (fixed env, timeout) and reads /proc/<pid>/stat for the edge identity; observational. file:CommandContext@150,file:Open@645,file:ReadAll@761 4385e5461f7c533ff76a931f860a26e31246c71c4923cc02cacc1a64bf279252 |
| +internal/host/group_maintenance_verbs_linux.go openMaintenanceDirectory legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Opens /run/carlos-group-maintenance with RESOLVE_NO_SYMLINKS|BENEATH and owner/mode checks (root:root 0700); refuses otherwise. file:Fstat@1377,file:Fstat@588,file:Openat2@1126,file:Openat2@237,file:Openat2@731 eeffaf936f8e8510a8b1e6077a7d4cecd2d08a8ba1ebbaa2d322077afe48adcf |
| +internal/host/group_maintenance_verbs_linux.go openMaintenanceLock legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Opens root's existing apply lock file without following symlinks; status does not create it. file:Fstat@394,file:Openat2@257 b8eedbbe8f77af34fdfbe895f41decc8440d8c6bc0fa78264130a72f33c109e1 |
| +internal/host/group_maintenance_verbs_linux.go replaceMaintenancePermit legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b2;basis=Reads back the temp permit it just wrote in the root 0700 directory (O_EXCL random name) before rename; root-only data. file:Openat2@288,file:Read@152 8a8f2a0ebf3766f7c0c3eacc459d016a9c16e0de9efb9b3e24868eebecdb7517 |
| +@remove internal/host/group_maintenance.go systemApplier.requireGroupMaintenance |
| +@removed internal/host/group_maintenance.go systemApplier.requireGroupMaintenance H3 census-ruling-region-ha-p3b2;basis=Its field checks, artifact check and used-marker Lstat moved verbatim into validateMaintenancePermit / validateMaintenanceArtifact / maintenanceUnconsumed (shared with the permit writer); acceptance, order and errors unchanged; it now reads nothing directly. |
| +@coverage . 4fb8f09da2bf4cbc701f049ea47d2d6fc3e7a045b1c869d938dd4c4216de183c |
| +@coverage infra/modules/region-host 22808206d904c1f402dea8515f5aafcc3d1d1eb966d65188df4c0ddb0640578c |
| +@coverage infra/modules/region-host/tests b5fb37fea582e28b204fd233d5b35a3e8839aafe64bf3bcb9ad677b9d08cc8e2 |
| +@coverage internal/host a2b161cc27eedecc823db97bfe8670c8916d08e2aacdfb50af6ffebe0fce7599 |