@malloy-publisher/app 0.0.205 → 0.0.206

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.
package/dist/api-doc.yaml CHANGED
@@ -38,13 +38,16 @@ tags:
38
38
  - name: publisher
39
39
  description: Publisher status and health check operations
40
40
  - name: environments
41
- description: Environment lifecycle management including creation, configuration,
41
+ description:
42
+ Environment lifecycle management including creation, configuration,
42
43
  and deletion of data modeling environments
43
44
  - name: connections
44
- description: Database connection management for secure data source configuration
45
+ description:
46
+ Database connection management for secure data source configuration
45
47
  and access
46
48
  - name: packages
47
- description: Package management for Malloy data models, including versioning and
49
+ description:
50
+ Package management for Malloy data models, including versioning and
48
51
  distribution
49
52
  - name: models
50
53
  description: Malloy model access and compilation operations
@@ -58,8 +61,6 @@ tags:
58
61
  description: Real-time file watching for development workflows
59
62
  - name: materializations
60
63
  description: Package-level materializations for persisting Malloy sources
61
- - name: manifests
62
- description: Build manifest management for tracking materialized source tables
63
64
 
64
65
  paths:
65
66
  /status:
@@ -620,55 +621,7 @@ paths:
620
621
  "503":
621
622
  $ref: "#/components/responses/ServiceUnavailable"
622
623
 
623
- # TODO: Remove this endpoint.
624
624
  /environments/{environmentName}/connections/{connectionName}/sqlSource:
625
- get:
626
- tags:
627
- - connections
628
- operationId: get-sqlsource
629
- deprecated: true
630
- summary: Get SQL source (deprecated)
631
- description: |
632
- **DEPRECATED**: This endpoint is deprecated and may be removed in future versions.
633
- Use the POST version instead for better security and functionality.
634
-
635
- Creates a Malloy source from a SQL statement using the specified connection.
636
- The SQL statement is executed to generate a source definition that can be used in Malloy models.
637
- parameters:
638
- - name: environmentName
639
- in: path
640
- description: Name of the environment
641
- required: true
642
- schema:
643
- $ref: "#/components/schemas/IdentifierPattern"
644
- - name: connectionName
645
- in: path
646
- description: Name of the connection
647
- required: true
648
- schema:
649
- $ref: "#/components/schemas/IdentifierPattern"
650
- - name: sqlStatement
651
- in: query
652
- description: SQL statement
653
- required: false
654
- schema:
655
- type: string
656
- responses:
657
- "200":
658
- description: SQL source information
659
- content:
660
- application/json:
661
- schema:
662
- $ref: "#/components/schemas/SqlSource"
663
- "401":
664
- $ref: "#/components/responses/Unauthorized"
665
- "404":
666
- $ref: "#/components/responses/NotFound"
667
- "500":
668
- $ref: "#/components/responses/InternalServerError"
669
- "503":
670
- $ref: "#/components/responses/ServiceUnavailable"
671
-
672
625
  post:
673
626
  tags:
674
627
  - connections
@@ -745,13 +698,6 @@ paths:
745
698
  required: true
746
699
  schema:
747
700
  $ref: "#/components/schemas/IdentifierPattern"
748
- - name: options
749
- in: query
750
- description: Options (deprecated; pass in body instead)
751
- deprecated: true
752
- required: false
753
- schema:
754
- type: string
755
701
  requestBody:
756
702
  description: SQL statement to execute
757
703
  required: true
@@ -833,55 +779,6 @@ paths:
833
779
  "503":
834
780
  $ref: "#/components/responses/ServiceUnavailable"
835
781
 
836
- # TODO: Remove this endpoint.
837
- /environments/{environmentName}/connections/{connectionName}/temporaryTable:
838
- get:
839
- tags:
840
- - connections
841
- operationId: get-temporarytable
842
- deprecated: true
843
- summary: Create temporary table (deprecated)
844
- description: |
845
- **DEPRECATED**: This endpoint is deprecated and may be removed in future versions.
846
- Use the POST version instead for better security and functionality.
847
-
848
- Creates a temporary table from a SQL statement using the specified connection.
849
- Temporary tables are useful for storing intermediate results during complex queries.
850
- parameters:
851
- - name: environmentName
852
- in: path
853
- description: Name of the environment
854
- required: true
855
- schema:
856
- $ref: "#/components/schemas/IdentifierPattern"
857
- - name: connectionName
858
- in: path
859
- description: Name of the connection
860
- required: true
861
- schema:
862
- $ref: "#/components/schemas/IdentifierPattern"
863
- - name: sqlStatement
864
- in: query
865
- description: SQL statement
866
- required: false
867
- schema:
868
- type: string
869
- responses:
870
- "200":
871
- description: Temporary table information
872
- content:
873
- application/json:
874
- schema:
875
- $ref: "#/components/schemas/TemporaryTable"
876
- "401":
877
- $ref: "#/components/responses/Unauthorized"
878
- "404":
879
- $ref: "#/components/responses/NotFound"
880
- "500":
881
- $ref: "#/components/responses/InternalServerError"
882
- "503":
883
- $ref: "#/components/responses/ServiceUnavailable"
884
-
885
782
  # NOTE: The GET …/connections/{connectionName}/queryData endpoint
886
783
  # was removed alongside the operational-guards changes. Use the
887
784
  # POST …/sqlQuery endpoint above instead — it accepts the SQL in
@@ -1066,60 +963,7 @@ paths:
1066
963
  "503":
1067
964
  $ref: "#/components/responses/ServiceUnavailable"
1068
965
 
1069
- # TODO: Remove the GET (deprecated) form once clients migrate.
1070
966
  /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource:
1071
- get:
1072
- tags:
1073
- - connections
1074
- operationId: get-sqlsource-in-package
1075
- deprecated: true
1076
- summary: Get SQL source (per-package, deprecated)
1077
- description: |
1078
- **DEPRECATED**: Use the POST version instead.
1079
-
1080
- Creates a Malloy source from a SQL statement using the specified
1081
- connection, resolved in the context of the named package.
1082
- parameters:
1083
- - name: environmentName
1084
- in: path
1085
- description: Name of the environment
1086
- required: true
1087
- schema:
1088
- $ref: "#/components/schemas/IdentifierPattern"
1089
- - name: packageName
1090
- in: path
1091
- description: Name of the package whose connection context to use
1092
- required: true
1093
- schema:
1094
- $ref: "#/components/schemas/IdentifierPattern"
1095
- - name: connectionName
1096
- in: path
1097
- description: Name of the connection
1098
- required: true
1099
- schema:
1100
- $ref: "#/components/schemas/IdentifierPattern"
1101
- - name: sqlStatement
1102
- in: query
1103
- description: SQL statement
1104
- required: false
1105
- schema:
1106
- type: string
1107
- responses:
1108
- "200":
1109
- description: SQL source information
1110
- content:
1111
- application/json:
1112
- schema:
1113
- $ref: "#/components/schemas/SqlSource"
1114
- "401":
1115
- $ref: "#/components/responses/Unauthorized"
1116
- "404":
1117
- $ref: "#/components/responses/NotFound"
1118
- "500":
1119
- $ref: "#/components/responses/InternalServerError"
1120
- "503":
1121
- $ref: "#/components/responses/ServiceUnavailable"
1122
-
1123
967
  post:
1124
968
  tags:
1125
969
  - connections
@@ -1204,13 +1048,6 @@ paths:
1204
1048
  required: true
1205
1049
  schema:
1206
1050
  $ref: "#/components/schemas/IdentifierPattern"
1207
- - name: options
1208
- in: query
1209
- description: Options (deprecated; pass in body instead)
1210
- deprecated: true
1211
- required: false
1212
- schema:
1213
- type: string
1214
1051
  requestBody:
1215
1052
  description: SQL statement to execute
1216
1053
  required: true
@@ -1298,60 +1135,6 @@ paths:
1298
1135
  "503":
1299
1136
  $ref: "#/components/responses/ServiceUnavailable"
1300
1137
 
1301
- # TODO: Remove this endpoint.
1302
- /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/temporaryTable:
1303
- get:
1304
- tags:
1305
- - connections
1306
- operationId: get-temporarytable-in-package
1307
- deprecated: true
1308
- summary: Create temporary table (per-package, deprecated)
1309
- description: |
1310
- **DEPRECATED**: Use the POST version instead.
1311
-
1312
- Creates a temporary table from a SQL statement using the specified
1313
- connection, resolved in the context of the named package.
1314
- parameters:
1315
- - name: environmentName
1316
- in: path
1317
- description: Name of the environment
1318
- required: true
1319
- schema:
1320
- $ref: "#/components/schemas/IdentifierPattern"
1321
- - name: packageName
1322
- in: path
1323
- description: Name of the package whose connection context to use
1324
- required: true
1325
- schema:
1326
- $ref: "#/components/schemas/IdentifierPattern"
1327
- - name: connectionName
1328
- in: path
1329
- description: Name of the connection
1330
- required: true
1331
- schema:
1332
- $ref: "#/components/schemas/IdentifierPattern"
1333
- - name: sqlStatement
1334
- in: query
1335
- description: SQL statement
1336
- required: false
1337
- schema:
1338
- type: string
1339
- responses:
1340
- "200":
1341
- description: Temporary table information
1342
- content:
1343
- application/json:
1344
- schema:
1345
- $ref: "#/components/schemas/TemporaryTable"
1346
- "401":
1347
- $ref: "#/components/responses/Unauthorized"
1348
- "404":
1349
- $ref: "#/components/responses/NotFound"
1350
- "500":
1351
- $ref: "#/components/responses/InternalServerError"
1352
- "503":
1353
- $ref: "#/components/responses/ServiceUnavailable"
1354
-
1355
1138
  # NOTE: The GET …/packages/{packageName}/connections/{connectionName}/queryData
1356
1139
  # endpoint was removed alongside the operational-guards changes.
1357
1140
  # Use the matching POST …/sqlQuery endpoint instead.
@@ -1406,16 +1189,6 @@ paths:
1406
1189
  required: true
1407
1190
  schema:
1408
1191
  $ref: "#/components/schemas/IdentifierPattern"
1409
- - name: autoLoadManifest
1410
- in: query
1411
- description: |
1412
- When true, automatically loads any existing build manifest
1413
- for the package so materialized table references resolve immediately.
1414
- Defaults to false.
1415
- required: false
1416
- schema:
1417
- type: boolean
1418
- default: false
1419
1192
  requestBody:
1420
1193
  required: true
1421
1194
  content:
@@ -1429,6 +1202,8 @@ paths:
1429
1202
  application/json:
1430
1203
  schema:
1431
1204
  $ref: "#/components/schemas/Package"
1205
+ "400":
1206
+ $ref: "#/components/responses/BadRequest"
1432
1207
  "401":
1433
1208
  $ref: "#/components/responses/Unauthorized"
1434
1209
  "500":
@@ -1526,6 +1301,8 @@ paths:
1526
1301
  application/json:
1527
1302
  schema:
1528
1303
  $ref: "#/components/schemas/Package"
1304
+ "400":
1305
+ $ref: "#/components/responses/BadRequest"
1529
1306
  "401":
1530
1307
  $ref: "#/components/responses/Unauthorized"
1531
1308
  "404":
@@ -1765,7 +1542,8 @@ paths:
1765
1542
  type: string
1766
1543
  - name: path
1767
1544
  in: path
1768
- description: Path to the model within the package (used to resolve relative
1545
+ description:
1546
+ Path to the model within the package (used to resolve relative
1769
1547
  imports)
1770
1548
  required: true
1771
1549
  schema:
@@ -2251,10 +2029,13 @@ paths:
2251
2029
  tags:
2252
2030
  - materializations
2253
2031
  operationId: create-materialization
2254
- summary: Create a materialization
2032
+ summary: Create a materialization (Round 1)
2255
2033
  description: |
2256
- Creates a new materialization in PENDING state for all persist sources across all
2257
- models in the package. Use POST .../materializations/{materializationId}?action=start to begin execution.
2034
+ Starts Round 1 of the two-round build protocol: asynchronously compiles the package,
2035
+ computes a build plan (per-source buildId, output columns, dependency/column lineage,
2036
+ connection capability), and pauses at BUILD_PLAN_READY without writing any tables.
2037
+ The control plane then issues Round 2 via
2038
+ POST .../materializations/{materializationId}?action=build with build instructions.
2258
2039
  parameters:
2259
2040
  - $ref: "#/components/parameters/environmentName"
2260
2041
  - $ref: "#/components/parameters/packageName"
@@ -2283,7 +2064,8 @@ paths:
2283
2064
  - materializations
2284
2065
  operationId: list-materializations
2285
2066
  summary: List materializations for a package
2286
- description: Returns the materialization history for the package, ordered by
2067
+ description:
2068
+ Returns the materialization history for the package, ordered by
2287
2069
  most recent first.
2288
2070
  parameters:
2289
2071
  - $ref: "#/components/parameters/environmentName"
@@ -2341,8 +2123,11 @@ paths:
2341
2123
  description: |
2342
2124
  Performs an action on a materialization. The action is specified via
2343
2125
  the `action` query parameter:
2344
- * `start` - Transitions a PENDING materialization to RUNNING and begins execution in the background. Returns 202.
2345
- * `stop` - Cancels a PENDING or RUNNING materialization. Returns 200.
2126
+ * `build` - Round 2. Provide BuildInstructions (CP-assigned table id, physical
2127
+ table name, and realization per source). Builds only the instructed sources into
2128
+ the exact names provided and assembles the manifest. Valid only when the
2129
+ materialization is at BUILD_PLAN_READY. Returns 202.
2130
+ * `stop` - Cancels a PENDING, BUILD_PLAN_READY, or building materialization. Returns 200.
2346
2131
  parameters:
2347
2132
  - $ref: "#/components/parameters/environmentName"
2348
2133
  - $ref: "#/components/parameters/packageName"
@@ -2353,9 +2138,15 @@ paths:
2353
2138
  schema:
2354
2139
  type: string
2355
2140
  enum:
2356
- - start
2141
+ - build
2357
2142
  - stop
2358
2143
  description: Action to perform on the materialization
2144
+ requestBody:
2145
+ required: false
2146
+ content:
2147
+ application/json:
2148
+ schema:
2149
+ $ref: "#/components/schemas/BuildInstructions"
2359
2150
  responses:
2360
2151
  "200":
2361
2152
  description: Materialization cancelled (action=stop)
@@ -2364,7 +2155,7 @@ paths:
2364
2155
  schema:
2365
2156
  $ref: "#/components/schemas/Materialization"
2366
2157
  "202":
2367
- description: Materialization started (action=start)
2158
+ description: Round 2 build accepted (action=build)
2368
2159
  content:
2369
2160
  application/json:
2370
2161
  schema:
@@ -2384,86 +2175,43 @@ paths:
2384
2175
  - materializations
2385
2176
  operationId: delete-materialization
2386
2177
  summary: Delete a materialization
2387
- description: Deletes a terminal (SUCCESS, FAILED, or CANCELLED) materialization
2388
- record.
2178
+ description: |
2179
+ Deletes a terminal (MANIFEST_FILE_READY, FAILED, or CANCELLED)
2180
+ materialization record. By default this removes the publisher's record
2181
+ only; the control plane owns table GC. Set dropTables=true to also drop
2182
+ the physical tables this run produced (from the materialization's
2183
+ manifest) as a best-effort cleanup.
2389
2184
  parameters:
2390
2185
  - $ref: "#/components/parameters/environmentName"
2391
2186
  - $ref: "#/components/parameters/packageName"
2392
2187
  - $ref: "#/components/parameters/materializationId"
2188
+ - name: dropTables
2189
+ in: query
2190
+ required: false
2191
+ description: |
2192
+ When true, also drop the physical tables recorded in the
2193
+ materialization's manifest before deleting the record. Defaults to
2194
+ false (record-only delete; the control plane owns table GC).
2195
+ schema:
2196
+ type: boolean
2197
+ default: false
2393
2198
  responses:
2394
2199
  "204":
2395
2200
  description: Materialization deleted
2396
2201
  "404":
2397
2202
  $ref: "#/components/responses/NotFound"
2398
2203
  "409":
2399
- description: Materialization cannot be deleted (PENDING or RUNNING)
2204
+ description: Materialization cannot be deleted while it is active
2400
2205
  content:
2401
2206
  application/json:
2402
2207
  schema:
2403
2208
  $ref: "#/components/schemas/Error"
2404
2209
 
2405
- /environments/{environmentName}/packages/{packageName}/manifest:
2406
- get:
2407
- tags:
2408
- - manifests
2409
- operationId: get-manifest
2410
- summary: Get the build manifest for a package
2411
- description: |
2412
- Returns the current build manifest containing buildId-to-tableName mappings
2413
- for all materialized sources in the package.
2414
- parameters:
2415
- - $ref: "#/components/parameters/environmentName"
2416
- - $ref: "#/components/parameters/packageName"
2417
- responses:
2418
- "200":
2419
- description: Build manifest
2420
- content:
2421
- application/json:
2422
- schema:
2423
- $ref: "#/components/schemas/BuildManifest"
2424
- "404":
2425
- $ref: "#/components/responses/NotFound"
2426
- post:
2427
- tags:
2428
- - manifests
2429
- operationId: manifest-action
2430
- summary: Perform an action on the package manifest
2431
- description: |
2432
- Performs an action on the package manifest. The action is specified via
2433
- the `action` query parameter:
2434
- * `reload` - Reads the build manifest from the shared store (DuckLake
2435
- in orchestrated mode, local DuckDB in standalone mode) and recompiles
2436
- every model in the package so subsequent queries resolve persisted
2437
- sources to their materialized tables. Intended for orchestrated
2438
- workers that did not themselves run the build; the endpoint does
2439
- not write anything *into* storage.
2440
- parameters:
2441
- - $ref: "#/components/parameters/environmentName"
2442
- - $ref: "#/components/parameters/packageName"
2443
- - name: action
2444
- in: query
2445
- required: true
2446
- schema:
2447
- type: string
2448
- enum:
2449
- - reload
2450
- description: Action to perform on the manifest
2451
- responses:
2452
- "200":
2453
- description: Manifest loaded
2454
- content:
2455
- application/json:
2456
- schema:
2457
- $ref: "#/components/schemas/BuildManifest"
2458
- "400":
2459
- $ref: "#/components/responses/BadRequest"
2460
- "404":
2461
- $ref: "#/components/responses/NotFound"
2462
-
2463
2210
  components:
2464
2211
  responses:
2465
2212
  BadRequest:
2466
- description: The request was malformed or cannot be performed given the current
2213
+ description:
2214
+ The request was malformed or cannot be performed given the current
2467
2215
  state of the system
2468
2216
  content:
2469
2217
  application/json:
@@ -2586,8 +2334,9 @@ components:
2586
2334
  description: Whether the server is fully initialized and ready to serve requests
2587
2335
  operationalState:
2588
2336
  type: string
2589
- enum: [ "initializing", "serving", "draining", "throttled" ]
2590
- description: Status of the server; initializing when the server is loading
2337
+ enum: ["initializing", "serving", "draining", "throttled"]
2338
+ description:
2339
+ Status of the server; initializing when the server is loading
2591
2340
  environments, packages and connections, serving when the server is
2592
2341
  initialized and ready to serve requests, draining when the
2593
2342
  server is going to shut down, and throttled when the server has hit
@@ -2598,12 +2347,14 @@ components:
2598
2347
  Only reported when the memory governor is enabled.
2599
2348
  frozenConfig:
2600
2349
  type: boolean
2601
- description: Whether the server configuration is frozen (read-only mode). When
2350
+ description:
2351
+ Whether the server configuration is frozen (read-only mode). When
2602
2352
  true, all mutation operations are disabled.
2603
2353
 
2604
2354
  Environment:
2605
2355
  type: object
2606
- description: Represents a Malloy environment containing packages, connections,
2356
+ description:
2357
+ Represents a Malloy environment containing packages, connections,
2607
2358
  and other resources
2608
2359
  properties:
2609
2360
  resource:
@@ -2617,7 +2368,8 @@ components:
2617
2368
  description: Environment README content
2618
2369
  location:
2619
2370
  type: string
2620
- description: Environment location, can be an absolute path or URI (e.g. github,
2371
+ description:
2372
+ Environment location, can be an absolute path or URI (e.g. github,
2621
2373
  s3, gcs, etc.)
2622
2374
  connections:
2623
2375
  type: array
@@ -2629,19 +2381,6 @@ components:
2629
2381
  description: List of Malloy packages in this environment
2630
2382
  items:
2631
2383
  $ref: "#/components/schemas/Package"
2632
- materializationStorage:
2633
- type: object
2634
- nullable: true
2635
- description: Optional DuckLake-backed storage for materialization manifests
2636
- (orchestrated mode). When set, manifests are stored in a shared
2637
- DuckLake catalog instead of the local DuckDB database.
2638
- properties:
2639
- catalogUrl:
2640
- type: string
2641
- description: PostgreSQL connection URL for the DuckLake catalog metadata store
2642
- dataPath:
2643
- type: string
2644
- description: Cloud storage path (s3:// or gs://) for DuckLake data files
2645
2384
 
2646
2385
  Package:
2647
2386
  type: object
@@ -2659,8 +2398,59 @@ components:
2659
2398
  description: Package description
2660
2399
  location:
2661
2400
  type: string
2662
- description: Package location, can be an absolute path or URI (e.g. github, s3,
2401
+ description:
2402
+ Package location, can be an absolute path or URI (e.g. github, s3,
2663
2403
  gcs, etc.)
2404
+ explores:
2405
+ type: array
2406
+ items:
2407
+ type: string
2408
+ description: >-
2409
+ Optional opt-in for curated discovery. When present, only these
2410
+ model file paths (relative to the package root) are listed via
2411
+ `listModels()`, and within-file discovery is filtered to each
2412
+ model's `export {}` closure. When absent or empty, every model is
2413
+ listed with its full source set (backward-compatible). Every other
2414
+ .malloy file still compiles for import/join resolution but is
2415
+ hidden from listings once `explores` is declared. Notebooks are
2416
+ always listed regardless of this field.
2417
+ exploresWarnings:
2418
+ type: array
2419
+ readOnly: true
2420
+ items:
2421
+ type: string
2422
+ description: >-
2423
+ Actionable messages for declared explores that do not resolve to
2424
+ a real model in this package (e.g. a misspelled path, or a notebook
2425
+ listed as an explore). Server-computed and read-only: it is
2426
+ ignored on create/update requests and only ever returned in
2427
+ responses. Present only when there are such problems. Loading is
2428
+ fail-safe — the unresolved entry simply lists nothing rather than
2429
+ exposing everything — so this is the signal that a package is
2430
+ misconfigured; publishing such a package is rejected.
2431
+ queryableSources:
2432
+ type: string
2433
+ enum:
2434
+ - declared
2435
+ - all
2436
+ description: >-
2437
+ Controls whether the discovery surface is also a query boundary.
2438
+ `"declared"` (the default) makes queryable == discoverable: when
2439
+ `explores` is declared, only `explores` model files — and within
2440
+ them only the `export {}` closure — are valid top-level query
2441
+ targets; every other source still compiles, imports, joins, and
2442
+ extends but is not directly queryable (denied with 404). `"all"`
2443
+ decouples them: `explores`/`export {}` gate discovery only and every
2444
+ compiled source stays directly queryable. When `explores` is absent
2445
+ there is no curated surface, so both modes are equivalent
2446
+ (everything queryable). Invalid values fall back to `"declared"`.
2447
+ Identity-based access is a separate concern — see `#(authorize)`.
2448
+ manifestLocation:
2449
+ type: ["string", "null"]
2450
+ description: |
2451
+ URI (gs:// or s3://) of the control-plane-computed manifest for this package.
2452
+ On (re)load the worker reads it and binds persist references
2453
+ (buildId -> physicalTableName). Null = serve live.
2664
2454
 
2665
2455
  Model:
2666
2456
  type: object
@@ -2702,7 +2492,8 @@ components:
2702
2492
  properties:
2703
2493
  resource:
2704
2494
  type: string
2705
- description: Canonical URL to the served page. Root-relative and does NOT
2495
+ description:
2496
+ Canonical URL to the served page. Root-relative and does NOT
2706
2497
  carry the /api/v0 prefix, because pages are static assets served off
2707
2498
  the server root rather than API resources.
2708
2499
  packageName:
@@ -2713,7 +2504,8 @@ components:
2713
2504
  description: Relative path to the HTML file within its package directory
2714
2505
  title:
2715
2506
  type: string
2716
- description: Title extracted from the file's <title> tag, or the path if
2507
+ description:
2508
+ Title extracted from the file's <title> tag, or the path if
2717
2509
  not present
2718
2510
 
2719
2511
  RawNotebook:
@@ -2769,7 +2561,8 @@ components:
2769
2561
  description: JSON string containing model metadata and structure information
2770
2562
  sourceInfos:
2771
2563
  type: array
2772
- description: Array of JSON strings containing source information for each data
2564
+ description:
2565
+ Array of JSON strings containing source information for each data
2773
2566
  source
2774
2567
  items:
2775
2568
  type: string
@@ -2785,7 +2578,8 @@ components:
2785
2578
  $ref: "#/components/schemas/Source"
2786
2579
  givens:
2787
2580
  type: array
2788
- description: Givens (runtime parameters) declared on this model via the
2581
+ description:
2582
+ Givens (runtime parameters) declared on this model via the
2789
2583
  `given:` keyword
2790
2584
  items:
2791
2585
  $ref: "#/components/schemas/Given"
@@ -2851,12 +2645,14 @@ components:
2851
2645
  description: Whether a value must be provided
2852
2646
  dimensionType:
2853
2647
  type: string
2854
- description: Malloy data type of the dimension (e.g. string, number, boolean,
2648
+ description:
2649
+ Malloy data type of the dimension (e.g. string, number, boolean,
2855
2650
  date, timestamp)
2856
2651
 
2857
2652
  Given:
2858
2653
  type: object
2859
- description: A given (runtime parameter) declared on a Malloy model via the
2654
+ description:
2655
+ A given (runtime parameter) declared on a Malloy model via the
2860
2656
  `given:` keyword. Surfaced on `CompiledModel.givens` and `Source.givens`
2861
2657
  so callers can introspect what runtime values a model accepts.
2862
2658
  properties:
@@ -2912,7 +2708,8 @@ components:
2912
2708
  $ref: "#/components/schemas/Filter"
2913
2709
  givens:
2914
2710
  type: array
2915
- description: Model-level givens (runtime parameters) available to queries
2711
+ description:
2712
+ Model-level givens (runtime parameters) available to queries
2916
2713
  on this source. Identical to `CompiledModel.givens`; repeated here
2917
2714
  for SDK ergonomics so consumers iterating sources can render inputs
2918
2715
  without a second lookup.
@@ -2938,23 +2735,27 @@ components:
2938
2735
  properties:
2939
2736
  query:
2940
2737
  type: string
2941
- description: Query string to execute on the model. If the query parameter is
2738
+ description:
2739
+ Query string to execute on the model. If the query parameter is
2942
2740
  set, the queryName parameter must be empty.
2943
2741
  sourceName:
2944
2742
  type: string
2945
- description: Name of the source in the model to use for queryName, search, and
2743
+ description:
2744
+ Name of the source in the model to use for queryName, search, and
2946
2745
  topValue requests.
2947
2746
  queryName:
2948
2747
  type: string
2949
- description: Name of a query to execute on a source in the model. Requires the
2748
+ description:
2749
+ Name of a query to execute on a source in the model. Requires the
2950
2750
  sourceName parameter is set. If the queryName parameter is set, the
2951
2751
  query parameter must be empty.
2952
2752
  compactJson:
2953
2753
  type: boolean
2954
2754
  default: false
2955
- description: "If true, returns a simple JSON array of row objects in the form
2956
- {\"columnName\": value}. If false (default), returns the full Malloy
2957
- result with type metadata for rendering."
2755
+ description:
2756
+ 'If true, returns a simple JSON array of row objects in the form
2757
+ {"columnName": value}. If false (default), returns the full Malloy
2758
+ result with type metadata for rendering.'
2958
2759
  versionId:
2959
2760
  type: string
2960
2761
  description: Version ID
@@ -2988,20 +2789,22 @@ components:
2988
2789
  properties:
2989
2790
  type:
2990
2791
  type: string
2991
- enum: [ "markdown", "code" ]
2792
+ enum: ["markdown", "code"]
2992
2793
  description: Type of notebook cell
2993
2794
  text:
2994
2795
  type: string
2995
2796
  description: Text contents of the notebook cell (either markdown or Malloy code)
2996
2797
  newSources:
2997
2798
  type: array
2998
- description: Array of JSON strings containing SourceInfo objects made available
2799
+ description:
2800
+ Array of JSON strings containing SourceInfo objects made available
2999
2801
  in this cell
3000
2802
  items:
3001
2803
  type: string
3002
2804
  queryInfo:
3003
2805
  type: string
3004
- description: JSON string containing QueryInfo object for the query in this cell
2806
+ description:
2807
+ JSON string containing QueryInfo object for the query in this cell
3005
2808
  (if the cell contains a query)
3006
2809
 
3007
2810
  NotebookCellResult:
@@ -3010,7 +2813,7 @@ components:
3010
2813
  properties:
3011
2814
  type:
3012
2815
  type: string
3013
- enum: [ "markdown", "code" ]
2816
+ enum: ["markdown", "code"]
3014
2817
  description: Type of notebook cell
3015
2818
  text:
3016
2819
  type: string
@@ -3020,7 +2823,8 @@ components:
3020
2823
  description: JSON string containing the execution result for this cell
3021
2824
  newSources:
3022
2825
  type: array
3023
- description: Array of JSON strings containing SourceInfo objects made available
2826
+ description:
2827
+ Array of JSON strings containing SourceInfo objects made available
3024
2828
  in this cell
3025
2829
  items:
3026
2830
  type: string
@@ -3031,14 +2835,16 @@ components:
3031
2835
  properties:
3032
2836
  result:
3033
2837
  type: string
3034
- description: JSON string containing the query results, metadata, and execution
2838
+ description:
2839
+ JSON string containing the query results, metadata, and execution
3035
2840
  information
3036
2841
  resource:
3037
2842
  type: string
3038
2843
  description: Resource path to the query result
3039
2844
  renderLogs:
3040
2845
  type: array
3041
- description: Render tag validation messages (errors, warnings) detected during
2846
+ description:
2847
+ Render tag validation messages (errors, warnings) detected during
3042
2848
  query preparation
3043
2849
  items:
3044
2850
  $ref: "#/components/schemas/LogMessage"
@@ -3071,7 +2877,7 @@ components:
3071
2877
  severity:
3072
2878
  type: string
3073
2879
  description: Severity level of the log message
3074
- enum: [ "debug", "info", "warn", "error" ]
2880
+ enum: ["debug", "info", "warn", "error"]
3075
2881
  message:
3076
2882
  type: string
3077
2883
  description: Human-readable log message
@@ -3091,7 +2897,7 @@ components:
3091
2897
  type:
3092
2898
  type: string
3093
2899
  description: Type of embedded database
3094
- enum: [ "embedded", "materialized" ]
2900
+ enum: ["embedded", "materialized"]
3095
2901
 
3096
2902
  Schema:
3097
2903
  description: A schema name in a Connection.
@@ -3194,7 +3000,8 @@ components:
3194
3000
  description: PostgreSQL password for authentication
3195
3001
  connectionString:
3196
3002
  type: string
3197
- description: Complete PostgreSQL connection string (alternative to individual
3003
+ description:
3004
+ Complete PostgreSQL connection string (alternative to individual
3198
3005
  parameters)
3199
3006
 
3200
3007
  MysqlConnection:
@@ -3264,7 +3071,7 @@ components:
3264
3071
  properties:
3265
3072
  authType:
3266
3073
  type: string
3267
- enum: [ service_principal, sas_token ]
3074
+ enum: [service_principal, sas_token]
3268
3075
  description: Authentication method for Azure Storage
3269
3076
  sasUrl:
3270
3077
  type: string
@@ -3305,7 +3112,8 @@ components:
3305
3112
  properties:
3306
3113
  bucketUrl:
3307
3114
  type: string
3308
- description: URL of the storage bucket (e.g. s3://my-bucket/path or
3115
+ description:
3116
+ URL of the storage bucket (e.g. s3://my-bucket/path or
3309
3117
  gs://my-bucket/path)
3310
3118
  s3Connection:
3311
3119
  $ref: "#/components/schemas/S3Connection"
@@ -3478,7 +3286,7 @@ components:
3478
3286
  type:
3479
3287
  type: string
3480
3288
  description: Type of database connection
3481
- enum: [ bigquery, snowflake, postgres, gcs, s3, azure ]
3289
+ enum: [bigquery, snowflake, postgres, gcs, s3, azure]
3482
3290
  attributes:
3483
3291
  $ref: "#/components/schemas/ConnectionAttributes"
3484
3292
  bigqueryConnection:
@@ -3519,24 +3327,6 @@ components:
3519
3327
  items:
3520
3328
  $ref: "#/components/schemas/Column"
3521
3329
 
3522
- # TODO: Remove this. Replaced by Table
3523
- TableSource:
3524
- type: object
3525
- deprecated: true
3526
- properties:
3527
- resource:
3528
- type: string
3529
- description: Resource path to the table source.
3530
- # Pass source as an opaque JSON string that is malloyVersion dependent.
3531
- # TODO: Remove this once we update the Malloy Publisher connection.
3532
- source:
3533
- type: string
3534
- columns:
3535
- description: Table fields
3536
- type: array
3537
- items:
3538
- $ref: "#/components/schemas/Column"
3539
-
3540
3330
  TemporaryTable:
3541
3331
  type: object
3542
3332
  properties:
@@ -3609,7 +3399,8 @@ components:
3609
3399
  description: Name of the environment being watched for file changes
3610
3400
  watchingPath:
3611
3401
  type: string
3612
- description: The file system path being monitored for changes, null if not
3402
+ description:
3403
+ The file system path being monitored for changes, null if not
3613
3404
  watching
3614
3405
  required:
3615
3406
  - enabled
@@ -3633,7 +3424,7 @@ components:
3633
3424
  status:
3634
3425
  type: string
3635
3426
  description: Connection test result status
3636
- enum: [ "ok", "failed" ]
3427
+ enum: ["ok", "failed"]
3637
3428
  errorMessage:
3638
3429
  type: string
3639
3430
  description: Error message if the connection test failed, null if successful
@@ -3648,7 +3439,8 @@ components:
3648
3439
  includeSql:
3649
3440
  type: boolean
3650
3441
  default: false
3651
- description: If true, returns the generated SQL alongside compilation results
3442
+ description:
3443
+ If true, returns the generated SQL alongside compilation results
3652
3444
  (only available when compilation succeeds and the source contains a
3653
3445
  runnable query).
3654
3446
  givens:
@@ -3662,9 +3454,10 @@ components:
3662
3454
  properties:
3663
3455
  status:
3664
3456
  type: string
3665
- description: Overall compilation status — "error" if any problems have error
3457
+ description:
3458
+ Overall compilation status — "error" if any problems have error
3666
3459
  severity
3667
- enum: [ "success", "error" ]
3460
+ enum: ["success", "error"]
3668
3461
  problems:
3669
3462
  type: array
3670
3463
  description: List of compilation problems (errors and warnings)
@@ -3672,7 +3465,8 @@ components:
3672
3465
  $ref: "#/components/schemas/CompileProblem"
3673
3466
  sql:
3674
3467
  type: string
3675
- description: Generated SQL for the compiled query. Only present when includeSql
3468
+ description:
3469
+ Generated SQL for the compiled query. Only present when includeSql
3676
3470
  is true and compilation succeeds with a runnable query.
3677
3471
 
3678
3472
  CompileProblem:
@@ -3685,7 +3479,7 @@ components:
3685
3479
  severity:
3686
3480
  type: string
3687
3481
  description: Severity level of the problem
3688
- enum: [ "error", "warn", "debug" ]
3482
+ enum: ["error", "warn", "debug"]
3689
3483
  code:
3690
3484
  type: string
3691
3485
  description: Machine-readable error code
@@ -3702,22 +3496,46 @@ components:
3702
3496
 
3703
3497
  CreateMaterializationRequest:
3704
3498
  type: object
3705
- description: Options for creating a materialization
3499
+ description:
3500
+ Options for starting a materialization. Auto-run by default; opt into the
3501
+ two-round control-plane-driven flow with pauseBetweenPhases.
3706
3502
  properties:
3707
- forceRefresh:
3503
+ pauseBetweenPhases:
3708
3504
  type: boolean
3709
3505
  default: false
3710
- description: If true, forces rebuild of all sources even if their BuildID is
3711
- unchanged
3712
- autoLoadManifest:
3506
+ description:
3507
+ When false (default) the publisher runs all phases in one pass —
3508
+ self-assigns table names (the "#@ persist name=" value, else the
3509
+ source name), builds with realization=COPY, assembles the manifest,
3510
+ and auto-loads it into the package models. When true it pauses at
3511
+ BUILD_PLAN_READY for the control plane to send Round 2 build
3512
+ instructions.
3513
+ forceRefresh:
3713
3514
  type: boolean
3714
3515
  default: false
3715
- description: If true, automatically reloads the manifest into the Malloy Runtime
3716
- after a successful materialization
3516
+ description: Build a new table even when a source's buildId is unchanged.
3517
+ sourceNames:
3518
+ type: array
3519
+ items:
3520
+ type: string
3521
+ description:
3522
+ Restrict the plan/build to these persist source names. Omit = all
3523
+ persist sources.
3524
+
3525
+ MaterializationStatus:
3526
+ type: string
3527
+ description: Phase-aware status of a two-round materialization run.
3528
+ enum:
3529
+ - PENDING
3530
+ - BUILD_PLAN_READY
3531
+ - MANIFEST_ROWS_READY
3532
+ - MANIFEST_FILE_READY
3533
+ - FAILED
3534
+ - CANCELLED
3717
3535
 
3718
3536
  Materialization:
3719
3537
  type: object
3720
- description: A record of a package materialization
3538
+ description: A record of one two-round materialization run for a package.
3721
3539
  properties:
3722
3540
  id:
3723
3541
  type: string
@@ -3725,21 +3543,36 @@ components:
3725
3543
  type: string
3726
3544
  packageName:
3727
3545
  type: string
3546
+ pauseBetweenPhases:
3547
+ type: boolean
3548
+ description:
3549
+ Echoes the create-time flag. False (default) = auto-run all phases;
3550
+ true = pause at BUILD_PLAN_READY for control-plane-driven Round 2.
3728
3551
  status:
3729
- type: string
3730
- enum: [ "PENDING", "RUNNING", "SUCCESS", "FAILED", "CANCELLED" ]
3552
+ $ref: "#/components/schemas/MaterializationStatus"
3553
+ buildPlan:
3554
+ oneOf:
3555
+ - $ref: "#/components/schemas/BuildPlan"
3556
+ - type: "null"
3557
+ description: Round 1 output. Null until status >= BUILD_PLAN_READY.
3558
+ manifest:
3559
+ oneOf:
3560
+ - $ref: "#/components/schemas/BuildManifest"
3561
+ - type: "null"
3562
+ description: Round 2 output. Null until status = MANIFEST_FILE_READY.
3731
3563
  startedAt:
3732
- type: [ "string", "null" ]
3564
+ type: ["string", "null"]
3733
3565
  format: date-time
3734
3566
  completedAt:
3735
- type: [ "string", "null" ]
3567
+ type: ["string", "null"]
3736
3568
  format: date-time
3737
3569
  error:
3738
- type: [ "string", "null" ]
3570
+ type: ["string", "null"]
3739
3571
  description: Error message if the materialization failed
3740
3572
  metadata:
3741
- type: [ "object", "null" ]
3742
- description: Materialization metadata including build options, source counts,
3573
+ type: ["object", "null"]
3574
+ description:
3575
+ Materialization metadata including build options, source counts,
3743
3576
  and durations
3744
3577
  createdAt:
3745
3578
  type: string
@@ -3748,26 +3581,161 @@ components:
3748
3581
  type: string
3749
3582
  format: date-time
3750
3583
 
3584
+ BuildPlan:
3585
+ type: object
3586
+ description: |
3587
+ Round 1 output. Mirrors Malloy's native build plan plus the minimal
3588
+ per-source detail the control plane needs in v0 to assign
3589
+ identity/naming/realization. Lineage, policy, and connection
3590
+ capability are intentionally omitted until they carry real data.
3591
+ required: [graphs, sources]
3592
+ properties:
3593
+ graphs:
3594
+ type: array
3595
+ description: Dependency-ordered build graphs, one per connection.
3596
+ items:
3597
+ $ref: "#/components/schemas/BuildGraph"
3598
+ sources:
3599
+ type: object
3600
+ description: Map of sourceID ("sourceName@modelURL") to per-source plan.
3601
+ additionalProperties:
3602
+ $ref: "#/components/schemas/PersistSourcePlan"
3603
+
3604
+ BuildGraph:
3605
+ type: object
3606
+ required: [connectionName, nodes]
3607
+ properties:
3608
+ connectionName:
3609
+ type: string
3610
+ nodes:
3611
+ type: array
3612
+ description:
3613
+ Leveled build nodes; each inner array is one parallelizable level,
3614
+ levels run in order.
3615
+ items:
3616
+ type: array
3617
+ items:
3618
+ $ref: "#/components/schemas/BuildNode"
3619
+
3620
+ BuildNode:
3621
+ type: object
3622
+ required: [sourceID]
3623
+ properties:
3624
+ sourceID:
3625
+ type: string
3626
+ description: "sourceName@modelURL"
3627
+ dependsOn:
3628
+ type: array
3629
+ description: Upstream sourceIDs in this graph.
3630
+ items:
3631
+ type: string
3632
+
3633
+ PersistSourcePlan:
3634
+ type: object
3635
+ required: [name, sourceID, connectionName, buildId, sql, columns]
3636
+ properties:
3637
+ name:
3638
+ type: string
3639
+ sourceID:
3640
+ type: string
3641
+ connectionName:
3642
+ type: string
3643
+ dialect:
3644
+ type: string
3645
+ buildId:
3646
+ type: string
3647
+ description: hash(connectionDigest + canonical logical SQL).
3648
+ sql:
3649
+ type: string
3650
+ description:
3651
+ The source's build SQL (with the build manifest applied for upstream
3652
+ rewrites).
3653
+ columns:
3654
+ type: array
3655
+ description: Output schema of the source.
3656
+ items:
3657
+ $ref: "#/components/schemas/Column"
3658
+
3659
+ Realization:
3660
+ type: string
3661
+ enum: [SNAPSHOT, COPY]
3662
+ description: SNAPSHOT = warehouse clone/snapshot; COPY = CREATE TABLE AS SELECT.
3663
+
3664
+ BuildInstructions:
3665
+ type: object
3666
+ description: Round 2 input. Per-source instructions assigned by the control plane.
3667
+ required: [sources]
3668
+ properties:
3669
+ sources:
3670
+ type: array
3671
+ items:
3672
+ $ref: "#/components/schemas/BuildInstruction"
3673
+
3674
+ BuildInstruction:
3675
+ type: object
3676
+ required: [buildId, materializedTableId, physicalTableName, realization]
3677
+ properties:
3678
+ buildId:
3679
+ type: string
3680
+ description: Identifies which planned source this instruction is for
3681
+ (matches PersistSourcePlan.buildId).
3682
+ sourceID:
3683
+ type: string
3684
+ description:
3685
+ Optional convenience echo of "sourceName@modelURL"; buildId is
3686
+ authoritative.
3687
+ materializedTableId:
3688
+ type: string
3689
+ description:
3690
+ CP-assigned surrogate id for the materialized table about to be
3691
+ produced.
3692
+ physicalTableName:
3693
+ type: string
3694
+ description:
3695
+ Fully-qualified, dialect-quoted table name to create. The publisher
3696
+ writes here verbatim.
3697
+ realization:
3698
+ $ref: "#/components/schemas/Realization"
3699
+
3751
3700
  BuildManifest:
3752
3701
  type: object
3753
- description: Manifest mapping BuildIDs to materialized table names
3702
+ description:
3703
+ Round 2 output. Maps each buildId a build produced to its physical table.
3704
+ Returned inline; the control plane persists it.
3754
3705
  properties:
3706
+ builtAt:
3707
+ type: string
3708
+ format: date-time
3755
3709
  entries:
3756
3710
  type: object
3757
3711
  additionalProperties:
3758
3712
  $ref: "#/components/schemas/ManifestEntry"
3759
- description: Map of BuildID to manifest entry
3713
+ description: Map of buildId to manifest entry.
3760
3714
  strict:
3761
3715
  type: boolean
3762
- description: Whether the manifest is in strict mode
3716
+ description: Whether unresolved references should error.
3763
3717
 
3764
3718
  ManifestEntry:
3765
3719
  type: object
3766
- description: A single entry in the build manifest
3720
+ description: A single entry in the build manifest.
3721
+ required: [buildId, physicalTableName]
3767
3722
  properties:
3768
- tableName:
3723
+ buildId:
3724
+ type: string
3725
+ sourceName:
3726
+ type: string
3727
+ materializedTableId:
3728
+ type: string
3729
+ description: Echoes the CP-assigned id from the BuildInstruction.
3730
+ physicalTableName:
3769
3731
  type: string
3770
- description: Name of the materialized table
3732
+ description: Name of the materialized table.
3733
+ connectionName:
3734
+ type: string
3735
+ realization:
3736
+ $ref: "#/components/schemas/Realization"
3737
+ rowCount:
3738
+ type: ["integer", "null"]
3771
3739
 
3772
3740
  parameters:
3773
3741
  environmentName: