review: Astra R1 for instance-control-memory-1291 (1 P1, mixed versions)
docs/superpowers/reviews/CODEX-FINDINGS-instance-control-memory-1291-R1.md+38 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>a87d09395a8771aef</task-id> <tool-use-id>toolu_015qXWPCQhrNEnB8bynQ5seG</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/95f33cc2-8998-4fa5-abb8-8043c3daeffb/tasks/a87d09395a8771aef.output</output-file> <status>completed</status> <summary>Agent "Implement instance-control memory fix" 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>**Status:** R1 fixed and committed as dde07131 "instance-control: renderer accepts the 64M and 256M anchors (#1291 R1)", on top of 8316ed89. Not pushed. Astra's findings file is still untracked in the worktree; I didn't commit it. **Change:** - The claims and build-worker rewrites now go through `replaceClaimControlMemory`. It accepts the current 256M line or the v0.40.1 64M line, and has the #1291 heal comment. - The adopt pass's controlChanged expression moved unchanged into `claimControlStale` in systemunits.go, so a test can call it. **Gates:** - Targeted tests (`TestClaimUnit*`, `TestPlan9Fix1*`, `TestControlUnitsShape`): PASS. - I also ran the 105 tests in files that call `ensureSystemUnits`. 104 pass; `TestClaimReviewControlEntryKeepsServiceLifetime` fails. - Census re-proposed under the same NAME, with `ensureSystemUnitsWithGuard` added to the claims file. Both census tests PASS. - `make code-health`: PASS. - darwin and windows builds: OK. **TDD evidence:** - (a) `TestClaimUnitRendererAcceptsLegacyMemoryTemplate` failed for claims and build worker before the fix and passes now. Off and demo box keep 64M. - (b) `TestClaimUnitLegacyRendererUpgradeHealsAtAdopt` simulates the old renderer by leaving only the 64M anchor. It shows the wrong render for claims and build worker, and checks that `claimControlStale` flags exactly those two modes and not a current render. I added it after the seam existed, so I never saw it fail. **Concerns:** - `TestClaimReviewControlEntryKeepsServiceLifetime` fails with "hostwrite: lifecycle provider unavailable". It tests claim-entry startup, not unit rendering, so I believe it was already failing, but I didn't confirm that on main. - The "old template" in the tests is today's unit with the #1291 change undone. The test fails if that comment or line changes. - On upgrade, control still runs with the wrong memory line until the next adopt pass. That is the ruling, not something this fix closes. - Follow-up for #1291 is unchanged: one registry child per start, or a cap on how many run at once.</result> <usage><subagent_tokens>108491</subagent_tokens><tool_uses>20</tool_uses><duration_ms>498884</duration_ms></usage> </task-notification>
Attributed to this commit: 14.7 g CO₂e (1,909,288 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on instance-control-memory-1291, 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-instance-control-memory-1291-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-instance-control-memory-1291-R1.md| new file mode 100644 |
| index 000000000..cee34c99f |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-instance-control-memory-1291-R1.md |
| @@ -0,0 +1,38 @@ |
| +Reviewed `origin/main...8316ed897130d4dbe601919799d755209b030a9c`, round 1 of 3. |
| + |
| +**P1 — Memory replacements silently fail across release versions.** |
| +Fault family: preserving mode-specific resource settings through upgrades and rollbacks. |
| + |
| +The new template changes the anchor to `MemoryMax=256M`, and the new renderer accepts only that anchor ([claimunit.go:31](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-control-memory-1291/internal/host/claimunit.go:31)). However, `system apply` runs the installed binary’s renderer against the candidate binary’s staged template: staging happens at [systemapply.go:1445](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-control-memory-1291/internal/host/systemapply.go:1445), rendering at line 1643. Renaming the executable does not replace the running updater. |
| + |
| +Replaying the exact replacements against both versions confirmed: |
| + |
| +| Updater → template | Claims result | Demo-worker result | |
| +|---|---|---| |
| +| Old → new | 256M; missing `GOMEMLIMIT=192MiB` | **256M instead of 1 GiB**; missing `GOMEMLIMIT=768MiB` | |
| +| New → old | **64M instead of 256M**; missing GOMEMLIMIT | **64M instead of 1 GiB**; missing GOMEMLIMIT | |
| + |
| +This affects the first upgrade and a subsequent channel rollback, potentially OOM-killing control under workloads previously supported. The new tests exercise only matching renderer/template versions ([claimunit_test.go:410](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-control-memory-1291/internal/host/claimunit_test.go:410)). |
| + |
| +**Fix:** support both template versions and provide a transition that already-installed updaters can handle—for example, deploy a compatible renderer before changing the template. Add mixed-version upgrade and rollback coverage. Merely accepting both anchors in this candidate does not fix the old updater installing it. |
| + |
| +No P2 or P3 findings. |
| + |
| +The other requested checks: |
| + |
| +- **Matching versions:** all four modes render correctly. Claims retain 256M/192MiB; workers retain 1 GiB/768MiB; off and demo-box modes receive 256M. |
| +- **Apply and restart:** installation performs `daemon-reload`, then restarts control before the edge ([systemapply.go:801](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-control-memory-1291/internal/host/systemapply.go:801)). The updater runs in a separate service. In-flight wakes can be interrupted, as already expected by this release sequence; the socket remains available. The compatibility finding above prevents unconditional approval of rollout. |
| +- **Sizing:** 256 MiB is a reasonable incident mitigation on the stated 3.9 GB box. It adds at most 192 MiB to the previous ceiling, without reserving that memory. It does not bound concurrent starts or guarantee twelve starts under every workload. Systemd defines this as an absolute usage limit: [https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html#MemoryMax=](https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html#MemoryMax=). |
| + |
| +Census verdicts concern root-read authority separately from the blocking compatibility defect: |
| + |
| +| Card entry | Verdict | |
| +|---|---| |
| +| `claimunit.go:claimUnitContent`, lines 141–199 | **APPROVE** existing authority disposition: no added reads, caller-controlled paths or expanded permissions. | |
| +| `carlos-instance-control.service:external`, lines 26–65 | **APPROVE** existing authority disposition: the approved ceiling increase preserves execution, environment sources and filesystem protections. | |
| +| `internal/host` envelope | **APPROVE**: reviewed the renderer, its callers and all changed tests; no additional authority change. | |
| +| `internal/host/units` envelope | **APPROVE**: only the control unit’s comment and memory ceiling changed. | |
| + |
| +`git diff --check` passed. Targeted Go tests could not start because Go attempted to update `go.mod` in the read-only workspace. No files changed, reviewers spawned or full suites run. |
| + |
| +**NOT READY** |
| \ No newline at end of file |