@malloy-publisher/app 0.18.5 → 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 +855 -64
  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),
@@ -5062,15 +5543,22 @@ components:
5062
5543
  table unread (answered live, read again), never `incompatible`.
5063
5544
  Both are non-terminal and never a plan-time refusal: a rebuild
5064
5545
  fixes them, and a source with either counts as stale, so the next
5065
- build rebuilds it in full. Each names the generation it judged in
5546
+ build rebuilds it in full. `upstream_unread` (bound, but withdrawn
5547
+ after a recompile, reload or publish failed, and the read of a
5548
+ warehouse table it was built from failed, then or at any read
5549
+ since, so whether that table changed is not known: answered live
5550
+ until a read of it succeeds and finds it unchanged, at the
5551
+ package's next manifest bind or rebind, or a reload plans it
5552
+ again; it judges nothing about the table and never counts it
5553
+ stale). Each names the generation it judged in
5066
5554
  `table`, so a consumer drops a verdict about a table it has since
5067
5555
  replaced. An open set.
5068
5556
  table:
5069
5557
  type: object
5070
5558
  required: [physicalTableName]
5071
5559
  description: >-
5072
- With `contract_missing` or `incompatible`: the table generation
5073
- the verdict judged, its `physicalTableName` and the `builtAt` its
5560
+ With `contract_missing`, `incompatible` or `upstream_unread`: the
5561
+ table generation the verdict judged, its `physicalTableName` and the `builtAt` its
5074
5562
  entry carried (absent when the entry carried none).
5075
5563
  properties:
5076
5564
  physicalTableName:
@@ -5203,7 +5691,12 @@ components:
5203
5691
  whole copy, the codes `publisher_served_copy_bind_total` counts,
5204
5692
  most actionable first (for example `cross_connection_join` before
5205
5693
  `fields_not_carried`): `cross_connection_join`,
5206
- `cross_connection_unbuilt`, `inline_join_kept`,
5694
+ `cross_connection_unbuilt`, `sql_embed_cross_connection` (a
5695
+ `.sql()` source reads it through `%{}` on another connection than
5696
+ its table is read on: a storage destination, or a managed
5697
+ catalog read through one), `sql_embed_bare` (a `.sql()`
5698
+ source embeds it bare, `%{ x }`, which its stored table cannot be
5699
+ embedded as), `inline_join_kept`,
5207
5700
  `read_terms_not_kept`, `fields_not_carried`, `column_types`,
5208
5701
  `classification_not_kept`, `pair_join_not_found`,
5209
5702
  `pair_not_compiled`, `definition_not_parsed`, `compile_failed`,
@@ -5354,8 +5847,7 @@ components:
5354
5847
 
5355
5848
  `bound` reports that the bind ran to completion, NOT that any query
5356
5849
  routes to a materialized table: an entry whose source fails the
5357
- eligibility gate is dropped, and the storage tier serves live under a
5358
- `PERSIST_STORAGE_MODE` that is not `on`. Read `manifestEntryCount`
5850
+ eligibility gate is dropped. Read `manifestEntryCount`
5359
5851
  and `storageServeBindings` for what actually bound.
5360
5852
 
5361
5853
  An EMPTY manifest is a bind like any other: it is fetched and applied,
@@ -5429,10 +5921,7 @@ components:
5429
5921
  `storage=` destination via the virtual-source transform (distinct
5430
5922
  from the same-connection manifest binding above — a storage source is
5431
5923
  read cross-connection from its destination, not substituted in the
5432
- manifest). Present only when at least one source is bound. Whether a
5433
- query actually routes to these tables additionally depends on
5434
- `PERSIST_STORAGE_MODE=on`; under `off`/`write-only` the bindings may
5435
- be present but the serve path still runs live (see `warnings`).
5924
+ manifest). Present only when at least one source is bound.
5436
5925
 
5437
5926
  Like `boundManifestUri`, this describes whatever is CURRENTLY bound
5438
5927
  rather than the configured manifest: after a failed rebind it goes on
@@ -5461,8 +5950,7 @@ components:
5461
5950
 
5462
5951
 
5463
5952
  A `live` verdict is the package-level form of a live fallback
5464
- that is otherwise visible only per query: a source built into
5465
- storage while `PERSIST_STORAGE_MODE` is off, one no published
5953
+ that is otherwise visible only per query: a source no published
5466
5954
  source reaches, one under a row-level gate the storage tier cannot
5467
5955
  keep. `POST …/packages?dryRun=true` answers the same verdicts for a
5468
5956
  package before it is published, with each stored source's named
@@ -5554,6 +6042,14 @@ components:
5554
6042
  The manifest URI actually bound to the served models; null when
5555
6043
  unbound. A non-null value is a live reference. See
5556
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`).
5557
6053
 
5558
6054
  ServerStatusEnvironment:
5559
6055
  type: object
@@ -5722,6 +6218,14 @@ components:
5722
6218
  fail-safe — the unresolved entry simply lists nothing rather than
5723
6219
  exposing everything — so this is the signal that a package is
5724
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.
5725
6229
  warnings:
5726
6230
  type: array
5727
6231
  readOnly: true
@@ -5905,7 +6409,15 @@ components:
5905
6409
  description: >-
5906
6410
  A stable identifier for the finding's family, for a client that
5907
6411
  acts on it rather than only showing it; absent for a family that
5908
- has none yet. `deprecated-malloynb-notebook`: a `.malloynb`
6412
+ has none yet. `render-tag`: a render annotation the
6413
+ renderer cannot apply as written, malformed for its field
6414
+ (`error`) or inert where it sits (`warn`); one per finding,
6415
+ `model` its file and `subject` the query or view it sits on.
6416
+ `render-tag-check-failed`: a model whose render-tag check did
6417
+ not finish (it could not be read, `error`, or the validator
6418
+ failed, `warn`), so its render-tag findings are unknown
6419
+ rather than clean; reported by a package-scope compile,
6420
+ one per model. `deprecated-malloynb-notebook`: a `.malloynb`
5909
6421
  notebook, the deprecated cell format (one per file, `model`
5910
6422
  naming it). `malloynb-cell-refused`: a `.malloynb` code cell
5911
6423
  whose `run:` statement the query route refuses for every
@@ -5945,9 +6457,10 @@ components:
5945
6457
  `deprecated-preaggregate-annotation`: a measure declaring
5946
6458
  `#@ preaggregate` or the deprecated alias `#(preaggregate)`,
5947
6459
  whose v2 spelling is `#(rollup)`; the message names the
5948
- spelling it found (one per measure, `model` its file, `subject` the source and the
5949
- message the measure; `warn`; only while
5950
- `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`).
5951
6464
  `deprecated-rollup-namespace`: a rollup line placed with
5952
6465
  `namespace=`, the deprecated spelling of its `name=`
5953
6466
  container; still read, in that container under the readable
@@ -5992,8 +6505,7 @@ components:
5992
6505
  a measure, a grain naming no dimension, a measure no rollup
5993
6506
  can merge);
5994
6507
  `materialization-table-collision` (two sources whose
5995
- `name=` puts them on one table; under
5996
- `PERSIST_COLLISION_ENFORCE=false` a refusal instead); and
6508
+ `name=` puts them on one table); and
5997
6509
  `materialization-near-miss` (a misspelled materialization
5998
6510
  route or directive, such as `#(materialise)` or
5999
6511
  `#@ persits`). `preaggregate-malformed` is retained and no
@@ -6037,10 +6549,6 @@ components:
6037
6549
  `inherited_where_with_given` or
6038
6550
  `given_where_over_unstored_field`, `unreadable_measure`,
6039
6551
  `join_not_in_grain` and `partial_name_collision`.
6040
- `materialization-storage-mode`: a `storage=` source the
6041
- deployment's `PERSIST_STORAGE_MODE` (`off` or `write-only`)
6042
- does not serve from storage (`subject` the source, or a
6043
- rollup's base; `reason` `storage_mode`; `warn`).
6044
6552
  `materialization-unreachable`,
6045
6553
  `materialization-destination-missing` and
6046
6554
  `materialization-connection-cannot-hold-table`: a source
@@ -6067,8 +6575,9 @@ components:
6067
6575
  extension; `warn`).
6068
6576
  `rollup-join-one-key-repeated`: a rollup's last build found
6069
6577
  a `join_one` key repeated in the data, so queries that read
6070
- that join beside other aggregates are answered live
6071
- (`subject` the rollup's base; `warn`). Its former name,
6578
+ that join beside other aggregates, or, for a `join_one` the
6579
+ rollup's grain reads, queries that read nothing through it,
6580
+ are answered live (`subject` the rollup's base; `warn`). Its former name,
6072
6581
  `preaggregate-join-one-key-repeated`, is retained, no longer
6073
6582
  produced.
6074
6583
  `served-copy-not-served`: the served copy (the author's own
@@ -6080,8 +6589,10 @@ components:
6080
6589
  `pair_join_not_found`, `pair_not_compiled`,
6081
6590
  `fields_not_carried`, `read_terms_not_kept`,
6082
6591
  `cross_connection_join`, `inline_join_kept`,
6083
- `reroot_not_compiled`, `classification_not_kept`; an open
6084
- set) (`subject` the source; `warn`).
6592
+ `reroot_not_compiled`, `classification_not_kept`,
6593
+ `sql_embed_cross_connection`, `sql_embed_bare`; an
6594
+ open set) (`subject` the
6595
+ source; `warn`).
6085
6596
  `model-recompile-failed`: a model file that compiled before
6086
6597
  did not compile when the package bound new tables, although
6087
6598
  neither its text nor that of any file it imports changed
@@ -6136,11 +6647,15 @@ components:
6136
6647
  later delta reads (its manifest entry's `lateRows`); it is
6137
6648
  carried until the source is rebuilt in full (one per source;
6138
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`).
6139
6653
  `rollup-join-one-key-repeated`: a bound rollup whose last
6140
6654
  build found the key of a `join_one` it reads repeated, so a
6141
6655
  query reading that join beside other aggregates is answered
6142
- live; it clears once a build finds the key unique (one per
6143
- rollup; `warn`). `preaggregate-join-one-key-repeated` is
6656
+ live, or, for a `join_one` its grain reads, a query reading
6657
+ nothing through it; it clears once a build finds the key
6658
+ unique (one per rollup and key; `warn`). `preaggregate-join-one-key-repeated` is
6144
6659
  retained, no longer produced: it is
6145
6660
  `rollup-join-one-key-repeated` now.
6146
6661
  `join-bypass`: an author join from a published source to one
@@ -6257,8 +6772,7 @@ components:
6257
6772
  `model-recompile-failed`; the unread reason on
6258
6773
  `database-table-unread` and `storage-table-unread`; the kept table's reason on
6259
6774
  `table-kept`; the serve verdict's reason on a
6260
- `materialization-*` verdict warning; `storage_mode` on
6261
- `materialization-storage-mode`; the rule a cell breaks on
6775
+ `materialization-*` verdict warning; the rule a cell breaks on
6262
6776
  `malloynb-cell-refused` (`off_surface`, `caller_annotation`,
6263
6777
  `required_filter`, `restricted_mode`, `compile_error`). Always snake_case. An open
6264
6778
  string; absent on a finding that has none.
@@ -8489,7 +9003,9 @@ components:
8489
9003
  description: >-
8490
9004
  The class of work a statement belongs to, attached as the `class`
8491
9005
  query-metadata property: `interactive` (a user or application query),
8492
- `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),
8493
9009
  `ops` (platform maintenance). Attribution's primary axis — a backend bill
8494
9010
  separates traffic from builds only if every statement says which it is.
8495
9011
 
@@ -8848,17 +9364,15 @@ components:
8848
9364
  type: string
8849
9365
  description: >-
8850
9366
  The serve verdict's reason (`ServeVerdict.reason`): `refused` (the
8851
- package refuses to serve it), `storage_mode` (built into storage,
8852
- but the server's PERSIST_STORAGE_MODE routes no query to it),
8853
- `unreachable` (no published source reaches it), `row_level_gate`
9367
+ package refuses to serve it), `unreachable` (no published source reaches it), `row_level_gate`
8854
9368
  (every published entry point over it carries a gate it cannot keep
8855
9369
  yet), `stale` (past its freshness window, with a fallback that does
8856
9370
  not serve stale), `shadowed` (its storage table is bound to another
8857
9371
  source of the same name), `destination_missing` (`storage=` names
8858
9372
  a destination the environment does not configure),
8859
9373
  `connection_cannot_hold_table` (its connection creates no tables),
8860
- `materialization_off` (only the served copy reads it, and the
8861
- 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
8862
9376
  it, and the served copy does not re-root it), `incompatible` (the
8863
9377
  table no longer matches the column contract its build recorded) or
8864
9378
  `contract_missing` (its build recorded no usable contract); a
@@ -8952,8 +9466,8 @@ components:
8952
9466
  description: >-
8953
9467
  How a `materialized` table was read, when it was not today's serve
8954
9468
  shape: `served_copy` means the model's served copy answered (the
8955
- author's own files with each stored source re-rooted on its table,
8956
- 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
8957
9471
  otherwise.
8958
9472
 
8959
9473
  QueryPathCandidate:
@@ -10134,6 +10648,28 @@ components:
10134
10648
  Never set on BigQuery, whose listing reads each table's whole
10135
10649
  schema: a table whose read failed there is listed with no
10136
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.
10137
10673
 
10138
10674
  TemporaryTable:
10139
10675
  type: object
@@ -10180,6 +10716,16 @@ components:
10180
10716
  With `reason: MATERIALIZATION_REFUSED`: the refusal's bounded
10181
10717
  reason, from the same open set as `RefusedSource.reason`. Absent
10182
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.
10183
10729
  reason:
10184
10730
  type: string
10185
10731
  description: |
@@ -10232,10 +10778,44 @@ components:
10232
10778
  source or connection the caller read and no storage path.
10233
10779
 
10234
10780
  ACCESS_DENIED, on a 403, means a gate (`#(authorize)` or
10235
- `#(access_filter)`) refused the caller. Every gate 403 carries it,
10236
- including a gate that could not be decided, which fails closed and
10237
- answers the same: only the server's metrics and log tell those
10238
- 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.
10239
10819
 
10240
10820
  MATERIALIZATION_REFUSED means a valid materialization declaration
10241
10821
  this server will not build, and the body's `refusalReason` is the
@@ -10296,6 +10876,19 @@ components:
10296
10876
  publisher.json included), and the package or version serves what
10297
10877
  it served before. The message carries the cause.
10298
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
+
10299
10892
  MANIFEST_NOT_FOUND, on a 400 from the same routes, means nothing
10300
10893
  is at the `manifestLocation` (no such file, object or bucket),
10301
10894
  and MANIFEST_INVALID, on a 422, that what is there does not parse
@@ -10344,13 +10937,15 @@ components:
10344
10937
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
10345
10938
  CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND, RESULT_TRUNCATED,
10346
10939
  RESULT_SHAPE_MISMATCH, STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10940
+ INHERITED_FILTER_UNVERIFIED, INDEX_SOURCE_UNBUILT,
10347
10941
  MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10348
10942
  TABLE_OWNERSHIP_UNVERIFIED, TABLE_IN_USE, BUILD_INSTRUCTIONS_INVALID,
10349
10943
  MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
10350
10944
  VERSION_CONFLICT, PACKAGE_IS_VERSIONED,
10351
10945
  PACKAGE_INSTALLED_FROM_LOCATION, FILE_EXISTS, VERSION_IS_LATEST,
10352
10946
  VERSION_IS_LAST_ACTIVE, VERSION_BUILDING, VERSION_ID_INVALID,
10353
- VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED.
10947
+ VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED,
10948
+ SIMULATION_ACTIVE.
10354
10949
  problems:
10355
10950
  type: array
10356
10951
  description: |
@@ -10366,6 +10961,72 @@ components:
10366
10961
  required:
10367
10962
  - message
10368
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
+
10369
11030
  Column:
10370
11031
  type: object
10371
11032
  description: Database column definition
@@ -10376,6 +11037,23 @@ components:
10376
11037
  type:
10377
11038
  type: string
10378
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.
10379
11057
 
10380
11058
  TableDescription:
10381
11059
  type: object
@@ -10462,7 +11140,8 @@ components:
10462
11140
  reload over every .malloy and .malloynb file, without swapping the
10463
11141
  result into the served package; with a source, importers compile
10464
11142
  against the replacement. It also reports the render-tag findings
10465
- (code "render-tag"), the dashboard, given and drill findings
11143
+ (code "render-tag", or "render-tag-check-failed" for a model whose
11144
+ check did not finish), the dashboard, given and drill findings
10466
11145
  (code "dashboard-lint") and each .malloynb code cell the query
10467
11146
  route would refuse (code "malloynb-cell-refused", at most 10 per
10468
11147
  notebook and 50 per package, with the rest named in
@@ -10599,6 +11278,14 @@ components:
10599
11278
  is true and compilation succeeds with a runnable query.
10600
11279
  document:
10601
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.
10602
11289
 
10603
11290
  CompiledDocument:
10604
11291
  type: object
@@ -11066,6 +11753,9 @@ components:
11066
11753
  copy of a model file without
11067
11754
  `##! experimental.persistence` did not compile, so none of its
11068
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);
11069
11759
  `persist_annotation_unparseable` is retained and no longer
11070
11760
  produced: a `#@` line that does not parse is an invalid annotation
11071
11761
  (`persist-unparseable`), which fails the publish and the load, so
@@ -11253,10 +11943,9 @@ components:
11253
11943
  catalog, which runs only SQL Malloy generated: a `storage=` source
11254
11944
  on a DuckLake connection, or a source of any tier on a connection
11255
11945
  configured `managed`);
11256
- `table_name_collision` (under `PERSIST_COLLISION_ENFORCE=false`, a
11257
- declaration whose `name=` puts it on one table with another, so
11258
- neither is built; by default such a package does not load; a run
11259
- 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
11260
11949
  whose readable table name another source's table already takes in
11261
11950
  that run); `current_time` (the build reads the current time, `now`,
11262
11951
  or keeps rows older than a moving cut-off it cannot leave out, so
@@ -11295,8 +11984,8 @@ components:
11295
11984
  the container; `storage=` declarations are never checked).
11296
11985
 
11297
11986
 
11298
- A persisted view or named query: `materialization_off` (persisted
11299
- 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),
11300
11989
  `multi_line_annotation` (its `#@` line spans more than one line),
11301
11990
  `build_name_collision` (its generated build source's name is one
11302
11991
  the model, or another persisted view, already takes),
@@ -12405,7 +13094,16 @@ components:
12405
13094
  description: The contract's shape version. `1`.
12406
13095
  producer:
12407
13096
  type: string
12408
- 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.
12409
13107
  dialect:
12410
13108
  type: string
12411
13109
  description: >-
@@ -12480,6 +13178,45 @@ components:
12480
13178
  ordering and ranges may not), or `none` (no string comparison is
12481
13179
  known to match). Every non-string column is `exact`. An open set:
12482
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.
12483
13220
  gateExact:
12484
13221
  type: boolean
12485
13222
  description: >-
@@ -12616,6 +13353,44 @@ components:
12616
13353
  derives its plan again at once, and the next build either builds
12617
13354
  the source over the upstream's table as it is or the plan refuses
12618
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.
12619
13394
  `instruction_unresolved` (an instruction no source in the run's
12620
13395
  build plan resolves to, so nothing was built for it; not
12621
13396
  `retryable` until the caller reads the plan again). Every
@@ -12624,6 +13399,18 @@ components:
12624
13399
  plan's reason, and any other unmatched instruction fails with this
12625
13400
  code; none is dropped. An open set; absent for a failure that has
12626
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.
12627
13414
  refused:
12628
13415
  type: boolean
12629
13416
  description: >-
@@ -12662,10 +13449,14 @@ components:
12662
13449
  passthrough). Five SQLSTATEs in class 42 are left to the other rules:
12663
13450
  a missing table or column (`42P01`, `42703`, `42S02`, `42S22`, and
12664
13451
  a BigQuery `Unrecognized name` or `Not found`), which stays absent,
12665
- and `42501` (insufficient privilege). A Postgres `42501` still
12666
- reports `false`, because its message says permission denied; a
12667
- Snowflake `42501` stays absent. Transient codes (`40001`, `40P01`,
12668
- 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.
12669
13460
 
12670
13461
 
12671
13462
  `true` is a transient failure, not a property of the inputs: the