| new file mode 100644 |
| index 000000000..d08351165 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/ASTRA-REVIEW-BRIEF-static-headers-R1.md |
| @@ -0,0 +1,80 @@ |
| +# Review brief: static-headers design (`_headers` for static sites), round 1 of 3 |
| + |
| +Repo carlos/platform, branch `static-headers`, commit named in the prompt. |
| +Under review: `docs/superpowers/specs/2026-10-29-static-headers-design.md`. |
| +Authorities: the code on `main` (a8b52609) — `internal/edge/static.go`, |
| +`internal/edge/redirects.go`, `internal/edge/edge.go` (ServeHTTP's |
| +`cacheable`, `maybeStore`, `writeCached`), `internal/edge/cache.go`, |
| +`internal/edge/assetadmit.go`, `internal/edge/assetcatch.go`, |
| +`internal/edge/compress.go`, `internal/console/apiship_assets.go`, |
| +`docs/site/cli.md`. Discussions #195 and #450 on amadan carlos/platform |
| +are the requests (summarised in the spec's section 1). 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 document, then the code it |
| +names, and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul approved the approach on 2026-10-29: one feature, a Netlify/Cloudflare |
| + format `_headers` file beside `_redirects`, covering both requests. |
| +- Calls the author made and wants checked, not re-litigated as taste: |
| + last-matching-rule-wins per header (not comma joining); a five-header |
| + allowlist; `Access-Control-Allow-Origin: *` only; no preflight; headers |
| + on 200-served files only; static routes taken out of the shared response |
| + cache. Report one only if it fails a stated goal or breaks something. |
| + |
| +## What to check |
| + |
| +1. Section 4.4: is taking `Kind == "static"` out of `cacheable` truly a |
| + no-op today (no static response ever stored, lookup and store both |
| + gated), and does it miss any path by which a static response with a |
| + `max-age` could still be stored or replayed to another visitor (tunnel / |
| + far-edge / backhaul paths, `viaTunnel` static routes, the hibernation |
| + branch, the asset catch)? |
| +2. Section 4.1: matching the pre-rewrite path. Check `serveTree`'s loop: |
| + is the pre-rewrite `p` and host the right input in every branch (the |
| + folder slash redirect, `/index.html` redirect, forced rules, rewrites |
| + onto a directory)? |
| +3. Section 4.3: which responses carry the headers. Check against |
| + `serveFile` and net/http's `ServeContent` (304, 206, 412, 416, HEAD) in |
| + the repo's Go toolchain. Anything that would carry `immutable` on a |
| + response that is not the file's bytes is a P1. |
| +4. Sections 3.1-3.4: is the syntax unambiguous enough to build, and does |
| + sharing the `_redirects` source parser and matcher work (the matcher's |
| + "/x/* matches /x" and trailing-slash behaviour; host-URL sources)? |
| +5. Compatibility (section 5): any existing behaviour of a site with no |
| + `_headers` that would change, header for header. |
| +6. Anything in the allowlist that could let a site set a header the |
| + platform owns or that changes a cache or security decision elsewhere |
| + in `internal/edge` (the compressor, the guard, analytics, usage |
| + metering). |
| + |
| +## 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, 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). 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. |