Skip to content
Pre-MVP. The 1.0 codebase is not a released product — see the 1.0 product boundary.

Detachment contract

What “standalone backend” mean, line by line, with thing in repo that enforce it. No line here without proof. Line with only local proof say so — deployed evidence is separate gate (SPEC.md §11 R4).

Evidence, not a status index. Release gates for the deployed proof are SPEC.md §11 R4.8 (detachment drill) and R4.9 (performance figures).

Contract line Enforced by Evidence level
Adopter own repository wire flow scripts/github.ts; artifact adopted into destination directory the operator name local
Adopter own database graduate/target.ts, graduate/migrate.ts write only the destination database; scripts/d1-provision.ts create adopter D1 local
Adopter own deployment and credentials emitted wrangler.example.jsonc, scripts/configure-deployment.mjs; bearer token read from adopter environment (API_BEARER_TOKEN) local
Normalized Prisma schema, real tables and indexes graduate/schema.ts, packages/eav-to-prisma; backend/test/graduate-generator.test.ts local
Reviewable, append-only migrations graduate/migrate.ts, graduate/lineage.ts, emitted scripts/emit-migration.mjs; backend/test/graduate-adoption.test.ts “regenerates after a schema change, appending to the migration lineage” local
Generated routes with familiar Prisma model/query semantics packages/prisma-generator-express (Hono target); backend/test/artifact-two-version-transition.test.ts boots the artifact and calls its routes local
No runtime call to Dee Wan backend/test/graduate-artifact-auth.test.ts, backend/test/graduate-no-callback.test.ts local
No dependency on Dee Wan identity, availability, infrastructure same two tests: emitted auth read one bearer token from own environment local; deployed proof OPEN
Developer-owned code survive regeneration graduate/zones.ts + backend/test/graduate-adoption.test.ts “keeps a developer’s own file across a schema change”; adopter-facing rule in EXTENDING-YOUR-BACKEND.md local
Adopter-owned DATA survive regeneration backend/test/graduate-adoption.test.ts “keeps rows the adopter wrote into their own table across a schema change” local
Developer can stop using Dee Wan and keep evolving repository zone rule + emitted scripts/regenerate.mjs and scripts/emit-migration.mjs run without CMS local; see “Stopping” below
  • Deployed, exact-commit detachment drill. Generated backend answering read while Dee Wan worker is off. Needs Cloudflare authority (SPEC.md §11 R0.2). Script and evidence file live at scripts/detach-drill.ts and docs/artifacts/detachment-evidence.md; both say plainly when no run exist.
  • Performance numbers. No benchmark run yet. See docs/PERFORMANCE-EVIDENCE.md. Until that file hold a run, no speed claim.

Generated content tables belong to the run. The migration verify the target against the plan and REFUSE (observed_row_set_mismatch) when it find rows in a generated table that the CMS did not publish. That refusal is the guarantee that deployed backend serve what CMS say it serve. Write your own data in your own tables — that is what src/owned/ and your own migrations are for.

Making an existing field required is not free. Rebuild of the table fail on rows holding NULL, and the run refuse instead of destroying data. Backfill first, then make it required.

Detaching is supported outcome, not emergency exit. Adopter delete the webhook, stop pressing Deploy, keep repository.

What keep working:

  • deployed worker and its database,
  • every route already generated,
  • migration lineage already applied,
  • their own code under src/owned/ and their own tables,
  • prisma migrate deploy, wrangler deploy, their CI.

What stop:

  • regeneration from CMS models (no new model definitions arrive),
  • content copy of newly published CMS content,
  • authoring surface: CMS is where content is edited.

From that point schema evolve by ordinary Prisma migration in adopter repo. Files under generated zone can be edited freely once nobody regenerate — zone rule only matter while CMS still emit into that tree.

CMS public API is live: publish reach it immediately. Edge cache off by default (no-store); when caching turned on, publish purge its cache tags. Generated backend is schema-and-content RELEASE: CMS change reach it only through explicit regeneration and deployment. Not continuously synchronized. Continuous sync is separate product decision, not built.