carlos / platform Public

docs: page cache copy deck, approved

Paul approved EPC-1..17 unchanged on 2026-11-09.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 84b21622bdb891cc6ff1c5e4750612284672b7dd parent 953cdb6
2 files changed, +213 −0
  • docs/superpowers/plans/2026-11-08-edge-page-cache-copy-approved.json +161 −0
  • docs/superpowers/plans/2026-11-08-edge-page-cache-copy.md +52 −0

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>a3db2713c91dc5e8a</task-id> <tool-use-id>toolu_011shzZHmKB6zDDpKZjTtLvC</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/d79ef2b4-4291-4945-bd45-b3f16796c4ba/tasks/a3db2713c91dc5e8a.output</output-file> <status>completed</status> <summary>Agent "Census inventories for the branch" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: done. All four census tests pass. No production code changed and nothing was pushed. Commits: 953cdb61 `census: inventory the edge page cache slice 1`, on top of c3cae0e3. Tests: in internal/provision, TestPlan9B8RecordWriteCensus, TestPlan14RootReadCensus and TestCensusScopeIsTheRootBinary pass, and `-run Census` is ok. In internal/registry, TestRouteWriterInventoryIsComplete and TestEveryRouteWriterRefusesAForwardRow pass. In internal/host, TestGroupNameClassCensus passes. Only the group-name test is in internal/host; the brief put all four there. Census card: 21 body, 5 sites, 8 reads, 29 new, 1 other (the registry schema), 7 envelopes re-pinned. All 29 new units are page-cache code and run in the agent as user carlos, not as root. The report lists what each reads and what each of the 8 reads units now reads. The card is at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/edge-page-cache-1/docs/superpowers/notes/census-proposal-edge-page-cache-1.md`. Concerns: nothing wrong on the root side; no root read of a path a tenant can write was added. For the reviewer: 1. The "all" purge target (control socket and Carlos-Purge) now reaches every host of the same instance, not just one host. It never crosses instances, but it widens the old one-host guarantee. 2. DeclaresPrefix can trigger new bucket reads of build manifests from the request path. The queue is capped at 64, a failed read is retried after a minute, and each build is read once. 3. Nothing writes `Record.Pages` yet. Report: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/edge-page-cache-1/.superpowers/sdd/2026-11-08-edge-page-cache-plan-1-home/census-report.md`</result> <usage><subagent_tokens>218265</subagent_tokens><tool_uses>73</tool_uses><duration_ms>717196</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bo9bc5to2</task-id> <tool-use-id>toolu_018nCsfNhFJsRzBFUFhzoPqm</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/d79ef2b4-4291-4945-bd45-b3f16796c4ba/tasks/bo9bc5to2.output</output-file> <status>completed</status> <summary>Background command "Run Astra census review" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b00o0iprz</task-id> <tool-use-id>toolu_01XxozupYgcteeZfvW1Cu9MQ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/d79ef2b4-4291-4945-bd45-b3f16796c4ba/tasks/b00o0iprz.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the census commit" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 68.9 g CO₂e (2,846,505 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on edge-page-cache-1, 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/plans/2026-11-08-edge-page-cache-copy-approved.json b/docs/superpowers/plans/2026-11-08-edge-page-cache-copy-approved.json
new file mode 100644
index 000000000..8028c5bdb
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-08-edge-page-cache-copy-approved.json
@@ -0,0 +1,161 @@
+{
+ "action": "approve",
+ "guidance": null,
+ "strings": [
+ {
+ "id": "EPC-1",
+ "text": "pages must be on or off.",
+ "original": "pages must be on or off.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-2",
+ "text": "usage: carlos instances set-pages --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <host> on|off",
+ "original": "usage: carlos instances set-pages --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <host> on|off",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-3",
+ "text": "<host> will keep copies of the pages its app marks for caching. servers pick this up within a minute.",
+ "original": "<host> will keep copies of the pages its app marks for caching. servers pick this up within a minute.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-4",
+ "text": "<host> will keep no copies of its pages, so every request reaches the app. servers pick this up within a minute.",
+ "original": "<host> will keep no copies of its pages, so every request reaches the app. servers pick this up within a minute.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-5",
+ "text": "this console predates `carlos instances set-pages` (deploy a console built from current main)",
+ "original": "this console predates `carlos instances set-pages` (deploy a console built from current main)",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-6",
+ "text": "carlos instances set-pages --app <a> <host> on|off",
+ "original": "carlos instances set-pages --app <a> <host> on|off",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-7",
+ "text": "set-upstreams | set-channel | set-assets | set-pages — set-channel is",
+ "original": "set-upstreams | set-channel | set-assets | set-pages — set-channel is",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-8",
+ "text": "Caching pages at the edge",
+ "original": "Caching pages at the edge",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-9",
+ "text": "Your app can ask the edge to keep a copy of a page and serve it without waking the app. Send `Carlos-Page-Cache: on` with the page, and a `Cache-Control` that says how long the copy may last, for example `public, s-maxage=31536000, max-age=0`. The edge keeps the copy until it expires, until your app clears it, or until the instance gets a new release or new config.",
+ "original": "Your app can ask the edge to keep a copy of a page and serve it without waking the app. Send `Carlos-Page-Cache: on` with the page, and a `Cache-Control` that says how long the copy may last, for example `public, s-maxage=31536000, max-age=0`. The edge keeps the copy until it expires, until your app clears it, or until the instance gets a new release or new config.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-10",
+ "text": "Use a long `s-maxage` and `max-age=0`. The edge can clear its own copy but not the one in a visitor's browser, so `max-age=0` makes the browser check with the edge each time, and the edge answers from its copy. If a page changes at a set time, such as a post scheduled for 9:00, make `s-maxage` end then, because nothing else will tell the edge.",
+ "original": "Use a long `s-maxage` and `max-age=0`. The edge can clear its own copy but not the one in a visitor's browser, so `max-age=0` makes the browser check with the edge each time, and the edge answers from its copy. If a page changes at a set time, such as a post scheduled for 9:00, make `s-maxage` end then, because nothing else will tell the edge.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-11",
+ "text": "Copies are kept only for visitors who send no cookies and no `Authorization` header, and served only to visitors in the same position, so a signed-in page is never shared. If a cookie doesn't change the page, such as a consent cookie, name it: `Carlos-Page-Cache: on; ignore-cookies=\"consent\"`. A visitor carrying only that cookie still gets the copy.",
+ "original": "Copies are kept only for visitors who send no cookies and no `Authorization` header, and served only to visitors in the same position, so a signed-in page is never shared. If a cookie doesn't change the page, such as a consent cookie, name it: `Carlos-Page-Cache: on; ignore-cookies=\"consent\"`. A visitor carrying only that cookie still gets the copy.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-12",
+ "text": "A page is kept only when your app answers with status 200, no `Set-Cookie`, no `Vary` other than `Accept-Encoding`, an uncompressed body of at most 8 MiB, and a path outside your release's asset folders. Instances that run as `carlos-app@` systemd units are not cached yet.",
+ "original": "A page is kept only when your app answers with status 200, no `Set-Cookie`, no `Vary` other than `Accept-Encoding`, an uncompressed body of at most 8 MiB, and a path outside your release's asset folders. Instances that run as `carlos-app@` systemd units are not cached yet.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-13",
+ "text": "Clear copies with the `Carlos-Purge` header or `CARLOS_CONTROL_SOCKET`, as you would for the response cache. `*` clears one host, a path clears that path with any query, `/path?query` clears one address, and `all` clears every host of the instance, including its aliases and custom domains. Each response says what happened in a `Carlos-Cache` header, in the same words as for asset files.",
+ "original": "Clear copies with the `Carlos-Purge` header or `CARLOS_CONTROL_SOCKET`, as you would for the response cache. `*` clears one host, a path clears that path with any query, `/path?query` clears one address, and `all` clears every host of the instance, including its aliases and custom domains. Each response says what happened in a `Carlos-Cache` header, in the same words as for asset files.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-14",
+ "text": "Once a page has been marked, the instance's other responses are no longer kept in the five-minute response cache, so mark every page you want cached.",
+ "original": "Once a page has been marked, the instance's other responses are no longer kept in the five-minute response cache, so mark every page you want cached.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-15",
+ "text": "carlos instances set-pages",
+ "original": "carlos instances set-pages",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-16",
+ "text": "Turns page caching on or off for one instance. `off` throws away the pages it keeps, and every request reaches the app, which helps while you are debugging or if a page was cached that shouldn't have been. `on` goes back to keeping the pages the app marks. Instances start with it on.",
+ "original": "Turns page caching on or off for one instance. `off` throws away the pages it keeps, and every request reaches the app, which helps while you are debugging or if a page was cached that shouldn't have been. `on` goes back to keeping the pages the app marks. Instances start with it on.",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ },
+ {
+ "id": "EPC-17",
+ "text": "`header` when the edge honours a `Carlos-Purge` response header, including `all` for every host of the instance",
+ "original": "`header` when the edge honours a `Carlos-Purge` response header, including `all` for every host of the instance",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": false
+ }
+ ],
+ "review": "mcg5iaya3zxusb36xzhbwg3sw4",
+ "generation": 1
+}
\ No newline at end of file
diff --git a/docs/superpowers/plans/2026-11-08-edge-page-cache-copy.md b/docs/superpowers/plans/2026-11-08-edge-page-cache-copy.md
new file mode 100644
index 000000000..1262c311b
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-08-edge-page-cache-copy.md
@@ -0,0 +1,52 @@
+# Edge page cache slice 1: copy record
+
+Every user-facing string plan 1 of the edge page cache writes (spec `2026-11-08-edge-page-cache-design.md` §4 and §10). Paul approved all 17 rows unchanged on 2026-11-09 in copy review `mcg5iaya3zxusb36xzhbwg3sw4` (`2026-11-08-edge-page-cache-copy-approved.json`). The gate is `approved_page_cache_copy_test.go` at the repo root, in the asset copy record's format: one table per heading, columns id, file, text, status.
+
+The rules are the asset copy record's (`2026-10-24-edge-asset-cache-copy.md`): a row's Go text is one literal or one `fmt.Sprintf`/`fmt.Errorf`/`errors.New` format, with a verb where the row has `<host>`; docs rows are one line per paragraph in `docs/site/cli.md`; the task that writes a row adds its id to `pageCacheCopyBuilt` in the same commit. EPC-7 keeps the em dash that is already in today's help text (Paul left it).
+
+## Console
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-1 | internal/console/apipages.go | pages must be on or off. | approved |
+
+## CLI: carlos instances set-pages
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-2 | instances_pages.go | usage: carlos instances set-pages --app <a> [--account <a>] [--account-id <id>] [--console <origin>] <host> on\|off | approved |
+| EPC-3 | instances_pages.go | <host> will keep copies of the pages its app marks for caching. servers pick this up within a minute. | approved |
+| EPC-4 | instances_pages.go | <host> will keep no copies of its pages, so every request reaches the app. servers pick this up within a minute. | approved |
+| EPC-5 | apimode.go | this console predates `carlos instances set-pages` (deploy a console built from current main) | approved |
+
+## CLI help
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-6 | instances_cli.go | carlos instances set-pages --app <a> <host> on\|off | approved |
+| EPC-7 | main.go | set-upstreams \| set-channel \| set-assets \| set-pages — set-channel is | approved |
+
+## Docs: Caching pages at the edge
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-8 | docs/site/cli.md | Caching pages at the edge | approved |
+| EPC-9 | docs/site/cli.md | Your app can ask the edge to keep a copy of a page and serve it without waking the app. Send `Carlos-Page-Cache: on` with the page, and a `Cache-Control` that says how long the copy may last, for example `public, s-maxage=31536000, max-age=0`. The edge keeps the copy until it expires, until your app clears it, or until the instance gets a new release or new config. | approved |
+| EPC-10 | docs/site/cli.md | Use a long `s-maxage` and `max-age=0`. The edge can clear its own copy but not the one in a visitor's browser, so `max-age=0` makes the browser check with the edge each time, and the edge answers from its copy. If a page changes at a set time, such as a post scheduled for 9:00, make `s-maxage` end then, because nothing else will tell the edge. | approved |
+| EPC-11 | docs/site/cli.md | Copies are kept only for visitors who send no cookies and no `Authorization` header, and served only to visitors in the same position, so a signed-in page is never shared. If a cookie doesn't change the page, such as a consent cookie, name it: `Carlos-Page-Cache: on; ignore-cookies="consent"`. A visitor carrying only that cookie still gets the copy. | approved |
+| EPC-12 | docs/site/cli.md | A page is kept only when your app answers with status 200, no `Set-Cookie`, no `Vary` other than `Accept-Encoding`, an uncompressed body of at most 8 MiB, and a path outside your release's asset folders. Instances that run as `carlos-app@` systemd units are not cached yet. | approved |
+| EPC-13 | docs/site/cli.md | Clear copies with the `Carlos-Purge` header or `CARLOS_CONTROL_SOCKET`, as you would for the response cache. `*` clears one host, a path clears that path with any query, `/path?query` clears one address, and `all` clears every host of the instance, including its aliases and custom domains. Each response says what happened in a `Carlos-Cache` header, in the same words as for asset files. | approved |
+| EPC-14 | docs/site/cli.md | Once a page has been marked, the instance's other responses are no longer kept in the five-minute response cache, so mark every page you want cached. | approved |
+
+## Docs: CLI reference
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-15 | docs/site/cli.md | carlos instances set-pages | approved |
+| EPC-16 | docs/site/cli.md | Turns page caching on or off for one instance. `off` throws away the pages it keeps, and every request reaches the app, which helps while you are debugging or if a page was cached that shouldn't have been. `on` goes back to keeping the pages the app marks. Instances start with it on. | approved |
+
+## Docs: environment table
+
+| id | file | text | status |
+|---|---|---|---|
+| EPC-17 | docs/site/cli.md | `header` when the edge honours a `Carlos-Purge` response header, including `all` for every host of the instance | approved |