edge-held-cap: Astra review brief, round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+95
−0
docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-held-cap.md+95 −0
CI cancelled — superseded by a newer push — run details
Intent
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-held-cap.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-held-cap.md| new file mode 100644 |
| index 000000000..0c33872e7 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-held-cap.md |
| @@ -0,0 +1,95 @@ |
| +# Review brief: branch edge-held-cap (held-stream caps, spec rev 4), round 1 of 3 |
| + |
| +Repo carlos/platform, branch `edge-held-cap`, commit cc07354138e1d1b84bf8e45088a10888c6242f32. |
| +Under review: the diff `cdf98181c40def06a8ebc780c2c58a04e42e0c59..cc07354138e1d1b84bf8e45088a10888c6242f32` |
| +(`git diff cdf98181..HEAD`), and the census card |
| +`docs/superpowers/notes/census-proposal-edge-held-cap.md`. |
| +Authorities: `docs/superpowers/specs/2026-10-28-edge-held-streams-design.md` |
| +(rev 3 merged on main as #432; this branch's §3.6 is the rev 4 text under |
| +review), `AGENTS.md` (census section). |
| + |
| +You are an independent reviewer. Read the diff, then the code it names, |
| +and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul approved raising the held-stream cap on the platform (2026-11-20). |
| +- Post 835's anti-goal (no proxied fallback past a cap) is kept; the |
| + branch records the alternative as weighed in §3.6. Do not propose the |
| + fallback. |
| +- No release or roll is part of this branch. |
| + |
| +## What to check |
| + |
| +1. **The caps.** `internal/edge/heldbudget.go`: `heldPerBox(mem, nofile)` |
| + and its constants. Is the arithmetic right (overflow, unsigned |
| + underflow, clamp), and do the stated numbers in §3.6 and the comments |
| + follow from it? Is reading `syscall.Sysinfo` and `RLIMIT_NOFILE` at |
| + package init correct on Linux amd64/arm64 (Go has already raised the |
| + soft limit by then?), and does `heldbudget_other.go` keep darwin and |
| + windows building? |
| +2. **The per-channel cap.** `heldSet.register(host, channel)` and |
| + `finish` in `internal/edge/heldstream.go`: is `channel` counted and |
| + released exactly once on every path a stream ends (including the |
| + unmanaged early return in `serveHeld`)? Is |
| + `fromTunnel(ctx) || linkedRequest(ctx)` the right test for "this |
| + request holds one of a channel's HTTP/2 streams"? Are there paths where |
| + a held stream rides a channel and is not counted (replica arm, link |
| + arm, fleet forward), or where a direct request is wrongly counted? |
| +3. **The sizing claims.** Spec §3.6 rev 4 says a held stream costs about |
| + 95 KiB / 1 fd asleep and 232 KiB / 2 fds awake (measured), the edge |
| + unit has no LimitNOFILE, a channel serves 250 streams with 128 kept for |
| + upgrades, and a plain request waits when the channel is full (x/net |
| + v0.62.0 `awaitOpenSlotForStreamLocked`). Check what you can against |
| + the code: `internal/host/units/carlos-edge.service`, |
| + `internal/tunnelclient/upgrade.go`, `internal/edge/upgrades.go`, |
| + `internal/edge/tunnel.go` transportFor. |
| +4. **What a 1,000-stream host does elsewhere.** Anything in the edge or |
| + activator that is O(streams) per event or per tick under `heldSet.mu` |
| + or `a.mu`, or bounded somewhere else at 64 (backhaul, HA forward, |
| + rate limit, plan throttle), that makes 1,000 per host unsafe or |
| + untrue. The follow-ups note already lists the cross-region backhaul |
| + slot cap; say whether anything else belongs there or blocks. |
| +5. **The witnesses.** `TestHeldE2EManyStreamsOneHost` |
| + (`internal/activator/heldstream_e2e_test.go`), |
| + `TestTunnelHeldStreamsCappedPerChannel` |
| + (`internal/edge/tunnel_e2e_test.go`), `TestHeldPerBox`, |
| + `TestHeldSetDefaultCaps`, `TestHeldSetPerChannel` |
| + (`internal/edge/heldstream_test.go`). Do they prove what they claim, |
| + and are they likely to flake on a loaded CI shard (timings, 200 |
| + connections)? |
| +6. **Census.** Give a verdict (approve or reject, citing the lines you |
| + read) for the unit `internal/edge/heldstream.go` `Edge.serveHeld` and |
| + for the re-pinned envelope `internal/edge`, by the rule in the card: |
| + reject if the change lets root open, run, query or follow anything it |
| + did not before from a path or input a tenant, an app or a box agent can |
| + create, write or name, or weakens a check root relies on. |
| + |
| +## 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. |