@malloy-publisher/app 0.18.6 → 0.18.7

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 (24) hide show
  1. package/dist/api-doc.yaml +818 -52
  2. package/dist/assets/{EnvironmentPage-C3gdsp81.js → EnvironmentPage-nfT0sfcF.js} +1 -1
  3. package/dist/assets/{HomePage-DqgKtxBQ.js → HomePage-CLVuGwtd.js} +1 -1
  4. package/dist/assets/{MainPage-BnTI-1vD.js → MainPage-BPN92PmE.js} +1 -1
  5. package/dist/assets/{ModelPage-eLIQM9Js.js → ModelPage-BtYHo01_.js} +2 -2
  6. package/dist/assets/{PackagePage-CejLNGDv.js → PackagePage-BYTMF_z7.js} +1 -1
  7. package/dist/assets/{PackageSplatRoute-CXdCJTYw.js → PackageSplatRoute-M9_ZKB-f.js} +2 -2
  8. package/dist/assets/{RenderedResult-cJiP774J.es-CZC2lkLE.js → RenderedResult-BkBdGb49.es-BeM14Cw6.js} +3 -3
  9. package/dist/assets/{RouteError-_sExFuNk.js → RouteError-O8rWhL-e.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-CaJX95t_.js → ThemeEditorPage-BPlQ20Nk.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-DogvpiUV.js → ToggleButtonGroup-ZFDdg4WD.js} +1 -1
  12. package/dist/assets/{documentRoutes-G_kvP2a6.js → documentRoutes-D2CHPd13.js} +1 -1
  13. package/dist/assets/{editPageMounted-CM_VLUwp.js → editPageMounted-CK5o2lS_.js} +2 -2
  14. package/dist/assets/{index-D9nJPs77.js → index-BvIvG2Vi.js} +1 -1
  15. package/dist/assets/{index-b7pou7Vk.js → index-Dd4jjg8n.js} +110 -110
  16. package/dist/assets/{index-CYndXhSx.js → index-m8b6Cq0X.js} +1 -1
  17. package/dist/assets/{index-O_b7OJ2r.js → index-w9WgUNKi.js} +1 -1
  18. package/dist/assets/{index.es-DQ-xbkiQ.js → index.es-c9W9AVnk.js} +1 -1
  19. package/dist/assets/usePackageLinkNavigate-DFEdCQJt.js +1 -0
  20. package/dist/assets/{usePackageRoute-yIGqS2C8.js → usePackageRoute-DZUIBpcE.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/dist/mcp-app/report.js +701 -701
  23. package/package.json +2 -2
  24. package/dist/assets/usePackageLinkNavigate-Lw9XmylW.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -393,6 +393,8 @@ paths:
393
393
  $ref: "#/components/responses/Unauthorized"
394
394
  "404":
395
395
  $ref: "#/components/responses/NotFound"
396
+ "409":
397
+ $ref: "#/components/responses/SimulationActive"
396
398
  "500":
397
399
  $ref: "#/components/responses/InternalServerError"
398
400
  "503":
@@ -786,6 +788,24 @@ paths:
786
788
  required: true
787
789
  schema:
788
790
  $ref: "#/components/schemas/PathPattern"
791
+ - name: include
792
+ in: query
793
+ description: |
794
+ Extra parts of the table to read. `collations` adds each column's
795
+ `nativeType` and `collation`, and the table's `defaultCollation`
796
+ (or `collationUnsupported`), `method` and `asOf`, read from the
797
+ connection's catalog after the table itself. Absent, the response
798
+ is exactly the plain table and no extra catalog read runs. A value
799
+ that is not one of the listed parts is a 400; so is a repeated
800
+ parameter.
801
+ required: false
802
+ style: form
803
+ explode: false
804
+ schema:
805
+ type: array
806
+ items:
807
+ type: string
808
+ enum: [collations]
789
809
  responses:
790
810
  "200":
791
811
  description: Table information
@@ -808,6 +828,73 @@ paths:
808
828
  "503":
809
829
  $ref: "#/components/responses/ServiceUnavailable"
810
830
 
831
+ /environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}/stats:
832
+ get:
833
+ tags:
834
+ - connections
835
+ operationId: get-table-stats
836
+ summary: Read a table's row count, bytes and last modification
837
+ description: |
838
+ Reads a table's size from the connection's catalog: its row count,
839
+ bytes and last modification time, each null where the catalog does not
840
+ record it. `method` says how the numbers were read; `rowCountBand`
841
+ appears only where the row count is an estimate (Postgres
842
+ `reltuples`). Only a table has stats (on Postgres a partitioned table,
843
+ its partitions summed, or a materialized view too); a view, an index
844
+ or an external table answers `unsupported`. On DuckDB the row count
845
+ is counted, and that answer writes an access record with
846
+ `decision: "ungated"`. Metadata only: no field holds a row value. Answered for
847
+ Postgres, BigQuery, DuckDB, MotherDuck, DuckLake and Snowflake
848
+ connections; any other answers `status` `unsupported`. A `publisher`
849
+ proxy connection forwards the request and relays the answer with
850
+ `method` `host`.
851
+ parameters:
852
+ - name: environmentName
853
+ in: path
854
+ description: Name of the environment
855
+ required: true
856
+ schema:
857
+ $ref: "#/components/schemas/IdentifierPattern"
858
+ - name: connectionName
859
+ in: path
860
+ description: Name of the connection
861
+ required: true
862
+ schema:
863
+ $ref: "#/components/schemas/IdentifierPattern"
864
+ - name: schemaName
865
+ in: path
866
+ description: Name of the schema
867
+ required: true
868
+ schema:
869
+ $ref: "#/components/schemas/IdentifierPattern"
870
+ - name: tablePath
871
+ in: path
872
+ description: The table, as a listing's `resource` names it, or bare (then qualified by schemaName)
873
+ required: true
874
+ schema:
875
+ $ref: "#/components/schemas/PathPattern"
876
+ responses:
877
+ "200":
878
+ description: The answer, or `status` `unsupported` with a `reason` when this connection cannot give it
879
+ content:
880
+ application/json:
881
+ schema:
882
+ $ref: "#/components/schemas/TableStats"
883
+ "400":
884
+ $ref: "#/components/responses/BadRequest"
885
+ "401":
886
+ $ref: "#/components/responses/Unauthorized"
887
+ "404":
888
+ $ref: "#/components/responses/NotFound"
889
+ "424":
890
+ $ref: "#/components/responses/ConnectionUnavailable"
891
+ "500":
892
+ $ref: "#/components/responses/InternalServerError"
893
+ "502":
894
+ $ref: "#/components/responses/DatabaseUnreachable"
895
+ "503":
896
+ $ref: "#/components/responses/ServiceUnavailable"
897
+
811
898
  /environments/{environmentName}/connections/{connectionName}/sqlSource:
812
899
  post:
813
900
  tags:
@@ -1198,6 +1285,24 @@ paths:
1198
1285
  schema:
1199
1286
  $ref: "#/components/schemas/PathPattern"
1200
1287
  - $ref: "#/components/parameters/versionId"
1288
+ - name: include
1289
+ in: query
1290
+ description: |
1291
+ Extra parts of the table to read. `collations` adds each column's
1292
+ `nativeType` and `collation`, and the table's `defaultCollation`
1293
+ (or `collationUnsupported`), `method` and `asOf`, read from the
1294
+ connection's catalog after the table itself. Absent, the response
1295
+ is exactly the plain table and no extra catalog read runs. A value
1296
+ that is not one of the listed parts is a 400; so is a repeated
1297
+ parameter.
1298
+ required: false
1299
+ style: form
1300
+ explode: false
1301
+ schema:
1302
+ type: array
1303
+ items:
1304
+ type: string
1305
+ enum: [collations]
1201
1306
  responses:
1202
1307
  "200":
1203
1308
  description: Table information
@@ -1222,6 +1327,82 @@ paths:
1222
1327
  "503":
1223
1328
  $ref: "#/components/responses/ServiceUnavailable"
1224
1329
 
1330
+ /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}/stats:
1331
+ get:
1332
+ tags:
1333
+ - connections
1334
+ operationId: get-table-stats-in-package
1335
+ summary: Read a table's row count, bytes and last modification (per-package)
1336
+ description: |
1337
+ Reads a table's size from the connection's catalog: its row count,
1338
+ bytes and last modification time, each null where the catalog does not
1339
+ record it. `method` says how the numbers were read; `rowCountBand`
1340
+ appears only where the row count is an estimate (Postgres
1341
+ `reltuples`). Only a table has stats (on Postgres a partitioned table,
1342
+ its partitions summed, or a materialized view too); a view, an index
1343
+ or an external table answers `unsupported`. On DuckDB the row count
1344
+ is counted, and that answer writes an access record with
1345
+ `decision: "ungated"`. Metadata only: no field holds a row value. Answered for
1346
+ Postgres, BigQuery, DuckDB, MotherDuck, DuckLake and Snowflake
1347
+ connections; any other answers `status` `unsupported`. A `publisher`
1348
+ proxy connection forwards the request and relays the answer with
1349
+ `method` `host`.
1350
+ parameters:
1351
+ - name: environmentName
1352
+ in: path
1353
+ description: Name of the environment
1354
+ required: true
1355
+ schema:
1356
+ $ref: "#/components/schemas/IdentifierPattern"
1357
+ - name: packageName
1358
+ in: path
1359
+ description: Name of the package whose connection context to use
1360
+ required: true
1361
+ schema:
1362
+ $ref: "#/components/schemas/IdentifierPattern"
1363
+ - name: connectionName
1364
+ in: path
1365
+ description: Name of the connection
1366
+ required: true
1367
+ schema:
1368
+ $ref: "#/components/schemas/IdentifierPattern"
1369
+ - name: schemaName
1370
+ in: path
1371
+ description: Name of the schema
1372
+ required: true
1373
+ schema:
1374
+ $ref: "#/components/schemas/IdentifierPattern"
1375
+ - name: tablePath
1376
+ in: path
1377
+ description: The table, as a listing's `resource` names it, or bare (then qualified by schemaName)
1378
+ required: true
1379
+ schema:
1380
+ $ref: "#/components/schemas/PathPattern"
1381
+ - $ref: "#/components/parameters/versionId"
1382
+ responses:
1383
+ "200":
1384
+ description: The answer, or `status` `unsupported` with a `reason` when this connection cannot give it
1385
+ content:
1386
+ application/json:
1387
+ schema:
1388
+ $ref: "#/components/schemas/TableStats"
1389
+ "400":
1390
+ $ref: "#/components/responses/BadRequest"
1391
+ "401":
1392
+ $ref: "#/components/responses/Unauthorized"
1393
+ "404":
1394
+ $ref: "#/components/responses/NotFound"
1395
+ "410":
1396
+ $ref: "#/components/responses/Gone"
1397
+ "424":
1398
+ $ref: "#/components/responses/ConnectionUnavailable"
1399
+ "500":
1400
+ $ref: "#/components/responses/InternalServerError"
1401
+ "502":
1402
+ $ref: "#/components/responses/DatabaseUnreachable"
1403
+ "503":
1404
+ $ref: "#/components/responses/ServiceUnavailable"
1405
+
1225
1406
  /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource:
1226
1407
  post:
1227
1408
  tags:
@@ -1831,6 +2012,8 @@ paths:
1831
2012
  $ref: "#/components/responses/Unauthorized"
1832
2013
  "404":
1833
2014
  $ref: "#/components/responses/NotFound"
2015
+ "409":
2016
+ $ref: "#/components/responses/SimulationActive"
1834
2017
  "500":
1835
2018
  $ref: "#/components/responses/InternalServerError"
1836
2019
  "503":
@@ -2101,6 +2284,8 @@ paths:
2101
2284
  $ref: "#/components/responses/Forbidden"
2102
2285
  "404":
2103
2286
  $ref: "#/components/responses/NotFound"
2287
+ "409":
2288
+ $ref: "#/components/responses/SimulationActive"
2104
2289
  "410":
2105
2290
  $ref: "#/components/responses/Gone"
2106
2291
  "422":
@@ -2471,6 +2656,16 @@ paths:
2471
2656
  The version queried may be named in the body (`QueryRequest.versionId`), in the URL
2472
2657
  (`?versionId=`), or both. When both name a version and they differ, the request answers
2473
2658
  400 with `reason` VERSION_ID_INVALID; an empty value in either names none.
2659
+
2660
+ A query with `queryClass: index` on a source that declares a stored table of its own
2661
+ (`#(materialize)` on the source, or its own `#@ persist`; not one it only inherits) is
2662
+ answered from that table or refused: with no ready table of it bound, it answers 409 with
2663
+ `reason` INDEX_SOURCE_UNBUILT and an `unbuiltReason`, and is never run live against the
2664
+ warehouse. The 404s and 403s of the published surface and the source's gates decide first.
2665
+ Any other class, and a source with no declaration of its own, is answered as before.
2666
+ This is a cost guard on the run target's own declaration, not a guarantee for every
2667
+ spelling: an import rename is refused like the source, but a rename in a model file, an
2668
+ inline `extend` in the query, and a `compose(…)` resolving to a stored member run live.
2474
2669
  parameters:
2475
2670
  - name: environmentName
2476
2671
  in: path
@@ -2513,6 +2708,8 @@ paths:
2513
2708
  $ref: "#/components/responses/Forbidden"
2514
2709
  "404":
2515
2710
  $ref: "#/components/responses/NotFound"
2711
+ "409":
2712
+ $ref: "#/components/responses/Conflict"
2516
2713
  "410":
2517
2714
  $ref: "#/components/responses/Gone"
2518
2715
  "413":
@@ -3582,6 +3779,21 @@ paths:
3582
3779
  description: Watch mode started successfully.
3583
3780
  "401":
3584
3781
  $ref: "#/components/responses/Unauthorized"
3782
+ "409":
3783
+ description: >-
3784
+ Simulated materialization is on (`PUBLISHER_MATERIALIZE_SIMULATE`),
3785
+ which refuses a watch-mode change until the server restarts without
3786
+ it. Like this deprecated route's other failures, the body is the
3787
+ legacy `{ "error": "<message>" }`, not `Error`, so it carries no
3788
+ `reason`.
3789
+ content:
3790
+ application/json:
3791
+ schema:
3792
+ type: object
3793
+ required: [error]
3794
+ properties:
3795
+ error:
3796
+ type: string
3585
3797
  "500":
3586
3798
  $ref: "#/components/responses/InternalServerError"
3587
3799
  "503":
@@ -3607,6 +3819,21 @@ paths:
3607
3819
  description: Watch mode stopped successfully.
3608
3820
  "401":
3609
3821
  $ref: "#/components/responses/Unauthorized"
3822
+ "409":
3823
+ description: >-
3824
+ Simulated materialization is on (`PUBLISHER_MATERIALIZE_SIMULATE`),
3825
+ which refuses a watch-mode change until the server restarts without
3826
+ it. Like this deprecated route's other failures, the body is the
3827
+ legacy `{ "error": "<message>" }`, not `Error`, so it carries no
3828
+ `reason`.
3829
+ content:
3830
+ application/json:
3831
+ schema:
3832
+ type: object
3833
+ required: [error]
3834
+ properties:
3835
+ error:
3836
+ type: string
3610
3837
  "500":
3611
3838
  $ref: "#/components/responses/InternalServerError"
3612
3839
  "503":
@@ -3687,6 +3914,7 @@ paths:
3687
3914
  serve). `reason:
3688
3915
  BUILD_PLAN_UNAVAILABLE`: the package's build plan could not be
3689
3916
  derived, or it serves an older model than its files.
3917
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3690
3918
  content:
3691
3919
  application/json:
3692
3920
  schema:
@@ -3800,7 +4028,9 @@ paths:
3800
4028
  "404":
3801
4029
  $ref: "#/components/responses/NotFound"
3802
4030
  "409":
3803
- description: Materialization cannot transition to the requested state
4031
+ description: >-
4032
+ Materialization cannot transition to the requested state.
4033
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3804
4034
  content:
3805
4035
  application/json:
3806
4036
  schema:
@@ -3837,7 +4067,9 @@ paths:
3837
4067
  "404":
3838
4068
  $ref: "#/components/responses/NotFound"
3839
4069
  "409":
3840
- description: Materialization cannot be deleted while it is active
4070
+ description: >-
4071
+ Materialization cannot be deleted while it is active.
4072
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3841
4073
  content:
3842
4074
  application/json:
3843
4075
  schema:
@@ -3958,6 +4190,7 @@ paths:
3958
4190
  (`MATERIALIZATION_CONFLICT`), the table is in use (`TABLE_IN_USE`),
3959
4191
  it is another's (`TABLE_OWNED_ELSEWHERE`), or it cannot be proven
3960
4192
  this package's (`TABLE_OWNERSHIP_UNVERIFIED`).
4193
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3961
4194
  content:
3962
4195
  application/json:
3963
4196
  schema:
@@ -4042,6 +4275,8 @@ paths:
4042
4275
  $ref: "#/components/responses/BadRequest"
4043
4276
  "404":
4044
4277
  $ref: "#/components/responses/NotFound"
4278
+ "409":
4279
+ $ref: "#/components/responses/SimulationActive"
4045
4280
  "500":
4046
4281
  $ref: "#/components/responses/InternalServerError"
4047
4282
 
@@ -4097,6 +4332,8 @@ paths:
4097
4332
  $ref: "#/components/responses/BadRequest"
4098
4333
  "404":
4099
4334
  $ref: "#/components/responses/NotFound"
4335
+ "409":
4336
+ $ref: "#/components/responses/SimulationActive"
4100
4337
  "500":
4101
4338
  $ref: "#/components/responses/InternalServerError"
4102
4339
 
@@ -4128,7 +4365,10 @@ components:
4128
4365
  credentials are fixed. `PATH_ACCESS_DENIED`: a path the query or the
4129
4366
  model reads itself refused access, so the path, or the caller's grant
4130
4367
  to it, is what to fix. With `reason: ACCESS_DENIED`, a gate refused
4131
- the caller. The body
4368
+ the caller. With `reason: INHERITED_FILTER_UNVERIFIED`, no gate did: a
4369
+ `where:` the queried source inherits could not be verified to read
4370
+ the fields it was written against, and the message says which kind of
4371
+ check failed. The body
4132
4372
  names what the caller read and never a storage path; the full text is
4133
4373
  logged.
4134
4374
  content:
@@ -4165,6 +4405,22 @@ components:
4165
4405
  * BUILD_PLAN_UNAVAILABLE: the package's build plan could not be
4166
4406
  derived when it loaded. Reload the package; retrying the read does
4167
4407
  not help.
4408
+ * INDEX_SOURCE_UNBUILT: a query with `queryClass: index` on a source
4409
+ that declares a stored table of its own, with no ready table of it
4410
+ bound. Retry once the table is built; `unbuiltReason` says why it
4411
+ is not ready.
4412
+ * SIMULATION_ACTIVE: the server runs simulated materialization, and
4413
+ the request is a materialization write (see `SimulationActive`).
4414
+ content:
4415
+ application/json:
4416
+ schema:
4417
+ $ref: "#/components/schemas/Error"
4418
+ SimulationActive:
4419
+ description: |
4420
+ `reason: SIMULATION_ACTIVE`. The server runs simulated materialization
4421
+ (`PUBLISHER_MATERIALIZE_SIMULATE`), an authoring mode that makes no
4422
+ materialization write, and this request would make one. It fails the
4423
+ same way until the server restarts without simulation.
4168
4424
  content:
4169
4425
  application/json:
4170
4426
  schema:
@@ -4981,6 +5237,232 @@ components:
4981
5237
  format: date-time
4982
5238
  description: When the in-progress load began. Present only while `loading` is true.
4983
5239
 
5240
+ MaterializationMode:
5241
+ type: string
5242
+ enum: [simulated, local, draft, published]
5243
+ description: >-
5244
+ How a package's tables came to be, so a reader never mistakes one kind
5245
+ for another. `local`: an unversioned package (a watched one, or one
5246
+ installed in place) whose tables this server builds itself.
5247
+ `published`: a published version, or a package whose tables a host's
5248
+ manifest bound. `simulated`: a package simulated materialization
5249
+ serves, its tables predicted and never built; not produced yet.
5250
+ `draft` is reserved for a later release. A client must accept a value
5251
+ it does not know.
5252
+
5253
+ MaterializationStateCounts:
5254
+ type: object
5255
+ description: How many items are in each `MaterializationItem.state`.
5256
+ required: [built, awaiting_build, not_buildable, refused, failed]
5257
+ properties:
5258
+ built:
5259
+ type: integer
5260
+ awaiting_build:
5261
+ type: integer
5262
+ not_buildable:
5263
+ type: integer
5264
+ refused:
5265
+ type: integer
5266
+ failed:
5267
+ type: integer
5268
+
5269
+ MaterializationFact:
5270
+ type: object
5271
+ description: >-
5272
+ One fact about an item's table, and how it is known. `basis` is
5273
+ `exact` for a fact read off a table that exists; `predicted` and
5274
+ `not_knowable_locally` are reserved for facts a later release
5275
+ predicts without building.
5276
+ required: [fact, value, basis]
5277
+ properties:
5278
+ fact:
5279
+ type: string
5280
+ description: >-
5281
+ Which fact: `table` (the physical table a query reads, present
5282
+ once built) or `builtAt` (when that table was built). An open
5283
+ string: a client must skip a fact it does not know.
5284
+ value:
5285
+ type: string
5286
+ basis:
5287
+ type: string
5288
+ enum: [exact, predicted, not_knowable_locally]
5289
+
5290
+ MaterializationItem:
5291
+ type: object
5292
+ description: >-
5293
+ One thing a package materializes (a `#(materialize)` or `#@ persist`
5294
+ source, a `#@ persist` view or named query, or a `#(rollup)`), and
5295
+ its fate: the one row the build plan's refusals, the last build's
5296
+ failures and the serve verdicts are joined into.
5297
+ required: [name, kind, sourceID, tier, mode, state, serves]
5298
+ properties:
5299
+ name:
5300
+ type: string
5301
+ description: >-
5302
+ The declared name: the source's, the view's (on `source`), or the
5303
+ named query's. A rollup has no declared name, so this is the name
5304
+ the plan generated for it, and `source` and `grain` say what it
5305
+ rolls up.
5306
+ kind:
5307
+ type: string
5308
+ enum: [persist, materialize, view, query, rollup]
5309
+ description: The annotation that declared it.
5310
+ source:
5311
+ type: string
5312
+ description: A view's source, or a rollup's base source.
5313
+ grain:
5314
+ type: array
5315
+ items:
5316
+ type: string
5317
+ description: A rollup's grain dimensions.
5318
+ sourceID:
5319
+ type: string
5320
+ description: >-
5321
+ `sourceName@modelPath`, package-relative: the `BuildPlan.sources`
5322
+ key with its file URL read relative to the package, so it names no
5323
+ place the server keeps files.
5324
+ modelPath:
5325
+ type: string
5326
+ description: The package-relative model that declares it.
5327
+ tier:
5328
+ type: string
5329
+ enum: [database, storage]
5330
+ description: >-
5331
+ Where its table lives: the source's own connection (`database`),
5332
+ or a storage destination (`storage`).
5333
+ destination:
5334
+ type: string
5335
+ description: >-
5336
+ The storage destination's name on the storage tier, else the
5337
+ connection the table is built on. Absent when not known (a
5338
+ refused `storage=` item the plan never placed).
5339
+ mode:
5340
+ $ref: "#/components/schemas/MaterializationMode"
5341
+ state:
5342
+ type: string
5343
+ enum: [built, awaiting_build, not_buildable, refused, failed]
5344
+ description: >-
5345
+ `built`: a table for it is bound. `awaiting_build`: it is valid
5346
+ and planned, no table is bound yet, and a build would make one.
5347
+ `not_buildable`: it is planned, but a build skips it here for
5348
+ `reason` (`destination_missing`, `connection_cannot_hold_table`,
5349
+ `materialization_off` or `upstream_unread`), so it is answered
5350
+ live until that changes.
5351
+ `refused`: it is valid and the plan or the bind does not build or
5352
+ serve it here, for `reason`. `failed`: this server's last build of
5353
+ it failed, for `reason` (an older table may still be bound and
5354
+ serving; `serves` says). Known only for builds this server ran
5355
+ since the package last loaded; a host's manifest that binds a
5356
+ table at its address clears it.
5357
+ serves:
5358
+ type: string
5359
+ enum: [serves, after_build, live, not_judged]
5360
+ description: >-
5361
+ How queries on it are answered right now. `serves`: from its
5362
+ bound table. `after_build`: nothing is bound yet; they are
5363
+ answered live now and from its table once a build binds one.
5364
+ `live`: answered live, for `reason`, and a build alone does not
5365
+ change that (a failed item with nothing bound is `live`).
5366
+ `not_judged`: no serve verdict was computed: a refused item, or a
5367
+ draft a compile planned without binding.
5368
+ queries:
5369
+ type: array
5370
+ items:
5371
+ type: string
5372
+ description: >-
5373
+ What a query names to be answered from this table, as far as is
5374
+ known without compiling queries: the source (or a rollup's base),
5375
+ `source -> view` for a persisted view, or the named query.
5376
+ reason:
5377
+ type: string
5378
+ description: >-
5379
+ Why it is not built, failed, or is answered live: a
5380
+ `RefusedSource.reason` for a refused item, `build_failed` for a
5381
+ failed one, else the `ServeVerdict.reason`. An open string.
5382
+ message:
5383
+ type: string
5384
+ description: What the state and verdict mean for it, in a sentence or two.
5385
+ fixes:
5386
+ type: array
5387
+ items:
5388
+ type: string
5389
+ description: The changes that would let it build or serve, from the verdict.
5390
+ facts:
5391
+ type: array
5392
+ items:
5393
+ $ref: "#/components/schemas/MaterializationFact"
5394
+
5395
+ MaterializationSummary:
5396
+ type: object
5397
+ description: >-
5398
+ One row per thing a package materializes, with counts by state. Read
5399
+ off the build plan, the bound tables and the serve verdicts as they
5400
+ stand; absent when the package materializes nothing.
5401
+ required: [mode, counts, items]
5402
+ properties:
5403
+ mode:
5404
+ $ref: "#/components/schemas/MaterializationMode"
5405
+ counts:
5406
+ $ref: "#/components/schemas/MaterializationStateCounts"
5407
+ items:
5408
+ type: array
5409
+ items:
5410
+ $ref: "#/components/schemas/MaterializationItem"
5411
+
5412
+ MaterializationDigest:
5413
+ type: object
5414
+ description: >-
5415
+ A package's `MaterializationSummary` cut down for a poll: counts of
5416
+ every item by state, and the items that are not `built`, or are built
5417
+ and answered live, each with its reason code. An item off the
5418
+ package's published surface is counted in `hiddenNotServed` rather
5419
+ than named. Built from the same function as the summary.
5420
+ required: [mode, counts, hiddenNotServed, notServed]
5421
+ properties:
5422
+ mode:
5423
+ $ref: "#/components/schemas/MaterializationMode"
5424
+ counts:
5425
+ $ref: "#/components/schemas/MaterializationStateCounts"
5426
+ hiddenNotServed:
5427
+ type: integer
5428
+ description: >-
5429
+ Items not answered from a table that `notServed` leaves out
5430
+ because they are not on the package's published surface: no
5431
+ `index.malloy` export names their source (a view's source, a
5432
+ rollup's base, a named query) as declared in their file, so a
5433
+ hidden source sharing an exported source's name elsewhere is
5434
+ counted here. Counted, never named, since `/status` is
5435
+ unauthenticated. A package that curates nothing, or declares
5436
+ `queryableSources: "all"`, makes every source queryable by name,
5437
+ so every item is named and this is 0.
5438
+ notServed:
5439
+ type: array
5440
+ items:
5441
+ type: object
5442
+ required: [name, kind, sourceID, state, serves]
5443
+ properties:
5444
+ name:
5445
+ type: string
5446
+ kind:
5447
+ type: string
5448
+ enum: [persist, materialize, view, query, rollup]
5449
+ sourceID:
5450
+ type: string
5451
+ modelPath:
5452
+ type: string
5453
+ tier:
5454
+ type: string
5455
+ enum: [database, storage]
5456
+ state:
5457
+ type: string
5458
+ enum: [built, awaiting_build, not_buildable, refused, failed]
5459
+ serves:
5460
+ type: string
5461
+ enum: [serves, after_build, live, not_judged]
5462
+ reason:
5463
+ type: string
5464
+ description: As `MaterializationItem.reason`; absent for an item simply awaiting its build.
5465
+
4984
5466
  ServeVerdict:
4985
5467
  type: object
4986
5468
  description: >-
@@ -5032,8 +5514,7 @@ components:
5032
5514
  type: string
5033
5515
  description: >-
5034
5516
  For a `live` verdict, why: `refused` (the plan refused to build it),
5035
- `storage_mode` (`storage=` while `PERSIST_STORAGE_MODE` is not
5036
- `on`), `unreachable` (no source on the package's published surface
5517
+ `unreachable` (no source on the package's published surface
5037
5518
  reads it), `row_level_gate` (every query through it carries an
5038
5519
  `#(authorize)` or `#(access_filter)` gate its table cannot keep
5039
5520
  yet, on either tier), `stale` (its table is past its freshness
@@ -5044,10 +5525,10 @@ components:
5044
5525
  `connection_cannot_hold_table` (database, on a connection whose
5045
5526
  type creates no tables), `types_unrecorded` (retained, no longer
5046
5527
  produced: an entry with no recorded types reads
5047
- `contract_missing` now), `materialization_off` (a `#(materialize)`
5048
- source, which only the served copy reads, and the served copy is
5049
- off: `PUBLISHER_MATERIALIZE`, and for `storage=`
5050
- `PERSIST_STORAGE_MODE`), `served_copy` (a source the served copy
5528
+ `contract_missing` now), `materialization_off` (a
5529
+ `#(materialize)` source, which only the served copy reads, in a
5530
+ package none of whose model files has a served copy: every one
5531
+ is a notebook or a report), `served_copy` (a source the served copy
5051
5532
  reads, `#(materialize)` or `#@ persist`, whose table is bound and
5052
5533
  built, but no model's served copy re-roots it, so its queries are
5053
5534
  answered live; `notServedIn` says where and why),
@@ -5366,8 +5847,7 @@ components:
5366
5847
 
5367
5848
  `bound` reports that the bind ran to completion, NOT that any query
5368
5849
  routes to a materialized table: an entry whose source fails the
5369
- eligibility gate is dropped, and the storage tier serves live under a
5370
- `PERSIST_STORAGE_MODE` that is not `on`. Read `manifestEntryCount`
5850
+ eligibility gate is dropped. Read `manifestEntryCount`
5371
5851
  and `storageServeBindings` for what actually bound.
5372
5852
 
5373
5853
  An EMPTY manifest is a bind like any other: it is fetched and applied,
@@ -5441,10 +5921,7 @@ components:
5441
5921
  `storage=` destination via the virtual-source transform (distinct
5442
5922
  from the same-connection manifest binding above — a storage source is
5443
5923
  read cross-connection from its destination, not substituted in the
5444
- manifest). Present only when at least one source is bound. Whether a
5445
- query actually routes to these tables additionally depends on
5446
- `PERSIST_STORAGE_MODE=on`; under `off`/`write-only` the bindings may
5447
- be present but the serve path still runs live (see `warnings`).
5924
+ manifest). Present only when at least one source is bound.
5448
5925
 
5449
5926
  Like `boundManifestUri`, this describes whatever is CURRENTLY bound
5450
5927
  rather than the configured manifest: after a failed rebind it goes on
@@ -5473,8 +5950,7 @@ components:
5473
5950
 
5474
5951
 
5475
5952
  A `live` verdict is the package-level form of a live fallback
5476
- that is otherwise visible only per query: a source built into
5477
- storage while `PERSIST_STORAGE_MODE` is off, one no published
5953
+ that is otherwise visible only per query: a source no published
5478
5954
  source reaches, one under a row-level gate the storage tier cannot
5479
5955
  keep. `POST …/packages?dryRun=true` answers the same verdicts for a
5480
5956
  package before it is published, with each stored source's named
@@ -5566,6 +6042,14 @@ components:
5566
6042
  The manifest URI actually bound to the served models; null when
5567
6043
  unbound. A non-null value is a live reference. See
5568
6044
  `PackageServingState.boundManifestUri`.
6045
+ materializationDigest:
6046
+ $ref: "#/components/schemas/MaterializationDigest"
6047
+ description: >-
6048
+ Set on a loaded copy that materializes anything: counts of its
6049
+ materialized items by state, and the ones not answered from a
6050
+ table, with reason codes. Recomputed at most every few seconds.
6051
+ The full rows are on the reload response and `compile` at scope
6052
+ `package` (`materializationSummary`).
5569
6053
 
5570
6054
  ServerStatusEnvironment:
5571
6055
  type: object
@@ -5734,6 +6218,14 @@ components:
5734
6218
  fail-safe — the unresolved entry simply lists nothing rather than
5735
6219
  exposing everything — so this is the signal that a package is
5736
6220
  misconfigured; publishing such a package is rejected.
6221
+ materializationSummary:
6222
+ readOnly: true
6223
+ $ref: "#/components/schemas/MaterializationSummary"
6224
+ description: >-
6225
+ Set only on the response of a reload (`?reload=true`), when the
6226
+ package materializes anything: each materialized item, with its
6227
+ tier, destination, state, whether queries are answered from it,
6228
+ and why not. Ignored on create and update requests.
5737
6229
  warnings:
5738
6230
  type: array
5739
6231
  readOnly: true
@@ -5965,9 +6457,10 @@ components:
5965
6457
  `deprecated-preaggregate-annotation`: a measure declaring
5966
6458
  `#@ preaggregate` or the deprecated alias `#(preaggregate)`,
5967
6459
  whose v2 spelling is `#(rollup)`; the message names the
5968
- spelling it found (one per measure, `model` its file, `subject` the source and the
5969
- message the measure; `warn`; only while
5970
- `PUBLISHER_MATERIALIZE` is on).
6460
+ spelling it found (one per `#@ preaggregate` line, naming the
6461
+ `#(rollup)` line it is read as, or one per measure for
6462
+ `#(preaggregate)`; `model` its file, `subject` the source and
6463
+ the message the measure; `warn`).
5971
6464
  `deprecated-rollup-namespace`: a rollup line placed with
5972
6465
  `namespace=`, the deprecated spelling of its `name=`
5973
6466
  container; still read, in that container under the readable
@@ -6012,8 +6505,7 @@ components:
6012
6505
  a measure, a grain naming no dimension, a measure no rollup
6013
6506
  can merge);
6014
6507
  `materialization-table-collision` (two sources whose
6015
- `name=` puts them on one table; under
6016
- `PERSIST_COLLISION_ENFORCE=false` a refusal instead); and
6508
+ `name=` puts them on one table); and
6017
6509
  `materialization-near-miss` (a misspelled materialization
6018
6510
  route or directive, such as `#(materialise)` or
6019
6511
  `#@ persits`). `preaggregate-malformed` is retained and no
@@ -6057,10 +6549,6 @@ components:
6057
6549
  `inherited_where_with_given` or
6058
6550
  `given_where_over_unstored_field`, `unreadable_measure`,
6059
6551
  `join_not_in_grain` and `partial_name_collision`.
6060
- `materialization-storage-mode`: a `storage=` source the
6061
- deployment's `PERSIST_STORAGE_MODE` (`off` or `write-only`)
6062
- does not serve from storage (`subject` the source, or a
6063
- rollup's base; `reason` `storage_mode`; `warn`).
6064
6552
  `materialization-unreachable`,
6065
6553
  `materialization-destination-missing` and
6066
6554
  `materialization-connection-cannot-hold-table`: a source
@@ -6159,6 +6647,9 @@ components:
6159
6647
  later delta reads (its manifest entry's `lateRows`); it is
6160
6648
  carried until the source is rebuilt in full (one per source;
6161
6649
  `warn`).
6650
+ `simulation-manifest-bound`: a package or version whose
6651
+ `manifestLocation` simulated materialization left unbound,
6652
+ its manifest never fetched, so it serves live (`warn`).
6162
6653
  `rollup-join-one-key-repeated`: a bound rollup whose last
6163
6654
  build found the key of a `join_one` it reads repeated, so a
6164
6655
  query reading that join beside other aggregates is answered
@@ -6281,8 +6772,7 @@ components:
6281
6772
  `model-recompile-failed`; the unread reason on
6282
6773
  `database-table-unread` and `storage-table-unread`; the kept table's reason on
6283
6774
  `table-kept`; the serve verdict's reason on a
6284
- `materialization-*` verdict warning; `storage_mode` on
6285
- `materialization-storage-mode`; the rule a cell breaks on
6775
+ `materialization-*` verdict warning; the rule a cell breaks on
6286
6776
  `malloynb-cell-refused` (`off_surface`, `caller_annotation`,
6287
6777
  `required_filter`, `restricted_mode`, `compile_error`). Always snake_case. An open
6288
6778
  string; absent on a finding that has none.
@@ -8513,7 +9003,9 @@ components:
8513
9003
  description: >-
8514
9004
  The class of work a statement belongs to, attached as the `class`
8515
9005
  query-metadata property: `interactive` (a user or application query),
8516
- `materialize` (a persist-source build), `index` (an index build or scan),
9006
+ `materialize` (a persist-source build), `index` (an index build or scan; a model query of this class on a
9007
+ source that declares a stored table of its own is answered only from
9008
+ that table, else refused with 409 INDEX_SOURCE_UNBUILT),
8517
9009
  `ops` (platform maintenance). Attribution's primary axis — a backend bill
8518
9010
  separates traffic from builds only if every statement says which it is.
8519
9011
 
@@ -8872,17 +9364,15 @@ components:
8872
9364
  type: string
8873
9365
  description: >-
8874
9366
  The serve verdict's reason (`ServeVerdict.reason`): `refused` (the
8875
- package refuses to serve it), `storage_mode` (built into storage,
8876
- but the server's PERSIST_STORAGE_MODE routes no query to it),
8877
- `unreachable` (no published source reaches it), `row_level_gate`
9367
+ package refuses to serve it), `unreachable` (no published source reaches it), `row_level_gate`
8878
9368
  (every published entry point over it carries a gate it cannot keep
8879
9369
  yet), `stale` (past its freshness window, with a fallback that does
8880
9370
  not serve stale), `shadowed` (its storage table is bound to another
8881
9371
  source of the same name), `destination_missing` (`storage=` names
8882
9372
  a destination the environment does not configure),
8883
9373
  `connection_cannot_hold_table` (its connection creates no tables),
8884
- `materialization_off` (only the served copy reads it, and the
8885
- served copy is off), `served_copy` (only the served copy reads
9374
+ `materialization_off` (only the served copy reads it, and no
9375
+ model file of the package has a served copy), `served_copy` (only the served copy reads
8886
9376
  it, and the served copy does not re-root it), `incompatible` (the
8887
9377
  table no longer matches the column contract its build recorded) or
8888
9378
  `contract_missing` (its build recorded no usable contract); a
@@ -8976,8 +9466,8 @@ components:
8976
9466
  description: >-
8977
9467
  How a `materialized` table was read, when it was not today's serve
8978
9468
  shape: `served_copy` means the model's served copy answered (the
8979
- author's own files with each stored source re-rooted on its table,
8980
- behind `PUBLISHER_MATERIALIZE`). An open string; absent
9469
+ author's own files with each stored source re-rooted on its
9470
+ table). An open string; absent
8981
9471
  otherwise.
8982
9472
 
8983
9473
  QueryPathCandidate:
@@ -10158,6 +10648,28 @@ components:
10158
10648
  Never set on BigQuery, whose listing reads each table's whole
10159
10649
  schema: a table whose read failed there is listed with no
10160
10650
  columns.
10651
+ method:
10652
+ $ref: "#/components/schemas/MetadataMethod"
10653
+ asOf:
10654
+ type: string
10655
+ format: date-time
10656
+ description: With `include=collations`, when the collations were read.
10657
+ defaultCollation:
10658
+ type: ["string", "null"]
10659
+ description: |
10660
+ With `include=collations`: the collation a string compares under
10661
+ when its column declares none, as a collation identity (`binary`
10662
+ for byte order). Postgres: the database's default; DuckDB and
10663
+ DuckLake: the session's `default_collation`; BigQuery: the table's
10664
+ `default_collation_name`, which it took from its dataset. Null when
10665
+ it could not be read. Absent when `collationUnsupported` is set.
10666
+ collationUnsupported:
10667
+ type: string
10668
+ description: |
10669
+ With `include=collations`: why collations are not reported (the
10670
+ connection has no collation reader, the relation is not one the
10671
+ catalog lists, or the read failed). Columns then carry no
10672
+ `collation`; the rest of the table answers.
10161
10673
 
10162
10674
  TemporaryTable:
10163
10675
  type: object
@@ -10204,6 +10716,16 @@ components:
10204
10716
  With `reason: MATERIALIZATION_REFUSED`: the refusal's bounded
10205
10717
  reason, from the same open set as `RefusedSource.reason`. Absent
10206
10718
  otherwise.
10719
+ unbuiltReason:
10720
+ type: string
10721
+ description: >-
10722
+ With `reason: INDEX_SOURCE_UNBUILT`: why the queried source's
10723
+ stored table is not ready. `unbuilt` (none is built yet, or none
10724
+ is bound to the version that answered), `building` (a build of it
10725
+ is in progress), `failed` (its last build failed) or `refused`
10726
+ (the package's build plan refuses to build it; `refusedSources`
10727
+ says why). An open set: read an absent or unrecognized value as
10728
+ `unbuilt`. Absent otherwise.
10207
10729
  reason:
10208
10730
  type: string
10209
10731
  description: |
@@ -10256,10 +10778,44 @@ components:
10256
10778
  source or connection the caller read and no storage path.
10257
10779
 
10258
10780
  ACCESS_DENIED, on a 403, means a gate (`#(authorize)` or
10259
- `#(access_filter)`) refused the caller. Every gate 403 carries it,
10260
- including a gate that could not be decided, which fails closed and
10261
- answers the same: only the server's metrics and log tell those
10262
- apart. A 403 with any other reason is not a gate's.
10781
+ `#(access_filter)`) refused the caller. Every gate refusal carries
10782
+ it, including a gate that could not be decided, which fails closed
10783
+ and answers the same: only the server's metrics and log tell those
10784
+ apart. The one 403 an `#(access_filter)` answers with another reason
10785
+ is INHERITED_FILTER_UNVERIFIED, below, when the model's own text
10786
+ moved a field the filter reads: that is no refusal of the caller.
10787
+ A 403 with any other reason is not a gate's.
10788
+
10789
+ INHERITED_FILTER_UNVERIFIED, on a 403, means a `where:` the queried
10790
+ source inherits from a source it is built from could not be
10791
+ verified to read the fields it was written against there: a field
10792
+ it reads is defined again on the way (`rename:`, `except:`, a new
10793
+ definition), or the check could not follow it. It also answers an
10794
+ inherited `#(access_filter)` whose condition the model's own text
10795
+ moved (`rename:`, `except:`, a new definition) once the caller has
10796
+ supplied every given it reads; a caller missing one gets
10797
+ ACCESS_DENIED, and so does a rebind written in the caller's own
10798
+ query. It is the model's own text, not a permission rule, so givens
10799
+ and a rewritten query do not help. The message names the source and the reason class
10800
+ (`redefined_field`, `unrecorded_join`, `unresolved_declaration`,
10801
+ `resolution_bound`, or `check_failed` when the check itself failed
10802
+ unexpectedly), never the filter or the file; the server log names
10803
+ both.
10804
+
10805
+ INDEX_SOURCE_UNBUILT, on a 409 from a model query, means a query
10806
+ with `queryClass: index` was refused because the source it queries
10807
+ declares a stored table of its own (`#(materialize)`, or its own
10808
+ `#@ persist`, not one it only inherits) and no ready table of it is
10809
+ bound. An index query on such a source is answered from that table
10810
+ or not at all, never run live against the warehouse; it is
10811
+ deferred, not wrong, and the same query succeeds once the table is
10812
+ built. The body's `unbuiltReason` says why the table is not ready.
10813
+ Only `queryClass: index` is refused this way: the same query in any
10814
+ other class is answered as before. Every governance check (the
10815
+ package's published surface, `#(authorize)`, row-level gates)
10816
+ decides first, so a caller who may not query the source gets that
10817
+ 404 or 403 instead, never this. The message names the source as
10818
+ the caller queried it, never a table, a path or a connection.
10263
10819
 
10264
10820
  MATERIALIZATION_REFUSED means a valid materialization declaration
10265
10821
  this server will not build, and the body's `refusalReason` is the
@@ -10320,6 +10876,19 @@ components:
10320
10876
  publisher.json included), and the package or version serves what
10321
10877
  it served before. The message carries the cause.
10322
10878
 
10879
+ SIMULATION_ACTIVE, on a 409, means the server runs simulated
10880
+ materialization (`PUBLISHER_MATERIALIZE_SIMULATE`), an authoring
10881
+ mode that makes no materialization write. It refuses a
10882
+ materialization create, stop or delete, a materialized table
10883
+ drop, a storage destination's table drop and file cleanup, a
10884
+ version delete or archive, the delete of an environment or of a
10885
+ package that has versions, run records or incremental-ledger
10886
+ rows, a publish of a version whose id a deleted version left run
10887
+ records under, a watch-mode change, and a manifest binding
10888
+ (`update-package` or `create-package` with a `manifestLocation`,
10889
+ `set-package-version-manifest`). It fails the same way until the
10890
+ server restarts without simulation.
10891
+
10323
10892
  MANIFEST_NOT_FOUND, on a 400 from the same routes, means nothing
10324
10893
  is at the `manifestLocation` (no such file, object or bucket),
10325
10894
  and MANIFEST_INVALID, on a 422, that what is there does not parse
@@ -10368,13 +10937,15 @@ components:
10368
10937
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
10369
10938
  CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND, RESULT_TRUNCATED,
10370
10939
  RESULT_SHAPE_MISMATCH, STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10940
+ INHERITED_FILTER_UNVERIFIED, INDEX_SOURCE_UNBUILT,
10371
10941
  MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10372
10942
  TABLE_OWNERSHIP_UNVERIFIED, TABLE_IN_USE, BUILD_INSTRUCTIONS_INVALID,
10373
10943
  MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
10374
10944
  VERSION_CONFLICT, PACKAGE_IS_VERSIONED,
10375
10945
  PACKAGE_INSTALLED_FROM_LOCATION, FILE_EXISTS, VERSION_IS_LATEST,
10376
10946
  VERSION_IS_LAST_ACTIVE, VERSION_BUILDING, VERSION_ID_INVALID,
10377
- VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED.
10947
+ VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED,
10948
+ SIMULATION_ACTIVE.
10378
10949
  problems:
10379
10950
  type: array
10380
10951
  description: |
@@ -10390,6 +10961,72 @@ components:
10390
10961
  required:
10391
10962
  - message
10392
10963
 
10964
+ MetadataMethod:
10965
+ type: string
10966
+ enum: [catalog, counted, sampled, history, host]
10967
+ description: |
10968
+ How a connection metadata answer was read: `catalog`, from the
10969
+ warehouse's catalog or metadata tables; `counted`, by an aggregate
10970
+ `count(*)` over the table; `sampled`, from a sample; `history`, from
10971
+ query history; `host`, relayed from the remote connection a
10972
+ `publisher` proxy names, which read it with its own credentials.
10973
+
10974
+ TableStats:
10975
+ type: object
10976
+ description: |
10977
+ A table's size, or `status` `unsupported` with a `reason`. Every
10978
+ answer carries `method` and `asOf`. No field holds a row value.
10979
+ required:
10980
+ - status
10981
+ - resource
10982
+ - method
10983
+ - asOf
10984
+ properties:
10985
+ status:
10986
+ type: string
10987
+ enum: [answered, unsupported]
10988
+ reason:
10989
+ type: string
10990
+ description: Why this connection cannot answer. Present only when `status` is `unsupported`.
10991
+ resource:
10992
+ type: string
10993
+ description: The table read, as its path was resolved.
10994
+ method:
10995
+ $ref: "#/components/schemas/MetadataMethod"
10996
+ asOf:
10997
+ type: string
10998
+ format: date-time
10999
+ description: When the answer was read.
11000
+ rowCount:
11001
+ type: ["integer", "null"]
11002
+ format: int64
11003
+ description: The table's rows; null when the catalog does not record them.
11004
+ rowCountBand:
11005
+ type: object
11006
+ description: |
11007
+ Present only when `rowCount` is an estimate (Postgres): the spread
11008
+ of the catalog's own estimates (`reltuples`, that value scaled to
11009
+ the table's current pages, and the statistics collector's live-row
11010
+ count). It is not a confidence interval.
11011
+ required:
11012
+ - low
11013
+ - high
11014
+ properties:
11015
+ low:
11016
+ type: integer
11017
+ format: int64
11018
+ high:
11019
+ type: integer
11020
+ format: int64
11021
+ bytes:
11022
+ type: ["integer", "null"]
11023
+ format: int64
11024
+ description: The table's stored bytes (Postgres, its total relation size with indexes and TOAST); null when not recorded.
11025
+ lastModified:
11026
+ type: ["string", "null"]
11027
+ format: date-time
11028
+ description: When the table's data last changed; null when the catalog does not record it.
11029
+
10393
11030
  Column:
10394
11031
  type: object
10395
11032
  description: Database column definition
@@ -10400,6 +11037,23 @@ components:
10400
11037
  type:
10401
11038
  type: string
10402
11039
  description: Data type of the column
11040
+ nativeType:
11041
+ type: string
11042
+ description: |
11043
+ With `include=collations`: the column's type as the warehouse's
11044
+ catalog names it (`character varying(20)`, `STRING`, `VARCHAR`).
11045
+ Unlike `type`, always the warehouse's own name.
11046
+ collation:
11047
+ type: ["string", "null"]
11048
+ description: |
11049
+ With `include=collations`: the column's collation identity, as a
11050
+ materialization's column contract records it: `binary` for byte
11051
+ order, else the engine's identity (`postgres:…`,
11052
+ `bigquery:und:ci`, `duckdb:nocase`). Null for a column that is not
11053
+ a string. A record's members carry neither field.
11054
+ storedAsDouble:
11055
+ type: boolean
11056
+ description: With `include=collations`, present and true on a DuckLake 128-bit integer column, whose files hold it as a DOUBLE.
10403
11057
 
10404
11058
  TableDescription:
10405
11059
  type: object
@@ -10624,6 +11278,14 @@ components:
10624
11278
  is true and compilation succeeds with a runnable query.
10625
11279
  document:
10626
11280
  $ref: "#/components/schemas/CompiledDocument"
11281
+ materializationSummary:
11282
+ $ref: "#/components/schemas/MaterializationSummary"
11283
+ description: >-
11284
+ Scope `package` only, when the package materializes anything: each
11285
+ materialized item of the package as the dry run plans it. Its
11286
+ `serves` is `not_judged`, since a compile binds nothing; `built`
11287
+ and `failed` read the tables the served package has bound and its
11288
+ last build's failures at the same address. Reload to judge serving.
10627
11289
 
10628
11290
  CompiledDocument:
10629
11291
  type: object
@@ -11091,6 +11753,9 @@ components:
11091
11753
  copy of a model file without
11092
11754
  `##! experimental.persistence` did not compile, so none of its
11093
11755
  `#@ persist` sources were planned);
11756
+ `persist_companion_failed` (planning a model file's `#@ persist`
11757
+ sources failed, so none of the ones it declares were planned; the
11758
+ file's other legs and the package's other files still plan);
11094
11759
  `persist_annotation_unparseable` is retained and no longer
11095
11760
  produced: a `#@` line that does not parse is an invalid annotation
11096
11761
  (`persist-unparseable`), which fails the publish and the load, so
@@ -11278,10 +11943,9 @@ components:
11278
11943
  catalog, which runs only SQL Malloy generated: a `storage=` source
11279
11944
  on a DuckLake connection, or a source of any tier on a connection
11280
11945
  configured `managed`);
11281
- `table_name_collision` (under `PERSIST_COLLISION_ENFORCE=false`, a
11282
- declaration whose `name=` puts it on one table with another, so
11283
- neither is built; by default such a package does not load; a run
11284
- also records it in its `metadata.refusedSources` for a source
11946
+ `table_name_collision` (a declaration whose `name=` puts it on one
11947
+ table with another, so neither is built; a package that declares
11948
+ one does not load; a run also records it in its `metadata.refusedSources` for a source
11285
11949
  whose readable table name another source's table already takes in
11286
11950
  that run); `current_time` (the build reads the current time, `now`,
11287
11951
  or keeps rows older than a moving cut-off it cannot leave out, so
@@ -11320,8 +11984,8 @@ components:
11320
11984
  the container; `storage=` declarations are never checked).
11321
11985
 
11322
11986
 
11323
- A persisted view or named query: `materialization_off` (persisted
11324
- named queries are built only with `PUBLISHER_MATERIALIZE` on),
11987
+ A persisted view or named query: `materialization_off` (retained,
11988
+ no longer produced: materialization v2 is always on),
11325
11989
  `multi_line_annotation` (its `#@` line spans more than one line),
11326
11990
  `build_name_collision` (its generated build source's name is one
11327
11991
  the model, or another persisted view, already takes),
@@ -12430,7 +13094,16 @@ components:
12430
13094
  description: The contract's shape version. `1`.
12431
13095
  producer:
12432
13096
  type: string
12433
- description: The Publisher version whose build wrote it; diagnostic only.
13097
+ description: >-
13098
+ The Publisher version whose build wrote it. Read only to judge a
13099
+ string column recorded before `ContractColumn.compareFrom` was, on
13100
+ any dialect: its `none` is taken as unread when this is a semantic
13101
+ version before 0.18.5 by semver precedence (`0.18.5-rc.1` is
13102
+ before), the column is stored `binary` under a binary
13103
+ `defaultCollation`, and its source's dialect has collations
13104
+ Publisher reads (DuckDB, Postgres, BigQuery). Otherwise, including
13105
+ when this is absent or not a semantic version, it is taken as
13106
+ read.
12434
13107
  dialect:
12435
13108
  type: string
12436
13109
  description: >-
@@ -12505,6 +13178,45 @@ components:
12505
13178
  ordering and ranges may not), or `none` (no string comparison is
12506
13179
  known to match). Every non-string column is `exact`. An open set:
12507
13180
  read an unknown value as `none`.
13181
+ compareFrom:
13182
+ type: string
13183
+ enum: [read, unread]
13184
+ description: >-
13185
+ A string column of a `storage=` table: how its `compare` was
13186
+ obtained. `read`: the verdict a rebuild records again unchanged,
13187
+ because the catalog answered it, or because nothing a read returns
13188
+ can change it: a `COLLATE` in the build's SQL, a dialect whose
13189
+ collations Publisher does not read, a stored collation that is not
13190
+ binary, a Postgres or DuckDB read that failed in a way every retry
13191
+ fails too (a rejected credential, the warehouse's own error for a
13192
+ statement wrong in itself, a Postgres missing privilege), and, on
13193
+ BigQuery, a project that holds a collated dataset, a table no read
13194
+ can place, or the project-wide read of that project refused for
13195
+ want of a permission (an error whose reason is `accessDenied`, as
13196
+ a dataset-scoped account gets) for an `.sql()` source, a view, or
13197
+ more datasets than are read one by one. `unread`: the fail-closed
13198
+ `none` recorded because a catalog read failed in a way a rebuild
13199
+ may not repeat: a Postgres or DuckDB read that failed transiently
13200
+ or for an unrecognized reason, or a BigQuery read that failed
13201
+ (including a 403 for a rate limit or a quota, and an "Access
13202
+ Denied" that names no reason), did not list a table, or was
13203
+ refused one dataset's catalog. A downstream that compares such a
13204
+ string fails
13205
+ with `upstream_contract_unread`, naming this table to rebuild,
13206
+ rather than being refused. A table built over stored tables takes
13207
+ `unread` only when every `none` it inherits is unread. Absent on a
13208
+ contract written before it was recorded (see
13209
+ `ColumnContract.producer`) and on a non-string column; a reader
13210
+ treats an unknown value as absent.
13211
+ unreadUpstreams:
13212
+ type: array
13213
+ items:
13214
+ type: string
13215
+ description: >-
13216
+ With `compareFrom: unread` on a table built over stored tables:
13217
+ the upstreams (`sourceEntityId`) whose unread verdicts it
13218
+ inherited, and the tables theirs came from, which are rebuilt
13219
+ before it can read otherwise.
12508
13220
  gateExact:
12509
13221
  type: boolean
12510
13222
  description: >-
@@ -12641,6 +13353,44 @@ components:
12641
13353
  derives its plan again at once, and the next build either builds
12642
13354
  the source over the upstream's table as it is or the plan refuses
12643
13355
  it (`upstream_table_unusable`); the source is `retryable`.
13356
+ `upstream_contract_insufficient` (a chained `storage=` build
13357
+ compares strings over a stored upstream whose entry carries no
13358
+ column contract the build can read: the table was built before
13359
+ contracts were recorded, or the entry a host supplied for it in
13360
+ `referenceManifest` holds none or an invalid one, so the contract
13361
+ that judges those strings is missing; `staleUpstreams` names those
13362
+ upstreams). It is non-terminal, never a refusal: once each is
13363
+ rebuilt, or supplied with its contract, the source builds over
13364
+ them, and it is `retryable`. A host that retries it without
13365
+ rebuilding or re-supplying them gets the same failure. Its
13366
+ `reason` names, per upstream, the check its contract failed: `it
13367
+ is absent`, or which field made a contract that is present
13368
+ invalid (text that does not parse as JSON, not an object, no
13369
+ version `v`, or a `v` that is not a number).
13370
+ `upstream_contract_unread` (a chained `storage=` build compares a
13371
+ string over a stored upstream whose column contract records it
13372
+ compared `none` only as the fail-closed fallback of a catalog read
13373
+ that did not complete when that upstream was built:
13374
+ `ContractColumn.compareFrom: unread`, or, on a contract recorded
13375
+ before `compareFrom` was, a `none` a release before 0.18.5 could
13376
+ only have recorded as its source's failed read, on any dialect
13377
+ (see `ColumnContract.producer`); `staleUpstreams` names the
13378
+ upstreams to rebuild). It is non-terminal, never a refusal, and
13379
+ handled as `upstream_contract_insufficient` is: rebuilding each
13380
+ upstream reads its catalog again, and once its contract records a
13381
+ verdict this build can use, the source builds; it is `retryable`.
13382
+ A rebuild whose read records a string compared otherwise than the
13383
+ build needs, or a `none` no rebuild changes, leaves the source
13384
+ refused at plan (`upstream_table_unusable`). A rebuild whose
13385
+ catalog read fails again for a reason a rebuild may not repeat
13386
+ (see `ContractColumn.compareFrom`) fails it the same way, bounded
13387
+ only by the caller's retry cap. Reported only when no string the
13388
+ build compares is refused for any other reason. Both
13389
+ `upstream_contract_insufficient` and `upstream_contract_unread`
13390
+ have one shape: on a run's `SourceFailure` only (never a plan's
13391
+ `RefusedSource`, which does not list the source), the value in
13392
+ this `code` field, with the upstreams in `staleUpstreams`,
13393
+ `retryable: true`, and `refused` and `refusalReason` absent.
12644
13394
  `instruction_unresolved` (an instruction no source in the run's
12645
13395
  build plan resolves to, so nothing was built for it; not
12646
13396
  `retryable` until the caller reads the plan again). Every
@@ -12649,6 +13399,18 @@ components:
12649
13399
  plan's reason, and any other unmatched instruction fails with this
12650
13400
  code; none is dropped. An open set; absent for a failure that has
12651
13401
  none.
13402
+ staleUpstreams:
13403
+ type: array
13404
+ items:
13405
+ type: string
13406
+ description: >-
13407
+ With `code: upstream_contract_insufficient`: the stored upstreams
13408
+ whose tables record no column contract, by content address
13409
+ (`sourceEntityId`). With `code: upstream_contract_unread`: the
13410
+ stored upstreams whose contracts record an unread string verdict,
13411
+ followed by any tables those verdicts were inherited from
13412
+ (`ContractColumn.unreadUpstreams`). Rebuilding them lets this
13413
+ source build. Absent otherwise.
12652
13414
  refused:
12653
13415
  type: boolean
12654
13416
  description: >-
@@ -12687,10 +13449,14 @@ components:
12687
13449
  passthrough). Five SQLSTATEs in class 42 are left to the other rules:
12688
13450
  a missing table or column (`42P01`, `42703`, `42S02`, `42S22`, and
12689
13451
  a BigQuery `Unrecognized name` or `Not found`), which stays absent,
12690
- and `42501` (insufficient privilege). A Postgres `42501` still
12691
- reports `false`, because its message says permission denied; a
12692
- Snowflake `42501` stays absent. Transient codes (`40001`, `40P01`,
12693
- and BigQuery's backend and quota reasons) are never `false`.
13452
+ and `42501` (insufficient privilege). A Postgres `42501` reports
13453
+ `false` by its code: no retry acquires the grant, and once it is
13454
+ granted a rebuild succeeds. A Snowflake `42501` stays absent.
13455
+ Transient codes (`40001`, `40P01`, and BigQuery's backend and
13456
+ quota reasons) are never `false`. When a failure carries a
13457
+ SQLSTATE, the message's wording ("syntax error", "access denied")
13458
+ never makes it `false`: a message that echoes SQL could otherwise
13459
+ settle a transient code.
12694
13460
 
12695
13461
 
12696
13462
  `true` is a transient failure, not a property of the inputs: the