reviews: Astra #991 R1 findings and the fixes census brief
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+52
−0
docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-R1.md+39 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-INSTANCE-GOMEMLIMIT-991-FIXES.md+13 −0
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-R1.md| new file mode 100644 |
| index 000000000..17a4bda45 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-R1.md |
| @@ -0,0 +1,39 @@ |
| +Reviewed `7e0c953..75e0c87fe2768781df78d1f6e495c8c5155d0ad6`, round 1 of 3. No P1 found. Four P2 findings follow. |
| + |
| +1. **P2 — Uncapped flat fallbacks still receive the default.** |
| + [backend_exec.go:2608](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/backend_exec.go:2608) treats a non-nil cgroup manager as proof that the requested limit applies. However, [cgroup.go:599](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/cgroup/cgroup.go:599) falls back to a plain start when group creation fails, and line 607 ignores limit-write errors for ordinary flat starts. Those children receive a default derived from a cap they never acquired. |
| + **Fix:** carry the actual containment outcome into environment construction and omit the injected default on uncapped fallbacks. Add a regression covering failed group creation or `memory.max` application. |
| + **Invariant:** the default derives from the cap applied to this start, not merely the requested tier. |
| + |
| +2. **P2 — Claim-backed binary launches miss the default.** |
| + [claim_snapshot.go:224](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/claim_snapshot.go:224) constructs the environment without `withGoMemLimit`, then independently records the limit at line 231. [claimproduction.go:590](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/host/claimproduction.go:590) forwards both. The root launcher preserves that environment at [claimlaunch_authority.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/host/claimlaunch_authority.go:64) and starts the capped unit. With claims enabled and no app override, this binary instance receives no default. |
| + **Fix:** compose the default from the captured launch limit for claim-backed serving launches too, keeping move pins independent of platform defaults and preserving launch identity/adoption checks. |
| + **Invariant:** every in-scope capped binary instance launch receives the default. |
| + |
| +3. **P2 — Tests do not protect against rereading the live tier.** |
| + Every nested test case sets a fixed `rt.Size` at [gomemlimit_test.go:189](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/gomemlimit_test.go:189). Reverting [containment.go:374](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/containment.go:374) to `b.tier(rt).MemoryMax` would therefore leave these tests passing. The flat cases likewise use fixed sizes. A second live-tier read could return a different value without these tests detecting the regression. |
| + **Fix:** inject a tier provider that returns different limits on successive calls, assert one read, and compare the launch environment with the applied/requested cap. Include an explicit supplied-tier case for generation zero. |
| + **Invariant:** environment construction and containment use one captured tier. |
| + |
| +4. **P2 — The documentation overstates the default’s scope.** |
| + [cli.md:1216](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/docs/site/cli.md:1216) promises the default for instances generally. Lines 1220–1223 then say seeds and `carlos run` receive the same environment. They do not receive this default; rootfs launches also omit it, and gVisor retains root’s fixed value rather than this calculation or an app override. |
| + **Fix:** explicitly limit the statement to capped native binary serving processes and clarify the seed, command, rootfs and gVisor exceptions. |
| + **Invariant:** documented launch behavior matches the implemented scope. |
| + |
| +No P3 findings. |
| + |
| +## Census verdict |
| + |
| +These approvals concern the submitted changes’ classes, claims and authority boundaries; they do not dismiss the functional findings above. |
| + |
| +| Unit or envelope | Verdict | |
| +|---|---| |
| +| `ExecBackend.spawnUnitFrom` — **body**, retained `legacy / accepted-legacy` | **APPROVED.** [backend_exec.go:2904](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/backend_exec.go:2904) captures the tier and changes child environment composition. The same tier reaches `startRole` at line 2961. Existing launch gates, start-identity validation and termination handling remain intact. | |
| +| `ExecBackend.spawnChildFrom` — **sites**, retained `legacy / accepted-legacy` | **APPROVED.** [backend_exec.go:2605](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/backend_exec.go:2605) moves the existing tier lookup to the caller; line 2692 passes it onward. The additional whole-route site introduces no new read source or authority. | |
| +| `ExecBackend.startRole` — **sites**, retained `authority / E2` | **APPROVED.** [containment.go:359](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/containment.go:359) retains sandbox and claim refusals before dispatch, folds the tier lookups, and preserves the supplied tier across start variants. | |
| +| `internal/activator` envelope | **APPROVED.** The new [helper:32](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/gomemlimit.go:32) performs map lookup and child-environment composition only. No new privileged input source or weakened check. | |
| +| `internal/cgroup` envelope | **APPROVED.** [cgroup.go:167](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/cgroup/cgroup.go:167) adds only the specified arithmetic; containment behavior is unchanged. | |
| + |
| +`git diff --check` passed. Targeted tests could not start because the read-only sandbox denied Go’s build directory. Census tests were not executed. Network restrictions also prevented reading discussion #991; its correction was assessed as recorded in the brief. No files were edited. |
| + |
| +**READY AFTER FIXES** |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-INSTANCE-GOMEMLIMIT-991-FIXES.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-INSTANCE-GOMEMLIMIT-991-FIXES.md| new file mode 100644 |
| index 000000000..cd23fbe1a |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-INSTANCE-GOMEMLIMIT-991-FIXES.md |
| @@ -0,0 +1,13 @@ |
| +# Review brief: #991 round 1 P2 fixes, census and root check (same round budget) |
| + |
| +Repo carlos/platform, branch `instance-gomemlimit-991`, commit e529ff4097366ca68d965973c000f669e4c32837. |
| +Under review: ONLY the diff `3a28687a..e529ff4097366ca68d965973c000f669e4c32837` (fixes for round 1's P2s 1, 3 and 4 in `docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-R1.md`). P2 2 (claim-backed launches) was declined by the controller: claims are shelved and switched off everywhere; it is a follow-up, do not re-raise it. |
| + |
| +This is not a new review round (AGENTS.md stopping rule 1). Two checks only: |
| + |
| +1. **Census:** the re-proposed overlay `internal/provision/testdata/plan14-root-reads-instance-gomemlimit-991.tsv` and card `docs/superpowers/notes/census-proposal-instance-gomemlimit-991.md`, which add the new unit `cgroup.Manager.Capped` and re-claim `ExecBackend.spawnChildFrom`. Give APPROVED or REFUSED per changed unit, as in round 1. |
| +2. **Root and termination behaviour newly changed by the fix:** does building the flat child's env inside the spawn's build closure, and reading memory.max back via `Manager.Capped`, change containment, start identity, refusal or termination behaviour in any way? Any new root read of a path a tenant can write? Is the remaining gap (flat PID-move fallback failing after start leaves the default) acceptable as a P3? |
| + |
| +Also confirm in one line each whether round 1's P2 1, 3 and 4 are resolved. |
| + |
| +Severity as in round 1 (P1 blocks; P2 fixed without another round; P3 follow-up). End with READY, READY AFTER FIXES or NOT READY. Do not edit files, do not run full suites (targeted `go test -run` fine, GOCACHE unset), do not spawn subagents. |