@cosmicdrift/kumiko-dev-server 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/package.json +8 -12
  2. package/src/__tests__/build-prod-bundle.integration.ts +1 -1
  3. package/src/__tests__/build-prod-bundle.test.ts +1 -1
  4. package/src/__tests__/cache-headers.test.ts +1 -1
  5. package/src/__tests__/classify-change.test.ts +1 -1
  6. package/src/__tests__/compose-features-wiring.integration.ts +10 -9
  7. package/src/__tests__/compose-features.test.ts +1 -1
  8. package/src/__tests__/config-seed-boot.integration.ts +5 -4
  9. package/src/__tests__/crash-tracker.test.ts +1 -1
  10. package/src/__tests__/create-kumiko-server.integration.ts +5 -5
  11. package/src/__tests__/discover-format.test.ts +32 -0
  12. package/src/__tests__/env-schema.integration.ts +1 -1
  13. package/src/__tests__/env-schema.test.ts +1 -1
  14. package/src/__tests__/few-shot-corpus.test.ts +1 -1
  15. package/src/__tests__/inject-schema.test.ts +1 -1
  16. package/src/__tests__/resolve-stylesheet.test.ts +11 -7
  17. package/src/__tests__/resolve-tailwind-cli.test.ts +1 -1
  18. package/src/__tests__/run-prod-app-spec.test.ts +1 -1
  19. package/src/__tests__/run-prod-app.integration.ts +6 -6
  20. package/src/__tests__/scaffold-app-feature.test.ts +1 -1
  21. package/src/__tests__/scaffold-app.test.ts +1 -1
  22. package/src/__tests__/scaffold-deploy.test.ts +1 -1
  23. package/src/__tests__/scaffold-feature.test.ts +1 -1
  24. package/src/__tests__/try-hono-first.test.ts +1 -1
  25. package/src/__tests__/walkthrough.integration.ts +1 -1
  26. package/src/codegen/__tests__/render-codegen.test.ts +50 -0
  27. package/src/codegen/__tests__/run-codegen.test.ts +1 -1
  28. package/src/codegen/__tests__/strict-mode-diagnostics.test.ts +1 -1
  29. package/src/codegen/__tests__/watch.test.ts +1 -1
  30. package/src/codegen/render.ts +7 -2
  31. package/src/codegen/run-codegen.ts +1 -1
  32. package/src/codegen/scan-events.ts +1 -21
  33. package/src/scaffold-app-feature.ts +2 -1
  34. package/src/{drizzle-tables-auth-mode.ts → schema-tables-auth-mode.ts} +1 -1
  35. package/templates/deploy/Dockerfile.template +15 -47
  36. package/CHANGELOG.md +0 -656
  37. package/src/drizzle-config.ts +0 -44
  38. /package/src/{drizzle-tables-minimal.ts → schema-tables-minimal.ts} +0 -0
package/CHANGELOG.md DELETED
@@ -1,656 +0,0 @@
1
- # @cosmicdrift/kumiko-dev-server
2
-
3
- ## 0.14.0
4
-
5
- ### Minor Changes
6
-
7
- - b8e1d48: scaffoldApp baut `src/run-config.ts` + `bin/main.ts` jetzt via ts-morph
8
- (AST) statt template-strings. Selbes Tool wie scaffoldAppFeature →
9
- ein konsistenter Mechanismus für generate + later modify. Plus:
10
- ts-morph als explicit dependency aufgenommen (war bisher nur via
11
- hoisted root-dep verfügbar; broken bei publish).
12
-
13
- ### Patch Changes
14
-
15
- - ce23d48: `walkthrough.integration.ts` — DX-3.1 walkthrough-snapshot-test. Pins
16
- scaffoldApp + scaffoldAppFeature output gegen die Behauptungen in
17
- docs.kumiko.so/en/walkthrough/. Catches doc-drift ohne actual
18
- `bunx … && yarn install && bun run boot` CI-run.
19
-
20
- 5 Tests: file-list, auto-mount-diff, run-config text-content,
21
- composeFeatures(includeBundled:true) = 7 features, bin/main auth.admin
22
- stub.
23
-
24
- - @cosmicdrift/kumiko-framework@0.14.0
25
- - @cosmicdrift/kumiko-bundled-features@0.14.0
26
-
27
- ## 0.13.0
28
-
29
- ### Minor Changes
30
-
31
- - 7bd5c88: `KUMIKO_DRY_RUN_ENV=boot` mode for runProdApp — runs env-validation +
32
- composeFeatures + validateBoot + createRegistry without DB/Redis
33
- connect, exits with status 0 on success. Used by the
34
- `samples/apps/use-all-bundled` smoke-app (Sprint 9.8 Phase C / Empfehlung
35
- 1 / canonical bug-catcher) and downstream by enterprise's
36
- `use-all-features` mirror. Render-modes (human|json|pulumi|k8s|1)
37
- behavior unchanged.
38
- - 575752f: `scaffoldAppFeature` + `kumiko add feature <name>` — DX-2 aus DX-Roadmap.
39
- Scaffolded ein neues Feature in `src/features/<name>/` einer bereits via
40
- `kumiko new app` scaffolded App + **auto-mountet** es in `src/run-config.ts`
41
- via ts-morph (import + `APP_FEATURES`-array-entry, idempotent).
42
-
43
- User-Promise "defineFeature → nichts woanders eintragen" erfüllt für die
44
- run-config-Seite. FEATURE_IMPORT_REGISTRY in drizzle/generate.ts ist
45
- DX-4's Refactor — bei DX-1+DX-2-App noch nicht vorhanden.
46
-
47
- Usage (in einer DX-1-gescaffoldeten App):
48
-
49
- ```sh
50
- bunx kumiko add feature product-catalog
51
- # → src/features/product-catalog/{feature.ts,index.ts}
52
- # → src/run-config.ts auto-edited: import + APP_FEATURES-entry
53
- ```
54
-
55
- - 3d5e9ef: `kumiko-schema-check` CLI — Empfehlung 3 aus Sprint-9.8-Retro
56
- (`luminous-watching-moler.md`). Diff't APP_FEATURES (runtime, aus
57
- `src/run-config.ts`) gegen FEATURE_IMPORT_REGISTRY (statisch, aus
58
- `drizzle/generate.ts`). Fängt Studio's 9.8-Drama: registry 18 features
59
- hinter APP_FEATURES → migrations fehlten für mounted features.
60
-
61
- Usage (im app-workspace):
62
-
63
- ```sh
64
- bunx kumiko-schema-check
65
- # or with custom paths:
66
- bunx kumiko-schema-check --run-config src/run-config.ts --generate drizzle/generate.ts
67
- ```
68
-
69
- Plus: 5 bundled-features hatten camelCase feature-names statt kebab-case
70
- (Memory `feedback_kebab_aggregates`) — aufgedeckt durch den schema-check
71
- gegen use-all-bundled. Fix: `channelEmail` → `channel-email`,
72
- `channelInApp` → `channel-in-app`, `channelPush` → `channel-push`,
73
- `rateLimiting` → `rate-limiting`, `rendererSimple` → `renderer-simple`.
74
-
75
- Plus `CHANNEL_IN_APP_FEATURE` und `RATE_LIMITING_FEATURE` Konstanten
76
- angepasst (waren intern auf camelCase, jetzt kebab-case).
77
-
78
- - 46b84d0: `scaffoldApp` + `kumiko new app <name>` — DX-1.0 aus DX-Roadmap. Generiert
79
- ein lauffähiges App-Skelett (package.json, tsconfig, run-config mit
80
- secrets+sessions, bin/main.ts mit auth-admin-stub + deterministische
81
- tenant-UUID, .env.example, README) in `<cwd>/<name>/`.
82
-
83
- Boot-Pfad: `KUMIKO_DRY_RUN_ENV=boot bun bin/main.ts` läuft ohne DB/Redis.
84
-
85
- Held-back für spätere DX-Phasen: drizzle-setup (DX-1.1, blocked-by DX-4
86
- auto-registry), Dockerfile (existing `kumiko init-deploy`), first feature
87
- scaffold (existing `kumiko create` bzw. DX-2 `kumiko add feature`).
88
-
89
- Usage:
90
-
91
- ```sh
92
- bunx kumiko new app my-shop
93
- cd my-shop && yarn install
94
- cp .env.example .env # JWT_SECRET + KUMIKO_SECRETS_MASTER_KEY_V1 setzen
95
- bun run boot # → boot validation OK
96
- ```
97
-
98
- ### Patch Changes
99
-
100
- - 2bd60c1: `buildServerBundle` BUILD_ONLY_EXTERNALS erweitert um drizzle-kit's
101
- dialect-resolver dynamic-imports: `@planetscale/database`, `@libsql/client`,
102
- `better-sqlite3`, `@neondatabase/serverless`, `@vercel/postgres`, `mysql2`.
103
-
104
- Aufgedeckt durch C1 Empfehlung 4 (bundle-smoke). Bisher schlug
105
- `bun build` an dynamic-imports im drizzle-kit auch wenn der App nur
106
- postgres nutzt. Externalisieren = build durchläuft + tree-shake wirft
107
- die ungenutzten driver-modules eh raus.
108
-
109
- - 8bfb284: Dockerfile.template setzt `YARN_ENABLE_SCRIPTS=false` im Build-Stage. Fixt msgpackr-extract native-build-Failures (ARM, CI) und generell jeden transitiven Native-Dep — der Build-Stage bundlet nur JS via `bun build`, Runtime-Native-Deps werden separat im Runtime-Stage via `bun install --production` installiert. Apps die bisher per-package-Workarounds via `dependenciesMeta.<pkg>.built=false` in der App-package.json brauchten (studio, enterprise) können diese Entries nach Upgrade auf diese dev-server-Version entfernen.
110
- - cc0ddc0: `Dockerfile.template` emits an inline `start.sh` for createBunServer command-override target.
111
-
112
- `infra/pulumi/bun-server.ts`'s `createBunServer` overrides the container command with `exec ./start.sh` after injecting DATABASE_URL from the init-container. Apps deployed via createBunServer crashed with `./start.sh: not found` until each one added a per-app `start.sh` in repo root (= studio's PR #22).
113
-
114
- Now the Dockerfile-template emits the file inline (`RUN printf … > ./start.sh && chmod +x`). Apps no longer need to ship one — the runtime stage generates it. Apps that don't go through createBunServer's command-override still boot via the bottom CMD; start.sh is dead-code in that case.
115
-
116
- - Updated dependencies [7f56b2f]
117
- - Updated dependencies [68b8118]
118
- - Updated dependencies [9121928]
119
- - Updated dependencies [72518fa]
120
- - Updated dependencies [0a00e7b]
121
- - Updated dependencies [aca1443]
122
- - Updated dependencies [c6cb96c]
123
- - Updated dependencies [3d5e9ef]
124
- - @cosmicdrift/kumiko-framework@0.13.0
125
- - @cosmicdrift/kumiko-bundled-features@0.13.0
126
-
127
- ## 0.12.2
128
-
129
- ### Patch Changes
130
-
131
- - Updated dependencies [597de52]
132
- - @cosmicdrift/kumiko-framework@0.12.2
133
- - @cosmicdrift/kumiko-bundled-features@0.12.2
134
-
135
- ## 0.12.1
136
-
137
- ### Patch Changes
138
-
139
- - Updated dependencies [f2ad7c4]
140
- - @cosmicdrift/kumiko-framework@0.12.1
141
- - @cosmicdrift/kumiko-bundled-features@0.12.1
142
-
143
- ## 0.12.0
144
-
145
- ### Patch Changes
146
-
147
- - Updated dependencies [0c1ebe5]
148
- - @cosmicdrift/kumiko-bundled-features@0.12.0
149
- - @cosmicdrift/kumiko-framework@0.12.0
150
-
151
- ## 0.11.2
152
-
153
- ### Patch Changes
154
-
155
- - Updated dependencies [92a84f0]
156
- - @cosmicdrift/kumiko-framework@0.11.2
157
- - @cosmicdrift/kumiko-bundled-features@0.11.2
158
-
159
- ## 0.11.1
160
-
161
- ### Patch Changes
162
-
163
- - Updated dependencies [e6f702f]
164
- - @cosmicdrift/kumiko-bundled-features@0.11.1
165
- - @cosmicdrift/kumiko-framework@0.11.1
166
-
167
- ## 0.11.0
168
-
169
- ### Patch Changes
170
-
171
- - Updated dependencies [30ea981]
172
- - Updated dependencies [9347212]
173
- - @cosmicdrift/kumiko-framework@0.11.0
174
- - @cosmicdrift/kumiko-bundled-features@0.11.0
175
-
176
- ## 0.10.0
177
-
178
- ### Patch Changes
179
-
180
- - Updated dependencies [d06f029]
181
- - Updated dependencies [753d392]
182
- - @cosmicdrift/kumiko-framework@0.10.0
183
- - @cosmicdrift/kumiko-bundled-features@0.10.0
184
-
185
- ## 0.9.0
186
-
187
- ### Minor Changes
188
-
189
- - 51e22f5: Add deploy-template scaffolding (Sprint 9.6).
190
-
191
- **New API:**
192
-
193
- - `scaffoldDeploy({ appName, port?, githubOrg?, destination?, force? })` exported from `@cosmicdrift/kumiko-dev-server`. Generates `deploy/Dockerfile`, `deploy/Dockerfile.dockerignore`, and `deploy/migrate-step.sh` from canonical templates shipped with the package. Substitutes `{{appName}}`, `{{port}}`, `{{githubOrg}}` placeholders.
194
- - New CLI command: `kumiko init-deploy --app <name> [--port <n>] [--github-org <org>] [--out <dir>] [--force]`.
195
-
196
- The templates are extracted from publicstatus's production-tested `deploy/Dockerfile` (node-alpine build stage → bun-alpine runtime, drizzle migrations baked in, healthcheck wired). Refuses to overwrite existing files unless `--force` is passed so a tuned per-app Dockerfile isn't clobbered.
197
-
198
- **Templates are a starting point, not a contract.** Apps should review and adjust:
199
-
200
- - **Image tag** is hardcoded `:latest` in `migrate-step.sh.template`. Swap to `:${BUILD_SHA}` for atomic deploys.
201
- - **DB defaults** in `migrate-step.sh.template` assume `db user = db name = appName`, host `db`, port `5432`. Adjust to your stack.
202
- - **`COPY /app/seeds`** assumes the app uses ES-Operations seed migrations. Comment out if your app has no `seeds/` directory (otherwise `docker build` fails).
203
- - **`docker build`-smoke-test:** the templates run untested against a non-publicstatus app-tree. Verify locally before pushing to CI.
204
-
205
- **Deferred to Sprint 9.7+:** `.github/workflows/build-image.yml.suggested`, `pulumi/secrets-bootstrap.sh`, `pulumi/extraEnv.snippet.ts`.
206
-
207
- **Plan-Doc drift (for 9.9 update):** Plan-Doc-Tabelle nennt `start.sh` (in-container migrate-then-run); diese Implementation liefert `migrate-step.sh` (host-side deploy-pipeline). Beide Konzepte sind gültig — Plan-Doc-Update sollte das klarstellen.
208
-
209
- - 37fe758: `scaffoldDeploy()` inspects the app source-tree and emits Dockerfile blocks conditionally (Sprint 9.6 follow-up).
210
-
211
- **Why this exists:** Sprint 9.6's first Dockerfile.template hardcoded `COPY --from=build /app/seeds ./seeds` with a "comment out if you don't use it" note in the changeset. Apps without a `seeds/` directory (e.g. studio.kumiko.so) crashed in Docker-build with `failed to compute cache key: "/app/seeds": not found`. Root-cause was a framework issue (template too rigid), not a per-app symptom — the framework should detect what the app actually has.
212
-
213
- **Detection:**
214
-
215
- - `hasSeeds` — `exists(sourceDir/seeds)`. Drives the ES-Ops `COPY ./seeds` block in the runtime stage.
216
- - `hasPrivateGhPackages` — scan `package.json` `dependencies` + `devDependencies` for any `@cosmicdriftgamestudio/*` entry. Drives the `ARG GITHUB_TOKEN` blocks (multi-stage with explicit re-declaration inside the build-stage) and the `ENV GITHUB_TOKEN=${GITHUB_TOKEN}` re-export before `yarn install --immutable`.
217
-
218
- **Template syntax:** mustache-style block conditionals `{{#flag}}…{{/flag}}` (multi-line via `[\s\S]`, surrounding line stripped on falsy). Plain `{{key}}` placeholder substitution is unchanged.
219
-
220
- **New API:**
221
-
222
- - `ScaffoldDeployOptions.sourceDir?: string` — defaults to `destination`. Lets the caller scaffold into one dir while detecting optional surfaces in another (rare).
223
- - `ScaffoldDeployResult.detected: { hasSeeds, hasPrivateGhPackages }` — surfaced so the CLI can report what was emitted.
224
-
225
- **6 new tests:** seeds detection (with + without), GH-Packages detection (private + public-only + malformed package.json).
226
-
227
- Sprint 9.6's "starting point not contract" disclaimer in the original changeset is now obsolete for these two surfaces — apps no longer need to manually comment out lines.
228
-
229
- ### Patch Changes
230
-
231
- - Updated dependencies [51e22f5]
232
- - @cosmicdrift/kumiko-framework@0.9.0
233
- - @cosmicdrift/kumiko-bundled-features@0.9.0
234
-
235
- ## 0.8.1
236
-
237
- ### Patch Changes
238
-
239
- - Updated dependencies [4b5f91e]
240
- - @cosmicdrift/kumiko-framework@0.8.1
241
- - @cosmicdrift/kumiko-bundled-features@0.8.1
242
-
243
- ## 0.8.0
244
-
245
- ### Minor Changes
246
-
247
- - f34af9a: Add framework-core env-schema (Sprint 9.2, Migration Phase 1).
248
-
249
- **New API:**
250
-
251
- - `frameworkCoreEnvSchema` exported from `@cosmicdrift/kumiko-dev-server` — Zod-object covering the vars read by framework-core: `PORT` (default `"3000"`), `DATABASE_URL`, `REDIS_URL`, `KUMIKO_INSTANCE_ID`, `KUMIKO_SKIP_ES_OPS`. `DATABASE_URL` + `REDIS_URL` carry `.meta({ kumiko: { pulumi: { secret: true } } })` so `KUMIKO_DRY_RUN_ENV=pulumi` emits `--secret` flags. Plus `FrameworkCoreEnv` type via `z.infer`. `NODE_ENV` is excluded: build-prod-bundle inlines it as a literal at build-time (esbuild define), so runtime env-validation can't observe it.
252
- - `composeEnvSchema({ core, features, extend, optionalFeatures })` accepts a new `core?` option. Keys from `core` are tagged with source `"framework-core"` in the resulting sources map and in `KumikoBootError.format()` output. Conflict detection runs across core/features/extend — a feature or `extend` block that re-declares a core var throws `KumikoBootError` at compose-time.
253
-
254
- **Why:** Phase 1 of the Sprint 9 env-schema migration (`kumiko-studio/docs/plans/sprint-9-env-schemas.md`). Apps wire `composeEnvSchema({ core: frameworkCoreEnvSchema, features, extend })` into `runProdApp` to get aggregated boot-validation for the vars that framework-core reads. `KUMIKO_DRY_RUN_ENV=pulumi|k8s` then enumerates them with source attribution per row — operators see "(framework-core)" next to `DATABASE_URL` rather than guessing whether the framework or the app is the consumer.
255
-
256
- **Backward-compat:** Purely additive. `runProdApp`'s existing `requireEnv("DATABASE_URL")` / `process.env["KUMIKO_INSTANCE_ID"]` reads remain unchanged. Apps that don't pass `envSchema` behave exactly as before.
257
-
258
- **Feature-specific vars (Phase 2):** `JWT_SECRET` (auth-email-password), `KUMIKO_SECRETS_MASTER_KEY_*` (secrets), `SMTP_*` (channel-email-smtp), `STRIPE_*` / `MOLLIE_*` (subscription-\*) stay scoped to their owning feature's `r.envSchema()` and are NOT in `frameworkCoreEnvSchema`.
259
-
260
- - dff4123: Add Zod-based env-schema declarations and boot-time validation (Sprint 9.1).
261
-
262
- **New API:**
263
-
264
- - `r.envSchema(z.object({...}))` — declare per-feature env-vars at registration time.
265
- - `@cosmicdrift/kumiko-framework/env`: `composeEnvSchema({features, extend, optionalFeatures})` merges feature schemas into one app-wide schema, returning `{schema, sources}`. `parseEnv(schema, env, {sources, pulumiPrefix})` validates `process.env` and throws `KumikoBootError` listing ALL problems at once (aggregated, not first-fail).
266
- - `@cosmicdrift/kumiko-framework/env/dry-run`: `renderDryRun(composed, mode, opts)` for `human|json|pulumi|k8s` introspection of the required env-vars without booting.
267
- - `runProdApp({envSchema, pulumiPrefix, bootErrorReporter, envSource})` runs schema validation before any DB/Redis connection. `KUMIKO_DRY_RUN_ENV=1|human|json|pulumi|k8s` prints the inventory and exits.
268
- - Per-var metadata via Zod's `.meta({ kumiko: { pulumi: { name, generator, secret } } })` for deploy-time tooling overrides.
269
-
270
- **Backward-compat:** Apps without `envSchema` keep working — existing `requireEnv("DATABASE_URL")` calls in `runProdApp` are untouched. Sprint-9.2-9.5 migrates framework + bundled-features + apps to schema-only env handling.
271
-
272
- **Why:** 2026-05-21 Studio deploy stacked 7 hacks chasing missing env-vars (10+ pipeline-fail iterations, ended in rollback). Schema-first boot validation surfaces ALL misconfigs upfront with `pulumi config set …` suggestions, replacing the discover-by-failing loop with a single dry-run + secrets-bootstrap pass.
273
-
274
- ### Patch Changes
275
-
276
- - Updated dependencies [145b8df]
277
- - Updated dependencies [f34af9a]
278
- - Updated dependencies [dff4123]
279
- - @cosmicdrift/kumiko-bundled-features@0.8.0
280
- - @cosmicdrift/kumiko-framework@0.8.0
281
-
282
- ## 0.7.0
283
-
284
- ### Minor Changes
285
-
286
- - bcf43b6: es-ops: `SeedMembershipRow` exposes `streamTenantId` (stream-tenant aus `kumiko_events.v1`) neben dem payload-`tenantId`. Seed-Authors müssen den `kumiko_events`-JOIN nicht mehr selbst bauen — `m.streamTenantId` ist der korrekte Wert für `systemWriteAs`'s `tenantIdOverride` wenn das Aggregate von einem fremden Executor angelegt wurde (typisches `seedTenantMembership(by=systemAdmin)`-Pattern).
287
-
288
- ### Patch Changes
289
-
290
- - Updated dependencies [bcf43b6]
291
- - @cosmicdrift/kumiko-framework@0.7.0
292
- - @cosmicdrift/kumiko-bundled-features@0.7.0
293
-
294
- ## 0.6.0
295
-
296
- ### Minor Changes
297
-
298
- - 8489d18: feat(es-ops): Phase 1.5 — tenantIdOverride + dry-run-validator + E2E-Test + Doku
299
-
300
- Phase 1.5 schließt die Lücken aus Phase 1 die den ersten Driver-Use-Case
301
- (publicstatus admin-roles) blockten. Siehe Retro:
302
- `kumiko-platform/docs/plans/features/es-ops-phase1-retro.md` (PR #9).
303
-
304
- **A1 — tenantIdOverride:**
305
- `SeedMigrationContext.systemWriteAs(qn, payload, tenantIdOverride?)`.
306
- Default SYSTEM_TENANT_ID (unverändert für System-scope-Aggregates wie
307
- config-values). Mit override: `createSystemUser(tenantIdOverride)` als
308
- Executor, damit der Event-Store-Executor den Aggregate-Stream im
309
- richtigen Tenant findet. Fix für die `version_conflict`-Klasse-Bug
310
- (Memory `feedback_event_store_tenant_consistency.md`).
311
-
312
- **A2 — dry-run-validator:**
313
- Runner parsed seed-files vor `migration.run()` per regex
314
- `systemWriteAs\(["']([^"']+)["']`, sammelt handler-QNs, validiert
315
- gegen `registry.getWriteHandler(qn)`. Fail-fast mit klarer Message
316
-
317
- - Datei + QN statt zur Runtime "handler not found". Catched camelCase-
318
- typos (kebab-case-vs-camelCase Drift) + andere QN-Drift zur Boot-Zeit.
319
- runProdApp reicht den richtigen Registry rein (`registry` neu in
320
- RunPendingSeedMigrationsArgs).
321
-
322
- **A3 — E2E-Test:**
323
- `packages/bundled-features/src/__tests__/es-ops-e2e.integration.ts`
324
- mit `setupTestStack`-Pattern: tenant+config Features echt geladen,
325
- echtes Membership-Aggregate via TenantHandlers.addMember im Demo-Tenant,
326
- seed-migration ruft update-member-roles mit tenantIdOverride → write
327
- geht durch, Marker landed, Event in Store, Read-Model aktualisiert.
328
- Plus typo-Test: seed mit camelCase fail-t Dry-Run mit
329
- `/dry-run found.*unknown handler-QN/`. **TDD-First**: ohne A1+A2 wäre
330
- der test rot.
331
-
332
- **A4 — Doku:**
333
- `framework/src/es-ops/README.md` erweitert um „Wann brauche ich
334
- tenantIdOverride?" + „Deployment-Anforderungen" (Docker COPY, Idempotenz,
335
- Multi-Replica) + „Lokaler Smoke vor Push". Recipe-README + seed-files
336
- auf neue API aktualisiert.
337
-
338
- **A5 — Smoke-Skript-Template:**
339
- `samples/recipes/seed-migration/scripts/smoke.ts` als copy-paste-Template
340
- für App-Authors: Bun-runnable, offline (read-only, kein DB-Write),
341
- validiert Module-Load + QN-Resolution + System-User-Access. Recipe-
342
- README dokumentiert Pflicht-Pattern.
343
-
344
- **Bonus-Fix:**
345
- `tenant:write:create`-access auf `["system", "SystemAdmin"]` erweitert
346
- (symmetrisch zu update-member-roles). Aufgedeckt durch Recipe-Smoke +
347
- initial-tenants-Seed. Pinning-Test in `tenant.integration.ts` updated.
348
-
349
- **Test-State:** 45/45 grün (Pre-Push). Typecheck clean. Biome clean.
350
- as-cast-Audit clean. Guard-silent-skip clean. Recipe-Smoke clean.
351
-
352
- **Folge-Step (separater PR):** publicstatus driver-sample reaktivieren
353
- mit lokalem Pre-Push-Smoke gegen publicstatus' echtes Feature-Set.
354
-
355
- ### Patch Changes
356
-
357
- - Updated dependencies [8489d18]
358
- - @cosmicdrift/kumiko-framework@0.6.0
359
- - @cosmicdrift/kumiko-bundled-features@0.6.0
360
-
361
- ## 0.5.2
362
-
363
- ### Patch Changes
364
-
365
- - 4f0d781: fix(tenant): updateMemberRoles erlaubt "system"-Rolle (symmetrisch zu create)
366
-
367
- Drift innerhalb des tenant-Features: `tenant:write:create` akzeptierte
368
- `["system", "SystemAdmin"]`, `tenant:write:update-member-roles` aber
369
- nur `["SystemAdmin"]`. Konsequenz: ops-tooling und seed-migrations
370
- (`createSystemUser` mit `roles: ["system"]`) konnten den Handler nicht
371
- aufrufen — `access_denied`.
372
-
373
- Live entdeckt beim ersten Driver-Sample der es-ops Phase 1: publicstatus
374
- seed `2026-05-20-fix-admin-roles.ts` rief `update-member-roles` via
375
- `systemWriteAs` → access_denied → Pod CrashLoopBackOff.
376
-
377
- Plus access-rule-Pinning-Test in `tenant.integration.ts`-scenario-7.
378
-
379
- - Updated dependencies [4f0d781]
380
- - @cosmicdrift/kumiko-framework@0.5.2
381
- - @cosmicdrift/kumiko-bundled-features@0.5.2
382
-
383
- ## 0.5.1
384
-
385
- ### Patch Changes
386
-
387
- - 0e00015: fix(es-ops): path.resolve statt path.join für seedsDir → seed-files
388
-
389
- Bun's `await import()` braucht absolute Pfade. Wenn der App-Author
390
- `runProdApp({ seedsDir: "./seeds" })` setzt (relativ), würde
391
- `path.join("./seeds", "foo.ts")` einen relativen Pfad liefern → Bun's
392
- Import-Resolver such relativ zum `runner.ts`-Modul (nicht zum
393
- `process.cwd()`) → `Cannot find module 'seeds/...' from '<runner-path>'`.
394
-
395
- `path.resolve` löst gegen `process.cwd()` auf → absolute Pfade →
396
- Import funktioniert. Aufgedeckt beim ersten Live-Boot der publicstatus-
397
- Driver-Migration (Pod CrashLoopBackOff).
398
-
399
- - Updated dependencies [0e00015]
400
- - @cosmicdrift/kumiko-framework@0.5.1
401
- - @cosmicdrift/kumiko-bundled-features@0.5.1
402
-
403
- ## 0.5.0
404
-
405
- ### Minor Changes
406
-
407
- - 7ff69ab: feat(es-ops): Phase 1 — file-based seed-migrations
408
-
409
- Neues first-class Operations-Pattern fürs Framework. Liefert `seed-migrations`
410
- als drizzle-migrate-equivalent für Event-Sourcing-Aggregate-Updates die
411
- idempotent-Seeder nicht erfassen können (z.B. „Member hat schon eine
412
- Rolle, aber jetzt soll noch eine dazukommen").
413
-
414
- Public-API:
415
-
416
- - `runProdApp({ seedsDir })` — Auto-apply pending Migrations beim Boot
417
- - `SeedMigration`-Interface (default-Export einer `seeds/<id>.ts`-File)
418
- - `SeedMigrationContext` mit `systemWriteAs` (ruft existing write-handler
419
- als System-User) + Read-Helpers (`findUserByEmail`,
420
- `findMembershipsOfUser`, `findTenants`)
421
- - CLI: `bunx kumiko ops seed:new|status|apply`
422
- - Tracking-Table `kumiko_es_operations` mit `operation_type`-Discriminator
423
- (vorbereitet auf Phase 2+ Operations: projection-rebuild, event-replay,
424
- stream-migration, ...)
425
- - Env-Flags: `KUMIKO_SKIP_ES_OPS=1` (alle skippen für Recovery),
426
- `KUMIKO_SKIP_ES_OPS_<ID>=1` (einzelne kaputte skippen)
427
-
428
- Garantien: single-run via tracking, atomic via per-migration-Tx,
429
- chronological order via filename-prefix, fail-stop bei Failure (kein
430
- Partial-Apply), ES-konform via Handler-Dispatch.
431
-
432
- Sub-path-Export: `@cosmicdrift/kumiko-framework/es-ops`
433
-
434
- Plan-Doc: `kumiko-platform/docs/plans/features/es-ops.md`
435
- Recipe: `samples/recipes/seed-migration/`
436
- Driver-Use-Case: publicstatus admin-roles-drift (parallel-Branch
437
- `feat/es-ops-driver-admin-roles`).
438
-
439
- Phase 2+ skizziert + offen markiert — Implementation pro Use-Case.
440
-
441
- ### Patch Changes
442
-
443
- - Updated dependencies [7ff69ab]
444
- - @cosmicdrift/kumiko-framework@0.5.0
445
- - @cosmicdrift/kumiko-bundled-features@0.5.0
446
-
447
- ## 0.4.1
448
-
449
- ### Patch Changes
450
-
451
- - 010b410: feat(auth-email-password): "Bestätigungs-Mail erneut senden" im LoginScreen
452
-
453
- LoginScreen bietet bei reason=email_not_verified jetzt einen Resend-Link
454
- im Fehler-Banner — der existierende `requestEmailVerification`-Endpoint
455
- wird direkt aufgerufen, der Banner wechselt nach Erfolg zum Info-Variant
456
- ("Wir haben dir eine neue Bestätigungs-Mail geschickt.").
457
-
458
- UX-Details:
459
-
460
- - Bei 429 → inline-Hint "Bitte warte kurz und versuche es erneut."
461
- - Bei Netzwerk/sonstigen Fehlern → inline-Hint "Konnte nicht senden."
462
- - Anti-Typo-Gate: ändert der User die Email-Eingabe nach dem Login-Fail,
463
- verschwindet der Resend-Link — sonst würde Resend silent-success an die
464
- geänderte (potentiell typoed) Adresse gehen ohne User-Feedback.
465
- - Andere Failure-Codes (invalid_credentials etc.) zeigen weiterhin keinen
466
- Resend-Link.
467
-
468
- i18n: 4 neue Keys (DE+EN) im `auth.login.resend*`-Namespace, additive.
469
- Apps die ihre Translations override-en müssen nichts ändern.
470
-
471
- Additive UI-Feature — keine API-Breaks, keine Schema-Migration.
472
-
473
- - Updated dependencies [010b410]
474
- - @cosmicdrift/kumiko-framework@0.4.1
475
- - @cosmicdrift/kumiko-bundled-features@0.4.1
476
-
477
- ## 0.4.0
478
-
479
- ### Minor Changes
480
-
481
- - 825e7d2: Visual-Tree V.1.4 → V.1.6 — Feature-complete Editor + Folder-Hierarchy + Roving-tabindex.
482
-
483
- **V.1.4** — explicit `folder?: string` Schema-Field auf text-block-entity. Slug bleibt
484
- kebab-only validiert, Folder explizit gesetzt. Tree gruppiert via `groupBlocksByFolder`
485
- (ersetzt `groupBlocksBySlugPrefix`). `Subscribe<T>` Signature um optional `emitError`
486
- erweitert für explicit async-error-Pfade. ProviderBranch zeigt Error-Banner mit
487
- Retry-Button. Drift-Test pinnt seedTextBlock-vs-set.write Slug-Validation.
488
-
489
- **V.1.4b** — URL-State-Routing für Editor-Target via `nav.searchParams`. F5 + Back-Button
490
- stellen den Editor-State wieder her. Format: `?t=text-content:edit&a_slug=...&a_lang=...`.
491
- Plus `useDispatchTarget` hook ersetzt globalen `dispatchTarget` als empfohlenen Production-
492
- Pfad (legacy bleibt für Test-Hooks).
493
-
494
- **V.1.5** — Arrow-Key-Navigation (`<aside role="tree">`, ARIA-tree-Pattern) + SSE-driven
495
- Tree-Refresh. `ClientFeatureDefinition.treeEntities?: string[]` listet Entity-Namen pro
496
- Provider; live-events triggern provider-re-mount → Stale-Tree-state="stub"→"filled"
497
- flippt nach save automatisch.
498
-
499
- **V.1.5c+d** — Active-Node-Highlight (explicit blue + 2px border-l + scrollIntoView),
500
- VS-Code-Polish (compact spacing, focus-visible, folder-icon-color text-amber, indent-
501
- guides per ancestor-depth), Folder-Wrapper für legal-pages ("📁 Legal" + slug-first
502
- Verschachtelung) und text-content ("📁 Content").
503
-
504
- **V.1.6** — Multi-level Folder-Splitting (`folder="page/marketing"` → nested folders,
505
- walk-or-create-pattern, folder/leaf-collision-tolerant). Roving-tabindex (nur focused-
506
- treeitem hat tabIndex=0, Tab cyclt aus dem Tree raus).
507
-
508
- 35/35 kumiko check PASS, 13/13 group-blocks + 22/22 text-content integration tests grün.
509
- Browser + Keyboard lokal validated.
510
-
511
- **Breaking**: `TreeContext` Type entfernt (V.1.2 SR2-Rip — war nie genutzt). Provider sind
512
- session-bound: `TreeChildrenSubscribe = () => Subscribe<T>` statt `(ctx) => Subscribe<T>`.
513
-
514
- **V.1.7-Followups**: useEffect-deps in VisualTree-focus-init (Performance), Cancellation-
515
- Token in TreeProvider's fetch (emit-after-unmount-warning), inline-rename, drag-drop,
516
- file-icons per slug-extension, parent-jump bei ArrowLeft auf collapsed-item.
517
-
518
- ### Patch Changes
519
-
520
- - Updated dependencies [825e7d2]
521
- - @cosmicdrift/kumiko-framework@0.4.0
522
- - @cosmicdrift/kumiko-bundled-features@0.4.0
523
-
524
- ## 0.3.0
525
-
526
- ### Minor Changes
527
-
528
- - 0.3.0 bringt zwei neue Subsysteme (Step-Engine Tier-3 + Visual-Tree) plus
529
- eine AST-Codemod-Pipeline als Vorarbeit für den L2-AI-Layer.
530
-
531
- ### Breaking Changes
532
-
533
- - `skipTransitionGuard` → `unsafeSkipTransitionGuard` (Rename in
534
- feature-ast + engine). Der `unsafe`-Prefix macht die Tragweite des
535
- Casts sichtbar und ist konsistent zur `unsafeProjectionUpsert`- und
536
- `r.rawTable`-Konvention. Migration: 1:1-Ersetzung, keine Verhaltens-Änderung.
537
-
538
- ### Features
539
-
540
- - **Step-Engine M.4 — Tier-3 Workflow-Engine.** Neue Step-Vocabulary
541
- `wait`, `waitForEvent`, `retry` ermöglicht persistierte Long-Running-Flows
542
- über Job-Boundaries hinweg. Q7 Snapshot-at-Start hängt jedem Step-Run
543
- einen SHA-256-Fingerprint des Aggregat-Zustands an, sodass Replays
544
- deterministisch gegen den ursprünglichen Eingangszustand laufen.
545
- - **Visual-Tree V.1.x — Tree-API + Editor-Panel.** Neue `VisualTree`-
546
- Component plus TreeProvider-Pattern; erste TreeProviders für
547
- `text-content` und `legal-pages` (CMS-light + Impressum/Privacy).
548
- Fundament für den späteren No-Code-Designer (~3000 LOC, 98 Tests).
549
- - **Codemod-Pipeline.** AST-basierte Patcher-Module für strukturelle
550
- Feature-Edits — wird vom kommenden L2-AI-Layer als Tool-Surface
551
- verwendet, ist aber eigenständig nutzbar für ts-morph-style Migrationen.
552
- - **user-data-rights Sample-Recipe.** DSGVO Art. 15/17/18/20 vollständig
553
- als Sample-Recipe (`samples/recipes/`) inklusive README — zeigt die
554
- Export- und Forget-Pipeline gegen den `compliance-profiles`-Default
555
- (`eu-dsgvo`).
556
-
557
- ### Fixes
558
-
559
- - `tier-engine`: auto-default-tier-Hook benutzt jetzt `ctx.db.raw` für
560
- Event-Store-Operationen (#37, vorher: stiller Bug, 22 Tage live).
561
- - `engine`: unsafe-projection-upsert nutzt `as never` statt `as any` —
562
- schmaler Cast-Surface, weniger Compiler-Knebel.
563
- - `visual-tree`: runtime-isolation marker für client-konsumierte Files,
564
- damit der Multi-Entry-Build den richtigen Bundle-Split bekommt.
565
- - `feature-ast`: vollständiger `unsafeSkipTransitionGuard`-Rename (war
566
- in zwei Modulen noch der alte Name).
567
- - `framework`: Error-Reasons + `noConsole`-Lint + No-Date-API-Guard
568
- wieder push-ready.
569
-
570
- ### Library-Updates
571
-
572
- hono 4.12, jose 6.2, stripe 22.1, meilisearch 0.58, marked 18,
573
- bun-types 1.3.13, lucide-react 1.14, bullmq 5.76, ioredis 5.10,
574
- i18next 26.0, react + radix-ui-primitives auf aktuelle Minors.
575
-
576
- ### Patch Changes
577
-
578
- - Updated dependencies
579
- - @cosmicdrift/kumiko-framework@0.3.0
580
- - @cosmicdrift/kumiko-bundled-features@0.3.0
581
-
582
- ## 0.2.3
583
-
584
- ### Patch Changes
585
-
586
- - Updated dependencies [1dbd038]
587
- - @cosmicdrift/kumiko-bundled-features@0.2.3
588
- - @cosmicdrift/kumiko-framework@0.2.3
589
-
590
- ## 0.2.2
591
-
592
- ### Patch Changes
593
-
594
- - 7a7da3e: Re-publish 0.2.1 → 0.2.2 mit korrekt aufgelösten cross-package-Versionen.
595
- 0.2.1 hatte `workspace:*` als Wert in den dependencies (npm publish ohne
596
- yarn-pack rewrite), Konsumenten bekamen "Workspace not found".
597
-
598
- publish-with-oidc.sh nutzt jetzt `yarn pack` (rewrited workspace:\*) +
599
- `npm publish <tarball>` (OIDC + provenance).
600
-
601
- - Updated dependencies [7a7da3e]
602
- - @cosmicdrift/kumiko-framework@0.2.2
603
- - @cosmicdrift/kumiko-bundled-features@0.2.2
604
-
605
- ## 0.2.1
606
-
607
- ### Patch Changes
608
-
609
- - 48b7f6a: CI: switch publish to npm-CLI with OIDC Trusted Publishing + provenance.
610
- No source changes — verifies the new publish path produces a verified-
611
- provenance attestation on npmjs.com instead of token-based publish.
612
- - Updated dependencies [48b7f6a]
613
- - @cosmicdrift/kumiko-framework@0.2.1
614
- - @cosmicdrift/kumiko-bundled-features@0.2.1
615
-
616
- ## 0.2.0
617
-
618
- ### Minor Changes
619
-
620
- - 6c70b6f: fix(tenant): seedTenant idempotent gegen Event-Store-Projection-Drift.
621
-
622
- Verhindert version_conflict beim App-Boot wenn Aggregat existiert aber
623
- Projection-Row fehlt (rebuild-drift, async-lag, manueller DB-Eingriff).
624
-
625
- ### Patch Changes
626
-
627
- - Updated dependencies [6c70b6f]
628
- - @cosmicdrift/kumiko-framework@0.2.0
629
- - @cosmicdrift/kumiko-bundled-features@0.2.0
630
-
631
- ## 0.1.0
632
-
633
- ### Minor Changes
634
-
635
- - 59ba6d7: Initial public release of Kumiko — AI-native backend builder.
636
-
637
- What ships in 0.1.0:
638
-
639
- - **Engine** (`@cosmicdrift/kumiko-framework`): `defineFeature`, `r.entity`, `r.writeHandler`, `r.queryHandler`, `r.projection`, `r.multiStreamProjection`, `r.hook`, `r.translations`, `r.crud`, `r.referenceData`, `r.screen`, `r.nav`, `r.authClaims`, full lifecycle pipeline with field-level access checks
640
- - **Pipeline** (`@cosmicdrift/kumiko-framework`): `createDispatcher`, JWT auth via jose, Zod schema validation, role-based access checks, command/write/query split
641
- - **DB** (`@cosmicdrift/kumiko-framework`): Drizzle helpers (`buildDrizzleTable`, `applyCursorQuery`), CRUD executor, Postgres dialect, optimistic locking, soft delete, multi-tenant scoping
642
- - **Event sourcing** (`@cosmicdrift/kumiko-framework`): aggregate streams, single + multi-stream projections, event upcasters, asOf queries, archive support, AsyncDaemon-pattern dispatcher
643
- - **Bundled features** (`@cosmicdrift/kumiko-bundled-features`): auth-email-password, sessions, tenants, users, jobs, secrets, file-provider-s3, mail-transport-smtp/inmemory, billing-foundation, cap-counter, channel-in-app, delivery, feature-toggles, legal-pages
644
- - **Renderer** (`@cosmicdrift/kumiko-renderer`, `@cosmicdrift/kumiko-renderer-web`): schema-driven CRUD UI for React + Expo Web, override paths, list debounce, theme tokens
645
- - **Headless** (`@cosmicdrift/kumiko-headless`): view-models for list/edit screens, locale-aware
646
- - **Dev server** (`@cosmicdrift/kumiko-dev-server`): `runDevApp`, `runProdApp`, `kumiko-build` for production bundles (client + server), Docker-ready
647
- - **Realtime** (`@cosmicdrift/kumiko-dispatcher-live`): SSE broadcast across tenants, Redis Pub/Sub backend
648
- - **CLI** (`bin/kumiko.ts`): interactive dev menu, test runners, check pipeline (Biome + TypeScript + 18 guards + Vitest)
649
-
650
- This is a pre-1.0 release — APIs may change between minor versions. Breaking changes will be documented per release.
651
-
652
- ### Patch Changes
653
-
654
- - Updated dependencies [59ba6d7]
655
- - @cosmicdrift/kumiko-framework@0.1.0
656
- - @cosmicdrift/kumiko-bundled-features@0.1.0