@nanobpm/urban 0.77.4 → 0.79.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.
@@ -214,7 +214,100 @@ export type {
214
214
  LineageStoreOptions,
215
215
  } from "./core/modules/lineage-store.ts";
216
216
 
217
- // Phase — the framework-level *domain phase* primitive (issue #266): derive "which phase is this
217
+ // ─────────────────────────────────────────── Read models ────────────────────────────────────────
218
+ // The declare-once, compile-to-both derived read-model primitive (ADR 0065): a closed expression DSL
219
+ // (`col`/`lit`/comparisons/`and`/`or`/`not`/`caseWhen`/`exists`) declared ONCE via `defineReadModel`,
220
+ // compiled to BOTH a SQLite VIEW select-list (`compileToSqlSelect`) and an in-process TS function
221
+ // (`compileToFn`) from the SAME AST, plus the framework-derived managed VIEW DDL and the parity guard
222
+ // that replaces per-projection hand-written parity tests.
223
+ //
224
+ // SIBLING REGISTRATION POINTS (ADR 0065 rollout — see core/read-model.ts for the full seam docs):
225
+ // • `readModelRegistry` — register a `defineReadModel(...)` result; the boot path (core/modules/
226
+ // workers.ts) applies its managed VIEW. The `writer-source-inversion` task registers here.
227
+ // • `projectionRegistry` — register a canonical engine-truth projection NAME usable in `exists(...)`.
228
+ // The `canonical-projections` task registers `urban_open_user_tasks` / `urban_instance_state`.
229
+ export {
230
+ and,
231
+ assertReadModelParity,
232
+ assertSqlIdentifier,
233
+ caseWhen,
234
+ col,
235
+ compileToFn,
236
+ compileToSqlSelect,
237
+ defineReadModel,
238
+ deriveReadModelViewDdl,
239
+ eq,
240
+ exists,
241
+ gt,
242
+ gte,
243
+ lit,
244
+ lt,
245
+ lte,
246
+ neq,
247
+ not,
248
+ or,
249
+ pcol,
250
+ ProjectionRegistry,
251
+ projectionRegistry,
252
+ ReadModelRegistry,
253
+ readModelRegistry,
254
+ when,
255
+ } from "./core/read-model.ts";
256
+ export type {
257
+ AndExpr,
258
+ BaseRow,
259
+ CaseExpr,
260
+ ColExpr,
261
+ CompareExpr,
262
+ CompareOp,
263
+ DerivationFn,
264
+ ExistsExpr,
265
+ Expr,
266
+ Literal,
267
+ LitExpr,
268
+ NotExpr,
269
+ OrExpr,
270
+ ParityDb,
271
+ ParityOptions,
272
+ ParitySample,
273
+ ProjColExpr,
274
+ ProjectionRows,
275
+ ProjectionSource,
276
+ ReadModel,
277
+ ReadModelDecl,
278
+ SqlCompileOptions,
279
+ WhenClause,
280
+ } from "./core/read-model.ts";
281
+
282
+ // Canonical engine-truth projection sidecars (ADR 0065, proposal point #1): two framework-owned,
283
+ // per-source projections the DSL `exists(...)` derives over — `urban_open_user_tasks` (which instances
284
+ // are parked on a human) and `urban_instance_state` (per-instance engine lifecycle state). Provisioned
285
+ // next to the lineage sidecar in core/modules/workers.ts; registered into `projectionRegistry` under
286
+ // their stable DSL names via `registerCanonicalProjections()`.
287
+ export {
288
+ CANONICAL_PROJECTIONS,
289
+ registerCanonicalProjections,
290
+ } from "./core/modules/canonical-projections.ts";
291
+ export {
292
+ OPEN_USER_TASKS_PROJECTION,
293
+ OPEN_USER_TASKS_SCHEMA_SQL,
294
+ OPEN_USER_TASKS_TABLE,
295
+ OpenUserTasksStore,
296
+ } from "./core/modules/open-user-tasks-store.ts";
297
+ export type {
298
+ OpenUserTaskRow,
299
+ OpenUserTasksStoreOptions,
300
+ } from "./core/modules/open-user-tasks-store.ts";
301
+ export {
302
+ INSTANCE_STATE_PROJECTION,
303
+ INSTANCE_STATE_SCHEMA_SQL,
304
+ INSTANCE_STATE_TABLE,
305
+ InstanceStateStore,
306
+ } from "./core/modules/instance-state-store.ts";
307
+ export type {
308
+ InstanceStateRow,
309
+ InstanceStateStoreOptions,
310
+ } from "./core/modules/instance-state-store.ts";
218
311
  // instance in?" from the BPMN scope hierarchy + write-provenance (Tier 0, zero declaration), an
219
312
  // optional `nano:phase` override (Tier 1), and a lineage rollup for the epic frontier (Tier 2).
220
313
  export {