wrangler.jsonc
This file
Path
apps/platform/wrangler.jsonc
356 lines · 12.9 KiB
Last changed by
Merge infra/drop-demo into mainoscabrielbefore adoptionc49b6bf
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–9why, one step back1{2 // The platform Worker: the contracts over RPC at /rpc and MCP at /mcp, git3 // smart HTTP for every project's repos, the Project Durable Object and the4 // Answer and OnPush Workflows. Deploy only through infra/deploy.ts, to an5 // explicit stage.6 //7 // The top level is stage `local`: it builds and types the Worker and is8 // never deployed. Each stage under `env` repeats every binding, since9 // wrangler does not inherit bindings into an environment. Resource namesDrop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
line 10why, one step back10 // are jobs plus the stage, never the brand. A `database_id` orMerge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 11–23why, one step back11 // KV `id` of zeros is a placeholder that infra/bootstrap.ts replaces with12 // the id of the resource it made.13 "$schema": "node_modules/wrangler/config-schema.json",14 "name": "platform",15 "main": "src/worker.ts",16 "compatibility_date": "2026-10-05",17 // isomorphic-git needs `Buffer` (the /isogit Lander). The OAuth provider18 // resolves a Client ID Metadata Document (the CLI's, served at /oauth/cli,19 // and an MCP client's) only with `global_fetch_strictly_public`, which20 // sends the fetch through the public internet (SSRF protection).21 "compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],22 // Rat Stack's byte limits are for a minified bundle (scripts/startup-budget.ts).23 "minify": true,Give checks the env as 611's job carries it, open values for landed runs, and parse env schemas in the Workeroscabrielbefore adoption234865c
line 24why, one step back24 // esbuild's name-keeping wraps every function and class in a helper callDrop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
lines 25–26why, one step back25 // that restores its name after minifying: about 130 KB of the entry.26 // Nothing here reads a name at run time: Effect's tagged errorsGive checks the env as 611's job carries it, open values for landed runs, and parse env schemas in the Workeroscabrielbefore adoption234865c
lines 27–28why, one step back27 // set `name` from their tag, services are keyed by strings, and the28 // runtime finds Durable Objects, Workflows and entrypoints by export name,Merge observability into mainoscabrielbefore adoption1985111
lines 29–33why, one step back29 // which minifying keeps. A stack trace shows minified names and positions.30 // The uploaded source maps take an uncaught exception's stack back to the31 // source, but a defect the platform reports itself is logged as thrown:32 // the same commit's `wrangler deploy --dry-run --outdir` gives the map to33 // read it by (README, Observability).Give checks the env as 611's job carries it, open values for landed runs, and parse env schemas in the Workeroscabrielbefore adoption234865c
line 34why, one step back34 "keep_names": false,Merge observability into mainoscabrielbefore adoption1985111
line 35why, one step back35 "upload_source_maps": true,Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 36–37why, one step back36 "workers_dev": true,37 "preview_urls": false,Merge observability into mainoscabrielbefore adoption1985111
lines 38–57why, one step back38 // Every invocation's logs and trace, unsampled, and Issues, which groups39 // what failed. The runtime's own spans record each Durable Object SQL40 // statement's bound values and each fetch's full URL, so these traces hold41 // the Project DO's layer names and repos and sealed values (never a plain42 // one). The maintainer keeps them in the account's trace store alone: no43 // `destinations`, and no Issues automation sends the platform's anywhere44 // (principle 7).45 // Unlike bindings, wrangler gives `observability` and `upload_source_maps`46 // to every stage that does not set its own47 // (packages/config/test/observability.test.ts holds each stage to them).48 "observability": {49 "enabled": true,50 "logs": {51 "enabled": true,52 "head_sampling_rate": 1,53 "invocation_logs": true,54 },55 "traces": { "enabled": true, "head_sampling_rate": 1 },56 "issues": { "enabled": true },57 },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 58–62why, one step back58 "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Project"] }],59 "vars": {60 // Until sign-in exists, one operator holds a session.61 "OPERATOR_HANDLE": "oscabriel",62 "STAGE": "local",Drop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
line 63why, one step back63 // "container" (apps/sandbox) or "isogit" (in this Worker).Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 64why, one step back64 "LANDER_ADAPTER": "container",Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
lines 65–68why, one step back65 // The Workers AI model that drafts asks; swap it here, no code change.66 "DRAFT_MODEL": "@cf/moonshotai/kimi-k2.7-code",67 // The web app, which `/` links to: `vite dev`'s URL locally.68 "PUBLIC_WEB_URL": "http://localhost:5173",Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 69–73why, one step back69 },70 "secrets": {71 // Declared in .env.schema; the user sets the values. SESSION_TOKENS is72 // optional; sign-in's cookie key and pepper are not, since accounts are73 // the platform's own and need no third party. MASTER_KEY wraps everyDrop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
line 74why, one step back74 // write-only env value: without it none can be stored or opened.Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 75–89why, one step back75 "required": [76 "OPERATOR_TOKEN",77 "COOKIE_KEY",78 "PASSWORD_PEPPER",79 "MASTER_KEY",80 ],81 },82 "durable_objects": {83 "bindings": [{ "name": "PROJECT", "class_name": "Project" }],84 },85 "workflows": [86 { "name": "answer-local", "binding": "ANSWER", "class_name": "Answer" },87 { "name": "on-push-local", "binding": "ON_PUSH", "class_name": "OnPush" },88 ],89 // The public namespace, and the private one that holds every project'sDrop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
line 90why, one step back90 // layer repos. Only this Worker binds the private one: the WorkersMerge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 91–107why, one step back91 // that serve public pages bind neither (principle 7).92 "artifacts": [93 { "binding": "ARTIFACTS", "namespace": "projects-local" },94 { "binding": "ARTIFACTS_PRIVATE", "namespace": "layers-local" },95 ],96 "d1_databases": [97 {98 "binding": "FRONT_PAGE",99 "database_name": "front-page-local",100 "database_id": "00000000-0000-0000-0000-000000000000",101 "migrations_dir": "migrations",102 },103 ],104 // KV namespace `oauth-local`.105 "kv_namespaces": [106 { "binding": "OAUTH_KV", "id": "00000000000000000000000000000000" },107 ],Name the ask an opening opened, say why a policy has not evaluated, and give code history a durable storeoscabrielbefore adoption51f046c
lines 108–109why, one step back108 // Lane logs, the CLI's releases the platform serves, and code history109 // (why and a path's log), kept by immutable ids across isolates.Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 110–112why, one step back110 "r2_buckets": [111 { "binding": "EVIDENCE", "bucket_name": "evidence-local" },112 { "binding": "RELEASES", "bucket_name": "releases-local" },Name the ask an opening opened, say why a policy has not evaluated, and give code history a durable storeoscabrielbefore adoption51f046c
line 113why, one step back113 { "binding": "CODE_CACHE", "bucket_name": "code-cache-local" },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 114why, one step back114 ],Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c
lines 115–117why, one step back115 // Sign-in's mail (Cloudflare Email Service). `wrangler dev` only logs116 // each mail, code included, so no real mail leaves a local run.117 "send_email": [{ "name": "EMAIL" }],Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 118why, one step back118 "worker_loaders": [{ "binding": "LOADER" }],Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
lines 119–120why, one step back119 // Workers AI, for the drafter (no key: the account's own).120 "ai": { "binding": "AI" },Merge observability into mainoscabrielbefore adoption1985111
lines 121–127why, one step back121 // Domain metrics (landings, refusals, lanes, waits, drafts) in Workers122 // Analytics Engine, one dataset per stage so no stage's counts mix with123 // another's. A dataset is made by its first write, so bootstrap makes none;124 // its name takes `_`, since SQL reads it as a table.125 "analytics_engine_datasets": [126 { "binding": "METRICS", "dataset": "metrics_local" },127 ],Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 128–141why, one step back128 "services": [{ "binding": "SANDBOX", "service": "sandbox" }],129 // Namespace ids differ per stage, so one stage's counts never spend130 // another's.131 "ratelimits": [132 {133 "name": "CLAIM_LIMIT",134 "namespace_id": "1001",135 "simple": { "limit": 10, "period": 60 },136 },137 {138 "name": "PROPOSAL_LIMIT",139 "namespace_id": "1002",140 "simple": { "limit": 5, "period": 60 },141 },Drop the private build plan's citations from the code, and fail verify if one comes backoscabrielbefore adoptiona29cef6
line 142why, one step back142 // Sign-in attempts per handle and per client address: theMerge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 143–148why, one step back143 // sixth in a minute is refused before the password is checked.144 {145 "name": "SIGN_IN_LIMIT",146 "namespace_id": "1003",147 "simple": { "limit": 5, "period": 60 },148 },Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
lines 149–154why, one step back149 // Drafts per person: each one is a model call and Checker runs.150 {151 "name": "DRAFT_LIMIT",152 "namespace_id": "1004",153 "simple": { "limit": 2, "period": 60 },154 },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 155–170why, one step back155 ],156 "triggers": {157 "events": [158 {159 "type": "cf.artifacts.repo.pushed",160 "filter": { "namespace": "projects-local" },161 "targets": [{ "type": "workflow", "workflow_name": "on-push-local" }],162 },163 ],164 },165 "env": {166 "dev-oscabriel": {167 "vars": {168 "OPERATOR_HANDLE": "oscabriel",169 "STAGE": "dev-oscabriel",170 "LANDER_ADAPTER": "container",Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
lines 171–172why, one step back171 "DRAFT_MODEL": "@cf/moonshotai/kimi-k2.7-code",172 "PUBLIC_WEB_URL": "https://web-dev-oscabriel.oscargabriel.workers.dev",Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 173–215why, one step back173 },174 "secrets": {175 "required": [176 "OPERATOR_TOKEN",177 "COOKIE_KEY",178 "PASSWORD_PEPPER",179 "MASTER_KEY",180 ],181 },182 "durable_objects": {183 "bindings": [{ "name": "PROJECT", "class_name": "Project" }],184 },185 "workflows": [186 {187 "name": "answer-dev-oscabriel",188 "binding": "ANSWER",189 "class_name": "Answer",190 },191 {192 "name": "on-push-dev-oscabriel",193 "binding": "ON_PUSH",194 "class_name": "OnPush",195 },196 ],197 "artifacts": [198 { "binding": "ARTIFACTS", "namespace": "projects-dev-oscabriel" },199 { "binding": "ARTIFACTS_PRIVATE", "namespace": "layers-dev-oscabriel" },200 ],201 "d1_databases": [202 {203 "binding": "FRONT_PAGE",204 "database_name": "front-page-dev-oscabriel",205 "database_id": "49c4ccfe-c491-49f1-9985-8296db748c4b",206 "migrations_dir": "migrations",207 },208 ],209 // KV namespace `oauth-dev-oscabriel`.210 "kv_namespaces": [211 { "binding": "OAUTH_KV", "id": "ddf5c48366af4ed7b93f183e7ceb3e9a" },212 ],213 "r2_buckets": [214 { "binding": "EVIDENCE", "bucket_name": "evidence-dev-oscabriel" },215 { "binding": "RELEASES", "bucket_name": "releases-dev-oscabriel" },Name the ask an opening opened, say why a policy has not evaluated, and give code history a durable storeoscabrielbefore adoption51f046c
line 216why, one step back216 { "binding": "CODE_CACHE", "bucket_name": "code-cache-dev-oscabriel" },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 217why, one step back217 ],Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c
line 218why, one step back218 "send_email": [{ "name": "EMAIL" }],Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 219why, one step back219 "worker_loaders": [{ "binding": "LOADER" }],Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
line 220why, one step back220 "ai": { "binding": "AI" },Merge observability into mainoscabrielbefore adoption1985111
lines 221–223why, one step back221 "analytics_engine_datasets": [222 { "binding": "METRICS", "dataset": "metrics_dev_oscabriel" },223 ],Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 224–242why, one step back224 "services": [225 { "binding": "SANDBOX", "service": "sandbox-dev-oscabriel" },226 ],227 "ratelimits": [228 {229 "name": "CLAIM_LIMIT",230 "namespace_id": "1101",231 "simple": { "limit": 10, "period": 60 },232 },233 {234 "name": "PROPOSAL_LIMIT",235 "namespace_id": "1102",236 "simple": { "limit": 5, "period": 60 },237 },238 {239 "name": "SIGN_IN_LIMIT",240 "namespace_id": "1103",241 "simple": { "limit": 5, "period": 60 },242 },Add the code-browser, policy and drafting contracts, peeled tags and commit times on the port, and the AI bindingoscabrielbefore adoptionfc4691d
lines 243–247why, one step back243 {244 "name": "DRAFT_LIMIT",245 "namespace_id": "1104",246 "simple": { "limit": 2, "period": 60 },247 },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 248–260why, one step back248 ],249 "triggers": {250 "events": [251 {252 "type": "cf.artifacts.repo.pushed",253 "filter": { "namespace": "projects-dev-oscabriel" },254 "targets": [255 { "type": "workflow", "workflow_name": "on-push-dev-oscabriel" },256 ],257 },258 ],259 },260 },Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062
lines 261–300why, one step back261 // Served on the brand's own domain, never workers.dev: infra/deploy.ts262 // passes its Custom Domain and PUBLIC_WEB_URL, which name the brand, so263 // they live in infra/stages.ts. The URL here is a stand-in the deploy's264 // --var replaces. Bootstrap writes the D1 and KV ids.265 "prod": {266 "workers_dev": false,267 "vars": {268 "OPERATOR_HANDLE": "oscabriel",269 "STAGE": "prod",270 "LANDER_ADAPTER": "container",271 "DRAFT_MODEL": "@cf/moonshotai/kimi-k2.7-code",272 "PUBLIC_WEB_URL": "https://from-infra-deploy.invalid",273 },274 "secrets": {275 "required": [276 "OPERATOR_TOKEN",277 "COOKIE_KEY",278 "PASSWORD_PEPPER",279 "MASTER_KEY",280 ],281 },282 "durable_objects": {283 "bindings": [{ "name": "PROJECT", "class_name": "Project" }],284 },285 "workflows": [286 { "name": "answer-prod", "binding": "ANSWER", "class_name": "Answer" },287 {288 "name": "on-push-prod",289 "binding": "ON_PUSH",290 "class_name": "OnPush",291 },292 ],293 "artifacts": [294 { "binding": "ARTIFACTS", "namespace": "projects-prod" },295 { "binding": "ARTIFACTS_PRIVATE", "namespace": "layers-prod" },296 ],297 "d1_databases": [298 {299 "binding": "FRONT_PAGE",300 "database_name": "front-page-prod",Record prod's D1 and KV ids, as bootstrap wrote themoscabrielbefore adoption1ece295
line 301why, one step back301 "database_id": "ebcdcb90-acd6-4fa5-ad04-eb2fc5484978",Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062
lines 302–306why, one step back302 "migrations_dir": "migrations",303 },304 ],305 // KV namespace `oauth-prod`.306 "kv_namespaces": [Record prod's D1 and KV ids, as bootstrap wrote themoscabrielbefore adoption1ece295
line 307why, one step back307 { "binding": "OAUTH_KV", "id": "bcdfcea12a6e4986a0a760e7cc9c7981" },Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062
lines 308–313why, one step back308 ],309 "r2_buckets": [310 { "binding": "EVIDENCE", "bucket_name": "evidence-prod" },311 { "binding": "RELEASES", "bucket_name": "releases-prod" },312 { "binding": "CODE_CACHE", "bucket_name": "code-cache-prod" },313 ],Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c
line 314why, one step back314 "send_email": [{ "name": "EMAIL" }],Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062
lines 315–316why, one step back315 "worker_loaders": [{ "binding": "LOADER" }],316 "ai": { "binding": "AI" },Merge observability into mainoscabrielbefore adoption1985111
lines 317–319why, one step back317 "analytics_engine_datasets": [318 { "binding": "METRICS", "dataset": "metrics_prod" },319 ],Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062
lines 320–354why, one step back320 "services": [{ "binding": "SANDBOX", "service": "sandbox-prod" }],321 "ratelimits": [322 {323 "name": "CLAIM_LIMIT",324 "namespace_id": "1301",325 "simple": { "limit": 10, "period": 60 },326 },327 {328 "name": "PROPOSAL_LIMIT",329 "namespace_id": "1302",330 "simple": { "limit": 5, "period": 60 },331 },332 {333 "name": "SIGN_IN_LIMIT",334 "namespace_id": "1303",335 "simple": { "limit": 5, "period": 60 },336 },337 {338 "name": "DRAFT_LIMIT",339 "namespace_id": "1304",340 "simple": { "limit": 2, "period": 60 },341 },342 ],343 "triggers": {344 "events": [345 {346 "type": "cf.artifacts.repo.pushed",347 "filter": { "namespace": "projects-prod" },348 "targets": [349 { "type": "workflow", "workflow_name": "on-push-prod" },350 ],351 },352 ],353 },354 },Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 355–356why, one step back355 },356}