carlos / platform Public

reviews: G6 pool branch round 1 (Astra NOT READY, Fable after fixes)

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0b73341c7469f1958a3b788db5fcb894e978b5a1 parent da418ae
2 files changed, +120 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-BRANCH-R1.md +49 −0
  • docs/superpowers/reviews/FABLE-FINDINGS-G6-POOL-BRANCH-R1.md +71 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>brxv12t0j</task-id> <tool-use-id>toolu_01Lt5dmchzgcSytZ3f5SXw1F</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/1be65f1d-61c8-4308-afb1-2c756edd9c6e/tasks/brxv12t0j.output</output-file> <status>completed</status> <summary>Background command "Wait for both pool branch reviews" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 16.2 g CO₂e (1,992,320 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/reviews/CODEX-FINDINGS-G6-POOL-BRANCH-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-BRANCH-R1.md
new file mode 100644
index 000000000..de634506d
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-G6-POOL-BRANCH-R1.md
@@ -0,0 +1,49 @@
+Reviewed `da418ae7adbc5da8b12bc303d63214229a4970ba`, branch round 1. **One P1 and one P2.** Findings are verified by source tracing; no tests were run. The census dependency scan was blocked by the read-only filesystem. The packaged diff’s changed lines match Git, and `git diff --check` passes.
+
+**P1 — Stale fleet routes still override a born-HA app’s region.**
+
+The backfill fix at [sealkey.go:298](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/sealkey.go:298) prevents writing fleet placement onto an HA row, but leaves the stale route intact. [appPlacement, fleets.go:723](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/fleets.go:723) still derives placement from that route whenever stored placement is empty, without checking `ha_pool`.
+
+Failure scenario: purge a legacy fleet app, then recreate its name as HA while a non-forward fleet route remains. Enable correctly writes `Pool: "ha", Regions: ["us"]`, but the next instance create derives `fleet/<name>` from the stale route. [apiinstances.go:2043](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/apiinstances.go:2043) substitutes that region and skips the manifest’s region restriction. With the fleet otherwise admitted, the record can be created outside the bound region, without HA stamping.
+
+[TestBackfillSkipsHAAppWithStaleRoute:786](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/appregion_ha_test.go:786) already constructs the stale-route state, but checks only stored placement and the app row—not effective placement or instance creation.
+
+Fix: enforce “a born-HA app has no fleet placement” in the shared effective-placement resolver, preserving fallback for legacy apps. Extend the test through instance creation and verify the record’s region, pool and HA flag, with a legacy positive control.
+
+**Fault family:** G6-2.5, placement remains bound to the app incarnation. This repeats the plan’s P1-3 and Task 4’s backfill finding. Apply stopping rule 2 before another local patch: my recommendation is its central-invariant-and-guard-test option.
+
+**P2 — Home-region refusals omit the allowed region.**
+
+At [apiinstances.go:2047](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/apiinstances.go:2047), the message renders stored region codes directly. A home-region HA app has `Regions: [""]`, so requesting `us` produces:
+
+> region us is not one this app runs in — allowed:
+
+The new [home-region test:216](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/internal/console/apiinstances_haenable_test.go:216) establishes this manifest shape but checks only the refusal status.
+
+Fix: render both the requested region and allowed regions through `homeRegionOut` or the existing region-label formatter; assert that the refusal names the home region. Fix before merge, without another review round.
+
+**Fault family:** internal region representation must not erase actionable information from user-facing errors.
+
+**Census verdict**
+
+| Card item | Verdict | Evidence |
+|---|---|---|
+| Root envelope `.` | **APPROVE** | Read `runAppsCreate` and `haMismatchErr` in [apps.go:511](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/apps.go:511), and the response fields, delegation and request construction in [apimode.go:1075](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-pool/apimode.go:1075). The change adds an optional JSON boolean, response decoding, confirmation checking and output. It retains the existing request transport and introduces no new tenant-controlled filesystem path, execution input or weakened root check. |
+| Individual units / disposition changes | **None** | The card and overlay contain zero unit changes and one envelope re-pin. |
+
+This approves the source change represented by the card; it does not claim a successful census test run.
+
+**Deferred minors triage**
+
+| Ledger item | Before merge? | Disposition |
+|---|---|---|
+| Task 3: blank home-region names | **Yes** | P2 above. |
+| Task 4: recorder omits GETs and fleet-registry snapshots | No separate requirement | Keep deferred; the P1 fix needs effective-placement and record assertions. |
+| Task 5: handler-written `got` lacks explicit synchronization | No | Keep deferred; use a channel or mutex. No race-detector result was obtained here. |
+| Task 6: HA failure hides simultaneous analytics failure | No | Keep for the copy follow-up; both failures are logged. |
+| Tasks 2/6: extra manifest read on General | No | Request-cached; no correctness defect established. |
+| Task 6: missing forged-field combination tests | No | The server ignores `ha_region` without HA and validates the selected region with HA. Add coverage later. |
+
+No additional P3 findings. Tasks 8 and 9 remain the acknowledged copy/docs merge gates; their placeholders were not counted as new findings.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/FABLE-FINDINGS-G6-POOL-BRANCH-R1.md b/docs/superpowers/reviews/FABLE-FINDINGS-G6-POOL-BRANCH-R1.md
new file mode 100644
index 000000000..8c90c2455
--- /dev/null
+++ b/docs/superpowers/reviews/FABLE-FINDINGS-G6-POOL-BRANCH-R1.md
@@ -0,0 +1,71 @@
+# G6 pool path branch review, round 1 (tip da418ae7)
+
+**Verdict: READY AFTER FIXES.** No P1, one P2, four P3s.
+
+This is a read-only review: I ran no tests, no build and no census run (the session was in plan mode). Everything below comes from reading the diff and the code it touches; CI on the tip is the authority for compile, test and census-hash results.
+
+## Findings
+
+### P2-1: a stale legacy fleet route still places a born-HA app at the create doors
+
+- **Where:** `internal/console/fleets.go:723-738` (`appPlacement`), read by the instance door at `apiinstances.go:1735` and applied at `:2043` (`region = placed`, skipping `m.Regions`). The sidecar door (`apisidecars.go:291`), the region door (`appregionset.go:204`) and `regioncandidates.go:304` read the same function.
+- **Problem:** Task 4 fix round 2 guarded only the backfill's write (`sealkey.go` `backfillApp` → `SetAppPlacementIfContext`). When the placement column is empty, `appPlacement` falls back to `legacyFleetFromRoutes`, so the same stale route is still read live on every create.
+- **Evidence:** the branch states the premise itself in the `backfillApp` comment: "Nothing deletes a purged app's routes, so a stale fleet/<f> route can outlive its app and name a born-HA app recreated under the same name". `TestBackfillSkipsHAAppWithStaleRoute` asserts only that the column stays empty; no test creates an instance in that world.
+- **Failure scenario:**
+ 1. A listed account purges a legacy fleet-placed app whose non-forward route survives.
+ 2. It recreates the name with `--ha --region us` and enables; the manifest is `Pool ha, Regions [us]`.
+ 3. An instance create reads `placed = fleet/<f>` and writes a record `Pool: "ha", Region: "fleet/<f>", HA: false`.
+ 4. The app shows as HA in Settings but its instance is legacy on a fleet, and a static record with that pool is served by the HA pool's boxes whatever its region.
+- **Scope:** this is not an admission breach, because the account is listed and the pool gate still runs. The precondition is narrow.
+- **Fix:** in `appPlacement`, when the stored column is empty and the live row has `ha_pool`, return `""` without the route fallback. Extend `TestBackfillSkipsHAAppWithStaleRoute`, or add a sibling on `haEnableWorld`, to create an instance and assert `Region us, HA true`, with a plain legacy app still inheriting the route as the control.
+- **Fault family:** G6-2.5, a born-HA app's placement stays bound to its row (the same family as plan R1 P1-3). The fix touches the instance create door, so the fix itself gets checked under the stopping rules.
+
+### P3 (follow-up list)
+
+1. `hapool.go:150`: `haCreateChoice` passes `""` as the app to `haPoolRefusal`, so the journal line reads `api create bab/: pool ha refused`. Pass the name through.
+2. `cmd/console/main.go:70`: the header comment names only the instance and sidecar doors; the list also gates app create with `ha` and the enable door's first create.
+3. `hapoolcopy.go:21,24`: two constant comments describe the wrong refusal. `haCopyNeedsRegion` is "no explicit region"; `haCopyRegion` is "region has no HA pool". Fix with Task 8.
+4. `server.go:5597`: `claimAppWith` picks the temporary insert before the HA insert. No caller sets both today; make the combination an explicit refusal.
+
+## What I checked and found sound
+
+- **Pool admission.**
+ - `refuseHAPool` sits after `ValidateShape` and `haCreateShapeRefusal` and before the environment binding, on the one path every instance arm passes; the sidecar gate sits after the pause.
+ - The only console record writers are `createRecordWithLifetime`, `createRecordMarked`, `CreateSidecarRecord` (all behind the two gated doors) and the domain-attach first route (pool `""`).
+ - The only manifest writers are the enable door, the updates-policy door (409 with no manifest, copies the existing one) and the two demo writers (no pool).
+ - Non-members get the 404 before the gate; the tests assert it byte-identical with no bucket change.
+- **Binding.**
+ - Create re-checks `region != rq.haRegion` after `beforeClaimRegion`.
+ - Enable binds only on `created`, under `beginCopiesMutation`'s incarnation pin.
+ - `SetAppRegion` and `SetAppPlacementIfContext` carry `ha_pool = ''` in the UPDATE.
+ - The place door has all three layers.
+ - Both swap doors capture admission before the `AppHAPool` read (`apicli.go:109`, `appswap.go:42`), so the recreated-name case is pinned.
+ - The row-level account move carries `ha_pool` with the row, and the destination still meets the gate at enable and instance create.
+- **Person-only.** `haCreateChoice` checks `p.Kind` first; a plain create's answer is unchanged.
+- **Legacy.** `haManifestBinding` returns nil for an empty row pool before anything else; the status line changes only pages whose manifest pool is HA-scoped.
+- **Web UI.** The server re-runs `pickedRegion` and `haCreateChoice`; `ha_region` is read only when `ha` is set and `region` is empty; the templates use constants and the existing `small` class only.
+- **Tests.** I sampled the gate tests and the create-binding race test. Refusals snapshot bucket keys, write counts and LISTs; controls repeat the same request; the race uses a blocking hook, not timing.
+
+## Census
+
+| Unit / envelope | Lines read | Verdict |
+|---|---|---|
+| Envelope `.` (root package) | `apps.go` `runAppsCreate` 517-640, `haMismatchErr` and constants 641-656; `apimode.go` `apiCreateAppResult` 1064-1080, `createAppAnalytics` / `createAppHA` 1113-1140 | **APPROVE** |
+| Units with a new disposition | none (overlay: 0 body, 0 sites, 1 envelope; seal unchanged `bc138ce5…`) | n/a |
+
+The change adds one bool flag, one `omitempty` JSON field on an existing POST, two decoded response fields, one string compare and one print of a console-supplied string. Root opens, runs, queries and follows nothing new, and no check is weakened. The root package does not import `internal/console`, so the card's scope claim holds. I did not recompute the envelope hash.
+
+## Deferred minors
+
+None must be fixed before merge.
+
+| Minor | Triage |
+|---|---|
+| Task 3: `apiinstances.go:2047` prints "allowed: " with an empty name for a home-region HA app | Fix with Task 8. Dev's HA region is its home, so the exit test will show it. |
+| Task 4: pre-hook recorder does not witness Gets or snapshot the registry | Follow-up. |
+| Task 5: `TestCreateAppHASendsTheFlag` reads `got` without a mutex | Follow-up; a cheap mutex if CI's race run ever flags it. |
+| Task 6: HA refusal and analytics failure show only the HA flash | Needs copy; follow-up. |
+| Task 2/6: one extra manifest read per Settings General view | Follow-up; it is request-cached and only on that section. |
+| Task 6: no direct test for forged `ha_region` without `ha`, or `ha` with both fields | Follow-up; the code path at `server.go` `handleNewApp` is unambiguous. |
+
+**READY AFTER FIXES**: fix P2-1 without another round. The branch still cannot merge until Tasks 8 and 9 replace the COPY-PENDING strings.