carlos / platform Public

spec: edge page cache rev 3 after Astra round 2

Paul's rule-2 choices: one page index per box owns every publish, clear,
reset and lookup; opted-in instances never use the LRU. Adds the cold
far-box start and asset-prefix precedence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4e634b3b1ac8bfe79b1013a69639db823c099402 parent 389496f
2 files changed, +351 −108
  • docs/superpowers/specs/2026-11-08-edge-page-cache-design.md +235 −108
  • docs/superpowers/specs/CODEX-REVIEW-BRIEF-PAGE-CACHE-R3.md +116 −0
diff --git a/docs/superpowers/specs/2026-11-08-edge-page-cache-design.md b/docs/superpowers/specs/2026-11-08-edge-page-cache-design.md
index 80bb63cdc..760a48f01 100644
--- a/docs/superpowers/specs/2026-11-08-edge-page-cache-design.md
+++ b/docs/superpowers/specs/2026-11-08-edge-page-cache-design.md
@@ -1,6 +1,6 @@
# Edge page cache: design
-Status: draft rev 2, 2026-11-08. Branch `design-edge-page-cache`.
+Status: draft rev 3, 2026-11-08. Branch `design-edge-page-cache`.
Builds on the edge asset cache (`2026-10-24-edge-asset-cache-design.md`,
merged and armed on dev and flagship) and on today's `Carlos-Purge`
channel (`internal/edge/purge_header.go`, `internal/edge/purge.go`).
@@ -80,8 +80,8 @@ Facts the design leans on. File references are to `main` at 06bb3f7e.
resurrect what the purge removed (`purge_header.go:266`).
- **The edge asset cache** keeps immutable, declared-prefix, non-HTML
responses in a disk store (`internal/assetcache`). The store has a
- budget, a per-app share, eviction, reserved fills, and gzip at serve
- time.
+ budget, a per-app share, eviction, reserved fills, and a gzip copy written with
+ each entry.
- **Fills.** Far edges catch a declared path and ask the home for it
with a signed fill (`X-Carlos-Asset-Fill`, HMAC under the mesh key).
They store only what the home acknowledges. The acknowledgement
@@ -152,9 +152,12 @@ Facts the design leans on. File references are to `main` at 06bb3f7e.
- **Browser copies.** The edge can't clear them; §4.2 tells apps what to
send.
- **Static sites and the asset cache** keep their own rules.
-- **The LRU's cookie gap** (§2) is older than this feature, and this
- design doesn't change unmarked responses. It goes on a follow-up
- discussion for the LRU's own owner.
+- **The LRU's cookie gap** (§2) is older than this feature. For apps
+ that never opt in, it stays as it is, and it goes on a follow-up
+ discussion for the LRU's own owner. Opted-in instances don't use the
+ LRU at all (§5.3).
+- **Paths under a declared asset prefix** stay with the asset cache
+ (§5.2) **(astra R2-4)**.
**Anti-goals** (failures even if everything else works)
- A reader sees a page drawn for someone else: a signed-in view, a paid
@@ -291,24 +294,34 @@ A response goes into the page store only when all of these hold:
- the body is at most 8 MiB (my call: above the LRU's 1 MiB, below the
asset cache's 32 MiB);
- the content type is anything, HTML included. The marker is what makes
- HTML acceptable here, where the asset cache refuses it.
-
-Pages are stored identity-encoded and compressed at serve time, as
-assets are. The stored headers follow the asset cache's list. The
-`Carlos-*` control headers are never stored or replayed.
-
-### 5.3 The two caches never mix (astra R1-3)
-
-- A response that carries the marker never enters the LRU, whether or
- not the page store kept it, and whatever the request carried. A
- marked response the page store refused is simply not cached.
-- The page store is looked up before the LRU. A request the page store
- bypasses still reaches the LRU, which keeps today's rules for
- unmarked responses.
-- An instance whose page switch is on gets one more rule (my call): the
- LRU neither stores nor serves for a request that carries `Cookie` or
- `Authorization`. That closes the cookie gap from §2 for every app
- that opts in, without changing apps that don't.
+ HTML acceptable here, where the asset cache refuses it;
+- the path is not under one of the release's declared asset prefixes.
+ Those paths belong to the asset cache, whose catcher answers them
+ before the page store is reached (`edge.go:2596`). A marker on such a
+ response is ignored, and page clears don't reach asset copies:
+ `carlos assets purge` does. The docs say so **(astra R2-4)**.
+
+Pages are stored the way the asset store stores a fill: identity, plus a
+gzip copy made once when the entry is written, and served by picking the
+stored copy **(astra R2-5)**. The stored headers follow the asset
+cache's list. The `Carlos-*` control headers are never stored or
+replayed.
+
+### 5.3 The two caches never mix (astra R1-3, R2-2; Paul's choice, rule 2)
+
+- **A marked response never enters the LRU**, whether or not the page
+ store kept it, whatever the request carried, and on any instance.
+- **An opted-in instance doesn't use the LRU at all**, for lookups or
+ for stores, on any of its hosts.
+ - **What makes it opted in:** its home holds the durable opt-in mark
+ (§6.2).
+ - **Where it's checked:** in one place, the LRU lookup gate. So
+ entries stored before the mark existed, and stores that finish
+ after it, can never be served while the mark stands. Nothing needs
+ purging, and no in-flight store can race it.
+ - **The cost:** unmarked `s-maxage` pages of an opted-in instance lose
+ the 5-minute cache. The docs tell such apps to mark them.
+- **Instances that never opt in** keep today's LRU rules unchanged.
### 5.4 The key and the entry
@@ -316,7 +329,7 @@ assets are. The stored headers follow the asset cache's list. The
sent. No query normalisation in v1.
- **Each entry also records:**
- the home box and its clear epoch for the instance (§8);
- - the clear sequence the entry is valid at (§6);
+ - the clear sequence the entry is valid at (§6.1);
- the absolute expiry;
- the ignore list;
- the `ETag`, if any.
@@ -330,49 +343,121 @@ box serves pages only when page caching is armed on it
(`CARLOS_PAGE_CACHE=1`, which needs the asset store), and only for an
instance whose page switch is on (§10).
-## 6. Serving on the home box
-
-At the point where the LRU lookup happens today (after the password gate
-and the plan throttle, before the rate limit and the activator), an
-eligible request is looked up in the page store first.
-
-**A hit** is a live entry whose epoch is this box's current epoch for the
-instance, on a host the page predicate allows right now. It is served
-with `Carlos-Cache: hit`.
-
-A miss goes to the app as today.
-
-**Clears fence publication (astra R1-1).** Clearing and publishing take
-the same per-instance lock:
-- **Clearing:** under the lock, the box increments the sequence,
- records the clear in its log, removes the matching entries and
- rejects matching pending fills.
-- **Publishing:** writing the file happens outside the lock. Indexing
- it, the step that makes it servable, happens under the lock, and only
- if no clear since the render started matches the entry's key. A
- matching clear means the file is discarded and nothing is indexed.
- The store's existing compress, sync and rename steps
- (`assetcache/fill.go:474`) all sit before that check.
-- **Validity:** an entry indexed this way is valid at the sequence
- current when it was indexed. An entry still present later is valid at
- every later sequence, because any clear that matched it would have
- removed it under the same lock.
-
-**Single-flight per key** (my call):
-- **Who may join:** a request may join a render only if no clear
- matching the key has happened since that render started. Later
- requests start a new render.
-- **When nothing is kept:** a render that isn't kept (a 500, a
- redirect, no marker, or a clear fenced it) sends its waiters to the
- app for themselves, never an error or an empty body.
+## 6. The page index, and serving on the home box
+
+### 6.1 One index, one rule (astra R1-1, R2-1; Paul's choice, rule 2)
+
+Every box, home or far, keeps its pages behind one **page index**. It is
+the only code that makes a page servable, removes one, or answers a
+lookup. Rounds 1 and 2 each found a path that applied the clear rule in
+one place and not another. The index exists so there is only one place.
+
+**Scopes.** The index holds one scope per (home box, instance). On the
+home, the home box is itself. A scope holds:
+- the epoch and the applied sequence;
+- the clear log (§8.1);
+- the entries;
+- on a far box, the lease.
+
+**One lock per scope.** All five operations below run under it, so they
+are totally ordered within the scope.
+
+- **Publish(entry, epoch, valid-at).** Writing the file (and its gzip
+ copy, `assetcache/fill.go:474`) happens before, outside the lock.
+ Under the lock, the entry is indexed only if all of these hold:
+ - the scope's epoch equals `epoch`;
+ - `valid-at` ≤ the scope's applied sequence;
+ - the scope's clear log covers every sequence in
+ (`valid-at`, applied];
+ - no clear in that range matches the entry's key.
+ Otherwise the file is discarded and nothing is indexed.
+- **Clear(epoch, seq, targets).** Applies only as the next sequence on
+ the scope's epoch. On the home it is always the next one, because
+ the home assigns it. It records the clear in the log, removes the
+ matching entries, and marks matching in-flight renders as fenced.
+- **Reset(new epoch).** Drops every entry, empties the log and sets the
+ new epoch and sequence. This covers a new epoch, a lease answer that
+ says "reset", a switch turned off, and a route that left.
+- **Lookup(request).** Returns an entry only when all of these hold:
+ - the entry's epoch is the scope's epoch;
+ - the host passes the predicate (on the home), or the lease is valid
+ and lists the host (on a far box);
+ - the request may read it under §5.1.
+ Nothing else returns a stored page.
+- **Join(request).** Joins an in-flight render for the same key only
+ when it isn't fenced. A fenced render stores nothing. The requests
+ that were already waiting get its response, because they arrived
+ before the clear did. Later requests start their own.
+
+**Where `valid-at` comes from:**
+- **A home render:** the scope's sequence when the render started.
+- **A far fill:** the acknowledgement's validated sequence (§7).
+
+**What the rule gives.** An entry in the index is valid at the scope's
+current sequence: any clear that matched it either removed it under the
+lock, or came before its Publish and refused it.
+
+**Checking it.** The randomized simulation (§12) drives the index
+directly, with the operations interleaved at random. It also checks the
+index's callers: no code path outside the index can make a page
+servable. A guard test fails if a page-store write bypasses Publish.
+
+### 6.2 Serving on the home box
+
+**Where the lookup sits.** At the point where the LRU lookup happens
+today: after the password gate and the plan throttle, before the rate
+limit and the activator. An eligible request is looked up in the page
+index. A hit is served with `Carlos-Cache: hit`. A miss goes to the app
+as today, and a response kept under §5.2 is published with `valid-at` =
+the sequence when the request started.
+
+**The opt-in mark** (astra R2-2 and R2-3):
+- **When it is written:** the first time the home admits a marked
+ response for an instance, it writes a durable opt-in mark for that
+ instance beside the page store. It is fsynced before that response is
+ published.
+- **What it does:**
+ - turns the LRU off for the instance (§5.3);
+ - lets the home advertise page caching for the instance's hosts to
+ far boxes (§7.1).
+- **What clears it:** only the operator's switch turned off, or the
+ instance's route leaving this box. A restart or a new epoch keeps it.
+
+**Single-flight per key** (my call). A render that isn't kept (a 500, a
+redirect, no marker, or fenced) sends its waiters to the app for
+themselves, never an error or an empty body.
**Losing authority.** When the instance's route leaves this box, or the
-page switch turns off, the box ends the epoch and drops the instance's
-entries **(astra R1-2)**. When the route arrives again, a new epoch
-starts with nothing in it.
+page switch turns off, the box resets the scope **(astra R1-2)**. When
+the route arrives again, a new epoch starts with nothing in it.
## 7. Serving on far boxes
+### 7.1 Starting cold (astra R2-3)
+
+A far box learns which hosts to try from the edges file, which the home
+already publishes and every box already polls. No new polling is added.
+- **The flag.** The home adds a `pages` flag to a host's entry when two
+ things hold:
+ - the instance holds the opt-in mark (§6.2);
+ - the host passes the page predicate.
+- **Without the flag,** the far box backhauls as today and sends no
+ lease traffic. Hosts of apps that never opt in cost nothing.
+- **The first lease.** For a flagged host with no scope yet, the far box
+ sends a host-scoped first renewal: the host, the home box it dials, a
+ nonce and a timestamp. The home answers from its own route table,
+ with the same fields as any lease answer (§8.3): the instance, the
+ epoch, the sequence and the eligible hosts. That opens the scope, and
+ later renewals name the instance.
+- **The cold request itself** goes as a plain backhaul, and the first
+ renewal runs in the background (my call), so a cold reader never
+ waits on it. Fills start with the next request.
+- **The flag is a hint, not authority.** Only a lease answer authorizes
+ serving. A flag that is up to 30 s stale costs at most a refused
+ first renewal, or a late start.
+
+### 7.2 Hits and fills
+
A far box today backhauls every request for a host homed elsewhere. With
page caching armed on the far box and the request eligible:
@@ -400,7 +485,7 @@ page caching armed on the far box and the request eligible:
the throttle, the wake and the app. A request with cookies goes as a
plain backhaul.
3. **The home's acknowledgement.** The home acknowledges only an entry
- it holds valid under the §6 lock: a fresh render it just indexed, or
+ it holds valid under the scope lock (§6.1): a fresh render it just indexed, or
a retained entry it still holds. The acknowledgement is signed in its
own domain and MACs the assertion, as asset acks do. It carries:
- the expiry and the epoch;
@@ -409,17 +494,19 @@ page caching armed on the far box and the request eligible:
- the ignore list;
- the account, app and instance from the home's own route table, not
from the far box's claim.
-4. **What the far box stores (astra R1-5).** Let `a` be the
- acknowledgement's validated sequence and `f` the sequence the far
- box's lease has applied, on the same epoch:
- - **`a == f`:** store.
- - **`a < f`:** store only if no clear in `(a, f]`, from the far box's
- own copy of recent clears, matches the key.
- - **`a > f`:** serve this response once, don't store it, and renew the
- lease in the background.
- - **A different epoch:** serve once, don't store.
-
- Account, app and instance come from the acknowledgement.
+4. **What the far box stores (astra R1-5, R2-1).** The far box calls the
+ index's Publish (§6.1) with the acknowledgement's epoch and validated
+ sequence as `valid-at`. The index's one rule decides:
+ - a clear that matches the key and landed in between refuses it;
+ - a different epoch refuses it;
+ - a gap in the log refuses it;
+ - a validated sequence newer than the far box's applied sequence
+ refuses it.
+
+ A refused fill's response is still served to the requests that
+ carried it, and nothing is kept. When the acknowledgement was newer,
+ the far box also renews in the background. Account, app and instance
+ come from the acknowledgement.
Fill limits (waiters, deadlines, concurrency per box and per instance)
follow the asset cache's. Fills the home acknowledged are unbilled at the
@@ -439,9 +526,9 @@ clear sequence.
hosts and the targets. The size is the builder's call. Something like
the last 256 clears or 10 minutes, whichever holds less.
- **Far boxes** keep the same bounded log per (home, instance) for what
- they've applied (§7 step 4).
+ they've applied (§6.1, §7.2 step 4).
- **Starting a new epoch:** the box holds no entries for the instance
- (§6, losing authority).
+ (§6.1 Reset).
### 8.2 Push
@@ -502,18 +589,22 @@ and instance (§8.5).
### 8.4 The bound
-**Invariant I1.** Let a clear be applied at the home at time t. No edge
-serves a page it covers after t + L. In-flight responses already being
-written are the only exception.
+**Invariant I1.** Let a clear be applied at the home at time t. No
+request that arrives at any edge after t + L is answered with a page the
+clear covers. A request that arrived before the clear reached that edge
+may still get the response already in flight for it.
**Why it holds:**
-- **On the home:** the clear and publication share a lock (§6), so no
- entry it covers is servable there after t.
-- **On a far box:** any renewal sent before t either was answered after
- t, and so carries the clear, or expires by `sent + L < t + L`. Any
- renewal sent after t carries the clear.
-- **Fills:** a far box stores a fill only when its sequences show the
- clear can't apply (§7 step 4).
+- **On the home:** the clear and every Publish and Lookup share the
+ scope lock (§6.1). Nothing the clear covers is servable there after
+ t.
+- **On a far box, served from a lease:** any renewal sent before t
+ either was answered after t, and so carries the clear, or expires by
+ `sent + L < t + L`. Any renewal sent after t carries the clear. Once a
+ far box has applied a clear, the index guarantees what follows for
+ that box.
+- **On a far box, from fills:** a fill validated before the clear can't
+ be published after it (§6.1).
- **The push** makes the usual case far faster. The bound doesn't depend
on it.
@@ -526,8 +617,9 @@ protections and adds these:
nonce), as `assetfill.go:120` does, so it authorizes storing exactly
the URL the far box asked for.
- **Lease renewal:** carries the sender box, the home box, the account,
- app and instance, a fresh nonce and a timestamp. The answer is MACed
- over the request and its nonce.
+ app and instance (or only the host, for a first renewal, §7.1), a
+ fresh nonce and a timestamp. The answer is MACed over the request and
+ its nonce.
- The far box keeps at most one outstanding renewal per (home,
instance), and accepts only the answer to it.
- The lease runs from that request's send time. An old answer, or one
@@ -554,7 +646,7 @@ must not clear.
- **Region HA:** out of v1 (§3). The page predicate refuses HA routes,
so neither home hits nor leases exist for them.
- **Moves:** the old home's route leaves, so its epoch ends and its
- entries go (§6). Its lease answers stop listing the hosts, and far
+ entries go (§6.2). Its lease answers stop listing the hosts, and far
boxes drop them. The new home starts a new epoch. A plain backhaul
that still reaches the old box finds no entry to serve, because the
entries are gone.
@@ -566,10 +658,12 @@ must not clear.
then far boxes, as for assets. A box that isn't armed treats the
marker as absent and strips it (§5.3 still applies: a marked response
never enters the LRU).
-- **Instance switch.** An off switch on the instance record, the asset
- cache's R1 parity (`carlos pages off|on`, names to copy review). Off
- means:
- - the home ends the epoch and drops the instance's entries (§6);
+- **Instance switch.** An off switch on the instance record, on by
+ default, the asset cache's R1 parity (`carlos pages off|on`, names to
+ copy review). Off means:
+ - the home resets the scope (§6.1) and clears the opt-in mark, so the
+ LRU's ordinary rules return;
+ - the edges-file flag drops;
- lease answers list no hosts.
It is per instance: other instances of the same app keep theirs. It is
the operator's tool when an app caches something it shouldn't.
@@ -600,16 +694,17 @@ must not clear.
Each slice changes something Paul can see (stopping rule 6).
1. **Home box.**
- - **Built:** the marker, the page predicate, the page store on the
- home with the clear lock, the epoch and sequence, the
+ - **Built:** the marker, the page predicate, the page index (§6.1)
+ with its simulation, the opt-in mark, the epoch and sequence, the
instance-wide clear, clear on a new release, the instance switch,
the §5.3 rules and `Carlos-Cache` on pages.
- **Rollout:** armed on dev.
- **Patrix:** sends the header (in its own repo), and repeat views
are served without waking it.
2. **Far boxes.**
- - **Built:** page fills, leases, push and catch-up, the message rules,
- and the randomized simulation (§12).
+ - **Built:** the edges-file flag and first renewal, page fills,
+ leases, push and catch-up, the message rules, and the simulation
+ extended to far boxes (§12).
- **Rollout:** armed on dev far boxes.
- **Check:** a reader through a far box gets hits, and a clear lands
there within L.
@@ -620,14 +715,21 @@ Each slice changes something Paul can see (stopping rule 6).
## 12. How we know it works
- **A randomized simulation** of homes, far boxes, clears, renders,
- fills, renewals and pushes. It runs with lost, delayed, duplicated
- and reordered pushes, renders that straddle clears, box restarts,
- moves, switch and predicate flips, and clock skew between boxes. It
- checks:
- - **I1:** nothing covered by a clear is served after t + L;
- - **I2:** nothing stored from a request that carried a cookie or an
- `Authorization` header is ever served, by either cache, for an
- instance with the switch on;
+ fills, renewals and pushes, built on the real page index (§6.1), not
+ a model of it. It runs with:
+ - lost, delayed, duplicated and reordered pushes;
+ - renders and fills that straddle clears, with Publish delayed after
+ the file is written;
+ - box restarts and moves;
+ - switch and predicate flips, and the opt-in mark appearing mid-run;
+ - clock skew between boxes.
+
+ It checks:
+ - **I1:** no request arriving after t + L gets a page the clear
+ covers;
+ - **I2:** for an opted-in instance, nothing stored from a request that
+ carried a cookie or an `Authorization` header is ever served, by
+ either cache, including LRU entries stored before the mark;
- **I3:** a hit is never served under a different account, app,
instance or host than the home stored it for, nor for a host the
predicate refuses at the last renewal.
@@ -647,6 +749,9 @@ Each slice changes something Paul can see (stopping rule 6).
- a page without the marker still goes to the LRU with the 5-minute
ceiling;
- a marked response never enters the LRU;
+ - an opted-in instance's host never reaches the LRU lookup;
+ - a page-store write that bypasses the index's Publish is caught;
+ - a path under a declared asset prefix is never page-cached;
- the marker and the internal headers never reach a visitor;
- a far box with an expired lease forwards;
- an HA route is never page-cached.
@@ -692,8 +797,11 @@ These are mine, not Paul's. They are listed so they can be checked.
requests create entries (§4.1, §5.1).
- **Responses:** 200 only; `Vary` only `Accept-Encoding`; an 8 MiB body
cap (§5.2).
-- **LRU:** a marked response never enters it. For opted-in instances,
- it also skips cookie and `Authorization` requests (§5.3).
+- **The opt-in mark:** written by the home on the first marked response,
+ so opting in needs nothing beyond the header (§6.2).
+- **Cold far boxes:** they learn which hosts to try from a flag in the
+ edges file, and the first request goes as a plain backhaul (§7.1).
+- **Asset paths:** declared asset prefixes win over the marker (§5.2).
- **Storage:** pages share the asset store and each app's share (§5.5).
- **Leases:** L = 5 s, measured from send, is what guarantees the bound;
the push only makes the usual case fast. The far box fails closed
@@ -739,3 +847,22 @@ were accepted:
- **Q1 (HA while sleeping):** settled by refusing HA routes in v1.
- **Q2 (cookie list scope):** settled as per entry, with no learning.
- **Q3 (switch scope):** settled as per instance throughout.
+
+**Round 2** (Astra, `CODEX-FINDINGS-PAGE-CACHE-R2.md`, rev 2 at
+5421a0f0). NOT READY.
+- **Resolved:** R1-2, R1-4, R1-5 and R1-6.
+- **Partly resolved:** R1-1, the far-box publication fence, came back as
+ R2-1. R1-3, LRU entries stored before the switch, came back as R2-2.
+
+Both families recurred two rounds running, which triggers stopping rule
+2. Paul chose, 2026-11-08:
+
+| Finding | Fault family | Paul's choice and resolution |
+|---|---|---|
+| **R2-1 (P1)** | I1, a clear must fence pending publications | "One rule, one place": the page index (§6.1) is the only code that publishes, clears, resets or looks up, on home and far alike, and the simulation drives it directly |
+| **R2-2 (P1)** | I2, no second shared-cache path | "Opted-in skips old cache": an opted-in instance never uses the LRU, checked once at the lookup gate (§5.3, §6.2) |
+| **R2-3 (P2)** | Protocol completeness | The edges-file `pages` flag and the host-scoped first renewal (§7.1) |
+| **R2-4 (P2)** | Cache ownership | Declared asset prefixes win (§5.2) |
+| **R2-5 (P3)** | Implementation accuracy | Corrected: the gzip copy is made at write time (§5.2) |
+
+Round 3 is the last in the budget. A fourth needs Paul's go.
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PAGE-CACHE-R3.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PAGE-CACHE-R3.md
new file mode 100644
index 000000000..1b0664435
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PAGE-CACHE-R3.md
@@ -0,0 +1,116 @@
+# Review brief: edge page cache spec, round 3 of 3
+
+Repo carlos/platform, branch `design-edge-page-cache`, the commit named in
+your prompt.
+Under review: `docs/superpowers/specs/2026-11-08-edge-page-cache-design.md`.
+Authorities (merged on main): `docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md`,
+`docs/superpowers/specs/2026-11-01-stateless-replicas-design.md`, the code
+under `internal/edge/` (cache.go, purge.go, purge_header.go, asset*.go,
+burst_notice.go, mesh.go, homemap.go, forwardha.go), `internal/assetcache/`,
+`internal/host/assetpolicy.go`. Do not review against unmerged branches; if
+this work needs one, say so as a P1 and stop.
+
+You are an independent reviewer and also the person who will plan the
+build from this document without being able to ask its author anything.
+Read the document, then the code it names, and check every claim against
+that code.
+
+## Fixed: do not re-argue
+
+Paul's requirements, recorded in spec §1:
+- an app opts in with a response header and a page stays until the app
+ clears it;
+- clearing one page or all pages, from inside the app or by an agent;
+- no stale content left hanging around;
+- a clear reaches far readers in low seconds.
+
+Also fixed: no new per-box polling of the S3 bucket (S3 request cost
+rulings), and page bytes count as usage (asset cache ruling R2). Report
+only mechanisms that fail to honour these. The calls listed in spec §14
+are the author's, not Paul's, and are open to challenge.
+
+## What to check
+
+1. **Invariant I1 (§8.4).** Can a far box, or the home, serve a page
+ covered by a clear more than L after the home applied it? Try lost,
+ delayed and reordered pushes, renewals racing clears, home restarts,
+ HA holder changes, moves, clock skew, and a fill that races a clear
+ (§6, §7 step 4).
+2. **Personalised pages (I2).** Can a response drawn for a signed-in or
+ cookie-carrying request be stored or served to someone else? Check
+ the ignore-list learning on far boxes (§7 step 5), HEAD, and the
+ interaction with today's LRU, which doesn't check request cookies.
+3. **Tenancy (I3).** Can an entry be served under the wrong account, app
+ or host? Check the fill acknowledgement, the lease's host set, and the
+ home-map checks against how `farAssetCatch` and `AssetsFor` work
+ today.
+4. **Trust.** Are the new push, lease and fill messages bounded and
+ unforgeable at least to the standard of asset fills and burst notices?
+ Can any of them be replayed for a wrong effect?
+5. **Fit with the code.** Is the claimed position of the page-store
+ lookup (after the plan throttle, before the rate limit and activator)
+ right, and does the far branch have a place to look up before
+ backhaul? Does anything in §2 misstate the code?
+6. **Builder check.** As the planner: list the questions you would still
+ need answered before planning well, where a wrong guess would matter.
+ Rank them. Skip anything §15 leaves to the builder or that you could
+ reasonably decide yourself.
+
+## Round 3
+
+Earlier rounds: `CODEX-FINDINGS-PAGE-CACHE-R1.md` (round 1, rev 1) and
+`CODEX-FINDINGS-PAGE-CACHE-R2.md` (round 2, rev 2). The round number
+counts every earlier review of this design or change, under any file
+name or reviewer. This is the last round in the budget.
+
+First give one line per P1 and P2 from round 2: resolved, partly, or
+not. Spec §16 says how the author resolved each. Carry every unresolved
+or partly resolved finding forward at its current severity, then add new
+findings. The verdict covers everything outstanding, earlier rounds
+included.
+
+Stopping rule 2 fired after round 2. Paul chose the fixes (spec §16).
+These are fixed; do not re-argue them, and report only a mechanism that
+fails to deliver them:
+- R2-1: one page index per box is the only code that publishes, clears,
+ resets or looks up (§6.1);
+- R2-2: an opted-in instance never uses the LRU, checked at the lookup
+ gate (§5.3, §6.2).
+
+Refusing region HA routes in v1 is the author's cut for R1-2, and round
+2 accepted it.
+
+## 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;
+- the invariant or trust boundary it breaks. That is its fault family.
+
+Then the builder questions (item 6), as a separate ranked list. 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.