carlos / platform Public

plans: G6 pool path rev 3, Astra round 2 fixture fixes

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4a806f0d06ebe9f262f2092582ffe11d3a652d37 parent db44f92
2 files changed, +30 −1
  • docs/superpowers/plans/2026-11-12-g6-pool-path.md +4 −1
  • docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-PLAN-R2.md +26 −0

CI passed — run details

Intent

Human

<task-notification> <task-id>bcr3koblm</task-id> <tool-use-id>toolu_01QKVoiULvXFb4t3VgeLC5Fa</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/1be65f1d-61c8-4308-afb1-2c756edd9c6e/tasks/bcr3koblm.output</output-file> <status>completed</status> <summary>Background command "Update ledger and wait for pool plan round 2" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 39.6 g CO₂e (4,461,668 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on g6-pool, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/plans/2026-11-12-g6-pool-path.md b/docs/superpowers/plans/2026-11-12-g6-pool-path.md
index 5c47e3750..2ff40c83d 100644
--- a/docs/superpowers/plans/2026-11-12-g6-pool-path.md
+++ b/docs/superpowers/plans/2026-11-12-g6-pool-path.md
@@ -13,6 +13,7 @@
## Review history
- Plan round 1 (Astra, `docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-PLAN-R1.md`, at ba96f50b): NOT READY, 4 P1 + 2 P2, all fixed in this revision. Families: P1-1 "pool authorization fails closed across configuration changes" and P1-2 "authorization covers every serving destination" share one cause and one fix (the gate keys on the pool name, Task 1); P1-3 G6-2.5 "born-HA placement stays bound to the incarnation" (Task 4); P1-4 "test prerequisites reach the behaviour under test" (every fixture now has a positive control and named prerequisites); P2-5 "concurrency tests prove the interleaving happened" (Task 4 barrier test); P2-6 "compatibility checks are enforced by the command users run" (Task 5 end-to-end). Round 2 is the last planned round (stopping rules).
+- Plan round 2 (Astra, `CODEX-FINDINGS-G6-POOL-PLAN-R2.md`, at db44f924): NOT READY, 1 P1 carried from R1 P1-4 (two controls could not pass: the plain-home control hits the fixture's rejecting replica stub; the pooled `--from` control is refused by `seedPlacementRefusal`). Same family two rounds running (stopping rule 2): fixed with Astra's concrete fix plus the one-place fixture contract (Global Constraints), no third round; reported to 8a3d302. All other R1 findings resolved.
## Spec corrections (verified at 3d332f24; rechecked at 39ecad21, the cited files unchanged by the main merge)
@@ -41,6 +42,7 @@ The spec cites `origin/main` at 01d6ca78. Lines have moved; some claims were wro
- The machine code `ha-pool-not-allowed` is not copy; it is fixed now.
- The branch does not merge while any `COPY-PENDING:` string remains (Task 8 adds the test that enforces it): the settings status line would show a placeholder to the flagship canary account.
- Tests: targeted only, `go test ./<pkg>/ -run 'TestX|TestY' -count=1`; never `go test ./...`, never the full suite (CI on amadan runs it). `internal/console`, `cmd/console` and the root package bind sockets: run them with the sandbox OFF and `d=$(mktemp -d /tmp/g/g6pool-tN.XXXX) && TMPDIR=$d go test ...; rm -rf "$d"` (remove that exact dir; never a glob in `/tmp/g`, `/tmp`, `$TMPDIR` or `~/.cache`). `GOCACHE` stays at its default. Add `GOFLAGS=-buildvcs=false` only if VCS stamping errors appear.
+- Fixture contract (plan round 2, stopping rule 2 option 3: one invariant, one place): every world a task builds goes through `haPoolWorldNew` or `haRegionFixture`, and each helper's FIRST assertion is its own success control (a plain create that answers 2xx in that world). An implementer runs that control before writing any refusal test; a control that cannot pass is fixed in the helper, never worked around in one test. Controls that are not successes by design (the seeded `--from` 409) say so.
- Every refusal test has a positive control in the same fixture: the same request, with the refused condition removed, succeeds with the stated status. A refusal whose control fails is testing an earlier refusal; fix the fixture (plan round 1, P1-4).
- Mutation checks only on refusal, security and lifecycle paths, at most ~10 per task, each a targeted `-run`; revert each mutation.
- Commit subjects under 80 characters. Implementers never create or remove worktrees, never `git worktree prune`, never `git stash`, never push, never touch amadan.
@@ -143,6 +145,7 @@ Every test below records the bucket keys under `apps/bab/titogo/` and `w.data.co
- the same body plus `"from":{"host":"<an existing sibling host>"}` → 403, same body (the seed arm is behind the gate).
- a non-member's token (a fresh `cliToken` for an address with no membership) → 404, byte-identical to the door's existing non-member 404.
- control: `HAPoolAccounts = {"bab"}` → 201, record `HA: true, Pool: "ha", Region: "us"` (as `TestHAPoolScopedBirth`).
+- `--from` control (plan round 2): with `{"bab"}` the seeded request does NOT succeed: it advances from the HA 403 to the existing seed-placement 409 (`seedPlacementRefusal`, `apiinstanceseed.go:114-119`, every non-empty manifest pool is refused before source resolution), with nothing written. Assert that 409 and its message; the plain 201 control above is the success control.
`TestHAPoolGateSidecarCreate` — the same four through `w.post(t, true, w.body(true))` and `provision.GetSidecarRecord`.
@@ -267,7 +270,7 @@ Fixture: `haRegionFixture(t, []string{"bab"})` (see "Read first"; its plain-crea
- Mark the first create with an explicit `created := true` in the `os.ErrNotExist` case; do not infer it from `etag == ""`.
- The re-checks (allowlist, region still HA) run on first create only (see Decisions). Update with a matching pool is untouched; a different pool is 409 and writes nothing.
- `Regions` is `[]string{row region}` in record vocabulary: `[""]` for the home. `instanceRegionAllowed` treats it correctly; no box reads `Manifest.Regions`.
-- Fixture prerequisites (round 1, P1-4): the enable door answers 503 before reading anything when `AppsDomain` is empty (`apiinstances.go:3562`), and neither `haPoolWorldNew` nor the base fixture's `Config` (`server_test.go:131-135`) sets it. Every Task 3 world passes a tweak setting `c.AppsDomain = "apps.example.test"`, so the door writes `Domain: "bab.apps.example.test"` (valid for `ValidHostShape`). Instance hosts are the app's own platform apex, `<app>.bab.apps.example.test` (e.g. `haapp.bab.apps.example.test`), which passes `ValidHost`, the namespace check (`apiinstances.go:1784-1791`) and the sibling-apex check (`:1834-1855`). `titogo`'s manifest is on `go.tito.io`, so the tests use new apps, never `titogo`. Control, first in each world: a PLAIN app `plainapp` (`CreateAppIn`) enables with 200 and an instance create at `plainapp.bab.apps.example.test` answers 201.
+- Fixture prerequisites (round 1, P1-4): the enable door answers 503 before reading anything when `AppsDomain` is empty (`apiinstances.go:3562`), and neither `haPoolWorldNew` nor the base fixture's `Config` (`server_test.go:131-135`) sets it. Every Task 3 world passes a tweak setting `c.AppsDomain = "apps.example.test"`, so the door writes `Domain: "bab.apps.example.test"` (valid for `ValidHostShape`). Instance hosts are the app's own platform apex, `<app>.bab.apps.example.test` (e.g. `haapp.bab.apps.example.test`), which passes `ValidHost`, the namespace check (`apiinstances.go:1784-1791`) and the sibling-apex check (`:1834-1855`). `titogo`'s manifest is on `go.tito.io`, so the tests use new apps, never `titogo`. Control, first in each world: a PLAIN app `plainapp` (`CreateAppIn`) enables with 200 and an instance create at `plainapp.bab.apps.example.test` answers 201. The plain HOME create enters the legacy leftover check (`createleftovers.go:45,195`), which opens `fx.srv.dbReplica`; `haPoolWorldNew` installs a stub that calls `t.Error` (`ha_pool_scope_test.go:179`). For the plain control, swap in an empty, working reader (`LTXFiles` returns an empty iterator; pattern `apiinstanceseed_test.go:81`) and restore the rejecting stub before any scoped-HA request (plan round 2).
**Files:**
- Modify: `internal/console/apiinstances.go:3544-3700` (`handleAPIInstanceEnable`; extract the `AppsDomain` + `ValidHostShape` checks `:3562-3616` into `instancesDomain`, keeping their exact messages and statuses)
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-PLAN-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-PLAN-R2.md
new file mode 100644
index 000000000..1bf3f0652
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-PLAN-R2.md
@@ -0,0 +1,26 @@
+- **R1 P1-1 — resolved:** restricted pools are collected from every configured region, independently of `HARegions`.
+- **R1 P1-2 — resolved:** authorization uses the pool name, covering records served across regions.
+- **R1 P1-3 — resolved:** placement now requires an incarnation recheck under locks and a conditional store update.
+- **R1 P1-4 — partly resolved:** `AppsDomain` is supplied, but the revised tests still require controls that cannot succeed.
+- **R1 P2-5 — resolved:** the race test requires successful creation, a forced interleaving, and successful enable.
+- **R1 P2-6 — resolved:** the older-console test now exercises the real CLI’s exit status and output.
+
+Reviewed commit `db44f924bf93e84ebb5b72735e24719eb1fe604b`.
+
+**P1 — Tasks 1 and 3: required positive controls conflict with existing behavior.** Carries forward R1 P1-4.
+
+Two concrete failures remain:
+
+1. **Task 3’s plain-instance control fails before the HA assertions.** [Plan:270](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/docs/superpowers/plans/2026-11-12-g6-pool-path.md:270) requires a plain app to enable and create a home-region instance with status 201. However, `haPoolWorldNew` configures a hibernation bucket and installs a `dbReplica` stub that calls `t.Error` and returns an error ([fixture:134](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/ha_pool_scope_test.go:134), [fixture:179](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/ha_pool_scope_test.go:179)). This unpooled home create enters the legacy leftover check, calls that stub, and returns 503 ([createleftovers.go:45](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/createleftovers.go:45), [createleftovers.go:195](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/createleftovers.go:195)). Setting `AppsDomain` does not resolve this failure.
+
+2. **Task 1’s pooled `--from` control cannot succeed by listing the account.** [Plan:139–145](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/docs/superpowers/plans/2026-11-12-g6-pool-path.md:139) requires successful controls for the gate tests, including the seeded request. But `seedPlacementRefusal` rejects every nonempty manifest pool with 409 ([apiinstanceseed.go:114](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/apiinstanceseed.go:114)), before source resolution ([apiinstanceseed.go:262](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/apiinstanceseed.go:262)). Listing `bab` cannot make that pooled request succeed.
+
+**Concrete fix:** Give the plain-home control an empty, working replica reader, retaining the rejecting stub for scoped-HA operations. For pooled `--from`, assert that listing the account advances the request from the HA authorization 403 to the existing seed-placement 409, with no writes. Keep a separate successful plain-create control.
+
+**Fault family:** Test prerequisites must reach the behavior being tested. This family remains outstanding for two consecutive rounds; stopping rule 2 applies. I recommend consolidating fixture prerequisites into one shared contract with a guard test before further implementation.
+
+No additional P2 or P3 findings. The rollout instructions are sufficient provided the account inventory and allowlist installation precede restart; a permissive code fallback would violate the required empty-list behavior.
+
+No files were changed or test suites run. Both architecture-specific `go list` checks were blocked by read-only Go-cache access, so live census enumeration remains unverified.
+
+**NOT READY**
\ No newline at end of file