Reference implementation for the VibeCode QA Cloudflare D1 App rubric.
This repo demonstrates a small Worker API backed by D1:
src/: Worker request handling and D1 query helpersmigrations/: ordered append-only SQL migrationsmigrations/manifest.json: checksum drift guard for migration identityscripts/: clean migration apply, drift, query-safety, and deploy-shape checkswrangler.toml: local, preview, and production D1 binding separation
pnpm install
pnpm typecheck
pnpm test
pnpm migrations:check
pnpm buildRun the full CI gate:
pnpm run ciMigrations are append-only after shared apply. Request data enters SQL through prepared
statement bindings, and tenant-owned queries include indexed tenant_id predicates.
Production deploys must apply D1 migrations before deploying Worker code that depends on the schema.
See docs/vcqa-report.md.