carlos / platform Public

docs: asset cache EAC-23/24 under ship --assets; §5.5 miss note; provider boundary test (asset cache plan 3 Task 10)

docs/site/cli.md carries Paul's approved EAC-23 (asset folders are fetched
without cookies) and EAC-24 (what is kept, and what Carlos-Cache says),
added to the copy record and gate. The spec's §5.5 records the controller
ruling that a streamed miss means a fill was attempted, not that it was
stored. TestAssetCodeImportsNoAWSSDK pins spec §9 for internal/assetcache's
deps and the edge's asset*.go imports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 62a4d321f1b4b62079c7202114ad8be3ac7467d1 parent 7cf5525
5 files changed, +115 −13
  • approved_asset_cache_copy_test.go +11 −11
  • docs/site/cli.md +4 −0
  • docs/superpowers/plans/2026-10-24-edge-asset-cache-copy.md +11 −2
  • docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md +4 −0
  • internal/edge/asset_boundary_test.go +85 −0
diff --git a/approved_asset_cache_copy_test.go b/approved_asset_cache_copy_test.go
index e4b003551..640f55a5e 100644
--- a/approved_asset_cache_copy_test.go
+++ b/approved_asset_cache_copy_test.go
@@ -27,16 +27,16 @@ const assetCacheCopyRecordPath = "docs/superpowers/plans/2026-10-24-edge-asset-c
var assetCacheCopyIDPattern = regexp.MustCompile(`^EAC-[0-9]+$`)
-// assetCacheCopyIDs is the record's inventory, pinned: EAC-1 to EAC-22,
-// EAC-25 (the status list cut short, added in task 10's review) and EAC-26
-// (the status table's unknown, plan 3 Task 12). Plan 3 Task 10 adds EAC-23
-// and EAC-24 (its two docs rows).
+// assetCacheCopyIDs is the record's inventory, pinned: EAC-1 to EAC-26.
+// EAC-23 and EAC-24 are plan 3 Task 10's two docs rows, EAC-25 the status
+// list cut short (added in plan 1 task 10's review) and EAC-26 the status
+// table's unknown (plan 3 Task 12).
var assetCacheCopyIDs = func() []string {
- ids := make([]string, 0, 24)
- for i := 1; i <= 22; i++ {
+ ids := make([]string, 0, 26)
+ for i := 1; i <= 26; i++ {
ids = append(ids, "EAC-"+strconv.Itoa(i))
}
- return append(ids, "EAC-25", "EAC-26")
+ return ids
}()
// assetCachePlan3ApprovalPath is Paul's plan 3 copy review (2026-10-25): the
@@ -60,6 +60,7 @@ var assetCacheCopyBuilt = []string{
"EAC-16", "EAC-17", "EAC-18", "EAC-19",
"EAC-25",
"EAC-26",
+ "EAC-23", "EAC-24",
}
// assetCacheBuiltRows turns built entries into the rows to check: one per
@@ -135,9 +136,8 @@ func TestAssetCacheCopyBuiltRowsAreApprovedAndPresent(t *testing.T) {
// plan 3 review that the record already carries has the approved text,
// verbatim, so the revised EAC-16 cannot drift back to the plan 1 wording
// (and, through TestAssetCacheCopyBuiltRowsAreApprovedAndPresent, neither
-// can docs/site/cli.md). An approved id the record does not carry yet
-// (EAC-23 and EAC-24 until Task 10) is not checked here; the inventory pins
-// when it arrives.
+// can docs/site/cli.md). An approved id the record does not carry is not
+// checked here; the inventory pins when it arrives.
func TestAssetCacheCopyRecordsThePlan3Approval(t *testing.T) {
raw, err := os.ReadFile(assetCachePlan3ApprovalPath)
if err != nil {
@@ -160,7 +160,7 @@ func TestAssetCacheCopyRecordsThePlan3Approval(t *testing.T) {
for _, r := range mustParseAssetCacheCopyRecord(t) {
byID[r.ID] = strings.ReplaceAll(r.Text, `\n`, "\n")
}
- for _, id := range []string{"EAC-16", "EAC-26"} {
+ for _, id := range []string{"EAC-16", "EAC-23", "EAC-24", "EAC-26"} {
if _, ok := byID[id]; !ok {
t.Errorf("the record has no %s row", id)
}
diff --git a/docs/site/cli.md b/docs/site/cli.md
index ec156a6cb..5529ec991 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -226,6 +226,10 @@ so write it for the person doing a rollback at 2am.
`--assets` names a folder your build writes its files to, for example `/assets/`. Repeat it for up to 8 folders. Each must start and end with `/`, be at most 128 bytes, and contain none of `%`, `?`, `#`, `*` or `..`. `/` alone is refused, because it would keep copies of every page. No folder may sit inside another. A static site cannot use it, because a static site is already served from every region. The folders belong to the release, so a rollback to an older build uses the folders that build declared.
+Files under an asset folder are fetched without the visitor's cookies or login, so put only public files there. Anything that needs to know who is asking belongs outside those folders.
+
+Servers keep a copy only when your app answers with status 200, a `Cache-Control` that allows it (for example `public, max-age=31536000, immutable`), a `Content-Type` that is not HTML, and no `Set-Cookie`. Each response says what happened in a `Carlos-Cache` header: `hit` came from a saved copy, `miss` was fetched from your app and saved, and `bypass` was fetched from your app and not saved.
+
### carlos promote
Points a channel at a version you have already shipped.
diff --git a/docs/superpowers/plans/2026-10-24-edge-asset-cache-copy.md b/docs/superpowers/plans/2026-10-24-edge-asset-cache-copy.md
index b43ca7c6f..dd5b4c8f5 100644
--- a/docs/superpowers/plans/2026-10-24-edge-asset-cache-copy.md
+++ b/docs/superpowers/plans/2026-10-24-edge-asset-cache-copy.md
@@ -28,8 +28,10 @@ The rules:
`\n\n`. In `docs/site/cli.md` each paragraph of a row is one line.
- No em dashes. A full stop and a new sentence instead, continuing in lower
case. Docs prose keeps the CLI page's sentence case.
-- Ids are not renumbered. EAC-23 and EAC-24 are plan 3's docs rows and stay
- free here.
+- Ids are not renumbered. EAC-23 and EAC-24 are plan 3's docs rows, added
+ by plan 3 Task 10 under `carlos ship --assets` in `docs/site/cli.md`.
+ Paul approved both on 2026-10-25
+ (`2026-10-24-edge-asset-cache-copy-approved-plan3.json`).
- Plan 3 Task 12 (discussion #396) added EAC-26, the status table's word
for published columns the console could not read, and revised EAC-16 to
say status lists the folders the home server is publishing. Paul
@@ -93,3 +95,10 @@ none a prefix of another.
| EAC-17 | docs/site/cli.md | Turns asset copying on or off for one instance. `off` means requests for its asset files always reach the app, which helps while you are debugging. `on` goes back to following the folders its release declares. An instance follows its release until you set it. | approved |
| EAC-18 | docs/site/cli.md | `--assets` names a folder your build writes its files to, for example `/assets/`. Repeat it for up to 8 folders. Each must start and end with `/`, be at most 128 bytes, and contain none of `%`, `?`, `#`, `*` or `..`. `/` alone is refused, because it would keep copies of every page. No folder may sit inside another. A static site cannot use it, because a static site is already served from every region. The folders belong to the release, so a rollback to an older build uses the folders that build declared. | approved |
| EAC-19 | docs/site/cli.md | `carlos deploy` takes the same repeatable `--assets` flag and passes it to the ship. Save the list as `"assets": ["/assets/"]` in `.carlos/config` and a bare `carlos deploy` declares it on every release. A flag on the command line replaces the saved list for that run, and `--no-assets` ships with none. A release that declares no folders gets no copies, so deploying a build without them turns copying off for that build. `--assets` and `--no-assets` cannot be given together. | approved |
+
+## Docs (plan 3, task 10)
+
+| id | file | text | status |
+|---|---|---|---|
+| EAC-23 | docs/site/cli.md | Files under an asset folder are fetched without the visitor's cookies or login, so put only public files there. Anything that needs to know who is asking belongs outside those folders. | approved |
+| EAC-24 | docs/site/cli.md | Servers keep a copy only when your app answers with status 200, a `Cache-Control` that allows it (for example `public, max-age=31536000, immutable`), a `Content-Type` that is not HTML, and no `Set-Cookie`. Each response says what happened in a `Carlos-Cache` header: `hit` came from a saved copy, `miss` was fetched from your app and saved, and `bypass` was fetched from your app and not saved. | approved |
diff --git a/docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md b/docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md
index 2744949e5..996eb8c14 100644
--- a/docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md
+++ b/docs/superpowers/specs/2026-10-24-edge-asset-cache-design.md
@@ -582,6 +582,10 @@ sha256, identical on every edge.
no `X-Carlos-Version`: an entry can outlive many deploys, so a version on
it would be a false "verified" for the deploy watch (`edge.go:813-847`
explains the header's freshness contract).
+ A streamed response says `Carlos-Cache: miss` once an admitted fill is
+ attempted. A later trailer veto or size abandonment cannot change a
+ header already sent, so `miss` means fetched with a fill attempted, not
+ necessarily stored **(controller ruling, plan 3 Task 9)**.
- `Age` on hits: the lifetime minus the time left to the entry's expiry.
An entry past its lifetime is not revalidated in v1; it is dropped and
diff --git a/internal/edge/asset_boundary_test.go b/internal/edge/asset_boundary_test.go
new file mode 100644
index 000000000..5f4d01c46
--- /dev/null
+++ b/internal/edge/asset_boundary_test.go
@@ -0,0 +1,85 @@
+package edge
+
+import (
+ "bytes"
+ "go/parser"
+ "go/token"
+ "os/exec"
+ "path/filepath"
+ "sort"
+ "strconv"
+ "strings"
+ "testing"
+)
+
+// TestAssetCodeImportsNoAWSSDK is the asset cache's provider boundary (spec
+// §9): the store and the edge's asset code import no AWS SDK package. It
+// checks two things:
+//
+// - every package internal/assetcache reaches (go list -deps, by its full
+// import path, since the test runs in this package's directory) is
+// outside github.com/aws/;
+// - the imports of this directory's asset*.go files (not _test.go), parsed
+// with go/parser, are outside github.com/aws/ too.
+//
+// It does not check internal/edge as a whole, which imports the AWS SDK for
+// its Route 53 adapter (route53dns.go). The no-AWS-configuration run is
+// Task 9's e2e (asset_e2e_test.go).
+func TestAssetCodeImportsNoAWSSDK(t *testing.T) {
+ const awsPrefix = "github.com/aws/"
+ const store = "github.com/carlosframework/platform/internal/assetcache"
+
+ cmd := exec.Command("go", "list", "-deps", store)
+ var stderr bytes.Buffer
+ cmd.Stderr = &stderr
+ out, err := cmd.Output()
+ if err != nil {
+ t.Fatalf("go list -deps %s: %v: %s", store, err, stderr.String())
+ }
+ deps := strings.Fields(string(out))
+ sawStore := false
+ for _, p := range deps {
+ if p == store {
+ sawStore = true
+ }
+ if strings.HasPrefix(p, awsPrefix) {
+ t.Errorf("%s depends on %s", store, p)
+ }
+ }
+ if !sawStore {
+ t.Fatalf("go list -deps %s did not list the package itself; got %q", store, deps)
+ }
+
+ files, err := filepath.Glob("asset*.go")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var parsed []string
+ fset := token.NewFileSet()
+ for _, f := range files {
+ if strings.HasSuffix(f, "_test.go") {
+ continue
+ }
+ af, err := parser.ParseFile(fset, f, nil, parser.ImportsOnly)
+ if err != nil {
+ t.Fatalf("parse %s: %v", f, err)
+ }
+ parsed = append(parsed, f)
+ for _, imp := range af.Imports {
+ path, err := strconv.Unquote(imp.Path.Value)
+ if err != nil {
+ t.Fatalf("%s: import %s: %v", f, imp.Path.Value, err)
+ }
+ if strings.HasPrefix(path, awsPrefix) {
+ t.Errorf("%s imports %s", f, path)
+ }
+ }
+ }
+ // Not vacuous: the five files the plan names are among those checked.
+ sort.Strings(parsed)
+ for _, want := range []string{"assetadmit.go", "assetarm.go", "assetcatch.go", "assetfill.go", "assetserve.go"} {
+ if i := sort.SearchStrings(parsed, want); i == len(parsed) || parsed[i] != want {
+ t.Errorf("%s was not checked; checked %q", want, parsed)
+ }
+ }
+}