review: Astra round 1 findings for audit-request-path
READY AFTER FIXES: two P2s, fixed in 4882aebb without another round.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+52
−0
docs/superpowers/reviews/FINDINGS-audit-request-path-R1.md+52 −0
CI passed — run details
diff --git a/docs/superpowers/reviews/FINDINGS-audit-request-path-R1.md b/docs/superpowers/reviews/FINDINGS-audit-request-path-R1.md| new file mode 100644 |
| index 000000000..456c5c3d0 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/FINDINGS-audit-request-path-R1.md |
| @@ -0,0 +1,52 @@ |
| +Reviewed `origin/main...2d1f36fdbf4ee5b7b8128ba3893cda755a043d65`, base `15b1ee6b6a65a52b82075003d8d6c2bcbb100ca5`, round 1 of 3. The requested tip adds only the brief after implementation tip `9604346a`. |
| + |
| +No P1 findings. Two P2 findings follow; no P3 findings. |
| + |
| +1. **P2 — Check 2: the prober’s dial-deadline claim is incorrect.** |
| + |
| + The new comment in [upstreamdial.go:13](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/upstreamdial.go:13), repeated in commit `c6ec153f`, says both `multiProxy` and the prober bound their dials with context deadlines. |
| + |
| + `multiProxy` does, inside its dial callback. The prober instead installs the unbounded `upstreamDialer().DialContext` and sets `http.Client.Timeout` and `ResponseHeaderTimeout`: [prober.go:136](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/prober.go:136). Go’s transport explicitly removes request cancellation and deadlines before dialing: [transport.go:1524](/home/paulca/.local/go-dist/src/net/http/transport.go:1524). |
| + |
| + **Failure scenario:** a black-holed probe target causes the HTTP request to time out, but its connection attempt can continue until the kernel’s timeout. Later probe ticks can start additional attempts. The prober closes idle connections on `Stop`, not after each failed probe. |
| + |
| + **Fix:** correct the new comment and branch description to distinguish the HTTP request bound from the dial bound. Record the existing unbounded prober dial as follow-up work. Its eventual fix needs a deadline inside the guarded dial callback or a dialer timeout. |
| + |
| + **Fault family:** outbound connection lifetime must be bounded at the operation that owns the connection. This is a pre-existing implementation gap newly described as already covered, not a regression introduced by this branch. |
| + |
| +2. **P2 — Check 5: the cancellation test assumes an in-flight handler settles within 100 ms.** |
| + |
| + [healthwait_cancel_test.go:84](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/healthwait_cancel_test.go:84) acknowledges that an already-sent probe may reach the handler after the wait returns, then uses a 100 ms sleep before taking its baseline. |
| + |
| + **Failure scenario:** a loaded runner delays that handler beyond the settling sleep. It increments `probes` during the subsequent observation window, and the test reports continued polling even though the client stopped correctly. Request cancellation does not synchronously join the server handler. |
| + |
| + **Fix:** synchronize cancellation with a controlled polling boundary and explicitly acknowledge completion of any outstanding handler. Assert that no new probe starts after cancellation; do not infer that boundary from elapsed wall time. |
| + |
| + **Fault family:** cancellation regression tests must distinguish a new probe from completion of one already sent. |
| + |
| +The remaining checks support the implementation: |
| + |
| +- **Idle timeout:** all five constructors set `publicIdleTimeout`: HTTP and HTTPS in [ingressdrain.go:96](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/ingressdrain.go:96), dev in [edge.go:5171](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/edge.go:5171), devbox in [devbox.go:225](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/devbox.go:225), and door in [door.go:201](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/door.go:201). Go applies this after an HTTP/1 request finishes; hijacked connections leave that loop. HTTP/2 inherits the setting and stops its idle timer while streams are open. Held streams, uploads, WebSockets and active tunnel traffic therefore retain their existing lifetimes. |
| +- **Timeout ordering:** `90 s < 120 s < 350 s` matches the backhaul pool and the configured TCP listeners. Terraform sets no listener idle-time override. AWS confirms the 350-second default: [https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html). |
| +- **Upstream guard:** `tcpProxy` uses the new guarded dialer both directly and inside local retries. `multiProxy`, the prober and TCP health waits retain their guard. Resolution-time IPv4, IPv6 and mapped-address refusal remains unchanged. |
| +- **Health waits:** polling is now synchronous, requests carry the wake context, and pauses select on cancellation. Both transports close idle connections on return; Go’s implementation also cancels abandoned pending dials. There is no detached polling loop left. Transport goroutines unwind asynchronously, so this is cancellation and cleanup, not a synchronous join of every internal goroutine. |
| +- **Preserved health semantics:** responses below 500 succeed, redirects are not followed, `X-Forwarded-Proto` remains set, and the three-second per-request timeout and polling backoff remain. The overall timeout still has its previous possible final-probe overshoot. |
| +- **Callers checked:** `ExecBackend.startChildAt` ([2438](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/backend_exec.go:2438)), `ExecBackend.startUnitAt` ([3176](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/backend_exec.go:3176)), `ExecBackend.startRootfs` ([293](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/rootfs.go:293)), `Service.genHealthy` ([518](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/swap.go:518)), and both branches of `UnitBackend.waitHealthy` ([179](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/activator/backend_unit.go:179)). Existing failure cleanup remains intact. The deleted context-free helpers had no production callers besides the wrappers replaced here. |
| +- **Throttle keys:** the changed key uses the matched route’s `Host`; the request host appears only in the quoted message. I traced the other callers and found no additional unrestricted remote-input key. Apparent exceptions are constrained by exact published-host membership, registered routes/channels, validated fleet membership, or fixed complaint/path values. |
| +- **Tests and portability:** the new tests target the old missing timeout, zero-valued dialer settings, per-request-host map growth, and continued probing after cancellation. The server and dialer tests inspect configuration rather than elapsed network behavior. The new dialer test alone does not verify `tcpProxy` wiring; that wiring is correct by inspection. No new Linux-only API or type appears in the changed production code. |
| + |
| +Census verdicts for `census-ruling-audit-request-path` at the requested tip: |
| + |
| +| Unit or envelope | Verdict | Evidence and basis | |
| +|---|---|---| |
| +| `Edge.openDoor` | **APPROVE** | Read [door.go:152](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/door.go:152) through its return. Only the server timeout and comment change. Socket checks, staged creation, permissions and shutdown remain unchanged. Retain `legacy / accepted-legacy`. | |
| +| `RunWithActivatorReady` | **APPROVE** | Read the function beginning at [edge.go:5061](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/edge.go:5061), including dev construction and public listener wiring. No new read or authority; existing five read sites remain. Retain its disposition. | |
| +| `Edge.planDisabledAdmit` | **APPROVE** | Read [plandisabled.go:76](/home/paulca/amadan.net/carlos/platform-audit-request-path/internal/edge/plandisabled.go:76)–97. The three added `registry:Host` reads use the route already supplied. Admission predicate, status exception and fixed response remain unchanged. Retain `legacy / accepted-legacy`. | |
| +| `internal/activator` envelope | **APPROVE** | Reviewed the changed health-wait functions, `healthPause`, `probeHealth`, callers and tests. Unix control-endpoint/peer checks, TCP link-local refusal and redirect refusal remain intact. No new destination or root authority. | |
| +| `internal/edge` envelope | **APPROVE** | Reviewed the five server constructions, `tcpProxy`, both dialer helpers, disabled-route admission and tests. Changes bound connection lifetime and throttle cardinality without widening destinations, filesystem access or admission authority. | |
| + |
| +Validation was limited to source review, clean `git diff --check`, and clean `gofmt -l` on changed Go files. The permitted targeted activator test command, run at `nice -n 19` with `GOCACHE` unset, failed before compilation because the read-only sandbox prevented creation of Go’s work directory. Tests, census execution and cross-compilation are therefore unverified here. No files were edited. |
| + |
| +Round 1 stops with no P1. Apply the P2 fixes without reopening the review, retaining the required census and changed-security checks. |
| + |
| +**READY AFTER FIXES** |
| \ No newline at end of file |