From 765f62c5ae07ca01788e1c76b453b16a5c2c0bf9 Mon Sep 17 00:00:00 2001 From: chitcommit <208086304+chitcommit@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:08:21 +0000 Subject: [PATCH] feat(wrangler): add SERVICE_SCOPE_DB hyperdrive binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the SERVICE_SCOPE_DB hyperdrive binding (id 89158b50e55a4d5d9279b5d5c890ea7b) to both root wrangler.jsonc and deploy/system-wrangler.jsonc. This is the service's own authoritative scopes Hyperdrive, paired with the existing CHITTYOS_CORE_DB binding for projection into ChittyOS-Core. Required by chittyschema/identity/scripts/validate-fractal-scopes.ts. The consumer code already exists in server/lib/central-workflows.ts via the @chittyos/schema/scope-projector adapter (PR #103) — without this binding the projector falls back to the SERVICE_SCOPE_DATABASE_URL env var. Validated: chittyschema validate-fractal-scopes.ts passes against both wrangler files (exit 0). Co-Authored-By: Claude Opus 4.7 (1M context) --- deploy/system-wrangler.jsonc | 7 ++++++- wrangler.jsonc | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/deploy/system-wrangler.jsonc b/deploy/system-wrangler.jsonc index 6bab310..c663dba 100644 --- a/deploy/system-wrangler.jsonc +++ b/deploy/system-wrangler.jsonc @@ -28,7 +28,8 @@ // Hyperdrive binding for fractal scope projection into ChittyOS-Core "hyperdrive": [ - { "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" } + { "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" }, + { "binding": "SERVICE_SCOPE_DB", "id": "89158b50e55a4d5d9279b5d5c890ea7b" } ], // Cloudflare Email Service binding (beta, Workers Paid plan) @@ -169,6 +170,10 @@ "r2_buckets": [ { "binding": "FINANCE_R2", "bucket_name": "chittyfinance-storage" } ], + "hyperdrive": [ + { "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" }, + { "binding": "SERVICE_SCOPE_DB", "id": "89158b50e55a4d5d9279b5d5c890ea7b" } + ], "durable_objects": { "bindings": [ { "name": "CF_AGENT", "class_name": "ChittyAgent" } diff --git a/wrangler.jsonc b/wrangler.jsonc index 6174b9e..ecc6c68 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -27,9 +27,12 @@ { "pattern": "finance.chitty.cc/*", "zone_name": "chitty.cc" } ], - // Hyperdrive binding for fractal scope projection into ChittyOS-Core + // Hyperdrive bindings for fractal scope projection. + // CHITTYOS_CORE_DB → ChittyOS-Core aggregation. SERVICE_SCOPE_DB → service's own authoritative scopes. + // Required by chittyschema/identity/scripts/validate-fractal-scopes.ts "hyperdrive": [ - { "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" } + { "binding": "CHITTYOS_CORE_DB", "id": "1d126444cff1416cb415447e6cc6d15a" }, + { "binding": "SERVICE_SCOPE_DB", "id": "89158b50e55a4d5d9279b5d5c890ea7b" } ], // Cloudflare Email Service binding