carlos / platform Public

review brief: static-dir-slash round 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev a85c6906dfffd4e308958e0ad761cdd0a74fb3aa parent cba536d
1 file changed, +39 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-static-dir-slash.md +39 −0

CI cancelled — superseded by a newer push — run details

Intent

Attributed to this commit: 93.6 g CO₂e (12,001,900 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on static-dir-slash, 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/superpowers/reviews/CODEX-REVIEW-BRIEF-static-dir-slash.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-static-dir-slash.md
new file mode 100644
index 000000000..2fc256d1e
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-static-dir-slash.md
@@ -0,0 +1,39 @@
+# Review brief: branch static-dir-slash, round 1 of 3
+
+Repo carlos/platform, branch `static-dir-slash`, commit cba536da6d (full sha: `git rev-parse cba536da6d`).
+Under review: the diff `origin/main...cba536da6d` (internal/edge/static.go serveTree, its tests, docs/site/cli.md, and the census overlay).
+Authorities: the static serving and _redirects code on main (internal/edge/static.go, internal/edge/redirects.go), AGENTS.md (stopping rules; "The census: an approval, not a decision").
+
+You are an independent reviewer. Read the diff, then the code it calls, and check every claim in the comments, the commit message and the docs against that code.
+
+## Fixed: do not re-argue
+
+- Paul's ruling 2026-10-29: a folder requested without its trailing slash redirects to the slash form (301), as GitHub Pages and Netlify do. Report only mechanisms that fail it.
+
+## What to check
+
+1. Correctness of the redirect in serveTree: only directories with an index.html, never files, never "/" or an empty path, never a rewritten request; Location is relative ("./<base>/"), keeps the query, and is safe for escaped, unicode, colon-bearing, dot and double-slash paths; HEAD behaves as GET.
+2. Interaction with _redirects: rules evaluated first are unchanged; the `names` guard really prevents a loop with a forced "/x/ /x 301!" rule, and does not leave other loops open (splat rules, host-specific rules, rules on parent paths, a rewrite onto a folder path without a slash).
+3. Interaction with the edge protection guard (probe/hard tiers), the password gate, the asset cache and the edge response cache: can a 301 now be cached or served where a 200 was expected, or bypass a check it should not? Analytics: confirm a 301 is not counted as a page view.
+4. Path-routed static apps (a prefix on another app's host) and temporary static sites: does the relative Location resolve to the right place?
+5. Tests: sound witnesses, nothing existing weakened (one test in static_cache_test.go now requests /about/ instead of /about; check that its point still holds).
+6. Census: the proposal at docs/superpowers/notes/census-proposal-static-dir-slash.md. Answer its review question for the unit `internal/edge/static.go staticSite.serveTree` and the re-pinned envelope `internal/edge`: approve or reject, with the reason.
+7. Docs text in docs/site/cli.md: true to the code.
+
+## 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.
+- **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 area, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). Then the census verdict (approve/reject per unit and envelope). 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; targeted `go test ./internal/edge/ -run ...` is fine.