Define the Minimal Application and the Paid Feature Boundary
The product is a trail-conditions board, not a platform demo. Two volunteers publish a report with one photo; anyone can read reports and images without an account. That yields exactly one write path, one read path and one binary path — the smallest shape that still exercises a versioned Worker, a relational store and object storage.
Name the six deliverables before naming a resource. A capstone is graded on what exists after the work, not on the order of commands. Every later section produces one row of this contract.
| ID | Deliverable | Accepted form |
|---|---|---|
| D1 | Two platform roots | Dev and prod both apply, second plan empty |
| D2 | Bundle record | Commit, lockfile digest, bundle digest, Wrangler version |
| D3 | Release record | Version ID, deployment ID, previous version ID, tag |
| D4 | Traffic policy | Rule list plus negative test results |
| D5 | Log evidence | One request line naming the version that answered |
| D6 | Recovery and teardown | Drift trace, restore bookmark, cleanup ledger |
The core is Worker, R2 and D1, and nothing else. The static shell ships as Worker assets, so there is no second hosting product to own. D1 holds report metadata and moderation state; R2 holds the photo, private, reachable only through the Worker.
AI, queues, KV and Access are extensions with a price and a decision. The boundary matters more than the exclusion: each row states what would reopen it, so the next engineer inherits a rule instead of a preference.
| Capability | Decision | Why the core does not need it | What reopens it |
|---|---|---|---|
| Worker and assets | Core | One origin for shell and API | Never |
| R2 | Core | One photo per report | More than one object per report |
| D1 | Core | Metadata, state, idempotency key | Write volume beyond one database |
| Queues | Deferred | The write is synchronous and small | Email digest or retry beyond the request |
| KV | Rejected | Edge cache already serves the read path | Cross-colo read model with its own TTL |
| Workers AI | Excluded | No inference in the product | Photo moderation requirement |
| Access | Excluded | Staff token is enough for two users | More than five staff, or SSO required |
| Logpush | Narrow | One dataset, short retention | Compliance retention beyond the dashboard |
A boundary that is absent from configuration is only a suggestion. No binding, no resource, no token scope, no variable. The token is the real enforcement: a capability the pipeline cannot call cannot appear in a demo by accident.
Five routes, one health endpoint, everything else a 404. The public surface is deliberately smaller than the API, because every extra route is another cache and authorization case to prove.
| Route | Auth | Touches | Cacheable |
|---|---|---|---|
GET / | None | Assets | Yes |
GET /api/reports | None | D1 read | Yes, short |
GET /api/reports/:id | None | D1 read | Yes, short |
GET /media/:id | None | R2 get | Yes, long |
POST /api/reports | Staff token | R2 put, D1 insert | Never |
GET /health | None | Version metadata | Never |
Cost has three meters and one trap. Requests and CPU, D1 rows read and written plus storage, R2 storage and operations. The trap is idle data: a destroyed Worker still bills the photos and rows it left behind.
The paid feature boundary is a spending boundary too. Usage-based products do not stop when traffic stops. A budget alert, a small seeded data set, and a teardown step in the acceptance review are the minimum controls; without them the capstone's cheapest month is the one after cleanup.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
C["Visitor"] --> H{"Hostname"}
H -->|"app hostname"| W["Worker version
one bundle, one owner"]
H -->|"workers.dev or preview"| DENY["No policy surface
disabled in configuration"]
W --> R{"Route and method"}
R -->|"GET list or detail"| DB[("D1
reports and state")]
R -->|"GET media"| OBJ[("R2
photos, private")]
R -->|"POST report"| AUTH{"Staff token valid?"}
AUTH -->|"no"| NO["401 and no write"]
AUTH -->|"yes"| DB
AUTH -->|"yes"| OBJ
R -->|"anything else"| NF["404"]
EXT["Queue, KV, AI, Access
not bound, not scoped"] -.->|"needs a binding
and a new review"| W
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class C,H,W primary;
class DB,OBJ secondary;
class R,AUTH ok;
class DENY,NO,NF danger;
class EXT warn;
Read the diagram as a spend map. Every solid arrow that ends at a store is a metered resource you chose. Every dotted arrow is a product you would have to add, bind and fund, which is why it is drawn outside the boundary rather than greyed inside it.
Design Dev and Production Resource and State Boundaries
Two accounts, not two workspaces. Workspaces share one credential and one blast radius, so a mistyped target in dev can still reach a production address. Separate accounts give separate tokens, separate zones, separate state buckets, and a dev teardown that cannot touch prod DNS.
One root module, two value sets. Account, zone, hostname, name prefix and capacity live in per-environment variables. The resource graph itself stays identical, because a graph with environment conditionals is a graph only one environment ever plans.
Names are account-global where it matters. D1 databases, Workers and queues are unique per account, so the prefix is tr-dev- or tr-prod- rather than a suffix. A copied value file then fails loudly instead of adopting the neighbour's database.
| Boundary | Dev | Prod | Failure when shared |
|---|---|---|---|
| Account | Dev account | Prod account | Dev token edits prod |
| Zone | Dev zone | Prod zone | A cache test changes prod |
| State key | platform/dev | platform/prod | Plan reads the other environment |
| State bucket | Dev bucket | Prod bucket | Dev credential reads prod state |
| Token | Dev scoped | Prod scoped | One leak compromises both |
| Worker name | tr-dev-board | tr-prod-board | Deploy claims the wrong script |
| Hostname | Dev hostname | Prod hostname | Certificate and DNS collision |
A backend is qualified by evidence, not by documentation. For this series that means the R2 S3-compatible backend with lockfile locking enabled, a second writer refused with a lock error, the lock object gone after the run, and one restore into a scratch key. If your team has not produced those three results, use a backend with native locking for the capstone; the requirement is proof, not vendor loyalty.
State is per root and never read across accounts. A cross-account state read turns a promotion into a hidden dependency. What crosses the boundary is the artifact and its digest, not the state that produced it.
Two guards catch the expensive mistake. A precondition on a small guard resource asserts that the environment variable matches the state key, and the CI job asserts that the account in the plan owns the token. A wrong-account apply fails before the first write, which is the only failure mode worth engineering for.
Bootstrap stays its own root with local state. It creates the bucket and its policy, applies once, then moves its own state under a dedicated prefix. The workload root must never own the bucket its state lives in.
Dev data is seeded, never copied. A seed script creates three reports and one small image, which keeps the environment disposable and removes any chance that a dev apply is mistaken for a restore rehearsal. Production copies never travel downwards; the schema travels upwards as a migration file.
The lock is not the isolation. A lock serialises writers to one state object; it says nothing about two roots editing one account. Isolation comes from account and token separation, and the lock only protects the record.
The promotion flow has three failure branches, and two of them are cheap to prevent. A missing review stops at the credential, a guard mismatch stops before the first write, and a multi-intent plan stops at the shape check. Only the third needs a human to read a diff.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
DEV["Dev account
plan, apply, test"] --> ART["Bundle digest
written into the release record"]
ART --> GATE{"Reviewed by
someone other than the author?"}
GATE -->|"no"| NOCRED["No prod credential
pipeline cannot apply"]
GATE -->|"yes"| PLAN["Prod plan
same root, prod values"]
PLAN --> CK{"Guard agrees:
environment, account, state key?"}
CK -->|"no"| ABORT["Abort before the first write"]
CK -->|"yes"| SHAPE{"Plan shape still
single intent?"}
SHAPE -->|"no"| COUPLE["Stop: two object families moved
coupling survived review"]
SHAPE -->|"yes"| APPLY["Apply
version and deployment"]
APPLY --> LIVE["Custom hostname serves
the recorded version"]
LIVE --> VERIFY{"Health version equals
deployment record?"}
VERIFY -->|"no"| DRIFT["Treat as traffic drift
contain, do not rebuild"]
VERIFY -->|"yes"| DONE["Environment accepted"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class DEV,PLAN,APPLY primary;
class ART,LIVE secondary;
class GATE,SHAPE,VERIFY ok;
class NOCRED,ABORT,COUPLE,DRIFT danger;
class CK warn;
class DONE ok;
Build One Bundle and Wire Exact Versioned Bindings
One bundle means one module entry, and that is a design choice. The bundler resolves imports into a single ESM file, so the version's module list holds exactly one element and the entry module names it. Static files travel separately in the assets directory, which keeps code and content on different clocks.
The build prints identity before Terraform sees it. The commit, the lockfile digest, the bundle digest, the Wrangler version and the Node version go into one record. Terraform reports the asset manifest hash after upload, but it does not hand you a whole-artifact digest, so the build must compute one.
The tag is the join between CI and Terraform. Version annotations cap the tag at 100 bytes, so the practical value is a short commit plus a digest prefix. A tag that overflows is truncated, and the join silently points at the wrong release.
Leave the self-deploy flag unset. A version that deploys itself at creation is the coupling this capstone exists to remove. Create the version with no traffic, then move a deployment that already knows which version it is pointing at.
| Binding | Type | Exact source | Proof after deploy | Wrong value symptom |
|---|---|---|---|---|
DB | d1 | Database uuid | Seeded report returns one row | Queries hit a foreign schema |
MEDIA | r2_bucket | Bucket name | Object head returns a size | 404, or an object in the wrong bucket |
CF_VERSION_METADATA | version_metadata | Platform-provided | Health reports a version ID | Health cannot prove the release |
STAFF_TOKEN | secret_text | CI secret at plan time | 401 without it, 201 with it | Auth bypass or permanent lockout |
Computed handoffs and literal handoffs fail differently. The database UUID and bucket name come from resources in the same state, so a change appears in the plan. A class name or queue name would be a literal that Terraform cannot verify, which is one reason this capstone keeps Durable Objects out of the core.
Compatibility is part of the artifact, not boilerplate. One compatibility date and one flag list, recorded beside the digest. Changing either is a release even when the bytes are identical, because the runtime behavior changed.
Do not bind a capability you did not provision. A queue producer with no queue fails at apply; a queue created by the deploy tool is an unowned resource. Reviewers compare the binding list against the boundary table, which is why the table exists in section one.
One writer per field, enforced by credential as well as by convention. The build job has no Cloudflare token, so the worst it can do is produce a file.
| Field | Writer | Never |
|---|---|---|
| Worker identity, version, deployment | Terraform | wrangler deploy |
| Bundle bytes | Build job | Terraform, which only uploads |
| Schema and ledger | Migration job | A provisioner inside Terraform |
| Token value | CI secret store | Repository or value file |
| Cache rule | Terraform | Dashboard edit |
Promote Application and Data Changes Through Reviewed Gates
Four gates answer four different questions. Is this the reviewed bytes, is this change single-intent, can both code versions share the schema, and does the live hostname behave? A gate that answers two questions hides the one that failed.
| Gate | Question | Passing evidence | Blocks when |
|---|---|---|---|
| Artifact | Same bytes as review | Digest and tag in the record | A rebuild happens after plan |
| Plan | One intent only | Plan shape matches the change type | Two object families move |
| Schema | Both versions can run | Ledger row plus a nullable change | Destructive DDL comes first |
| Traffic | Behavior matches policy | Acceptance matrix plus log line | Version mismatch or a private response cached |
Order is schema, then code, then contract. Add the nullable column, deploy code that writes both shapes, backfill, and drop the old column in a later release. Dropping first collapses the rollback window to zero, and a rollback then becomes a data incident.
A migration is a job with four artifacts. A numbered file, a checksum, a ledger row and a bookmark. Running SQL from a Terraform provisioner hides all four inside an apply, which is why the migration job is not a Terraform resource in this design.
Bookmark before the change, export beyond the window. Time Travel is the fast restore, not an archive. Write the bookmark into the release record before the migration starts, and keep an export for the changes you cannot re-derive from a seed.
Promotion states are explicit, so nobody argues about what "deployed" means. A version is a candidate, then verified, then live, then retired. A rollback is a new deployment to an existing version, not a reversal of state.
| Transition | Approver | Attached evidence | Undone by |
|---|---|---|---|
| Candidate to verified | Build owner | Digest and plan shape | Deleting the version address |
| Verified to live | Platform owner, not the author | Dev evidence and schema gate | Deploying the previous version |
| Live to retired | Release owner | Rollback window elapsed | Re-deploying the retired version |
Data changes get a second reviewer. The person who can approve a Worker release is not automatically qualified to approve a destructive migration. Separating the approval is the whole gate; without it, the second signature is decoration.
The pull request is the gate's interface. One change per pull request: a version bump, a migration file, or a traffic rule. A request that carries a schema change and a code change together cannot be reviewed as either, and splitting it later is cheaper than explaining it during an incident.
A plan is not evidence until it is saved. Attach the plan text and the shape assertion, not a screenshot of a success message. A saved plan binds to a backend and a state serial, so the durable record is the plan output plus the serial it was created against.
The pipeline orders what Terraform cannot. Terraform can put the database before the Worker; it cannot place SQL between them. The release therefore runs database, migration, apply, deployment, verification, with one commit identifier written into every record.
Freeze the artifact between plan and apply. A rebuild inside that window uploads bytes the reviewer never saw. Treat the rebuild as a failed release rather than a retry, because the reviewed digest is the only thing the approval actually covered.
Every gate writes into one record. Commit, digest, version ID, deployment ID, bookmark and ledger tail. When two of those disagree, the release is suspect before the first request reaches it.
Prove Traffic Policy, Logs and Service Behavior
Traffic policy is three decisions, not a settings page. Which hostname answers, what may be cached, and what a denial looks like. Each one needs a request that proves it, because none of them is visible in a successful deploy message.
One hostname, and it is the custom domain. The workers.dev route and preview URLs are off, so there is no second surface with different firewall and cache behavior. A version URL may exist for a reviewer, and it is not part of the policy.
Cache only the public read paths, and keep the key honest. The rule matches path and query only, so a hostname change on the same zone cannot silently stop the rule from matching.
| Path | Cached | Key | Why it is safe |
|---|---|---|---|
/api/reports | Yes | Path and query | No per-user data |
/api/reports/:id | Yes | Path | Public state only |
/media/:id | Yes, long | Path | Key contains a content hash |
/health | No | Not applicable | Must report the live version |
POST /api/reports | No | Not applicable | Correctness before speed |
| Any authenticated response | No | Not applicable | Never stored at the edge |
Immutability is what makes the long TTL truthful. The photo key includes a content hash, so replacing an image writes a new key. If a key can change content, the cache TTL is a promise the system cannot keep.
Denial is a response, not an absence. A write without the token is a 401 with no row and no object; an unknown path is a 404; a draft read is a 404 rather than a 403, so the API does not confirm that the identifier exists.
The evidence matrix is the acceptance test, and it checks side effects. A status code alone cannot distinguish a rejected write from a write that happened and then failed to report.
| Case | Request | Expected | Side effect |
|---|---|---|---|
| Public list | Anonymous GET | 200 | None |
| Cache repeat | Same GET twice | Second is a hit | None |
| Unauthorized write | POST, no token | 401 | Row count unchanged |
| Authorized write | POST, token, new key | 201 | One row, one object |
| Duplicate write | Same idempotency key | 200 | Still one row |
| Draft media | GET a draft key | 404 | No bytes returned |
| Release identity | GET health | Version matches record | None |
Logs prove which version answered; the status code does not. Enable invocation logs with persistence, sample fully in dev and deliberately in prod, and record the rate beside the evidence. The health endpoint and the log line must name the same version.
A cache hit has no invocation, so silence is not failure. The log test must use a miss or an explicit bypass. Otherwise a correct cache policy looks like a broken observability pipeline.
A cache policy can pass every functional test and still leak. The private-response test is the one that matters: authenticate, read a draft, then read the same URL anonymously and confirm the second response is not a hit.
The verification flow ends in a record, not a dashboard glance. Each case produces a status, a version and a cache outcome, and the release is accepted only when every row matches.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
REQ["Request on the custom hostname"] --> ELIG{"Cache eligible
by path and method?"}
ELIG -->|"miss"| WK["Worker version executes"]
ELIG -->|"hit"| HIT["Served at the edge
no invocation log"]
WK --> AUTH{"Authorized path?"}
AUTH -->|"no"| DENY["401 or 404
no storage call"]
AUTH -->|"yes"| STORE[("D1 read, or R2 put
then D1 insert")]
STORE --> RESP["Response with explicit cache headers"]
RESP --> REC["Record: status, version, cache outcome, timestamp"]
HIT --> REC
DENY --> REC
REC --> CMP{"Every acceptance row matches?"}
CMP -->|"yes"| PASS["Release accepted
evidence attached"]
CMP -->|"no"| BLOCK["Release blocked
version stays unverified"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class REQ,WK,REC primary;
class ELIG,STORE,RESP secondary;
class AUTH,HIT ok;
class DENY,BLOCK danger;
class CMP,PASS warn;
Submit Recovery and Owned-Cleanup Evidence
Pick one failure and make it boring. The recommended drift is a deployment made outside Terraform, because traffic moves, the plan stays empty, and everything looks healthy. It is cheap to reproduce and it tests detection rather than courage.
Detection is a version comparison, not a plan review. The health endpoint reports the version ID, the release record holds the deployment's version ID, and a mismatch is the alarm. An empty plan is the symptom; the two IDs are the proof.
Containment is a deployment, not a rebuild. Re-point the deployment at the reviewed version. A rebuild changes the artifact and converts a traffic incident into an unreviewed release, which is how a small drift becomes the incident report.
Recovery evidence is timestamps and identifiers. Detected at, contained at, version IDs on both sides, deployment ID and approver. A narrative without those values cannot be audited, and it will be rewritten from memory next time.
| Failure | Detection | Containment | Does not fix |
|---|---|---|---|
| Traffic drift | Health version differs from record | Deploy the reviewed version | Data written by the drifted version |
| Bad migration | Ledger tail and a failing query | Restore the bookmark or fix forward | Code that assumes the newer schema |
| Stale cache | Read returns old content | Purge the exact path | Anything outside the cached path |
| Leaked token | 401 spike or audit trail | Rotate the secret, cut a version | Objects already written |
Cleanup order follows deletion asymmetry. The custom domain goes first because its certificate survives the resource; the Worker goes last among the compute objects because deleting it removes the script and any namespaces it owns; data goes after the code that reads it.
| Step | Object | Destroys | Check afterwards |
|---|---|---|---|
| 1 | Custom domain | Hostname routing, not the certificate | Certificate still listed |
| 2 | Cache rule | The policy | Path no longer cached |
| 3 | Deployment and version addresses | State entries only | Versions still listed by API |
| 4 | Worker | Script and owned namespaces | Name no longer resolves |
| 5 | D1 database | Rows and migration ledger | Database absent |
| 6 | R2 objects and bucket | Photos | Bucket absent |
| 7 | State object and bucket | The record itself | A snapshot exists outside it |
Owned cleanup means every object has a disposition. Destroyed, transferred, or retained with an owner and a date. An object described as probably fine is an unowned resource with extra words.
The cost boundary closes here, not at the first destroy. Traffic at zero still bills storage, so acceptance is incomplete until the storage meters are zero or the retained set is listed with a reason and an owner.
A reviewer should be able to re-run the evidence without you. That is the real test of the capstone: the record names the version, the request, the expected result and the time, so a second engineer can reproduce the check and get the same answer.
Cloudflare platform acceptance review
Execution status: design-only. Written against Terraform 1.17.1 and cloudflare/cloudflare 5.28.1, checked on 6 November 2026. Nothing here was applied to a live account to produce this article, so every expected result is documented behavior, not a measurement. Identifiers are written as tokens rather than real values.
Prerequisites. Two disposable accounts, one zone per account, an API token per account scoped to Workers Scripts, D1, R2 and the zone cache rule, a built bundle, and a migration directory with one file. Use the smallest plan that supports the products, and never point the restore step at data you intend to keep.
Deliverables to submit. The D1 to D6 table from section one, plus the acceptance table below filled with your own values.
| Check | Passing result | Failing result means |
|---|---|---|
| Second plan in each account | Empty | Configuration or provider drift |
| Version tag | Matches digest prefix | Tag truncated or rebuilt after plan |
| Plan shape | One object family per change | Ownership overlap survived |
| Public read twice | Second is a hit | Cache rule does not match |
| Write without token | 401, row count unchanged | Auth is not before storage |
| Write with token | 201, one row and one object | Write order or idempotency is wrong |
| Duplicate write | Still one row | Idempotency key is missing |
| Private read | 404, no bytes | Draft state is not enforced |
| Health | Version equals deployment | Traffic moved outside Terraform |
| Teardown ledger | Every object destroyed or retained with an owner | Cleanup is incomplete |
- Confirm the boundary. Read the binding list and the token scope together. Any capability in one and not the other is an unfinished review, not a future extension.
- Apply dev, then apply again. The second plan must be empty. A non-empty second plan is the cheapest possible failure to find.
- Record the build. Commit, lockfile digest, bundle digest, compatibility date, flag list and Wrangler version in one line. This is the artifact record the tag must match.
- Create the version without traffic. Confirm the version number and ID exist and the old deployment still serves. If traffic moved, the self-deploy flag is still set somewhere.
- Promote by deployment only. The promotion plan should replace the deployment and nothing else. A version replacement here means the split is not real.
- Run the acceptance matrix on the custom hostname. Status, version, cache outcome and side effect for each row. Do the private-read test last, because it is the one that invalidates the rest.
- Break traffic on purpose. Move the deployment outside Terraform, then compare health with the release record. Record detection time before you fix anything.
- Contain, then verify. Re-deploy the reviewed version, confirm the two IDs, and write the containment time into the record. Do not rebuild during this step.
- Recover the data path once. Take a bookmark, apply the migration, restore the bookmark on purpose, and record which query failed. That failure is the evidence that a restore is not a rollback.
- Tear down in order, writing dispositions. Custom domain, cache rule, deployment addresses, Worker, database, bucket, then state. Confirm each object in the dashboard rather than trusting the destroy output.
Expected observation. Every plan after the first is empty until you change something, the promotion plan contains one deployment, the acceptance matrix passes on the custom hostname, and the teardown ledger has no row without a disposition.
Failure checks. The capstone fails if a promotion plan replaces a version, if the observed version differs from the record, if an unauthenticated write changes a row count, if a draft read returns bytes, or if cleanup is described as done without a per-object check.
Cost note. Keep the seeded set to a handful of reports and one small image, leave the retention policy short, and delete the data before the state. The dominant idle cost is stored objects and rows, not requests.
Evidence to keep. The artifact line, both version IDs, both deployment IDs, the acceptance table, the detection and containment timestamps, the bookmark, and the teardown ledger. Keep the trace, never the token.
The platform is the sum of what you can prove, not what you can deploy. A version ID, a deployment ID, a digest, a bookmark and a ledger are five values that survive a lost terminal session. A capstone that can produce them on demand has demonstrated the property the whole series was building toward: changes are reviewable, traffic is reversible, and data has a recovery route that someone else can follow.