-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
568 lines (553 loc) · 41.9 KB
/
Copy pathwrangler.jsonc
File metadata and controls
568 lines (553 loc) · 41.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
{
// ChittyConnect - itsChitty™
// The AI-intelligent spine with ContextConsciousness & MemoryCloude
//
// Deploy model:
// wrangler dev → local dev (env.dev)
// wrangler deploy --env staging → chittyconnect-staging worker
// wrangler deploy --env production → chittyconnect worker (live routes)
//
// Secret model (canonical — no exceptions):
// chittysecrets → cold / source-of-truth
// wrangler secret put → hot / runtime delivery (scoped per env)
// KV → short-lived rotated values only
// [vars] → non-secret config only
//
// Binding inheritance:
// Wrangler does NOT inherit resource bindings (KV, DO, R2, D1,
// queues, vectorize, AI, tail_consumers) into env blocks.
// Every env block must explicitly declare its bindings.
// Only top-level metadata (name, main, compat, account_id) is shared.
"$schema": "node_modules/wrangler/config-schema.json",
"name": "chittyconnect",
"legacy_env": false,
"main": "src/index.js",
"compatibility_date": "2026-08-07",
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
"account_id": "0bc21e3a5a9de1a4cc843be9c3e98121",
"observability": { "enabled": false },
// ──────────────────────────────────────────────────────────────────
// BARE DEPLOY GUARD (#219)
// wrangler runs build.command before every deploy. We require a
// sentinel env var that scripts/safe-deploy.sh sets — so bare
// `wrangler deploy` invocations (no --env, no wrapper) abort here
// before any binding write happens. Catches: laptop shells with the
// Global API Key, wdeploy-style aliases, agent scripts, stray CI.
// The only sanctioned deploy path is `npm run deploy[:staging]`.
// ──────────────────────────────────────────────────────────────────
"build": {
"command": "[ \"${CHITTYCONNECT_SAFE_DEPLOY:-0}\" = \"1\" ] || { echo '::error::Direct wrangler deploy blocked. Run: npm run deploy (or deploy:staging). See chittyconnect#219.' >&2; exit 1; }",
"cwd": "."
},
// Migrations are global to the DO class, not per-env
"migrations": [
{ "tag": "v3", "new_classes": ["MCPSessionDurableObject"] },
{ "tag": "v4", "renamed_classes": [{"from": "MCPSessionDurableObject", "to": "MCPSessionGraveyard"}], "new_sqlite_classes": ["McpConnectAgent"] },
{ "tag": "v5", "new_sqlite_classes": ["SessionStateActor"] }
],
// ──────────────────────────────────────────────────────────────────
// CLOUDFLARE SECRETS STORE — shared secrets across workers
// Store: default_secrets_store (e914522471964c3c8cf1e601770edcc3)
// Top-level binding — inherited by all environments
// ──────────────────────────────────────────────────────────────────
"secrets_store_secrets": [
// Mercury API tokens (7 orgs)
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE" },
{ "binding": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS" },
{ "binding": "MERCURY_TOKEN_IT_CAN_BE_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_IT_CAN_BE_LLC" },
{ "binding": "MERCURY_TOKEN_CHITTY_SERVICES", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHITTY_SERVICES" },
{ "binding": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING" },
// MCP token
{ "binding": "CH1TTY_MCP_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "ch1tty_mcp_token" },
// CF Access service tokens (client_id + secret for each consumer)
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE" },
// Mercury OIDC (CF Access SaaS app — programmatic token exchange for write operations)
{ "binding": "MERCURY_OIDC_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_ID" },
{ "binding": "MERCURY_OIDC_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_SECRET" },
{ "binding": "MERCURY_OIDC_ISSUER", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_ISSUER" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_ID" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" }
],
// ──────────────────────────────────────────────────────────────────
// ENVIRONMENTS — one worker, three declared environments
// Each env explicitly declares all resource bindings it needs.
// ──────────────────────────────────────────────────────────────────
"env": {
// ════════════════════════════════════════════════════════════════
// DEV — `wrangler dev`
// ════════════════════════════════════════════════════════════════
"dev": {
"vars": {
"ENVIRONMENT": "development",
"MERCURY_EGRESS_PROFILE": "direct",
"MERCURY_EGRESS_URL": "",
"CHITTYID_SERVICE_URL": "https://id.chitty.cc",
"CHITTYAUTH_SERVICE_URL": "https://auth.chitty.cc",
"REGISTRY_SERVICE_URL": "https://registry.chitty.cc",
"CHITTYCHRONICLE_SERVICE_URL": "https://chronicle.chitty.cc",
"CHITTYMINT_URL": "https://mint.chitty.cc",
"CHITTY_MINT_URL": "https://mint.chitty.cc/chittymint/v1/mint-fact",
"DOCUMINT_MINT_URL": "https://documint.chitty.cc/documint/v1/mint",
"CHITTYCONNECT_URL": "http://localhost:8787",
"CHITTYROUTER_URL": "https://router.chitty.cc",
"CHITTY_FALLBACK_URL": "https://fallback.id.chitty.cc",
"CHITTYSERV_URL": "http://chittyserv-dev:8080",
"OLLAMA_URL": "https://ollama.chitty.cc/v1/chat/completions",
"AI_MODEL_PRIMARY": "@cf/meta/llama-4-scout-17b-16e-instruct",
"CHITTYOS_ACCOUNT_ID": "0bc21e3a5a9de1a4cc843be9c3e98121",
"CHITTYOS_DOMAIN": "chitty.cc",
"NEON_ORG_ID": "org-old-mountain-22774840",
"CREDENTIAL_FAILOVER_ENABLED": "true",
"CREDENTIAL_BROKER_TYPE": "cloudflare-secrets",
"CHITTYSERV_URL": "http://chittyserv:8080", // F-021: was dev-only; staging+prod added per SOP-080
"EVIDENCE_LEGACY_MODE": "false",
"NEON_ROLE_NAME": "chittyos_app",
"NEON_DATABASE": "neondb",
"TWILIO_PHONE_NUMBER": "+1XXXXXXXXXX"
},
// Resource bindings — dev
"r2_buckets": [
{ "binding": "FILES", "bucket_name": "chittyos-files" }
],
"kv_namespaces": [
{ "binding": "IDEMP_KV", "id": "9ad1ec9795d243ca94f7502e6efb6a62" },
{ "binding": "TOKEN_KV", "id": "788d2fce231d4819a11b46d5f4678b04" },
{ "binding": "API_KEYS", "id": "cf6da7757caf4da5a8a365be2174f391" },
{ "binding": "OAUTH_KV", "id": "054ff38c93854e7c87b3aa307a7759cc" },
{ "binding": "CREDENTIAL_CACHE", "id": "aa18a59a2eb24fb29cfe08ef62519f4d" },
{ "binding": "RATE_LIMIT", "id": "1ab2c1114f5c4e248b8eba157615a125" },
{ "binding": "TENANT_CONNECTIONS", "id": "a1a42192fca34c7cbec8dd3df3d53d54" }
],
// "ai_search_namespaces": [
// { "binding": "AI_SEARCH", "namespace": "default" }
// ],
"durable_objects": {
"bindings": [
{ "name": "MCP_AGENT", "class_name": "McpConnectAgent" },
{ "name": "SESSION_STATE", "class_name": "SessionStateActor" }
]
},
"d1_databases": [
{ "binding": "DB", "database_name": "chittyconnect", "database_id": "29473911-4c5b-47d8-a3e7-d1be2370edf6" }
],
"queues": {
"producers": [
{ "binding": "EVENT_Q", "queue": "github-events" },
{ "binding": "PROOF_Q", "queue": "documint-proofs" }
],
"consumers": [
{ "queue": "documint-proofs", "max_batch_size": 10, "max_retries": 5, "dead_letter_queue": "documint-proofs-dlq" }
]
},
"ai": { "binding": "AI" },
"services": [
{ "binding": "SVC_TASKS", "service": "chittyagent-tasks", "environment": "production" },
{ "binding": "SVC_LEDGER", "service": "chittyledger", "environment": "production" },
{ "binding": "SVC_FINANCE", "service": "chittyfinance", "environment": "production" },
{ "binding": "SVC_CONCIERGE", "service": "chittyconcierge", "environment": "production" },
{ "binding": "SVC_CONTEXTUAL", "service": "chittycontextual", "environment": "production" },
{ "binding": "SVC_ID", "service": "chittyid", "environment": "production" },
{ "binding": "SVC_EVIDENCE", "service": "chittyagent-evidence", "environment": "production" },
{ "binding": "SVC_CHRONICLE", "service": "chittychronicle", "environment": "production" },
// { "binding": "SVC_DISPUTE", "service": "chittydispute" }, // TODO: uncomment to use service-binding instead of HTTPS fetch to dispute.chitty.cc
{ "binding": "SVC_SCORE", "service": "chittyscore-worker", "environment": "production" },
{ "binding": "SVC_STORAGE", "service": "chittystorage" }
]
},
// ════════════════════════════════════════════════════════════════
// STAGING — `wrangler deploy --env staging`
// ════════════════════════════════════════════════════════════════
"staging": {
// Staging is reachable at https://chittyconnect-staging.chittyos.workers.dev
// No `routes` block — production owns connect.chitty.cc/* (mcp.chitty.cc/*
// is owned by the chittymcp worker). Closes #192.
"workers_dev": true,
// Cloudflare Secrets Store — must be declared per-env (not inherited from top-level)
"secrets_store_secrets": [
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE" },
{ "binding": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS" },
{ "binding": "MERCURY_TOKEN_IT_CAN_BE_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_IT_CAN_BE_LLC" },
{ "binding": "MERCURY_TOKEN_CHITTY_SERVICES", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHITTY_SERVICES" },
{ "binding": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING" },
{ "binding": "CH1TTY_MCP_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "ch1tty_mcp_token" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE" },
{ "binding": "MERCURY_OIDC_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_ID" },
{ "binding": "MERCURY_OIDC_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_SECRET" },
{ "binding": "MERCURY_OIDC_ISSUER", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_ISSUER" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_ID" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" }
],
"vars": {
"ENVIRONMENT": "staging",
"MERCURY_EGRESS_PROFILE": "direct",
"MERCURY_EGRESS_URL": "",
"CHITTYID_SERVICE_URL": "https://id.chitty.cc",
"CHITTYAUTH_SERVICE_URL": "https://auth.chitty.cc",
"REGISTRY_SERVICE_URL": "https://registry.chitty.cc",
"CHITTYCHRONICLE_SERVICE_URL": "https://chronicle.chitty.cc",
"CHITTYMINT_URL": "https://mint.chitty.cc",
"CHITTY_MINT_URL": "https://mint.chitty.cc/chittymint/v1/mint-fact",
"DOCUMINT_MINT_URL": "https://documint.chitty.cc/documint/v1/mint",
"CHITTYCONNECT_URL": "https://chittyconnect-staging.chittyos.workers.dev",
"CHITTYROUTER_URL": "https://router.chitty.cc",
"CHITTY_FALLBACK_URL": "https://fallback.id.chitty.cc",
"OLLAMA_URL": "https://ollama.chitty.cc/v1/chat/completions",
"AI_MODEL_PRIMARY": "@cf/meta/llama-4-scout-17b-16e-instruct",
"CHITTYOS_ACCOUNT_ID": "0bc21e3a5a9de1a4cc843be9c3e98121",
"CHITTYOS_DOMAIN": "chitty.cc",
"NEON_ORG_ID": "org-old-mountain-22774840",
"CREDENTIAL_FAILOVER_ENABLED": "true",
"CREDENTIAL_BROKER_TYPE": "cloudflare-secrets",
"CHITTYSERV_URL": "http://chittyserv:8080", // F-021: was dev-only; staging+prod added per SOP-080
"EVIDENCE_LEGACY_MODE": "false",
"NEON_ROLE_NAME": "chittyos_app",
"NEON_DATABASE": "neondb",
"TWILIO_PHONE_NUMBER": "+1XXXXXXXXXX",
"SECRETS_PORTAL_ACCESS_ONLY": "true",
"SECRETS_PORTAL_ACCESS_EMAILS": "nick@chittycorp.com",
// STAGING HAS NO ACCESS APPLICATION AND NO SERVICE TOKEN OF ITS OWN.
//
// The Access app (d80ff72b-fc89-4fba-a822-886f632bc5df) is scoped to
// connect.chitty.cc/secrets-portal, and env.staging declares no
// `routes`, so nothing fronts staging. Deliberately left EMPTY rather
// than copying production's audience tag and Client ID: sharing them
// would mean one token authenticates to both environments and could not
// be revoked from staging without simultaneously killing the production
// rotation path this change exists to enable.
//
// Empty => the service-token path denies unconditionally (fail closed).
// To enable staging, provision a SEPARATE Access application and a
// SEPARATE service token via the ChittyConnect concierge, then fill in
// that app's own auth domain, audience tag, and Client ID here. Do not
// paste production's values.
"SECRETS_PORTAL_ACCESS_AUTH_DOMAIN": "",
"SECRETS_PORTAL_ACCESS_AUD": "",
"SECRETS_PORTAL_ACCESS_SERVICE_TOKENS": ""
},
"triggers": {
"crons": [
"0 * * * *",
"*/5 * * * *",
"*/50 * * * *"
]
},
// Resource bindings — staging
"r2_buckets": [
{ "binding": "FILES", "bucket_name": "chittyos-files" }
],
"kv_namespaces": [
{ "binding": "IDEMP_KV", "id": "9ad1ec9795d243ca94f7502e6efb6a62" },
{ "binding": "TOKEN_KV", "id": "788d2fce231d4819a11b46d5f4678b04" },
{ "binding": "API_KEYS", "id": "cf6da7757caf4da5a8a365be2174f391" },
{ "binding": "OAUTH_KV", "id": "054ff38c93854e7c87b3aa307a7759cc" },
{ "binding": "CREDENTIAL_CACHE", "id": "aa18a59a2eb24fb29cfe08ef62519f4d" },
{ "binding": "RATE_LIMIT", "id": "1ab2c1114f5c4e248b8eba157615a125" },
{ "binding": "TENANT_CONNECTIONS", "id": "a1a42192fca34c7cbec8dd3df3d53d54" }
],
// "ai_search_namespaces": [
// { "binding": "AI_SEARCH", "namespace": "default" }
// ],
"durable_objects": {
"bindings": [
{ "name": "MCP_AGENT", "class_name": "McpConnectAgent" },
{ "name": "SESSION_STATE", "class_name": "SessionStateActor" }
]
},
"d1_databases": [
{ "binding": "DB", "database_name": "chittyconnect", "database_id": "29473911-4c5b-47d8-a3e7-d1be2370edf6" }
],
"queues": {
"producers": [
{ "binding": "EVENT_Q", "queue": "github-events" },
{ "binding": "PROOF_Q", "queue": "documint-proofs" }
]
// No `consumers` block — `documint-proofs` is consumed by the
// production chittyconnect worker. A Cloudflare queue can have
// only one consumer worker, so staging must not register itself.
// Staging can still produce to the queue for end-to-end testing;
// prod will process the messages. Closes #193.
},
"ai": { "binding": "AI" },
"services": [
{ "binding": "SVC_TASKS", "service": "chittyagent-tasks", "environment": "production" },
{ "binding": "SVC_LEDGER", "service": "chittyledger", "environment": "production" },
{ "binding": "SVC_FINANCE", "service": "chittyfinance", "environment": "production" },
{ "binding": "SVC_CONCIERGE", "service": "chittyconcierge", "environment": "production" },
{ "binding": "SVC_CONTEXTUAL", "service": "chittycontextual", "environment": "production" },
{ "binding": "SVC_ID", "service": "chittyid", "environment": "production" },
{ "binding": "SVC_EVIDENCE", "service": "chittyagent-evidence", "environment": "production" },
{ "binding": "SVC_CHRONICLE", "service": "chittychronicle", "environment": "production" },
// { "binding": "SVC_DISPUTE", "service": "chittydispute" }, // TODO: uncomment to use service-binding instead of HTTPS fetch to dispute.chitty.cc
{ "binding": "SVC_SCORE", "service": "chittyscore-worker", "environment": "production" },
{ "binding": "SVC_STORAGE", "service": "chittystorage" }
]
},
// ════════════════════════════════════════════════════════════════
// PRODUCTION — `wrangler deploy --env production`
// ════════════════════════════════════════════════════════════════
"production": {
// workers.dev URL is enabled so post-deploy CI can probe /health without
// hitting the zone WAF (which 403's GitHub Actions runner IPs). The
// public surface is connect.chitty.cc. mcp.chitty.cc is owned by the
// chittymcp worker (canonical MCP aggregator); chittyconnect must not
// claim that route.
"workers_dev": true,
// Cloudflare Secrets Store — must be declared per-env (not inherited from top-level)
"secrets_store_secrets": [
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_CITY_STUDIO" },
{ "binding": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_ARIBIA_LLC_APT_ARLENE" },
{ "binding": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHICAGO_FURNISHED_CONDOS" },
{ "binding": "MERCURY_TOKEN_IT_CAN_BE_LLC", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_IT_CAN_BE_LLC" },
{ "binding": "MERCURY_TOKEN_CHITTY_SERVICES", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_CHITTY_SERVICES" },
{ "binding": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_TOKEN_JEAN_ARLENE_VENTURING" },
{ "binding": "CH1TTY_MCP_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "ch1tty_mcp_token" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYCOMMAND" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYAGENT" },
{ "binding": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_ID_CHITTYFINANCE" },
{ "binding": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "CF_ACCESS_CLIENT_SECRET_CHITTYFINANCE" },
{ "binding": "MERCURY_OIDC_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_ID" },
{ "binding": "MERCURY_OIDC_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_CLIENT_SECRET" },
{ "binding": "MERCURY_OIDC_ISSUER", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_OIDC_ISSUER" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_ID", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_ID" },
{ "binding": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "MERCURY_EGRESS_ACCESS_CLIENT_SECRET" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "CHITTYAUTH_ISSUED_MINT_TOKEN", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" },
{ "binding": "MINT_API_KEY", "store_id": "e914522471964c3c8cf1e601770edcc3", "secret_name": "chittyauth_issued_mint_api_key" }
],
"routes": [
{ "pattern": "connect.chitty.cc/*", "zone_name": "chitty.cc" }
],
"vars": {
"ENVIRONMENT": "production",
"MERCURY_EGRESS_PROFILE": "direct",
"MERCURY_EGRESS_URL": "",
"CHITTYID_SERVICE_URL": "https://id.chitty.cc",
"CHITTYAUTH_SERVICE_URL": "https://auth.chitty.cc",
"REGISTRY_SERVICE_URL": "https://registry.chitty.cc",
"CHITTYCHRONICLE_SERVICE_URL": "https://chronicle.chitty.cc",
"CHITTYMINT_URL": "https://mint.chitty.cc",
"CHITTY_MINT_URL": "https://mint.chitty.cc/chittymint/v1/mint-fact",
"DOCUMINT_MINT_URL": "https://documint.chitty.cc/documint/v1/mint",
"CHITTYCONNECT_URL": "https://connect.chitty.cc",
"CHITTYROUTER_URL": "https://router.chitty.cc",
"CHITTY_FALLBACK_URL": "https://fallback.id.chitty.cc",
"OLLAMA_URL": "https://ollama.chitty.cc/v1/chat/completions",
"AI_MODEL_PRIMARY": "@cf/meta/llama-4-scout-17b-16e-instruct",
"CHITTYOS_ACCOUNT_ID": "0bc21e3a5a9de1a4cc843be9c3e98121",
"CHITTYOS_DOMAIN": "chitty.cc",
"NEON_ORG_ID": "org-old-mountain-22774840",
"CREDENTIAL_FAILOVER_ENABLED": "true",
"CREDENTIAL_BROKER_TYPE": "cloudflare-secrets",
"CHITTYSERV_URL": "http://chittyserv:8080", // F-021: was dev-only; staging+prod added per SOP-080
"EVIDENCE_LEGACY_MODE": "false",
"NEON_ROLE_NAME": "chittyos_app",
"NEON_DATABASE": "neondb",
"TWILIO_PHONE_NUMBER": "+1XXXXXXXXXX",
"SECRETS_PORTAL_ACCESS_ONLY": "true",
"SECRETS_PORTAL_ACCESS_EMAILS": "nick@chittycorp.com",
// Cloudflare Access application fronting connect.chitty.cc/secrets-portal
// (app d80ff72b-fc89-4fba-a822-886f632bc5df). Scoped to THIS app and
// THIS environment on purpose: a generically-named or cross-environment
// audience var is the drift that produced the chittysecrets defect fixed
// in 7d946b0, and a shared token cannot be revoked per-environment.
"SECRETS_PORTAL_ACCESS_AUTH_DOMAIN": "chittycorp.cloudflareaccess.com",
"SECRETS_PORTAL_ACCESS_AUD": "27d61f1a1143bec18325a5acd65a9d49ac381a450bbb9d610e682bdd3679eaba",
// Access service-token Client IDs (identifiers, NOT credentials) admitted
// on the non-identity write path. Empty/unset => deny, never allow.
// 142a1994... = "ChittyOS MCP Admin Portal".
"SECRETS_PORTAL_ACCESS_SERVICE_TOKENS": "142a1994adbbbf34550eaa1792bcd1b6.access"
},
"triggers": {
"crons": [
"0 * * * *",
"*/5 * * * *",
"*/50 * * * *"
]
},
// Resource bindings — production
"r2_buckets": [
{ "binding": "FILES", "bucket_name": "chittyos-files" }
],
"kv_namespaces": [
{ "binding": "IDEMP_KV", "id": "9ad1ec9795d243ca94f7502e6efb6a62" },
{ "binding": "TOKEN_KV", "id": "788d2fce231d4819a11b46d5f4678b04" },
{ "binding": "API_KEYS", "id": "cf6da7757caf4da5a8a365be2174f391" },
{ "binding": "OAUTH_KV", "id": "054ff38c93854e7c87b3aa307a7759cc" },
{ "binding": "CREDENTIAL_CACHE", "id": "aa18a59a2eb24fb29cfe08ef62519f4d" },
{ "binding": "RATE_LIMIT", "id": "1ab2c1114f5c4e248b8eba157615a125" },
{ "binding": "TENANT_CONNECTIONS", "id": "a1a42192fca34c7cbec8dd3df3d53d54" }
],
// "ai_search_namespaces": [
// { "binding": "AI_SEARCH", "namespace": "default" }
// ],
"durable_objects": {
"bindings": [
{ "name": "MCP_AGENT", "class_name": "McpConnectAgent" },
{ "name": "SESSION_STATE", "class_name": "SessionStateActor" }
]
},
"d1_databases": [
{ "binding": "DB", "database_name": "chittyconnect", "database_id": "29473911-4c5b-47d8-a3e7-d1be2370edf6" }
],
"queues": {
"producers": [
{ "binding": "EVENT_Q", "queue": "github-events" },
{ "binding": "PROOF_Q", "queue": "documint-proofs" }
],
"consumers": [
{ "queue": "documint-proofs", "max_batch_size": 10, "max_retries": 5, "dead_letter_queue": "documint-proofs-dlq" }
]
},
"ai": { "binding": "AI" },
"services": [
{ "binding": "SVC_TASKS", "service": "chittyagent-tasks", "environment": "production" },
{ "binding": "SVC_LEDGER", "service": "chittyledger", "environment": "production" },
{ "binding": "SVC_FINANCE", "service": "chittyfinance", "environment": "production" },
{ "binding": "SVC_CONCIERGE", "service": "chittyconcierge", "environment": "production" },
{ "binding": "SVC_CONTEXTUAL", "service": "chittycontextual", "environment": "production" },
{ "binding": "SVC_ID", "service": "chittyid", "environment": "production" },
{ "binding": "SVC_EVIDENCE", "service": "chittyagent-evidence", "environment": "production" },
{ "binding": "SVC_CHRONICLE", "service": "chittychronicle", "environment": "production" },
// { "binding": "SVC_DISPUTE", "service": "chittydispute" }, // TODO: uncomment to use service-binding instead of HTTPS fetch to dispute.chitty.cc
{ "binding": "SVC_SCORE", "service": "chittyscore-worker", "environment": "production" },
{ "binding": "SVC_STORAGE", "service": "chittystorage" }
]
}
}
// ──────────────────────────────────────────────────────────────────
// SECRETS MANIFEST
// ──────────────────────────────────────────────────────────────────
// All secrets: wrangler secret put <NAME> --env <dev|staging|production>
// Source of truth: chittysecrets → Cloudflare Secrets (hot runtime delivery)
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ GITHUB INTEGRATION │
// ├─────────────────────────────────────────────────────────────────┤
// │ GITHUB_APP_ID GitHub App numeric ID │
// │ GITHUB_APP_PK GitHub App private key (PEM) │
// │ GITHUB_WEBHOOK_SECRET Webhook signature verification │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ CHITTYOS SERVICE TOKENS (pattern: CHITTY_<SERVICE>_TOKEN) │
// │ Audit 2026-05-23: ✓ deployed, ⚠ declared-not-provisioned │
// ├─────────────────────────────────────────────────────────────────┤
// │ ✓ CHITTY_ID_TOKEN ChittyID service auth │
// │ ✓ CHITTY_AUTH_TOKEN ChittyAuth-issued auth token │
// │ ✓ CHITTY_AUTH_SERVICE_TOKEN ChittyAuth service auth │
// │ ✓ CHITTY_REGISTRY_TOKEN ChittyRegistry service auth │
// │ ✓ CHITTY_CHRONICLE_TOKEN ChittyChronicle service auth │
// │ ✓ CHITTY_CASES_TOKEN ChittyCases service auth │
// │ ✓ CHITTY_FINANCE_TOKEN ChittyFinance service auth │
// │ ✓ CHITTY_EVIDENCE_TOKEN ChittyEvidence service auth │
// │ ✓ CHITTY_SYNC_TOKEN ChittySync service auth │
// │ ✓ CHITTY_PROOF_TOKEN ChittyProof service auth │
// │ ✓ CHITTY_CONTEXTUAL_TOKEN ChittyContextual service auth │
// │ ✓ CHITTY_TASK_TOKEN ChittyTask service auth │
// │ ✓ CHITTY_SERV_TOKEN ChittyServ homelab auth │
// │ ✓ CHITTY_TRACK_TOKEN ChittyTrack observability token │
// │ ✓ CHITTY_DISPUTES_TOKEN ChittyDisputes service auth │
// │ ✓ CHITTY_LEDGER_TOKEN ChittyLedger service auth │
// │ ✓ CHITTYCONNECT_SERVICE_TOKEN ChittyConnect self-service token │
// │ ✓ CHITTYMINT_SECRET ChittyMint webhook secret │
// │ ⚠ CHITTY_DNA_TOKEN ChittyDNA service auth (not prov) │
// │ ⚠ CHITTY_VERIFY_TOKEN ChittyVerify service auth (n/p) │
// │ ⚠ CHITTY_CERTIFY_TOKEN ChittyCertify service auth (n/p) │
// │ ⚠ CHITTY_TRUST_TOKEN ChittyTrust service auth (n/p) │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ THIRD-PARTY INTEGRATIONS │
// ├─────────────────────────────────────────────────────────────────┤
// │ ✓ NOTION_TOKEN Notion API integration │
// │ ✓ OPENAI_API_KEY OpenAI API key │
// │ ✓ GDRIVE_CLIENT_ID Google Drive OAuth client ID │
// │ ✓ GDRIVE_CLIENT_SECRET Google Drive OAuth client secret │
// │ ✓ OLLAMA_CF_CLIENT_ID CF Access client ID (Ollama tunnel) │
// │ ✓ OLLAMA_CF_CLIENT_SECRET CF Access client secret (Ollama) │
// │ ✓ TWILIO_ACCOUNT_SID Twilio account SID │
// │ ✓ TWILIO_AUTH_TOKEN Twilio auth token │
// │ ✓ AI_SEARCH_TOKEN AI search integration token │
// │ ✓ QUO_API_KEY Quo (calls/SMS) API key │
// │ ⚠ GOOGLE_ACCESS_TOKEN Google OAuth access token (n/p) │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ NEON DATABASE │
// ├─────────────────────────────────────────────────────────────────┤
// │ ✓ NEON_DATABASE_URL Neon connection string │
// │ ✓ NEON_API_KEY Neon API key (secret rotation) │
// │ ✓ NEON_ISSUED_MINTING_API_KEY Neon-issued mint API key │
// │ ⚠ NEON_PROJECT_ID Neon project ID (n/p, in NEON_DATABASE_URL) │
// │ ⚠ NEON_BRANCH_ID Neon branch ID (n/p, in NEON_DATABASE_URL) │
// │ ⚠ NEON_HOST Neon host (n/p, in NEON_DATABASE_URL) │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ CREDENTIAL PROVISIONING & 1PASSWORD │
// ├─────────────────────────────────────────────────────────────────┤
// │ ✓ ONEPASSWORD_CONNECT_TOKEN chittysecrets Connect JWT │
// │ ✓ CLOUDFLARE_MAKE_API_KEY CF API fallback (if 1Pass down) │
// │ ✓ ENCRYPTION_KEY 32-byte key for KV cache encryption│
// │ ✓ INTERNAL_WEBHOOK_SECRET Internal webhook verification │
// │ ✓ SECRETS_PORTAL_AES_KEY AES key for /secrets portal │
// │ ⚠ OP_EVENTS_API_TOKEN chittysecrets Events API token (n/p) │
// │ ⚠ EMERGENCY_REVOKE_TOKEN Emergency credential revoke (n/p) │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ RETIRED ALIASES (removed from code — DO NOT re-add) │
// ├─────────────────────────────────────────────────────────────────┤
// │ CF_ACCOUNT_ID → removed, use CHITTYOS_ACCOUNT_ID │
// │ CLOUDFLARE_ACCOUNT_ID → removed, use CHITTYOS_ACCOUNT_ID │
// │ CHITTY_SERVICE_TOKEN → removed, use CHITTY_ID_TOKEN │
// │ CHITTY_ID_SERVICE_TOKEN → removed in PR #198, use CHITTY_ID_TOKEN │
// │ (still provisioned as worker │
// │ secret 2026-05-23 — orphaned, │
// │ safe to delete after ecosystem │
// │ grep confirms no other consumers) │
// │ CHITTY_API_KEY → removed (dead code) │
// │ CHITTYEVIDENCE_MINT_API_KEY → removed in PR #198 (never bound) │
// └─────────────────────────────────────────────────────────────────┘
//
// ┌─────────────────────────────────────────────────────────────────┐
// │ PHANTOM BINDINGS (referenced in code, not yet provisioned) │
// ├─────────────────────────────────────────────────────────────────┤
// │ COMMAND_KV KV guarded: if (c.env.COMMAND_KV) │
// │ CONVERSATIONS KV guarded: if (c.env.CONVERSATIONS) │
// │ CONTEXT_CONSCIOUSNESS DO guarded: if (c.env.CONTEXT_...) │
// │ CHRONICLE_KV KV guarded: if (env.CHRONICLE_KV) │
// │ MEMORY_KV KV fallback: env.MEMORY_KV||TOKEN_KV │
// │ SESSION_STATE DO guarded: throw if missing │
// │ PREDICTION_CACHE KV dead: no non-test code references │
// │ DOCUMENT_STORAGE R2 dead: no non-test code references │
// │ Provision as KV/DO/R2 when features are promoted to prod. │
// └─────────────────────────────────────────────────────────────────┘
//
// chittysecrets vault items required for credential provisioning:
// Vault: ChittyOS-Core (oxwo63jlcbo66c7kwx67lquw4i)
// Item title: "cloudflare" fields: make_api_key, account_id
}