carlos / platform Public

plan: edge page cache slice 1, self-review fixes

Opted-in LRU check is path-independent; purge-order test states its
expectation; single-flight deferred to slice 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev bb3b48649e368552a0170dcc93931d63dc6754e2 parent ed0dde8
1 file changed, +14 −7
  • docs/superpowers/plans/2026-11-08-edge-page-cache-plan-1-home.md +14 −7

CI passed — run details

diff --git a/docs/superpowers/plans/2026-11-08-edge-page-cache-plan-1-home.md b/docs/superpowers/plans/2026-11-08-edge-page-cache-plan-1-home.md
index f66ad0c50..1a9eae245 100644
--- a/docs/superpowers/plans/2026-11-08-edge-page-cache-plan-1-home.md
+++ b/docs/superpowers/plans/2026-11-08-edge-page-cache-plan-1-home.md
@@ -16,6 +16,9 @@ until the app clears it or a new release or config arrives.
- **Opted-in instances** (holding a durable opt-in mark) skip the LRU
entirely.
- **Not in this slice:** far boxes, leases and pushes.
+- **No single-flight in this slice.** The spec's Join (§6.1) arrives
+ with far fills in slice 2, so concurrent misses each render, as they
+ do today.
**Tech Stack:** Go stdlib; existing `internal/assetcache`,
`internal/edge`, `internal/registry`, `internal/provision`,
@@ -436,9 +439,11 @@ func (e *Edge) pagesOptedIn(up upstream) bool
- **State:** `pages atomic.Pointer[pageState]` on `Edge`, holding
`{idx *pageindex.Index}`.
-**At the LRU gate, when `pageRouteEligible` holds:**
-1. If `pagesOptedIn(up)`: the LRU is off for this request, so
+**At the LRU gate:**
+1. **Whenever `pagesOptedIn(up)` holds,** whatever the path and whether
+ or not `pageRouteEligible` holds, the LRU is off for this request:
`cacheable = false`. This is the one place §5.3's rule is checked.
+ The steps below run only when `pageRouteEligible` holds.
2. If `pageReadable(r)`: `idx.Lookup`. A hit is served with
`serveAssetEntry(w, r, entry, now, "hit")`, and the handler returns.
3. If `pageStorable(r)`: `t := idx.Begin(scope)`, and wrap the writer in
@@ -493,7 +498,9 @@ func (e *Edge) pagesOptedIn(up upstream) bool
- `If-None-Match` with the stored ETag gets 304.
- **Opt-in and the LRU:** `TestOptedInInstanceSkipsLRU`. Seed the LRU
with an entry for the host (`seed`), then serve one marked page.
- The seeded URL now misses the LRU and reaches the app.
+ The seeded URL now misses the LRU and reaches the app. So does an
+ unmarked `s-maxage` response under a declared asset prefix (it is
+ not page-eligible, and it is not stored in the LRU).
- **Ineligible routes:** `TestPageIneligibleRoutes`, a table over HA,
`Gate` set, `ImportGate` set, `PagesOff`, `Kind == "static"`, a
forward row, and a path under a declared asset prefix. None is
@@ -548,10 +555,10 @@ still calls only `Cache.PurgeHost`, so a wake never clears pages (spec
- `TestPurgeHeaderClearsPage`: store `/post`, then a POST whose
response carries `Carlos-Purge: /post`. The next GET of `/post` is
a `miss`.
- - `TestPurgeHeaderOnStoredResponseOrder`: a marked GET response that
- itself carries `Carlos-Purge: /post` is applied before that
- response is considered (it stays stored if it is `/post`'s own
- fresh render).
+ - `TestPurgeHeaderOnStoredResponseOrder`: a marked GET of `/post`
+ whose own response carries `Carlos-Purge: /post` is not stored. Its
+ ticket predates the clear, so Finish is fenced. The next GET is a
+ `miss` that reaches the app.
- `TestPurgeAllClearsAliases` (Review Focus 5): store pages on the
primary and an alias (`upsertAlias`). `Carlos-Purge: all` misses
both, and `Carlos-Purge: *` sent for the alias host misses only the