carlos / platform Public

remote-metrics-nested: review brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 139e04ca70384a6bb637278415d723f69b063284 parent ad74768
1 file changed, +89 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-remote-metrics-nested.md +89 −0

CI failed — run details

diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-remote-metrics-nested.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-remote-metrics-nested.md
new file mode 100644
index 000000000..072fb0a4c
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-remote-metrics-nested.md
@@ -0,0 +1,89 @@
+# Review brief: branch remote-metrics-nested, round 1 of 3
+
+Repo carlos/platform, branch `remote-metrics-nested`, commit named in the
+reviewer's prompt.
+Under review: the diff `origin/main..<commit>` (merge base 4dc5902d, which
+merged remote-instance-metrics).
+Authorities: the code on main at the merge base, and
+`docs/superpowers/notes/remote-instance-metrics.md` (its rules were
+reviewed on that branch: note rounds 1-2, branch rounds 1-2; findings
+`docs/superpowers/reviews/CODEX-FINDINGS-remote-instance-metrics-*.md`).
+This branch adds the section "Follow-up: nested instances". Do not review
+against unmerged branches; if this work needs one, say so as a P1 and stop.
+
+You are an independent reviewer. Read the note's new section, then the
+diff, and check every claim against the code.
+
+## Fixed: do not re-argue
+
+- Paul's rulings for this work: boxes tag samples with the instance's
+ tenant and the console shows a remote sample only with the matching tag;
+ untagged samples never show remotely; local rows keep today's behaviour
+ (they accept untagged readings); no new per-box polling.
+- The tag rule merged in 4dc5902d (one tenant ever per host in the
+ agent's life via putEntryLocked/Tenancies, the registry row agreeing,
+ reads before and after, CarryTags, leftovers). Raise it again only with
+ new evidence that a nested reading can carry the wrong tenant.
+
+## What to check
+
+Fault family: **tenant identity of samples**. Name it beside every
+finding in that family.
+
+1. Root cause: is it right that nested units were never sampled, and are
+ all of a nested host's processes under
+ `carlos.slice/carlos-instances.slice/<SliceName(host)>/<unit>`? Check
+ `internal/instancectl` (names.go, server.go, gen.go), the unit templates
+ in `internal/host/units`, and `internal/activator`. Is any nested unit
+ of a host placed elsewhere, or anything of another host or tenant
+ placed in that slice?
+2. `nestedUnitReadings`, `snapshotNestedUnits`, `cgroupID`, `sumUnitRaw`,
+ `mergeNested` (`internal/host/metrics_nested*.go`, `metrics_loop.go`)
+ and the wiring in `agent.go` (the snapshot is taken before the
+ activator can start anything). Can a nested reading be tagged while it
+ includes a process or charge of another tenant, or of a unit this agent
+ did not start? Is summing unit cgroups (not the slice) sound for CPU
+ deltas and memory? Cgroup id reuse?
+3. Do every nested unit's spawns go through activator entries, so the
+ one-tenant rule covers them (instance-control starts them at the
+ agent's request)? Check instance-control paths that start units for a
+ host without an entry (moves, maintenance, probes, sweeps).
+4. Tests: production-wired where the note says; a nested instance sampled
+ and tagged; a reused hostname under the nested layout; an agent
+ restart with a unit in flight; the root-runner test. Mutations: 8, all
+ killed.
+5. Request budget: no new store request.
+6. **Census (the reviewer decides every class).** Card
+ `docs/superpowers/notes/census-proposal-remote-metrics-nested.md`: give
+ approve or reject, citing lines, for each unit (2 changed, 4 new) and
+ the `internal/host` envelope, per AGENTS.md "The census: the reviewer
+ decides".
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+ Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review. (The
+ census, and review of any newly changed security, root, termination
+ or production-storage behaviour, still check the fix; see AGENTS.md,
+ "Stopping rules".)
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for
+ another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not
+raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section or task, the problem,
+the evidence (file:line, verified), the failure scenario, a concrete
+fix and the invariant or trust boundary it breaks (that is its fault
+family). Then the census verdicts. End with exactly one verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another
+ round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites.