carlos / platform Public

docs: apply copy review to W2b text; list P3 follow-ups

Luna copy pass applied verbatim.
Implemented-by: Astra (codex)
claude pushed by paul@keymail.dev 707641a32ac55fc3f165a997c99b1df7db9a9b28 parent 33885a6
4 files changed, +13 −9
  • docs/region-ha-runbook.md +1 −1
  • docs/superpowers/notes/2026-11-06-region-ha-g2-follow-ups.md +6 −2
  • docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md +2 −2
  • internal/host/housekeeper_group_test.go +4 −4

Intent

Human

<task-notification> <task-id>bnbe6d4ns</task-id> <tool-use-id>toolu_01VpVo3aWU5TRqBHsFR4iA5k</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/87a21814-5655-4016-9e7e-41935ee8e96e/tasks/bnbe6d4ns.output</output-file> <status>completed</status> <summary>Background command "W=/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g2r-fixes/.superpowers/sdd/2026-11-06-region-ha-g2r-fixes; for i in $(seq 1 340); do [ -f $W/t7.done ] &amp;&amp; break; sleep 10; done; cat $W/t7.done 2&gt;/dev/null; tail -1 $W/t7.log" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a4790ba54535c8079</task-id> <tool-use-id>toolu_01NjcTts4MguCG8Pk5tcGr3R</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/87a21814-5655-4016-9e7e-41935ee8e96e/tasks/a4790ba54535c8079.output</output-file> <status>completed</status> <summary>Agent "Review Task 7 W2b election" 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>**Task 7 (W2b) review, 36bff577..33885a62** The change meets the spec: ✅ Task quality: **Approved**. I found no P1 or P2. Four P3 notes follow below. **Is the group signal trustworthy?** Yes. - The new case at `internal/host/housekeeper.go:190` reads `groupReferenced(getenv)` (`boxreference.go:34`). That is `CARLOS_BOX_REFERENCE` from the agent's own environment, which comes from root's host.env. - Only `hostenv.Fetch` (`hostenv.go:384`) and `AssembleGroup` (`group.go:134`) set the marker. Both throw away any value that arrives as a parameter (`hostenv.go:209`, `group.go:106`, `Seed` at `:426`). - Nothing a tenant controls can reach the agent's environment. App config goes to `/etc/carlos/apps/*.env`. The only `os.Setenv` in `internal/host` is the attended maintenance command (`group_maintenance_prepare.go:23`), not the agent. - The failure is safe either way. If the marker went missing on a group member, the member would simply contend as it did before this change. A fixed box can only get the marker by an operator editing host.env. **Are the lease-gated duties off on members?** Yes. - All four duties go through `runHousekeeperDuties(housekeeperGate, …)`: domains reconcile (`agent.go:4255`), retention prune (`:4455`), steering (`steering_loop.go:250`) and the mesh key mint (`housekeeper.go:490`). A never-mode box returns `(nil, false)` and contends false. - The election starts on both paths, claims on or off (`agent.go:917-919` and `:1054-1055`), so members do get the never-mode election. - Nothing falls back to running "when no housekeeper exists". `issuerGate` treats a nil gate as "issue freely" (`certsync.go:84`). Only a box with no deployment store gets a nil gate, and a group member always has one, because `AssembleGroup` requires the bucket. - On the edge, everything that issues or publishes is closed on members: HostPolicy refuses with `errNotIssuer` (`certsync.go:210`), certwarm checks the gate, the wildcard manager checks the gate, the publishing cache only writes to the bucket when gated in, and backfill needs a contender (`certsync.go:597` and the contender predicate). - `retention.go:212` runs `newHousekeeper` a second time, but only to test for sole mode. That can't happen on a group box. **Domain health stamp.** The report is right to leave it alone. `domains.StampHealth` (`agent.go:4257`) checks DNS and TLS from the box's own view and writes only to that box's registry (#303). It takes no lease and calls no DNS provider. The startup log at `:4227` still describes the behaviour accurately. **Lease file, fixed boxes and T1.** - A member never writes the lease file: `run` returns before it ever calls `acquire`. The test counts PUTs, so it would also catch a lock that was written and then deleted. - Fixed boxes are unchanged. The fleet case still comes first, and the bucket and directory cases are untouched. - T1 still holds. The serve-only wildcard path never reaches `obtain` on a member. Keeping the warning for fixed boxes without DNS is correct. **Spec and runbook wording.** Accurate and kept short. In the §7.2 table only the "under this spec" cell changed. The "today" cell correctly stays "Every box, and one election." The §17 bullet is right. §12.5 does say the platform box stays fixed. The runbook's log line matches the code: `run` adds the `agent: housekeeper: ` prefix to the reason string. **Tests.** - They run the real code: `newHousekeeper`, the run loop, `acquireDeploymentLease` against a local `httptest` server backed by a `DirStore`, the real duty gate and a real mesh key mint. - The fixed-box case uses the real `startHousekeeper` and also checks the lease is released. - The mutation check is shown. Removing the three new lines turns the main test red on all three of its assertions. **P3 findings** 1. **No alarm when no box contends.** Nothing warns when a deployment has no fixed contender. Each member logs one line at startup, and from then on the deployment is silent. The effect is worse than issuance pausing: - retention prune stops, so the bucket keeps growing; - domains reconcile stops, so new platform-domain hosts are not created and trashed apps are never purged; - in a brand-new deployment the mesh key is never created, and every backhaul hop is refused (`homemap.go:1261`). Today the only guard is a runbook rule plus §12.5 (the platform box is always fixed). A later readiness or status check could flag "no box holds the housekeeper lease". This is not needed for this task. 2. **Two different group signals.** The housekeeper reads only the environment marker. `systemleg.go:81` also accepts `groupMarkerPresent("/etc")`. The boot checks require both to agree, since a present marker forces strict group validation (`group_boot.go:68`), so in practice they can't disagree. Noted only so nobody relaxes those checks later. 3. **The group test doesn't use the production starter.** `TestHousekeeperGroupNeverWritesLease` calls `hk.run` directly, while the fixed-box test uses `startHousekeeper`. It still tests the production mode logic, but `startHousekeeper()` would make the two cases match. 4. **Census still open (process, not code).** The `internal/host` census envelope was re-pinned and still needs to be proposed and approved before merge, as the report says. I made no edits, commits or subagents.</result> <usage><subagent_tokens>85519</subagent_tokens><tool_uses>19</tool_uses><duration_ms>140777</duration_ms></usage> </task-notification>

diff --git a/docs/region-ha-runbook.md b/docs/region-ha-runbook.md
index 53cbf4763..c260473d4 100644
--- a/docs/region-ha-runbook.md
+++ b/docs/region-ha-runbook.md
@@ -43,7 +43,7 @@ To roll back, restore the previous host.env and restart `carlos-edge.service`.
Set `/carlos/<env>/<region>/CARLOS_WILDCARD_DOMAINS` for group members to the same value as the region's fixed boxes. This is a required regional SSM parameter for serving their mirrored wildcards. It is not derived because no allowed source lists the region's static wildcard parents without bypassing the current-set limit.
-Group members never contend for the housekeeper lease. At least one fixed box must contend, and the platform box always does. Members need no `CARLOS_DNS_PROVIDER` or DNS token. You can remove the hand-set `/carlos/dev/ie/CARLOS_DNS_PROVIDER` after this release reaches the members. Each member logs `agent: housekeeper: never (group member: deployment-wide duties stay on fixed boxes)` once at startup.
+Group members never contend for the housekeeper lease. At least one fixed box must contend. The platform box always does. Members do not need `CARLOS_DNS_PROVIDER` or a DNS token. After this release reaches the members, remove the hand-set `/carlos/dev/ie/CARLOS_DNS_PROVIDER`. Each member logs `agent: housekeeper: never (group member: deployment-wide duties stay on fixed boxes)` once at startup.
Once this branch is released, group members need neither `CARLOS_DNS_PROVIDER` nor a DNS token to serve the mirrored wildcard. Ordering stays with the issuer. In a member's `carlos-edge` journal, look for this serve-only line from `internal/edge/wildcard.go`. Its exact format is:
diff --git a/docs/superpowers/notes/2026-11-06-region-ha-g2-follow-ups.md b/docs/superpowers/notes/2026-11-06-region-ha-g2-follow-ups.md
index fd35199a4..9512c3d7e 100644
--- a/docs/superpowers/notes/2026-11-06-region-ha-g2-follow-ups.md
+++ b/docs/superpowers/notes/2026-11-06-region-ha-g2-follow-ups.md
@@ -172,8 +172,8 @@ simulation does not reopen a closed review round.
without a DNS provider or token. Ordering stays with the issuer.
3. **W2b: group members as housekeeper candidates.**
- Status: built in `938991aa`, Task 7. Paul's ruling 2026-11-07 (W2b),
- 00:22Z: group members never contend for the housekeeper lease.
+ Status: built in `938991aa`, Task 7. Paul's ruling 2026-11-07 (W2b)
+ at 00:22Z: group members never contend for the housekeeper lease.
The election runs among fixed boxes. Spec §7.2 and §17 are amended.
4. **W2c: regional wildcard parents.**
@@ -213,3 +213,7 @@ simulation does not reopen a closed review round.
- backhaulSuspect takes the homeMap write lock per backhauled request
- one host's TLS failure marks the whole box suspect with no log on first mark
- observeRegional counts a fallback twice and the log key merges follow and fallback
+- No alarm when no fixed box contends for the housekeeper lease. Retention prune and domains reconcile stop, and a new deployment never mints its mesh key. A readiness or status check could flag a deployment with no lease holder.
+- The housekeeper reads only the `CARLOS_BOX_REFERENCE` marker, while `systemleg.go` also accepts the `/etc` group marker. Boot checks keep them in agreement; do not relax them.
+- `TestHousekeeperGroupNeverWritesLease` calls `hk.run` directly; use `startHousekeeper` to match the fixed-box case.
+- Legacy ownerless names no longer use remembered holders; `farForward` now goes through backhaul (extra regional metric, 503 when the name is gone).
diff --git a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
index f999ea780..89aba4c6f 100644
--- a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
+++ b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
@@ -310,7 +310,7 @@ A box acts on a duty only after an HA acquire, which every duty needs anyway, si
| **Co-spawn sidecars** (`activator.go:17-25`) | Start on the box that woke the instance. | Unchanged: the holder. |
| **`carlos run`:** the record names one picking box (`runexec.go:109-119`) | Any box may pick. | Only the duty owner picks. |
| **WebSockets** | Held on the waking box. | On the holder. A forwarded upgrade rides the backhaul; the plan confirms it does. |
-| **Static sites** and **housekeeper duties** | Every box, and one election. | Static sites are unchanged. Group members never contend for the housekeeper lease. The election runs among fixed boxes. A deployment needs at least one fixed contender; the platform box is always fixed (§12.5). Paul's ruling 2026-11-07 (W2b). |
+| **Static sites** and **housekeeper duties** | Every box, and one election. | Static sites are unchanged. Group members never contend for the housekeeper lease. The election runs among fixed boxes. At least one fixed box must contend. The platform box is always fixed (§12.5). Paul's ruling 2026-11-07 (W2b). |
### 7.3 Keys and tokens (astra-1.6)
@@ -639,7 +639,7 @@ Every other claim package stays inert with claims off, and is left to opportunis
- **`db pull`, `db query --at` and the cross-region db forward:** unchanged. They read the replica, so any box of the region serves them.
- **Litestream #284** (`origin/litestream-oom-284`): restores get more frequent, so land slice A before small group instances.
- **The change index (#336):** one new scope, `control/box-roles`. Edges deletions ride `control/edges`.
-- **The housekeeper election and certificates:** group members never contend. The election runs among fixed boxes, with at least one fixed contender per deployment. The platform box is always fixed (§12.5). Certificate serving is unchanged (S2 §6). Paul's ruling 2026-11-07 (W2b).
+- **The housekeeper election and certificates:** group members never contend. The election runs among fixed boxes. At least one fixed box must contend per deployment. The platform box is always fixed (§12.5). Certificate serving is unchanged (S2 §6). Paul's ruling 2026-11-07 (W2b).
## 18. Request budget (astra-1.16, astra-1.16 r2)
diff --git a/internal/host/housekeeper_group_test.go b/internal/host/housekeeper_group_test.go
index 3e5749b52..0d4dc6d5a 100644
--- a/internal/host/housekeeper_group_test.go
+++ b/internal/host/housekeeper_group_test.go
@@ -39,8 +39,8 @@ func TestHousekeeperGroupMode(t *testing.T) {
}
}
-// The transport serves the real lease client over a directory store. Only
-// S3 is replaced; mode selection, acquisition, release and duty gates run.
+// The test serves the real lease client through a directory store. Only
+// S3 is replaced. Mode selection, acquisition, release and duty gates run.
func housekeeperDirEndpoint(t *testing.T) (*release.DirStore, *atomic.Int64) {
t.Helper()
store := release.NewDirStore(t.TempDir())
@@ -103,8 +103,8 @@ func TestHousekeeperGroupNeverWritesLease(t *testing.T) {
hk := newHousekeeper(os.Getenv, acquireDeploymentLease)
old := theHousekeeper.Swap(hk)
t.Cleanup(func() { theHousekeeper.Store(old) })
- // Run to completion, so a missing exclusion has time to acquire and
- // release a real lease. Counting PUTs also catches a deleted lock.
+ // Run to completion so a missing exclusion has time to acquire and
+ // release a real lease. Counting PUTs also catches a lock that was deleted.
ctx, cancel := context.WithTimeout(t.Context(), 250*time.Millisecond)
defer cancel()
hk.run(ctx)