carlos / platform Public

docs: Luna copy pass on the GOMEMLIMIT sentence; Astra fixes check

Astra: fixes check READY, census APPROVED for Manager.Capped and
spawnChildFrom. P3 (failed PID-move fallback keeps the default) noted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ae99243f71de0ea2ac5001e37e2ea3a297cd6d7e parent ffee76c
2 files changed, +23 −1
  • docs/site/cli.md +1 −1
  • docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-FIXES.md +22 −0

CI passed — run details

Intent

Human

<task-notification> <task-id>br7iyz7ws</task-id> <tool-use-id>toolu_01T3Wnr4hZJfDZcXutnwRSuA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/br7iyz7ws.output</output-file> <status>completed</status> <summary>Background command "Wait for docs branch CI result" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 81.5 g CO₂e (10,550,777 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on instance-gomemlimit-991, 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/site/cli.md b/docs/site/cli.md
index 8961d30e7..e72a1fce5 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -1213,7 +1213,7 @@ no bundle can override:
| `CARLOS_PURGE` | `header` when the edge honours a `Carlos-Purge` response header, including `all` for every host of the instance |
| `CARLOS_ADMIN_TOKEN` | a secret shared with this one instance: the platform presents it when it calls your app, and your app presents it on `CARLOS_CONTROL_SOCKET` |
-A binary instance whose memory cap was applied also gets `GOMEMLIMIT`, set to 80% of its memory size, unless your app's config or `<host>.env` sets its own. Seeds, `carlos run` commands, rootfs apps and instances run under gVisor don't get it.
+A binary instance with an applied memory cap also gets `GOMEMLIMIT`, set to 80% of its memory size, unless your app’s config or `<host>.env` sets a value for it. Seeds, `carlos run` commands, rootfs apps and instances run under gVisor don’t get it.
The box keeps a sealed copy of each instance's `<host>.env`. It also keeps sealed copies of the `instance.key` and `report.token` files an app keeps at the top of its own directory. These copies are stored in the region's data bucket. Each copy is sealed to the box's secrets key and bound to your app. Only a box that can already read your app's secrets can open it. When a box starts an instance whose `<host>.env` is missing, it puts the sealed copy back first. This keeps the instance's `CARLOS_ADMIN_TOKEN` and `CARLOS_INSTANCE_KEY` instead of giving it new ones. A file that is there is never replaced. You can edit other values in `<host>.env`. The box seals the new contents within a minute. `CARLOS_ADMIN_TOKEN`, `CARLOS_INSTANCE_KEY`, `instance.key` and `report.token` cannot change once sealed. If the box finds a different value, it refuses to start the instance and raises an alert. Deleting the file does not reset it. A box without the secrets key a copy was sealed to will not start that instance. This includes a box whose key was changed. Put the old key back.
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-FIXES.md b/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-FIXES.md
new file mode 100644
index 000000000..e9f35e877
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-INSTANCE-GOMEMLIMIT-991-FIXES.md
@@ -0,0 +1,22 @@
+Reviewed only `3a28687a..e529ff4097366ca68d965973c000f669e4c32837`, within round 1’s existing budget. **No new P1 or P2 findings.**
+
+| Changed census unit or envelope | Verdict |
+|---|---|
+| `Manager.Capped` — new `legacy / accepted-legacy` | **APPROVED.** [cgroup.go:459](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/cgroup/cgroup.go:459) reads the agent’s delegated `memory.max`, validates child names and compares the captured limit. It grants no authority. |
+| `ExecBackend.spawnChildFrom` — re-claimed `legacy / accepted-legacy` | **APPROVED.** [backend_exec.go:2689](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/activator/backend_exec.go:2689) constructs each attempt’s environment after limit application. The helper copies the map, so a retry cannot retain an injected value from the previous attempt. |
+| `internal/activator` envelope | **APPROVED.** The production change only conditions default injection; the remaining changes are regression tests. |
+| `internal/cgroup` envelope | **APPROVED.** The new read-only helper and tests leave placement and termination primitives unchanged. |
+
+`spawnUnitFrom` and `startRole` are unchanged within this diff; their round-one approvals stand.
+
+Containment, start identity, refusal gates and termination handling remain unchanged. The added read runs as the agent (`carlos`), using its existing delegated cgroup path; it introduces **no new root read of tenant-writable state**.
+
+**P3 — Failed PID-move fallback can retain the default.** At [cgroup.go:844](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/instance-gomemlimit-991/internal/cgroup/cgroup.go:844), environment construction precedes process start and the subsequent PID move. If that move fails, the process keeps its default despite never entering the capped group. **Acceptable as P3:** this preserves the existing unfenced flat fallback, changes no security gate or cleanup behavior, and affects the provenance of a soft runtime limit. Generation starts and fenced flat starts refuse this fallback.
+
+- **P2 1: Resolved**, except for that explicitly accepted P3; absent delegation, failed group creation and unapplied `memory.max` now omit the default.
+- **P2 3: Resolved.** Changing-tier tests assert one read and matching environment/cap values; generation zero also tests a supplied tier with zero live reads.
+- **P2 4: Resolved.** Documentation scopes the new default and lists excluded launch types; gVisor retains its separate root-supplied value.
+
+`git diff --check` passed. Targeted regression and census tests could not start: the read-only sandbox denied Go’s build directory under `$TMPDIR`; `GOCACHE` was unset. These approvals therefore rest on source inspection. No files were edited, no full suites ran, and no subagents were spawned.
+
+**READY**
\ No newline at end of file