@malloy-publisher/app 0.18.6 → 0.18.8

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 (25) hide show
  1. package/dist/api-doc.yaml +1082 -160
  2. package/dist/assets/{EnvironmentPage-C3gdsp81.js → EnvironmentPage-B9eJXM9R.js} +1 -1
  3. package/dist/assets/{HomePage-DqgKtxBQ.js → HomePage-CUCq65Mm.js} +1 -1
  4. package/dist/assets/{MainPage-BnTI-1vD.js → MainPage-DMCpsSwG.js} +1 -1
  5. package/dist/assets/{ModelPage-eLIQM9Js.js → ModelPage-CRpHJTqZ.js} +2 -2
  6. package/dist/assets/{PackagePage-CejLNGDv.js → PackagePage-CrgssVfP.js} +1 -1
  7. package/dist/assets/PackageSplatRoute-Dh1u1dZ4.js +2 -0
  8. package/dist/assets/{RenderedResult-cJiP774J.es-CZC2lkLE.js → RenderedResult-DW_0pVGi.es-CQe3gbdA.js} +3 -3
  9. package/dist/assets/{RouteError-_sExFuNk.js → RouteError-C11mhFOT.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-CaJX95t_.js → ThemeEditorPage-CQdYTEul.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-DogvpiUV.js → ToggleButtonGroup-CPXIFQqB.js} +1 -1
  12. package/dist/assets/{documentRoutes-G_kvP2a6.js → documentRoutes-DarwM5Zm.js} +1 -1
  13. package/dist/assets/{editPageMounted-CM_VLUwp.js → editPageMounted-DmeRc7t9.js} +2 -2
  14. package/dist/assets/{index-D9nJPs77.js → index-BNAHVKoh.js} +1 -1
  15. package/dist/assets/{index-b7pou7Vk.js → index-BX1A_FPA.js} +111 -111
  16. package/dist/assets/{index-O_b7OJ2r.js → index-C0mf24Mk.js} +1 -1
  17. package/dist/assets/{index-CYndXhSx.js → index-CHCSj9_S.js} +1 -1
  18. package/dist/assets/{index.es-DQ-xbkiQ.js → index.es-B1q1T-14.js} +10 -10
  19. package/dist/assets/usePackageLinkNavigate-iOWW_Iek.js +1 -0
  20. package/dist/assets/{usePackageRoute-yIGqS2C8.js → usePackageRoute-BNCiKCRB.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/PackageSplatRoute-CXdCJTYw.js +0 -2
  25. package/dist/assets/usePackageLinkNavigate-Lw9XmylW.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -253,6 +253,8 @@ paths:
253
253
  Creates a new Malloy environment with the specified configuration. An environment serves as a
254
254
  container for packages, connections, and other resources. The environment will be initialized
255
255
  with the provided metadata and can immediately accept packages and connections.
256
+ A name that differs only in letter case from an existing environment's is refused with a
257
+ 400: on a case-insensitive file system both would resolve to one directory.
256
258
  requestBody:
257
259
  required: true
258
260
  content:
@@ -338,6 +340,8 @@ paths:
338
340
  Updates the configuration and metadata of an existing environment. This allows you to
339
341
  modify environment settings, update the README, change the location, or update other
340
342
  environment-level properties. The environment must exist and be accessible.
343
+ The update applies only to the environment the path names: a body whose `name` names
344
+ another environment is refused with a 400.
341
345
  parameters:
342
346
  - name: environmentName
343
347
  in: path
@@ -393,6 +397,8 @@ paths:
393
397
  $ref: "#/components/responses/Unauthorized"
394
398
  "404":
395
399
  $ref: "#/components/responses/NotFound"
400
+ "409":
401
+ $ref: "#/components/responses/SimulationActive"
396
402
  "500":
397
403
  $ref: "#/components/responses/InternalServerError"
398
404
  "503":
@@ -475,7 +481,8 @@ paths:
475
481
  operationId: create-connection
476
482
  summary: Create a new database connection
477
483
  description: |
478
- Creates a new database connection in the specified environment.
484
+ Creates a new database connection in the specified environment, named as the path names
485
+ it: a body whose `name` names another connection is refused with a 400.
479
486
  parameters:
480
487
  - name: environmentName
481
488
  in: path
@@ -786,6 +793,24 @@ paths:
786
793
  required: true
787
794
  schema:
788
795
  $ref: "#/components/schemas/PathPattern"
796
+ - name: include
797
+ in: query
798
+ description: |
799
+ Extra parts of the table to read. `collations` adds each column's
800
+ `nativeType` and `collation`, and the table's `defaultCollation`
801
+ (or `collationUnsupported`), `method` and `asOf`, read from the
802
+ connection's catalog after the table itself. Absent, the response
803
+ is exactly the plain table and no extra catalog read runs. A value
804
+ that is not one of the listed parts is a 400; so is a repeated
805
+ parameter.
806
+ required: false
807
+ style: form
808
+ explode: false
809
+ schema:
810
+ type: array
811
+ items:
812
+ type: string
813
+ enum: [collations]
789
814
  responses:
790
815
  "200":
791
816
  description: Table information
@@ -808,6 +833,81 @@ paths:
808
833
  "503":
809
834
  $ref: "#/components/responses/ServiceUnavailable"
810
835
 
836
+ /environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}/stats:
837
+ get:
838
+ tags:
839
+ - connections
840
+ operationId: get-table-stats
841
+ summary: Read a table's row count, bytes and last modification
842
+ description: |
843
+ Reads a table's size from the connection's catalog: its row count,
844
+ bytes and last modification time, each null where the catalog does not
845
+ record it. `method` says how the numbers were read; `rowCountBand`
846
+ appears only where the row count is an estimate (Postgres
847
+ `reltuples`; DuckLake where its catalog leaves deletes unaccounted).
848
+ Only a table has stats (on Postgres a partitioned table, its
849
+ partitions summed, or a materialized view too); a view, an index or
850
+ an external table answers `unsupported`. On DuckDB and MotherDuck the
851
+ row count is counted, and that answer writes an access record with
852
+ `decision: "ungated"`. A caller that declines the count (the MCP
853
+ `search_database_schema` tool) is answered DuckDB's row-group
854
+ estimate instead: `method` `catalog`, with a `rowCountBand`, and no
855
+ access record. A DuckLake connection reads its catalog's
856
+ metadata tables and never counts: `method` `catalog`, no access
857
+ record. Every stats read holds a query slot while it runs, a DuckLake
858
+ one included, since it loads the catalog's shared metadata database.
859
+ Metadata only: no field holds a row value. Answered for
860
+ Postgres, BigQuery, DuckDB, MotherDuck, DuckLake and Snowflake
861
+ connections; any other answers `status` `unsupported`. A `publisher`
862
+ proxy connection forwards the request and relays the answer with
863
+ `method` `host`.
864
+ parameters:
865
+ - name: environmentName
866
+ in: path
867
+ description: Name of the environment
868
+ required: true
869
+ schema:
870
+ $ref: "#/components/schemas/IdentifierPattern"
871
+ - name: connectionName
872
+ in: path
873
+ description: Name of the connection
874
+ required: true
875
+ schema:
876
+ $ref: "#/components/schemas/IdentifierPattern"
877
+ - name: schemaName
878
+ in: path
879
+ description: Name of the schema
880
+ required: true
881
+ schema:
882
+ $ref: "#/components/schemas/IdentifierPattern"
883
+ - name: tablePath
884
+ in: path
885
+ description: The table, as a listing's `resource` names it, or bare (then qualified by schemaName)
886
+ required: true
887
+ schema:
888
+ $ref: "#/components/schemas/PathPattern"
889
+ responses:
890
+ "200":
891
+ description: The answer, or `status` `unsupported` with a `reason` when this connection cannot give it
892
+ content:
893
+ application/json:
894
+ schema:
895
+ $ref: "#/components/schemas/TableStats"
896
+ "400":
897
+ $ref: "#/components/responses/BadRequest"
898
+ "401":
899
+ $ref: "#/components/responses/Unauthorized"
900
+ "404":
901
+ $ref: "#/components/responses/NotFound"
902
+ "424":
903
+ $ref: "#/components/responses/ConnectionUnavailable"
904
+ "500":
905
+ $ref: "#/components/responses/InternalServerError"
906
+ "502":
907
+ $ref: "#/components/responses/DatabaseUnreachable"
908
+ "503":
909
+ $ref: "#/components/responses/ServiceUnavailable"
910
+
811
911
  /environments/{environmentName}/connections/{connectionName}/sqlSource:
812
912
  post:
813
913
  tags:
@@ -1198,6 +1298,24 @@ paths:
1198
1298
  schema:
1199
1299
  $ref: "#/components/schemas/PathPattern"
1200
1300
  - $ref: "#/components/parameters/versionId"
1301
+ - name: include
1302
+ in: query
1303
+ description: |
1304
+ Extra parts of the table to read. `collations` adds each column's
1305
+ `nativeType` and `collation`, and the table's `defaultCollation`
1306
+ (or `collationUnsupported`), `method` and `asOf`, read from the
1307
+ connection's catalog after the table itself. Absent, the response
1308
+ is exactly the plain table and no extra catalog read runs. A value
1309
+ that is not one of the listed parts is a 400; so is a repeated
1310
+ parameter.
1311
+ required: false
1312
+ style: form
1313
+ explode: false
1314
+ schema:
1315
+ type: array
1316
+ items:
1317
+ type: string
1318
+ enum: [collations]
1201
1319
  responses:
1202
1320
  "200":
1203
1321
  description: Table information
@@ -1222,6 +1340,87 @@ paths:
1222
1340
  "503":
1223
1341
  $ref: "#/components/responses/ServiceUnavailable"
1224
1342
 
1343
+ /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}/stats:
1344
+ get:
1345
+ tags:
1346
+ - connections
1347
+ operationId: get-table-stats-in-package
1348
+ summary: Read a table's row count, bytes and last modification (per-package)
1349
+ description: |
1350
+ Reads a table's size from the connection's catalog: its row count,
1351
+ bytes and last modification time, each null where the catalog does not
1352
+ record it. `method` says how the numbers were read; `rowCountBand`
1353
+ appears only where the row count is an estimate (Postgres
1354
+ `reltuples`; DuckLake where its catalog leaves deletes unaccounted).
1355
+ Only a table has stats (on Postgres a partitioned table, its
1356
+ partitions summed, or a materialized view too); a view, an index or
1357
+ an external table answers `unsupported`. On DuckDB and MotherDuck the
1358
+ row count is counted, and that answer writes an access record with
1359
+ `decision: "ungated"`. A DuckLake connection reads its catalog's
1360
+ metadata tables and never counts: `method` `catalog`, no access
1361
+ record. Every stats read holds a query slot while it runs, a DuckLake
1362
+ one included, since it loads the catalog's shared metadata database.
1363
+ Metadata only: no field holds a row value. Answered for
1364
+ Postgres, BigQuery, DuckDB, MotherDuck, DuckLake and Snowflake
1365
+ connections; any other answers `status` `unsupported`. A `publisher`
1366
+ proxy connection forwards the request and relays the answer with
1367
+ `method` `host`.
1368
+ parameters:
1369
+ - name: environmentName
1370
+ in: path
1371
+ description: Name of the environment
1372
+ required: true
1373
+ schema:
1374
+ $ref: "#/components/schemas/IdentifierPattern"
1375
+ - name: packageName
1376
+ in: path
1377
+ description: Name of the package whose connection context to use
1378
+ required: true
1379
+ schema:
1380
+ $ref: "#/components/schemas/IdentifierPattern"
1381
+ - name: connectionName
1382
+ in: path
1383
+ description: Name of the connection
1384
+ required: true
1385
+ schema:
1386
+ $ref: "#/components/schemas/IdentifierPattern"
1387
+ - name: schemaName
1388
+ in: path
1389
+ description: Name of the schema
1390
+ required: true
1391
+ schema:
1392
+ $ref: "#/components/schemas/IdentifierPattern"
1393
+ - name: tablePath
1394
+ in: path
1395
+ description: The table, as a listing's `resource` names it, or bare (then qualified by schemaName)
1396
+ required: true
1397
+ schema:
1398
+ $ref: "#/components/schemas/PathPattern"
1399
+ - $ref: "#/components/parameters/versionId"
1400
+ responses:
1401
+ "200":
1402
+ description: The answer, or `status` `unsupported` with a `reason` when this connection cannot give it
1403
+ content:
1404
+ application/json:
1405
+ schema:
1406
+ $ref: "#/components/schemas/TableStats"
1407
+ "400":
1408
+ $ref: "#/components/responses/BadRequest"
1409
+ "401":
1410
+ $ref: "#/components/responses/Unauthorized"
1411
+ "404":
1412
+ $ref: "#/components/responses/NotFound"
1413
+ "410":
1414
+ $ref: "#/components/responses/Gone"
1415
+ "424":
1416
+ $ref: "#/components/responses/ConnectionUnavailable"
1417
+ "500":
1418
+ $ref: "#/components/responses/InternalServerError"
1419
+ "502":
1420
+ $ref: "#/components/responses/DatabaseUnreachable"
1421
+ "503":
1422
+ $ref: "#/components/responses/ServiceUnavailable"
1423
+
1225
1424
  /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource:
1226
1425
  post:
1227
1426
  tags:
@@ -1508,7 +1707,12 @@ paths:
1508
1707
  424 refusal, or 200 with the package as it would load, its `warnings` included, plus the
1509
1708
  `location` it was loaded from. The 200 also carries what a publish would build and serve:
1510
1709
  the `buildPlan`, and `serveVerdicts`, each materialized source's serve verdict with each
1511
- stored source's named views compiled against a compile-only served copy (no table is built). With package versioning on, the tree's `publisher.json`
1710
+ stored source's named views compiled against a compile-only served copy (no table is built),
1711
+ and `materializationSummary`, one line per materialized item as the publish would leave
1712
+ it, in the shape a package's serving state carries. Since the dry run builds and binds
1713
+ nothing, no item is `built` and none `serves`: each is `awaiting_build` (with `serves`
1714
+ `after_build`, or `live` and the reason it would answer live), `not_buildable`, or
1715
+ `refused` with its reason. The tree's `publisher.json`
1512
1716
  must declare a valid version, as a versioned publish requires (400
1513
1717
  `MANIFEST_VERSION_MISSING` or `MANIFEST_VERSION_INVALID`), and the 200 names it as
1514
1718
  `versionId`. Version lifecycle checks (a version that already exists, `latest`) are not
@@ -1516,24 +1720,14 @@ paths:
1516
1720
  package being served. A frozen configuration refuses a dry run as it refuses a publish,
1517
1721
  since the server still downloads and loads the caller's content; so does memory
1518
1722
  backpressure (503).
1519
- A server runs at most 2 dry runs at once and refuses more with 503. With package
1520
- versioning on, a `description` that is not a string or a
1723
+ A server runs at most 2 dry runs at once and refuses more with 503. A
1724
+ `description` that is not a string or a
1521
1725
  `manifestLocation` that names no manifest is the 400 a versioned
1522
1726
  publish answers.
1523
1727
 
1524
1728
  ## Versioned publish
1525
1729
 
1526
- Package versioning is a server setting, `PUBLISHER_PACKAGE_VERSIONING` (`on` by
1527
- default; `ServerStatus.packageVersioning` reports it), and a transition: a later release
1528
- removes the setting and always publishes versions.
1529
-
1530
- With it off, a request that carries a `location` installs the package in place,
1531
- replacing the previous publish, as before versions, whatever its `publisher.json`
1532
- declares; the package has no versions, and the server logs a warning that names it. A
1533
- package that already has published versions refuses that with 409 (`reason`
1534
- `PACKAGE_IS_VERSIONED`).
1535
-
1536
- With it on, a request that carries a `location` publishes an immutable version of the
1730
+ A request that carries a `location` publishes an immutable version of the
1537
1731
  package: the one its own `publisher.json` declares. The request takes no version
1538
1732
  parameter: the version is that field, the way `npm publish` reads `package.json`, so
1539
1733
  bumping it is the release action.
@@ -1558,10 +1752,12 @@ paths:
1558
1752
  hold immutable versions: publishing a version of it is refused with 400.
1559
1753
  - The request's `description`, when sent, is the package's description. Each version
1560
1754
  keeps the `description` from its own publisher.json.
1755
+ - An environment whose version registry is not bound yet (its database row was not
1756
+ written) refuses a publish, and a dry run, with 503 naming the environment. It never
1757
+ installs the package in place instead.
1561
1758
 
1562
1759
  A request without a `location` registers a directory already in the environment as a
1563
- single unversioned package, as packages loaded from `publisher.config.json` are with
1564
- versioning off. A
1760
+ single unversioned package. A
1565
1761
  package that already has versions refuses that with 409 (`reason`
1566
1762
  `PACKAGE_IS_VERSIONED`).
1567
1763
  parameters:
@@ -1703,8 +1899,16 @@ paths:
1703
1899
  naming the route that replaces it.
1704
1900
 
1705
1901
  Updates the configuration and metadata of an existing package. This allows you to
1706
- modify package settings, update the description, change the location, or update other
1707
- package-level properties. The package must exist and be accessible.
1902
+ modify package settings, update the description, or update other package-level
1903
+ properties. The package must exist and be accessible.
1904
+
1905
+ It does not install new content. A `location` other than the one the package was
1906
+ installed from (on a package with no versions: one an earlier release installed in
1907
+ place, or a directory registered without a location) is refused with 409 (`reason`
1908
+ `PACKAGE_NOT_VERSIONED`), and nothing of the request is applied: publish that location
1909
+ as a version instead (`create-package` with the `location`, and a semantic `version` in
1910
+ its publisher.json). A `location` equal to the installed one is a metadata update, and a
1911
+ reload fetches that location again.
1708
1912
 
1709
1913
  A supplied `materialization` block REPLACES the one on disk, so re-send every
1710
1914
  field of it you want to keep. Two exceptions are preserved when omitted:
@@ -1723,20 +1927,13 @@ paths:
1723
1927
 
1724
1928
  A package fetched from a `location` keeps none of these on reload: a reload fetches
1725
1929
  it again and replaces its files, `publisher.json` included, keeping only its
1726
- `location` and manifest binding. So when the package will be fetched from a
1727
- location once this request is applied (the `location` it sends, or else the one it
1728
- was installed from), a change to `description`, `explores`, `queryableSources`,
1729
- `scope`, `queryMetadata` or `materialization` is refused with 409 (`reason`
1930
+ `location` and manifest binding. So on a package installed from a location, a
1931
+ change to `description`, `explores`, `queryableSources`, `scope`, `queryMetadata`
1932
+ or `materialization` is refused with 409 (`reason`
1730
1933
  `PACKAGE_INSTALLED_FROM_LOCATION`). A change is judged by the value the request
1731
1934
  would leave in force: clearing a set field is a change, a null is omitted, and a
1732
- value equal to the current one (`explores` normalized as stored) is not. A request
1733
- that names a new `location` is judged against the tree fetched from it, and a
1734
- refusal leaves the previous install serving. When the package it replaces was
1735
- itself installed from a location, a field sent with that package's value is the
1736
- package sent back, not a change: it is left out and the new tree's value serves,
1737
- so a whole package read back with only its `location` changed is accepted.
1738
- Make the change in the package's
1739
- source and reload it, or publish it as a version.
1935
+ value equal to the current one (`explores` normalized as stored) is not. Make the
1936
+ change in the package's source and reload it, or publish it as a version.
1740
1937
  parameters:
1741
1938
  - name: environmentName
1742
1939
  in: path
@@ -1831,6 +2028,8 @@ paths:
1831
2028
  $ref: "#/components/responses/Unauthorized"
1832
2029
  "404":
1833
2030
  $ref: "#/components/responses/NotFound"
2031
+ "409":
2032
+ $ref: "#/components/responses/SimulationActive"
1834
2033
  "500":
1835
2034
  $ref: "#/components/responses/InternalServerError"
1836
2035
  "503":
@@ -1846,7 +2045,7 @@ paths:
1846
2045
  Lists every version published to the package, highest version first, including archived
1847
2046
  ones (marked by `archiveStatus`). The entry marked `latest` is the version served when a
1848
2047
  request names no `versionId`. An unversioned package (one registered from a directory,
1849
- mounted in a watched environment, or loaded or published with versioning off) has no
2048
+ mounted in a watched environment, or installed by an earlier release with versioning off) has no
1850
2049
  versions and returns an empty list.
1851
2050
  parameters:
1852
2051
  - $ref: "#/components/parameters/environmentName"
@@ -2101,6 +2300,8 @@ paths:
2101
2300
  $ref: "#/components/responses/Forbidden"
2102
2301
  "404":
2103
2302
  $ref: "#/components/responses/NotFound"
2303
+ "409":
2304
+ $ref: "#/components/responses/SimulationActive"
2104
2305
  "410":
2105
2306
  $ref: "#/components/responses/Gone"
2106
2307
  "422":
@@ -2471,6 +2672,16 @@ paths:
2471
2672
  The version queried may be named in the body (`QueryRequest.versionId`), in the URL
2472
2673
  (`?versionId=`), or both. When both name a version and they differ, the request answers
2473
2674
  400 with `reason` VERSION_ID_INVALID; an empty value in either names none.
2675
+
2676
+ A query with `queryClass: index` on a source that declares a stored table of its own
2677
+ (`#(materialize)` on the source, or its own `#@ persist`; not one it only inherits) is
2678
+ answered from that table or refused: with no ready table of it bound, it answers 409 with
2679
+ `reason` INDEX_SOURCE_UNBUILT and an `unbuiltReason`, and is never run live against the
2680
+ warehouse. The 404s and 403s of the published surface and the source's gates decide first.
2681
+ Any other class, and a source with no declaration of its own, is answered as before.
2682
+ This is a cost guard on the run target's own declaration, not a guarantee for every
2683
+ spelling: an import rename is refused like the source, but a rename in a model file, an
2684
+ inline `extend` in the query, and a `compose(…)` resolving to a stored member run live.
2474
2685
  parameters:
2475
2686
  - name: environmentName
2476
2687
  in: path
@@ -2513,6 +2724,8 @@ paths:
2513
2724
  $ref: "#/components/responses/Forbidden"
2514
2725
  "404":
2515
2726
  $ref: "#/components/responses/NotFound"
2727
+ "409":
2728
+ $ref: "#/components/responses/Conflict"
2516
2729
  "410":
2517
2730
  $ref: "#/components/responses/Gone"
2518
2731
  "413":
@@ -3004,7 +3217,8 @@ paths:
3004
3217
  BUILD_PLAN_UNAVAILABLE; reloading the package derives it again, and
3005
3218
  retrying the read does not. After an edit to a connection the
3006
3219
  package's persisted sources build on, the plan is re-derived (a
3007
- content address folds in its connection's digest) and the read waits
3220
+ content address folds in its connection's digest), or once a
3221
+ container it refused sources for now exists, and the read waits
3008
3222
  for it; past 10 seconds it answers 503 with `reason`
3009
3223
  BUILD_PLAN_REFRESHING and a `Retry-After` header. A failed
3010
3224
  re-derivation answers 409 BUILD_PLAN_UNAVAILABLE, as at load, and run
@@ -3582,6 +3796,21 @@ paths:
3582
3796
  description: Watch mode started successfully.
3583
3797
  "401":
3584
3798
  $ref: "#/components/responses/Unauthorized"
3799
+ "409":
3800
+ description: >-
3801
+ Simulated materialization is on (`PUBLISHER_MATERIALIZE_SIMULATE`),
3802
+ which refuses a watch-mode change until the server restarts without
3803
+ it. Like this deprecated route's other failures, the body is the
3804
+ legacy `{ "error": "<message>" }`, not `Error`, so it carries no
3805
+ `reason`.
3806
+ content:
3807
+ application/json:
3808
+ schema:
3809
+ type: object
3810
+ required: [error]
3811
+ properties:
3812
+ error:
3813
+ type: string
3585
3814
  "500":
3586
3815
  $ref: "#/components/responses/InternalServerError"
3587
3816
  "503":
@@ -3607,6 +3836,21 @@ paths:
3607
3836
  description: Watch mode stopped successfully.
3608
3837
  "401":
3609
3838
  $ref: "#/components/responses/Unauthorized"
3839
+ "409":
3840
+ description: >-
3841
+ Simulated materialization is on (`PUBLISHER_MATERIALIZE_SIMULATE`),
3842
+ which refuses a watch-mode change until the server restarts without
3843
+ it. Like this deprecated route's other failures, the body is the
3844
+ legacy `{ "error": "<message>" }`, not `Error`, so it carries no
3845
+ `reason`.
3846
+ content:
3847
+ application/json:
3848
+ schema:
3849
+ type: object
3850
+ required: [error]
3851
+ properties:
3852
+ error:
3853
+ type: string
3610
3854
  "500":
3611
3855
  $ref: "#/components/responses/InternalServerError"
3612
3856
  "503":
@@ -3687,6 +3931,7 @@ paths:
3687
3931
  serve). `reason:
3688
3932
  BUILD_PLAN_UNAVAILABLE`: the package's build plan could not be
3689
3933
  derived, or it serves an older model than its files.
3934
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3690
3935
  content:
3691
3936
  application/json:
3692
3937
  schema:
@@ -3800,7 +4045,9 @@ paths:
3800
4045
  "404":
3801
4046
  $ref: "#/components/responses/NotFound"
3802
4047
  "409":
3803
- description: Materialization cannot transition to the requested state
4048
+ description: >-
4049
+ Materialization cannot transition to the requested state.
4050
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3804
4051
  content:
3805
4052
  application/json:
3806
4053
  schema:
@@ -3837,7 +4084,9 @@ paths:
3837
4084
  "404":
3838
4085
  $ref: "#/components/responses/NotFound"
3839
4086
  "409":
3840
- description: Materialization cannot be deleted while it is active
4087
+ description: >-
4088
+ Materialization cannot be deleted while it is active.
4089
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3841
4090
  content:
3842
4091
  application/json:
3843
4092
  schema:
@@ -3958,6 +4207,7 @@ paths:
3958
4207
  (`MATERIALIZATION_CONFLICT`), the table is in use (`TABLE_IN_USE`),
3959
4208
  it is another's (`TABLE_OWNED_ELSEWHERE`), or it cannot be proven
3960
4209
  this package's (`TABLE_OWNERSHIP_UNVERIFIED`).
4210
+ `reason: SIMULATION_ACTIVE`: the server runs simulated materialization, which makes no materialization write (see `SimulationActive`).
3961
4211
  content:
3962
4212
  application/json:
3963
4213
  schema:
@@ -4042,6 +4292,8 @@ paths:
4042
4292
  $ref: "#/components/responses/BadRequest"
4043
4293
  "404":
4044
4294
  $ref: "#/components/responses/NotFound"
4295
+ "409":
4296
+ $ref: "#/components/responses/SimulationActive"
4045
4297
  "500":
4046
4298
  $ref: "#/components/responses/InternalServerError"
4047
4299
 
@@ -4097,6 +4349,8 @@ paths:
4097
4349
  $ref: "#/components/responses/BadRequest"
4098
4350
  "404":
4099
4351
  $ref: "#/components/responses/NotFound"
4352
+ "409":
4353
+ $ref: "#/components/responses/SimulationActive"
4100
4354
  "500":
4101
4355
  $ref: "#/components/responses/InternalServerError"
4102
4356
 
@@ -4128,7 +4382,10 @@ components:
4128
4382
  credentials are fixed. `PATH_ACCESS_DENIED`: a path the query or the
4129
4383
  model reads itself refused access, so the path, or the caller's grant
4130
4384
  to it, is what to fix. With `reason: ACCESS_DENIED`, a gate refused
4131
- the caller. The body
4385
+ the caller. With `reason: INHERITED_FILTER_UNVERIFIED`, no gate did: a
4386
+ `where:` the queried source inherits could not be verified to read
4387
+ the fields it was written against, and the message says which kind of
4388
+ check failed. The body
4132
4389
  names what the caller read and never a storage path; the full text is
4133
4390
  logged.
4134
4391
  content:
@@ -4149,6 +4406,9 @@ components:
4149
4406
  content. Bump the `version` in publisher.json and publish again.
4150
4407
  * PACKAGE_IS_VERSIONED: the package has published versions, which are
4151
4408
  immutable, so it cannot be changed in place.
4409
+ * PACKAGE_NOT_VERSIONED: a package update named a new `location` for a
4410
+ package with no versions, which is not installed in place. Publish the
4411
+ location as a version instead.
4152
4412
  * PACKAGE_INSTALLED_FROM_LOCATION: the package is fetched again from
4153
4413
  the location it was installed from on reload, which would discard
4154
4414
  the change. Make it in the package's source and reload.
@@ -4165,6 +4425,22 @@ components:
4165
4425
  * BUILD_PLAN_UNAVAILABLE: the package's build plan could not be
4166
4426
  derived when it loaded. Reload the package; retrying the read does
4167
4427
  not help.
4428
+ * INDEX_SOURCE_UNBUILT: a query with `queryClass: index` on a source
4429
+ that declares a stored table of its own, with no ready table of it
4430
+ bound. Retry once the table is built; `unbuiltReason` says why it
4431
+ is not ready.
4432
+ * SIMULATION_ACTIVE: the server runs simulated materialization, and
4433
+ the request is a materialization write (see `SimulationActive`).
4434
+ content:
4435
+ application/json:
4436
+ schema:
4437
+ $ref: "#/components/schemas/Error"
4438
+ SimulationActive:
4439
+ description: |
4440
+ `reason: SIMULATION_ACTIVE`. The server runs simulated materialization
4441
+ (`PUBLISHER_MATERIALIZE_SIMULATE`), an authoring mode that makes no
4442
+ materialization write, and this request would make one. It fails the
4443
+ same way until the server restarts without simulation.
4168
4444
  content:
4169
4445
  application/json:
4170
4446
  schema:
@@ -4579,18 +4855,6 @@ components:
4579
4855
  This server's release version, for example "0.8.2". Use it to tell
4580
4856
  which build answered, for instance to rule out an old copy served
4581
4857
  from the npx cache.
4582
- packageVersioning:
4583
- type: string
4584
- enum: ["off", "on"]
4585
- readOnly: true
4586
- description: >-
4587
- "on" when a publish from a location publishes an immutable
4588
- version (`PUBLISHER_PACKAGE_VERSIONING=on`, the default); "off" when
4589
- it installs the package in place, as before versions
4590
- (`PUBLISHER_PACKAGE_VERSIONING=off`). Reads and the versions
4591
- routes answer in both. Absent from a server that predates
4592
- versions, which reads as "off": how an orchestrator talking to
4593
- servers mid-rollout tells which ones publish native versions.
4594
4858
  versionPromotion:
4595
4859
  type: string
4596
4860
  enum: ["on-publish", "explicit"]
@@ -4981,6 +5245,282 @@ components:
4981
5245
  format: date-time
4982
5246
  description: When the in-progress load began. Present only while `loading` is true.
4983
5247
 
5248
+ MaterializationMode:
5249
+ type: string
5250
+ enum: [simulated, local, draft, published]
5251
+ description: >-
5252
+ How a package's tables came to be, so a reader never mistakes one kind
5253
+ for another. `local`: an unversioned package (a watched one, or one
5254
+ installed in place) whose tables this server builds itself.
5255
+ `published`: a published version, or a package whose tables a host's
5256
+ manifest bound. `simulated`: a package simulated materialization
5257
+ serves, its tables predicted and never built, every query routed to
5258
+ one answered from live.
5259
+ `draft` is reserved for a later release. A client must accept a value
5260
+ it does not know.
5261
+
5262
+ MaterializationStateCounts:
5263
+ type: object
5264
+ description: How many items are in each `MaterializationItem.state`.
5265
+ required: [built, awaiting_build, not_buildable, refused, failed]
5266
+ properties:
5267
+ built:
5268
+ type: integer
5269
+ awaiting_build:
5270
+ type: integer
5271
+ not_buildable:
5272
+ type: integer
5273
+ refused:
5274
+ type: integer
5275
+ failed:
5276
+ type: integer
5277
+
5278
+ MaterializationFact:
5279
+ type: object
5280
+ description: >-
5281
+ One fact about an item's table, and how it is known. `basis` is
5282
+ `exact` for a fact read off a table that exists, or off column
5283
+ metadata; `predicted` for one simulated materialization predicts
5284
+ without building; `not_knowable_locally` for one that depends on what
5285
+ only the host knows (its build times, limits, catalogs), for which
5286
+ `value` says why.
5287
+ required: [fact, value, basis]
5288
+ properties:
5289
+ fact:
5290
+ type: string
5291
+ description: >-
5292
+ Which fact: `table` (the physical table a query reads, present
5293
+ once built) or `builtAt` (when that table was built). Under
5294
+ simulated materialization also `storedTypes`, `collation`,
5295
+ `rowCount`, `bytes`, `keyUniqueness`, `freshness`, `limits`,
5296
+ `sameCatalog`, `managed`, `buildCost` and `reuse`. An open
5297
+ string: a client must skip a fact it does not know.
5298
+ value:
5299
+ type: string
5300
+ basis:
5301
+ type: string
5302
+ enum: [exact, predicted, not_knowable_locally]
5303
+ method:
5304
+ type: string
5305
+ description: >-
5306
+ How the fact was obtained, where that is more than reading a
5307
+ built table: `described` (the build SQL's output as the warehouse
5308
+ describes it, never run), `declared` (the build source's declared
5309
+ output), `catalog`, `estimated` or `counted` (the table stats
5310
+ route's methods), `build_sql` (read off the build SQL without
5311
+ running it), `aggregate` (one aggregate per key check: the
5312
+ `COUNT(*)` of the rows the build's own check SQL finds, or, for a
5313
+ `storage=` table's own key, `count()` against `count(distinct
5314
+ key)` over the rows its build SQL selects; only counts come back),
5315
+ `address` (the content address).
5316
+ Metadata is read with the author's own credentials. An open
5317
+ string.
5318
+ band:
5319
+ type: object
5320
+ description: >-
5321
+ Where a fact is approximate, its spread; an upper bound sets
5322
+ only `high`.
5323
+ properties:
5324
+ low:
5325
+ type: string
5326
+ high:
5327
+ type: string
5328
+
5329
+ MaterializationItem:
5330
+ type: object
5331
+ description: >-
5332
+ One thing a package materializes (a `#(materialize)` or `#@ persist`
5333
+ source, a `#@ persist` view or named query, or a `#(rollup)`), and
5334
+ its fate: the one row the build plan's refusals, the last build's
5335
+ failures and the serve verdicts are joined into.
5336
+ required: [name, kind, sourceID, tier, mode, state, serves]
5337
+ properties:
5338
+ name:
5339
+ type: string
5340
+ description: >-
5341
+ The declared name: the source's, the view's (on `source`), or the
5342
+ named query's. A rollup has no declared name, so this is the name
5343
+ the plan generated for it, and `source` and `grain` say what it
5344
+ rolls up.
5345
+ kind:
5346
+ type: string
5347
+ enum: [persist, materialize, view, query, rollup]
5348
+ description: The annotation that declared it.
5349
+ source:
5350
+ type: string
5351
+ description: A view's source, or a rollup's base source.
5352
+ grain:
5353
+ type: array
5354
+ items:
5355
+ type: string
5356
+ description: A rollup's grain dimensions.
5357
+ sourceID:
5358
+ type: string
5359
+ description: >-
5360
+ `sourceName@modelPath`, package-relative: the `BuildPlan.sources`
5361
+ key with its file URL read relative to the package, so it names no
5362
+ place the server keeps files.
5363
+ sourceEntityId:
5364
+ type: string
5365
+ description: >-
5366
+ The content address its table is built under: the key of a build
5367
+ manifest's `entries` and `failures`, so a run's manifest can be
5368
+ matched to its items. Absent for an item the plan never addressed
5369
+ (a refused one).
5370
+ modelPath:
5371
+ type: string
5372
+ description: The package-relative model that declares it.
5373
+ tier:
5374
+ type: string
5375
+ enum: [database, storage]
5376
+ description: >-
5377
+ Where its table lives: the source's own connection (`database`),
5378
+ or a storage destination (`storage`).
5379
+ destination:
5380
+ type: string
5381
+ description: >-
5382
+ The storage destination's name on the storage tier, else the
5383
+ connection the table is built on. Absent when not known (a
5384
+ refused `storage=` item the plan never placed).
5385
+ mode:
5386
+ $ref: "#/components/schemas/MaterializationMode"
5387
+ state:
5388
+ type: string
5389
+ enum: [built, awaiting_build, not_buildable, refused, failed]
5390
+ description: >-
5391
+ `built`: a table for it is bound. `awaiting_build`: it is valid
5392
+ and planned, no table is bound yet, and a build would make one.
5393
+ `not_buildable`: it is planned, but a build skips it here for
5394
+ `reason` (`destination_missing`, `connection_cannot_hold_table`,
5395
+ `materialization_off` or `upstream_unread`), so it is answered
5396
+ live until that changes.
5397
+ `refused`: it is valid and the plan or the bind does not build or
5398
+ serve it here, for `reason`. `failed`: this server's last build of
5399
+ it failed, for `reason` (an older table may still be bound and
5400
+ serving; `serves` says). Known only for builds this server ran
5401
+ since the package last loaded; a host's manifest that binds a
5402
+ table at its address clears it.
5403
+ serves:
5404
+ type: string
5405
+ enum: [serves, after_build, live, not_judged]
5406
+ description: >-
5407
+ How queries on it are answered right now. `serves`: from its
5408
+ bound table. `after_build`: nothing is bound yet; they are
5409
+ answered live now and from its table once a build binds one.
5410
+ `live`: answered live, for `reason`, and a build alone does not
5411
+ change that (a failed item with nothing bound is `live`).
5412
+ `not_judged`: no serve verdict was computed: a refused item, or a
5413
+ draft a compile planned without binding.
5414
+ queries:
5415
+ type: array
5416
+ items:
5417
+ type: string
5418
+ description: >-
5419
+ What a query names to be answered from this table, as far as is
5420
+ known without compiling queries: the source (or a rollup's base),
5421
+ `source -> view` for a persisted view, or the named query.
5422
+ reason:
5423
+ type: string
5424
+ description: >-
5425
+ Why it is not built, failed, or is answered live: a
5426
+ `RefusedSource.reason` for a refused item, `build_failed` for a
5427
+ failed one, else the `ServeVerdict.reason`. An open string.
5428
+ message:
5429
+ type: string
5430
+ description: What the state and verdict mean for it, in a sentence or two.
5431
+ fixes:
5432
+ type: array
5433
+ items:
5434
+ type: string
5435
+ description: The changes that would let it build or serve, from the verdict.
5436
+ facts:
5437
+ type: array
5438
+ items:
5439
+ $ref: "#/components/schemas/MaterializationFact"
5440
+ readsThrough:
5441
+ $ref: "#/components/schemas/ReadsThrough"
5442
+ description: >-
5443
+ On a `refused` item, as `ServeVerdict.readsThrough`: the stored
5444
+ source whose table answers its queries through the served copy.
5445
+
5446
+ MaterializationSummary:
5447
+ type: object
5448
+ description: >-
5449
+ One row per thing a package materializes, with counts by state. Read
5450
+ off the build plan, the bound tables and the serve verdicts as they
5451
+ stand; absent when the package materializes nothing.
5452
+ required: [mode, counts, items]
5453
+ properties:
5454
+ mode:
5455
+ $ref: "#/components/schemas/MaterializationMode"
5456
+ counts:
5457
+ $ref: "#/components/schemas/MaterializationStateCounts"
5458
+ items:
5459
+ type: array
5460
+ items:
5461
+ $ref: "#/components/schemas/MaterializationItem"
5462
+ hiddenItems:
5463
+ type: integer
5464
+ description: >-
5465
+ Set only on `GET …/packages/{packageName}/status`: the items
5466
+ `items` leaves out because they are not on the package's
5467
+ published surface, by the rule `MaterializationDigest.hiddenNotServed`
5468
+ follows. Counted, never named; `counts` still counts them.
5469
+
5470
+ MaterializationDigest:
5471
+ type: object
5472
+ description: >-
5473
+ A package's `MaterializationSummary` cut down for a poll: counts of
5474
+ every item by state, and the items that are not `built`, or are built
5475
+ and answered live, each with its reason code. An item off the
5476
+ package's published surface is counted in `hiddenNotServed` rather
5477
+ than named. Built from the same function as the summary.
5478
+ required: [mode, counts, hiddenNotServed, notServed]
5479
+ properties:
5480
+ mode:
5481
+ $ref: "#/components/schemas/MaterializationMode"
5482
+ counts:
5483
+ $ref: "#/components/schemas/MaterializationStateCounts"
5484
+ hiddenNotServed:
5485
+ type: integer
5486
+ description: >-
5487
+ Items not answered from a table that `notServed` leaves out
5488
+ because they are not on the package's published surface: no
5489
+ `index.malloy` export names their source (a view's source, a
5490
+ rollup's base, a named query) as declared in their file, so a
5491
+ hidden source sharing an exported source's name elsewhere is
5492
+ counted here. Counted, never named, since `/status` is
5493
+ unauthenticated. A package that curates nothing, or declares
5494
+ `queryableSources: "all"`, makes every source queryable by name,
5495
+ so every item is named and this is 0.
5496
+ notServed:
5497
+ type: array
5498
+ items:
5499
+ type: object
5500
+ required: [name, kind, sourceID, state, serves]
5501
+ properties:
5502
+ name:
5503
+ type: string
5504
+ kind:
5505
+ type: string
5506
+ enum: [persist, materialize, view, query, rollup]
5507
+ sourceID:
5508
+ type: string
5509
+ modelPath:
5510
+ type: string
5511
+ tier:
5512
+ type: string
5513
+ enum: [database, storage]
5514
+ state:
5515
+ type: string
5516
+ enum: [built, awaiting_build, not_buildable, refused, failed]
5517
+ serves:
5518
+ type: string
5519
+ enum: [serves, after_build, live, not_judged]
5520
+ reason:
5521
+ type: string
5522
+ description: As `MaterializationItem.reason`; absent for an item simply awaiting its build.
5523
+
4984
5524
  ServeVerdict:
4985
5525
  type: object
4986
5526
  description: >-
@@ -5032,8 +5572,7 @@ components:
5032
5572
  type: string
5033
5573
  description: >-
5034
5574
  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
5575
+ `unreachable` (no source on the package's published surface
5037
5576
  reads it), `row_level_gate` (every query through it carries an
5038
5577
  `#(authorize)` or `#(access_filter)` gate its table cannot keep
5039
5578
  yet, on either tier), `stale` (its table is past its freshness
@@ -5044,10 +5583,10 @@ components:
5044
5583
  `connection_cannot_hold_table` (database, on a connection whose
5045
5584
  type creates no tables), `types_unrecorded` (retained, no longer
5046
5585
  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
5586
+ `contract_missing` now), `materialization_off` (a
5587
+ `#(materialize)` source, which only the served copy reads, in a
5588
+ package none of whose model files has a served copy: every one
5589
+ is a notebook or a report), `served_copy` (a source the served copy
5051
5590
  reads, `#(materialize)` or `#@ persist`, whose table is bound and
5052
5591
  built, but no model's served copy re-roots it, so its queries are
5053
5592
  answered live; `notServedIn` says where and why),
@@ -5165,19 +5704,8 @@ components:
5165
5704
  the like), the verdict's own `reason`, or `not_rerooted` when none
5166
5705
  names one. With a `served_copy` `servePath`: `through_base` (an
5167
5706
  extension of a re-rooted source, left as written, which reads that
5168
- source's table by name). An open string.
5169
- cutoverPath:
5170
- type: string
5171
- deprecated: true
5172
- description: >-
5173
- Deprecated: the same value as `servePath`, under its old name.
5174
- Emitted beside it for this release only.
5175
- cutoverReason:
5176
- type: string
5177
- deprecated: true
5178
- description: >-
5179
- Deprecated: the same value as `servePathReason`, under its old
5180
- name. Emitted beside it for this release only.
5707
+ source's table by name, a plan-refused one with `readsThrough`
5708
+ included). An open string.
5181
5709
  views:
5182
5710
  type: array
5183
5711
  description: >-
@@ -5188,6 +5716,47 @@ components:
5188
5716
  reproduce).
5189
5717
  items:
5190
5718
  $ref: "#/components/schemas/ViewServeVerdict"
5719
+ readsThrough:
5720
+ $ref: "#/components/schemas/ReadsThrough"
5721
+ description: >-
5722
+ With a `refused` reason: present when the source has no table of
5723
+ its own but the served copy answers its queries from the table of
5724
+ a stored source it refines (by `extend` or rename, never across a
5725
+ query), with that source's row-level gate applied, so a query on
5726
+ it reports `path.servedBy.kind: materialized` with
5727
+ `via: served_copy`. `verdict` and `reason` still describe its own
5728
+ table, which is never built. Read off the compiled served copies
5729
+ and the build plan as they stand, never by running a query; absent
5730
+ when no served copy reads it through a base (the base is reached
5731
+ across a query, the served copy declines the base or the source
5732
+ itself for a gate, or the copy has yet to compile). On a dry run
5733
+ it is judged from the preview's served copy, compiled over
5734
+ bindings declared from the plan, as `servePath` is, and such a
5735
+ source's `servePath` is `served_copy` with `servePathReason`
5736
+ `through_base`.
5737
+
5738
+ ReadsThrough:
5739
+ type: object
5740
+ description: >-
5741
+ The stored source a refused refinement is read through, and the table
5742
+ that answers its queries.
5743
+ required: [sourceName, sourceID]
5744
+ properties:
5745
+ sourceName:
5746
+ type: string
5747
+ description: The stored source it refines, by name.
5748
+ sourceID:
5749
+ type: string
5750
+ description: >-
5751
+ That source's identity, as `ServeVerdict.sourceID` gives one
5752
+ (package-relative on a `MaterializationItem`, as its own
5753
+ `sourceID` is): a name alone is ambiguous across models.
5754
+ tableId:
5755
+ type: string
5756
+ description: >-
5757
+ That source's table: its `sourceEntityId` in the build plan, the
5758
+ `tableId` a query's `path.servedBy` names when this table answers
5759
+ it. Absent when the plan does not address the source.
5191
5760
 
5192
5761
  NotServedIn:
5193
5762
  type: object
@@ -5207,7 +5776,7 @@ components:
5207
5776
  Every reason the served copy gives for not reading the source's
5208
5777
  table in this model: the `reason` of each `served-copy-not-served`
5209
5778
  package warning on that model that names the source or the model's
5210
- whole copy, the codes `publisher_served_copy_bind_total` counts,
5779
+ whole copy, the codes `publisher_served_copy_outcome_total` counts,
5211
5780
  most actionable first (for example `cross_connection_join` before
5212
5781
  `fields_not_carried`): `cross_connection_join`,
5213
5782
  `cross_connection_unbuilt`, `sql_embed_cross_connection` (a
@@ -5216,13 +5785,22 @@ components:
5216
5785
  catalog read through one), `sql_embed_bare` (a `.sql()`
5217
5786
  source embeds it bare, `%{ x }`, which its stored table cannot be
5218
5787
  embedded as), `inline_join_kept`,
5219
- `read_terms_not_kept`, `fields_not_carried`, `column_types`,
5220
- `classification_not_kept`, `pair_join_not_found`,
5788
+ `read_terms_not_kept`, `refinement_left_as_written` (declared by
5789
+ refinement alone over a base whose filter or gate its table does
5790
+ not hold, and reading no re-rooted base), `fields_not_carried`,
5791
+ `column_types`, `classification_not_kept`, `pair_join_not_found`,
5221
5792
  `pair_not_compiled`, `definition_not_parsed`, `compile_failed`,
5222
- `no_declaration`, `reroot_not_compiled`. `not_rerooted` alone when
5223
- no warning names one (also `servePathReason`'s value for that
5224
- case). Never empty. An open set: treat an unknown value as
5225
- `not_rerooted`.
5793
+ `no_declaration`, `reroot_not_compiled`. With no warning naming
5794
+ one, `inherited_gate` alone (it is re-rooted, or read through a
5795
+ re-rooted base, but a row-level gate declared on a source the
5796
+ re-root replaces cannot be grafted on the copy, so its queries
5797
+ are answered live, under that gate), `through_base` alone (a
5798
+ refinement left as written by design, which reads the re-rooted
5799
+ source it refines by name, so that source's table answers its
5800
+ queries and its own is unread), or `not_rerooted` alone (no
5801
+ reason at all, a Publisher defect; also `servePathReason`'s
5802
+ value for that case). Never empty. An open set: treat an
5803
+ unknown value as `not_rerooted`.
5226
5804
  ViewServeVerdict:
5227
5805
  type: object
5228
5806
  required: [view, verdict]
@@ -5366,8 +5944,7 @@ components:
5366
5944
 
5367
5945
  `bound` reports that the bind ran to completion, NOT that any query
5368
5946
  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`
5947
+ eligibility gate is dropped. Read `manifestEntryCount`
5371
5948
  and `storageServeBindings` for what actually bound.
5372
5949
 
5373
5950
  An EMPTY manifest is a bind like any other: it is fetched and applied,
@@ -5441,10 +6018,7 @@ components:
5441
6018
  `storage=` destination via the virtual-source transform (distinct
5442
6019
  from the same-connection manifest binding above — a storage source is
5443
6020
  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`).
6021
+ manifest). Present only when at least one source is bound.
5448
6022
 
5449
6023
  Like `boundManifestUri`, this describes whatever is CURRENTLY bound
5450
6024
  rather than the configured manifest: after a failed rebind it goes on
@@ -5473,14 +6047,25 @@ components:
5473
6047
 
5474
6048
 
5475
6049
  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
6050
+ that is otherwise visible only per query: a source no published
5478
6051
  source reaches, one under a row-level gate the storage tier cannot
5479
6052
  keep. `POST …/packages?dryRun=true` answers the same verdicts for a
5480
6053
  package before it is published, with each stored source's named
5481
6054
  views checked as well.
5482
6055
  items:
5483
6056
  $ref: "#/components/schemas/ServeVerdict"
6057
+ materializationSummary:
6058
+ readOnly: true
6059
+ $ref: "#/components/schemas/MaterializationSummary"
6060
+ description: >-
6061
+ Server-computed, read-only: each materialized item of the loaded
6062
+ copy on the package's published surface, with its tier,
6063
+ destination, state, whether queries are answered from it, and why
6064
+ not, as a reload's response carries it. An item off that surface
6065
+ is counted in `hiddenItems`, never named, as the `/status` digest
6066
+ counts it. Recomputed on every read, like `serveVerdicts`. Absent
6067
+ when the package materializes nothing or no copy is loaded.
6068
+ `malloy-pub materialize --wait` prints it when a run settles.
5484
6069
 
5485
6070
  PackageStatusEntry:
5486
6071
  description: |
@@ -5566,6 +6151,15 @@ components:
5566
6151
  The manifest URI actually bound to the served models; null when
5567
6152
  unbound. A non-null value is a live reference. See
5568
6153
  `PackageServingState.boundManifestUri`.
6154
+ materializationDigest:
6155
+ $ref: "#/components/schemas/MaterializationDigest"
6156
+ description: >-
6157
+ Set on a loaded copy that materializes anything: counts of its
6158
+ materialized items by state, and the ones not answered from a
6159
+ table, with reason codes. Recomputed at most every few seconds.
6160
+ The full rows are on the reload response, `compile` at scope
6161
+ `package`, and `GET …/packages/{packageName}/status`
6162
+ (`materializationSummary`).
5569
6163
 
5570
6164
  ServerStatusEnvironment:
5571
6165
  type: object
@@ -5734,6 +6328,16 @@ components:
5734
6328
  fail-safe — the unresolved entry simply lists nothing rather than
5735
6329
  exposing everything — so this is the signal that a package is
5736
6330
  misconfigured; publishing such a package is rejected.
6331
+ materializationSummary:
6332
+ readOnly: true
6333
+ $ref: "#/components/schemas/MaterializationSummary"
6334
+ description: >-
6335
+ Set only on the response of a reload (`?reload=true`) or a dry-run
6336
+ publish (`?dryRun=true`), when the package materializes anything:
6337
+ each materialized item, with its tier, destination, state, whether
6338
+ queries are answered from it, and why not. A dry run builds and
6339
+ binds nothing, so none of its items is `built` or `serves`.
6340
+ Ignored on create and update requests.
5737
6341
  warnings:
5738
6342
  type: array
5739
6343
  readOnly: true
@@ -5965,9 +6569,10 @@ components:
5965
6569
  `deprecated-preaggregate-annotation`: a measure declaring
5966
6570
  `#@ preaggregate` or the deprecated alias `#(preaggregate)`,
5967
6571
  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).
6572
+ spelling it found (one per `#@ preaggregate` line, naming the
6573
+ `#(rollup)` line it is read as, or one per measure for
6574
+ `#(preaggregate)`; `model` its file, `subject` the source and
6575
+ the message the measure; `warn`).
5971
6576
  `deprecated-rollup-namespace`: a rollup line placed with
5972
6577
  `namespace=`, the deprecated spelling of its `name=`
5973
6578
  container; still read, in that container under the readable
@@ -6012,8 +6617,7 @@ components:
6012
6617
  a measure, a grain naming no dimension, a measure no rollup
6013
6618
  can merge);
6014
6619
  `materialization-table-collision` (two sources whose
6015
- `name=` puts them on one table; under
6016
- `PERSIST_COLLISION_ENFORCE=false` a refusal instead); and
6620
+ `name=` puts them on one table); and
6017
6621
  `materialization-near-miss` (a misspelled materialization
6018
6622
  route or directive, such as `#(materialise)` or
6019
6623
  `#@ persits`). `preaggregate-malformed` is retained and no
@@ -6057,10 +6661,6 @@ components:
6057
6661
  `inherited_where_with_given` or
6058
6662
  `given_where_over_unstored_field`, `unreadable_measure`,
6059
6663
  `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
6664
  `materialization-unreachable`,
6065
6665
  `materialization-destination-missing` and
6066
6666
  `materialization-connection-cannot-hold-table`: a source
@@ -6100,6 +6700,7 @@ components:
6100
6700
  `column_types`, `no_declaration`, `definition_not_parsed`,
6101
6701
  `pair_join_not_found`, `pair_not_compiled`,
6102
6702
  `fields_not_carried`, `read_terms_not_kept`,
6703
+ `refinement_left_as_written`,
6103
6704
  `cross_connection_join`, `inline_join_kept`,
6104
6705
  `reroot_not_compiled`, `classification_not_kept`,
6105
6706
  `sql_embed_cross_connection`, `sql_embed_bare`; an
@@ -6159,6 +6760,9 @@ components:
6159
6760
  later delta reads (its manifest entry's `lateRows`); it is
6160
6761
  carried until the source is rebuilt in full (one per source;
6161
6762
  `warn`).
6763
+ `simulation-manifest-bound`: a package or version whose
6764
+ `manifestLocation` simulated materialization left unbound,
6765
+ its manifest never fetched, so it serves live (`warn`).
6162
6766
  `rollup-join-one-key-repeated`: a bound rollup whose last
6163
6767
  build found the key of a `join_one` it reads repeated, so a
6164
6768
  query reading that join beside other aggregates is answered
@@ -6281,8 +6885,7 @@ components:
6281
6885
  `model-recompile-failed`; the unread reason on
6282
6886
  `database-table-unread` and `storage-table-unread`; the kept table's reason on
6283
6887
  `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
6888
+ `materialization-*` verdict warning; the rule a cell breaks on
6286
6889
  `malloynb-cell-refused` (`off_surface`, `caller_annotation`,
6287
6890
  `required_filter`, `restricted_mode`, `compile_error`). Always snake_case. An open
6288
6891
  string; absent on a finding that has none.
@@ -8513,7 +9116,9 @@ components:
8513
9116
  description: >-
8514
9117
  The class of work a statement belongs to, attached as the `class`
8515
9118
  query-metadata property: `interactive` (a user or application query),
8516
- `materialize` (a persist-source build), `index` (an index build or scan),
9119
+ `materialize` (a persist-source build), `index` (an index build or scan; a model query of this class on a
9120
+ source that declares a stored table of its own is answered only from
9121
+ that table, else refused with 409 INDEX_SOURCE_UNBUILT),
8517
9122
  `ops` (platform maintenance). Attribution's primary axis — a backend bill
8518
9123
  separates traffic from builds only if every statement says which it is.
8519
9124
 
@@ -8872,17 +9477,15 @@ components:
8872
9477
  type: string
8873
9478
  description: >-
8874
9479
  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`
9480
+ package refuses to serve it), `unreachable` (no published source reaches it), `row_level_gate`
8878
9481
  (every published entry point over it carries a gate it cannot keep
8879
9482
  yet), `stale` (past its freshness window, with a fallback that does
8880
9483
  not serve stale), `shadowed` (its storage table is bound to another
8881
9484
  source of the same name), `destination_missing` (`storage=` names
8882
9485
  a destination the environment does not configure),
8883
9486
  `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
9487
+ `materialization_off` (only the served copy reads it, and no
9488
+ model file of the package has a served copy), `served_copy` (only the served copy reads
8886
9489
  it, and the served copy does not re-root it), `incompatible` (the
8887
9490
  table no longer matches the column contract its build recorded) or
8888
9491
  `contract_missing` (its build recorded no usable contract); a
@@ -8976,9 +9579,30 @@ components:
8976
9579
  description: >-
8977
9580
  How a `materialized` table was read, when it was not today's serve
8978
9581
  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
9582
+ author's own files with each stored source re-rooted on its
9583
+ table). An open string; absent
8981
9584
  otherwise.
9585
+ mode:
9586
+ $ref: "#/components/schemas/MaterializationMode"
9587
+ tableSql:
9588
+ type: string
9589
+ description: >-
9590
+ The SQL that reads the table that answered, in every mode. Under
9591
+ simulated materialization it is what would have run, since the
9592
+ table does not exist and the rows came from live. Given only in
9593
+ the full response, beside the result's own `sql`: a
9594
+ `compactJson` response carries no SQL, so it leaves this out.
9595
+ Absent too when `kind` is `live`, or when the SQL could not be
9596
+ prepared.
9597
+ measuredOn:
9598
+ type: string
9599
+ enum: [table, live]
9600
+ description: >-
9601
+ What the query's rows, latency and cost were measured on: `table`,
9602
+ the table that answered; `live`, the warehouse (a simulated
9603
+ table, or a stored run that fell back to live). A latency or cost
9604
+ measured on `live` is never the table's. Absent when `kind` is
9605
+ `live`.
8982
9606
 
8983
9607
  QueryPathCandidate:
8984
9608
  type: object
@@ -9085,11 +9709,9 @@ components:
9085
9709
  - TIME_ZONE
9086
9710
  - CROSS_CONNECTION
9087
9711
  - COUNT_SEMANTICS
9712
+ - COMPARISON_SEMANTICS
9088
9713
  - STALE
9089
9714
  - READ_FAILED
9090
- - WARNED
9091
- - CONTRACT
9092
- - RUN_FAILED
9093
9715
  description: >-
9094
9716
  Why a table could not answer a query. `NOT_BUILT`, it is not bound to
9095
9717
  this package yet; `NOT_SERVED`, either its serve verdict is `live`,
@@ -9105,18 +9727,31 @@ components:
9105
9727
  than live, or the source's ungated `where:` reads a column the table
9106
9728
  does not hold exactly or does not compare as its source does (a
9107
9729
  zoned timestamp, or a collation: on Postgres a database table's
9108
- stored collation that differs from its source's or cannot be read).
9109
- A database table is `NOT_SERVED` this way only for that last case,
9110
- with a `detail` and no `code`. A query that itself names a column a
9111
- stored table leaves out is `MISSING_FIELD`, and a gate the table
9112
- cannot keep is `ROW_LEVEL_GATE`; `OPTED_OUT`, the queried source opts out of its tables with
9730
+ stored collation that differs from its source's or cannot be read),
9731
+ the caller's own filters or the result's string ordering or grouping
9732
+ compare a string the table does not compare as its source does, or
9733
+ an access decision (a gate, or a given) would read a table stored as
9734
+ of its build. A database table is `NOT_SERVED` this way only for
9735
+ those last cases, with a `detail` and no `code`. A query that itself
9736
+ names a column a stored table leaves out is `MISSING_FIELD`, and a
9737
+ gate the table cannot keep is `ROW_LEVEL_GATE`; `OPTED_OUT`, the queried source opts out of its tables with
9113
9738
  `#@ -persist`; `MISSING_FIELD`, the query reads a field the table
9114
9739
  lacks (or otherwise does not compile against it); `SHAPE_MISMATCH`,
9115
9740
  the query is not the shape the stored result answers: it is not a
9116
9741
  call of the persisted view or query, it refines the call, or its text
9117
9742
  names beside the call a name the stored result's variant takes over;
9118
9743
  `ROW_LEVEL_GATE`, answering from it would bypass a row-level gate on
9119
- the queried source; `GRAIN_TOO_COARSE`, a rollup's grain does not
9744
+ the queried source, or, from a rollup, persisted view or persisted
9745
+ query, the source's ungated `where:` reads a column the table does
9746
+ not hold exactly or does not compare as its source does, or an
9747
+ access decision (a gate, or a given) would read a table stored as of
9748
+ its build; `COMPARISON_SEMANTICS`, from a rollup, persisted view or
9749
+ persisted query, the caller's own filters, or the string the result
9750
+ orders or groups by, compare a string the table does not compare as
9751
+ the source does (a collation, or a zoned timestamp), or could not be
9752
+ read to tell (releases through 0.18.7 said `ROW_LEVEL_GATE` for
9753
+ these on a rollup or past a gate, and `MISSING_FIELD` on a persisted
9754
+ view or query); `GRAIN_TOO_COARSE`, a rollup's grain does not
9120
9755
  cover the query's groups or filters; `TIME_ZONE`, it was built in
9121
9756
  another time zone than the query's; `CROSS_CONNECTION`, the query
9122
9757
  needs a join the table's connection cannot reach; `COUNT_SEMANTICS`,
@@ -9128,11 +9763,8 @@ components:
9128
9763
  destination holds, or a destination catalog missing on the worker).
9129
9764
 
9130
9765
 
9131
- Retained, no longer produced (shipped in 0.14.0): `WARNED`, now
9132
- `NOT_SERVED` (or `OPTED_OUT` for `#@ -persist`); `CONTRACT`, now
9133
- `ROW_LEVEL_GATE`; `RUN_FAILED`, now `READ_FAILED`. A closed list to
9134
- which codes may be added, so a client treats an unknown one as a
9135
- skip it cannot explain.
9766
+ A closed list to which codes may be added, so a client treats an
9767
+ unknown one as a skip it cannot explain.
9136
9768
 
9137
9769
  LogMessage:
9138
9770
  type: object
@@ -10158,6 +10790,28 @@ components:
10158
10790
  Never set on BigQuery, whose listing reads each table's whole
10159
10791
  schema: a table whose read failed there is listed with no
10160
10792
  columns.
10793
+ method:
10794
+ $ref: "#/components/schemas/MetadataMethod"
10795
+ asOf:
10796
+ type: string
10797
+ format: date-time
10798
+ description: With `include=collations`, when the collations were read.
10799
+ defaultCollation:
10800
+ type: ["string", "null"]
10801
+ description: |
10802
+ With `include=collations`: the collation a string compares under
10803
+ when its column declares none, as a collation identity (`binary`
10804
+ for byte order). Postgres: the database's default; DuckDB and
10805
+ DuckLake: the session's `default_collation`; BigQuery: the table's
10806
+ `default_collation_name`, which it took from its dataset. Null when
10807
+ it could not be read. Absent when `collationUnsupported` is set.
10808
+ collationUnsupported:
10809
+ type: string
10810
+ description: |
10811
+ With `include=collations`: why collations are not reported (the
10812
+ connection has no collation reader, the relation is not one the
10813
+ catalog lists, or the read failed). Columns then carry no
10814
+ `collation`; the rest of the table answers.
10161
10815
 
10162
10816
  TemporaryTable:
10163
10817
  type: object
@@ -10204,6 +10858,16 @@ components:
10204
10858
  With `reason: MATERIALIZATION_REFUSED`: the refusal's bounded
10205
10859
  reason, from the same open set as `RefusedSource.reason`. Absent
10206
10860
  otherwise.
10861
+ unbuiltReason:
10862
+ type: string
10863
+ description: >-
10864
+ With `reason: INDEX_SOURCE_UNBUILT`: why the queried source's
10865
+ stored table is not ready. `unbuilt` (none is built yet, or none
10866
+ is bound to the version that answered), `building` (a build of it
10867
+ is in progress), `failed` (its last build failed) or `refused`
10868
+ (the package's build plan refuses to build it; `refusedSources`
10869
+ says why). An open set: read an absent or unrecognized value as
10870
+ `unbuilt`. Absent otherwise.
10207
10871
  reason:
10208
10872
  type: string
10209
10873
  description: |
@@ -10256,10 +10920,44 @@ components:
10256
10920
  source or connection the caller read and no storage path.
10257
10921
 
10258
10922
  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.
10923
+ `#(access_filter)`) refused the caller. Every gate refusal carries
10924
+ it, including a gate that could not be decided, which fails closed
10925
+ and answers the same: only the server's metrics and log tell those
10926
+ apart. The one 403 an `#(access_filter)` answers with another reason
10927
+ is INHERITED_FILTER_UNVERIFIED, below, when the model's own text
10928
+ moved a field the filter reads: that is no refusal of the caller.
10929
+ A 403 with any other reason is not a gate's.
10930
+
10931
+ INHERITED_FILTER_UNVERIFIED, on a 403, means a `where:` the queried
10932
+ source inherits from a source it is built from could not be
10933
+ verified to read the fields it was written against there: a field
10934
+ it reads is defined again on the way (`rename:`, `except:`, a new
10935
+ definition), or the check could not follow it. It also answers an
10936
+ inherited `#(access_filter)` whose condition the model's own text
10937
+ moved (`rename:`, `except:`, a new definition) once the caller has
10938
+ supplied every given it reads; a caller missing one gets
10939
+ ACCESS_DENIED, and so does a rebind written in the caller's own
10940
+ query. It is the model's own text, not a permission rule, so givens
10941
+ and a rewritten query do not help. The message names the source and the reason class
10942
+ (`redefined_field`, `unrecorded_join`, `unresolved_declaration`,
10943
+ `resolution_bound`, or `check_failed` when the check itself failed
10944
+ unexpectedly), never the filter or the file; the server log names
10945
+ both.
10946
+
10947
+ INDEX_SOURCE_UNBUILT, on a 409 from a model query, means a query
10948
+ with `queryClass: index` was refused because the source it queries
10949
+ declares a stored table of its own (`#(materialize)`, or its own
10950
+ `#@ persist`, not one it only inherits) and no ready table of it is
10951
+ bound. An index query on such a source is answered from that table
10952
+ or not at all, never run live against the warehouse; it is
10953
+ deferred, not wrong, and the same query succeeds once the table is
10954
+ built. The body's `unbuiltReason` says why the table is not ready.
10955
+ Only `queryClass: index` is refused this way: the same query in any
10956
+ other class is answered as before. Every governance check (the
10957
+ package's published surface, `#(authorize)`, row-level gates)
10958
+ decides first, so a caller who may not query the source gets that
10959
+ 404 or 403 instead, never this. The message names the source as
10960
+ the caller queried it, never a table, a path or a connection.
10263
10961
 
10264
10962
  MATERIALIZATION_REFUSED means a valid materialization declaration
10265
10963
  this server will not build, and the body's `refusalReason` is the
@@ -10320,6 +11018,19 @@ components:
10320
11018
  publisher.json included), and the package or version serves what
10321
11019
  it served before. The message carries the cause.
10322
11020
 
11021
+ SIMULATION_ACTIVE, on a 409, means the server runs simulated
11022
+ materialization (`PUBLISHER_MATERIALIZE_SIMULATE`), an authoring
11023
+ mode that makes no materialization write. It refuses a
11024
+ materialization create, stop or delete, a materialized table
11025
+ drop, a storage destination's table drop and file cleanup, a
11026
+ version delete or archive, the delete of an environment or of a
11027
+ package that has versions, run records or incremental-ledger
11028
+ rows, a publish of a version whose id a deleted version left run
11029
+ records under, a watch-mode change, and a manifest binding
11030
+ (`update-package` or `create-package` with a `manifestLocation`,
11031
+ `set-package-version-manifest`). It fails the same way until the
11032
+ server restarts without simulation.
11033
+
10323
11034
  MANIFEST_NOT_FOUND, on a 400 from the same routes, means nothing
10324
11035
  is at the `manifestLocation` (no such file, object or bucket),
10325
11036
  and MANIFEST_INVALID, on a 422, that what is there does not parse
@@ -10335,15 +11046,18 @@ components:
10335
11046
  The package-version values let a caller tell "forgot to bump the
10336
11047
  version" from "the model is broken", which share a status code:
10337
11048
 
10338
- * MANIFEST_VERSION_MISSING (400): with package versioning on, a
10339
- publish whose publisher.json has no `version`.
11049
+ * MANIFEST_VERSION_MISSING (400): a publish whose publisher.json
11050
+ has no `version`.
10340
11051
  * MANIFEST_VERSION_INVALID (400): such a publish whose `version`
10341
11052
  is not a semantic version.
10342
11053
  * VERSION_CONFLICT (409): that version is already published with
10343
11054
  different content.
10344
11055
  * PACKAGE_IS_VERSIONED (409): the package has published versions,
10345
- so it cannot be changed in place (a write, or a publish with
10346
- package versioning off).
11056
+ so it cannot be changed in place (a write, or registering a
11057
+ directory under its name).
11058
+ * PACKAGE_NOT_VERSIONED (409): a package update named a new
11059
+ `location` for a package with no versions; new content from a
11060
+ location is published as a version, not installed in place.
10347
11061
  * PACKAGE_INSTALLED_FROM_LOCATION (409): the package is fetched
10348
11062
  again from a `location` on reload, which would discard a report
10349
11063
  write or a package update's change to its settings.
@@ -10368,13 +11082,15 @@ components:
10368
11082
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
10369
11083
  CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND, RESULT_TRUNCATED,
10370
11084
  RESULT_SHAPE_MISMATCH, STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
11085
+ INHERITED_FILTER_UNVERIFIED, INDEX_SOURCE_UNBUILT,
10371
11086
  MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10372
11087
  TABLE_OWNERSHIP_UNVERIFIED, TABLE_IN_USE, BUILD_INSTRUCTIONS_INVALID,
10373
11088
  MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
10374
- VERSION_CONFLICT, PACKAGE_IS_VERSIONED,
11089
+ VERSION_CONFLICT, PACKAGE_IS_VERSIONED, PACKAGE_NOT_VERSIONED,
10375
11090
  PACKAGE_INSTALLED_FROM_LOCATION, FILE_EXISTS, VERSION_IS_LATEST,
10376
11091
  VERSION_IS_LAST_ACTIVE, VERSION_BUILDING, VERSION_ID_INVALID,
10377
- VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED.
11092
+ VERSION_NOT_LATEST, VERSION_NOT_FOUND, VERSION_ARCHIVED,
11093
+ SIMULATION_ACTIVE.
10378
11094
  problems:
10379
11095
  type: array
10380
11096
  description: |
@@ -10390,6 +11106,77 @@ components:
10390
11106
  required:
10391
11107
  - message
10392
11108
 
11109
+ MetadataMethod:
11110
+ type: string
11111
+ enum: [catalog, counted, sampled, history, host]
11112
+ description: |
11113
+ How a connection metadata answer was read: `catalog`, from the
11114
+ warehouse's catalog or metadata tables; `counted`, by an aggregate
11115
+ `count(*)` over the table; `sampled`, from a sample; `history`, from
11116
+ query history; `host`, relayed from the remote connection a
11117
+ `publisher` proxy names, which read it with its own credentials.
11118
+
11119
+ TableStats:
11120
+ type: object
11121
+ description: |
11122
+ A table's size, or `status` `unsupported` with a `reason`. Every
11123
+ answer carries `method` and `asOf`. No field holds a row value.
11124
+ required:
11125
+ - status
11126
+ - resource
11127
+ - method
11128
+ - asOf
11129
+ properties:
11130
+ status:
11131
+ type: string
11132
+ enum: [answered, unsupported]
11133
+ reason:
11134
+ type: string
11135
+ description: Why this connection cannot answer. Present only when `status` is `unsupported`.
11136
+ resource:
11137
+ type: string
11138
+ description: The table read, as its path was resolved.
11139
+ method:
11140
+ $ref: "#/components/schemas/MetadataMethod"
11141
+ asOf:
11142
+ type: string
11143
+ format: date-time
11144
+ description: When the answer was read.
11145
+ rowCount:
11146
+ type: ["integer", "null"]
11147
+ format: int64
11148
+ description: The table's rows; null when the catalog does not record them.
11149
+ rowCountBand:
11150
+ type: object
11151
+ description: |
11152
+ Present only when `rowCount` is an estimate. Postgres: the spread
11153
+ of the catalog's own estimates (`reltuples`, that value scaled to
11154
+ the table's current pages, and the statistics collector's live-row
11155
+ count). DuckLake, where its catalog leaves deletes unaccounted:
11156
+ `high` is `rowCount`, which counts them as nothing, and `low` takes
11157
+ off the most they could remove. DuckDB and MotherDuck, where the
11158
+ count is declined: `high` is `rowCount`, DuckDB's `estimated_size`
11159
+ (the rows its row groups hold, which a delete does not lower),
11160
+ and `low` is 0. It is not a confidence interval.
11161
+ required:
11162
+ - low
11163
+ - high
11164
+ properties:
11165
+ low:
11166
+ type: integer
11167
+ format: int64
11168
+ high:
11169
+ type: integer
11170
+ format: int64
11171
+ bytes:
11172
+ type: ["integer", "null"]
11173
+ format: int64
11174
+ description: The table's stored bytes (Postgres, its total relation size with indexes and TOAST; DuckLake, its live data and delete files); null when not recorded.
11175
+ lastModified:
11176
+ type: ["string", "null"]
11177
+ format: date-time
11178
+ description: When the table's data last changed; null when the catalog does not record it. On DuckLake, the latest snapshot that wrote or retired the table's storage (a compaction or a flush included); it may be null, or earlier than the true last write, after snapshot expiry.
11179
+
10393
11180
  Column:
10394
11181
  type: object
10395
11182
  description: Database column definition
@@ -10400,6 +11187,23 @@ components:
10400
11187
  type:
10401
11188
  type: string
10402
11189
  description: Data type of the column
11190
+ nativeType:
11191
+ type: string
11192
+ description: |
11193
+ With `include=collations`: the column's type as the warehouse's
11194
+ catalog names it (`character varying(20)`, `STRING`, `VARCHAR`).
11195
+ Unlike `type`, always the warehouse's own name.
11196
+ collation:
11197
+ type: ["string", "null"]
11198
+ description: |
11199
+ With `include=collations`: the column's collation identity, as a
11200
+ materialization's column contract records it: `binary` for byte
11201
+ order, else the engine's identity (`postgres:…`,
11202
+ `bigquery:und:ci`, `duckdb:nocase`). Null for a column that is not
11203
+ a string. A record's members carry neither field.
11204
+ storedAsDouble:
11205
+ type: boolean
11206
+ description: With `include=collations`, present and true on a DuckLake 128-bit integer column, whose files hold it as a DOUBLE.
10403
11207
 
10404
11208
  TableDescription:
10405
11209
  type: object
@@ -10624,6 +11428,14 @@ components:
10624
11428
  is true and compilation succeeds with a runnable query.
10625
11429
  document:
10626
11430
  $ref: "#/components/schemas/CompiledDocument"
11431
+ materializationSummary:
11432
+ $ref: "#/components/schemas/MaterializationSummary"
11433
+ description: >-
11434
+ Scope `package` only, when the package materializes anything: each
11435
+ materialized item of the package as the dry run plans it. Its
11436
+ `serves` is `not_judged`, since a compile binds nothing; `built`
11437
+ and `failed` read the tables the served package has bound and its
11438
+ last build's failures at the same address. Reload to judge serving.
10627
11439
 
10628
11440
  CompiledDocument:
10629
11441
  type: object
@@ -11087,14 +11899,10 @@ components:
11087
11899
  set aside); `materialize_companion_failed` (the generated
11088
11900
  `#(materialize)` companion did not plan or compile);
11089
11901
  `persisted_view_companion_failed` (the persisted-view companion
11090
- did not plan or compile); `v1_build_companion_failed` (the build
11091
- copy of a model file without
11092
- `##! experimental.persistence` did not compile, so none of its
11093
- `#@ persist` sources were planned);
11094
- `persist_annotation_unparseable` is retained and no longer
11095
- produced: a `#@` line that does not parse is an invalid annotation
11096
- (`persist-unparseable`), which fails the publish and the load, so
11097
- no served plan carries it.
11902
+ did not plan or compile); `persist_companion_failed` (planning a
11903
+ model file's `#@ persist` sources failed, so none of the ones it
11904
+ declares were planned; the file's other legs and the package's
11905
+ other files still plan).
11098
11906
 
11099
11907
  OmittedFile:
11100
11908
  type: object
@@ -11190,9 +11998,6 @@ components:
11190
11998
  free_parameter,
11191
11999
  given,
11192
12000
  given_in_persisted_query,
11193
- dynamic_projection,
11194
- dynamic_join,
11195
- dynamic_joined_where,
11196
12001
  inherited_where_with_given,
11197
12002
  partition_without_storage,
11198
12003
  partition_column_unknown,
@@ -11233,12 +12038,24 @@ components:
11233
12038
  upstream_unread,
11234
12039
  upstream_table_unusable,
11235
12040
  container_not_found,
12041
+ bound_invocation_unkeyable,
12042
+ address_unresolved,
11236
12043
  ]
11237
12044
  description: >-
11238
12045
  The bounded refusal reason; `message` says the specifics.
11239
12046
 
11240
12047
 
11241
- On every mechanism: `free_parameter`; a row-level gate the
12048
+ On every mechanism: `free_parameter` (the source declares a
12049
+ parameter left unbound: a source with one is never stored,
12050
+ whether or not its rows read it); `bound_invocation_unkeyable`
12051
+ (the source extends a bound invocation of a source that reads
12052
+ the parameter it binds, `s(x is 50) extend { … }`, whose build
12053
+ cannot be keyed: write it as a query source over the invocation,
12054
+ `s(x is 50) -> { select: * } extend { … }`, which is stored);
12055
+ `address_unresolved` (a run's own refusal of a source whose
12056
+ build Malloy could not key, so its content address could not be
12057
+ resolved, of any other shape: it alone is not built,
12058
+ and the rest of the package is); a row-level gate the
11242
12059
  table could not keep, named by the gate's kind, `access_filter`
11243
12060
  for a row filter (`#(access_filter)`, any of the gates that
11244
12061
  refused it) and `authorize` for a lock (`#(authorize)`);
@@ -11278,10 +12095,9 @@ components:
11278
12095
  catalog, which runs only SQL Malloy generated: a `storage=` source
11279
12096
  on a DuckLake connection, or a source of any tier on a connection
11280
12097
  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
12098
+ `table_name_collision` (a declaration whose `name=` puts it on one
12099
+ table with another, so neither is built; a package that declares
12100
+ one does not load; a run also records it in its `metadata.refusedSources` for a source
11285
12101
  whose readable table name another source's table already takes in
11286
12102
  that run); `current_time` (the build reads the current time, `now`,
11287
12103
  or keeps rows older than a moving cut-off it cannot leave out, so
@@ -11320,8 +12136,8 @@ components:
11320
12136
  the container; `storage=` declarations are never checked).
11321
12137
 
11322
12138
 
11323
- A persisted view or named query: `materialization_off` (persisted
11324
- named queries are built only with `PUBLISHER_MATERIALIZE` on),
12139
+ A persisted view or named query: `materialization_off` (retained,
12140
+ no longer produced: materialization v2 is always on),
11325
12141
  `multi_line_annotation` (its `#@` line spans more than one line),
11326
12142
  `build_name_collision` (its generated build source's name is one
11327
12143
  the model, or another persisted view, already takes),
@@ -11370,11 +12186,7 @@ components:
11370
12186
  `preaggregate_over_dynamic_source` (shipped in 0.14.0: a rollup
11371
12187
  over a caller-scoped source, now `reads_given`,
11372
12188
  `given_where_over_unstored_field` or `inherited_where_with_given`,
11373
- as every mechanism names the same case), `dynamic_projection`,
11374
- `dynamic_join` and `dynamic_joined_where` (a `storage=`
11375
- `#@ persist` source's given in a field it declares, in a join's
11376
- `on:` condition, or in a source it joins; now `reads_given`,
11377
- whose `message` still names the position), `not_duckdb_portable` (a `storage=` table no
12189
+ as every mechanism names the same case), `not_duckdb_portable` (a `storage=` table no
11378
12190
  column of which Malloy can type is now built, and its source is
11379
12191
  answered live), the three `partition_*` reasons (`partition=` is a
11380
12192
  retired key, which fails the publish and the load as
@@ -12075,13 +12887,12 @@ components:
12075
12887
  table in place of its source, it reads the table's columns from
12076
12888
  the warehouse and compares each with this type (case and spacing
12077
12889
  aside). If a column was retyped or dropped since, or cannot be
12078
- read, a strict build is refused and any other build recomputes
12079
- the upstream from its definition. Without it nothing can be
12080
- checked: a strict build reads the table unchecked, with a warning
12081
- and a count (`publisher_materialization_upstream_recompute_total`,
12082
- `reason="reference_types_unrecorded"`), and any other build
12083
- recomputes the upstream. Ignored for a `storage=` upstream: omit
12084
- it there. Optional and additive.
12890
+ read, the build is refused; no build recomputes the upstream from
12891
+ its definition. Without it nothing can be checked: the build
12892
+ reads the table unchecked, with a warning and a count
12893
+ (`publisher_materialization_upstream_read_unchecked_total`).
12894
+ Ignored for a `storage=` upstream: omit it there. Optional and
12895
+ additive.
12085
12896
  items:
12086
12897
  $ref: "#/components/schemas/Column"
12087
12898
  schema:
@@ -12430,7 +13241,16 @@ components:
12430
13241
  description: The contract's shape version. `1`.
12431
13242
  producer:
12432
13243
  type: string
12433
- description: The Publisher version whose build wrote it; diagnostic only.
13244
+ description: >-
13245
+ The Publisher version whose build wrote it. Read only to judge a
13246
+ string column recorded before `ContractColumn.compareFrom` was, on
13247
+ any dialect: its `none` is taken as unread when this is a semantic
13248
+ version before 0.18.5 by semver precedence (`0.18.5-rc.1` is
13249
+ before), the column is stored `binary` under a binary
13250
+ `defaultCollation`, and its source's dialect has collations
13251
+ Publisher reads (DuckDB, Postgres, BigQuery). Otherwise, including
13252
+ when this is absent or not a semantic version, it is taken as
13253
+ read.
12434
13254
  dialect:
12435
13255
  type: string
12436
13256
  description: >-
@@ -12505,6 +13325,45 @@ components:
12505
13325
  ordering and ranges may not), or `none` (no string comparison is
12506
13326
  known to match). Every non-string column is `exact`. An open set:
12507
13327
  read an unknown value as `none`.
13328
+ compareFrom:
13329
+ type: string
13330
+ enum: [read, unread]
13331
+ description: >-
13332
+ A string column of a `storage=` table: how its `compare` was
13333
+ obtained. `read`: the verdict a rebuild records again unchanged,
13334
+ because the catalog answered it, or because nothing a read returns
13335
+ can change it: a `COLLATE` in the build's SQL, a dialect whose
13336
+ collations Publisher does not read, a stored collation that is not
13337
+ binary, a Postgres or DuckDB read that failed in a way every retry
13338
+ fails too (a rejected credential, the warehouse's own error for a
13339
+ statement wrong in itself, a Postgres missing privilege), and, on
13340
+ BigQuery, a project that holds a collated dataset, a table no read
13341
+ can place, or the project-wide read of that project refused for
13342
+ want of a permission (an error whose reason is `accessDenied`, as
13343
+ a dataset-scoped account gets) for an `.sql()` source, a view, or
13344
+ more datasets than are read one by one. `unread`: the fail-closed
13345
+ `none` recorded because a catalog read failed in a way a rebuild
13346
+ may not repeat: a Postgres or DuckDB read that failed transiently
13347
+ or for an unrecognized reason, or a BigQuery read that failed
13348
+ (including a 403 for a rate limit or a quota, and an "Access
13349
+ Denied" that names no reason), did not list a table, or was
13350
+ refused one dataset's catalog. A downstream that compares such a
13351
+ string fails
13352
+ with `upstream_contract_unread`, naming this table to rebuild,
13353
+ rather than being refused. A table built over stored tables takes
13354
+ `unread` only when every `none` it inherits is unread. Absent on a
13355
+ contract written before it was recorded (see
13356
+ `ColumnContract.producer`) and on a non-string column; a reader
13357
+ treats an unknown value as absent.
13358
+ unreadUpstreams:
13359
+ type: array
13360
+ items:
13361
+ type: string
13362
+ description: >-
13363
+ With `compareFrom: unread` on a table built over stored tables:
13364
+ the upstreams (`sourceEntityId`) whose unread verdicts it
13365
+ inherited, and the tables theirs came from, which are rebuilt
13366
+ before it can read otherwise.
12508
13367
  gateExact:
12509
13368
  type: boolean
12510
13369
  description: >-
@@ -12641,6 +13500,44 @@ components:
12641
13500
  derives its plan again at once, and the next build either builds
12642
13501
  the source over the upstream's table as it is or the plan refuses
12643
13502
  it (`upstream_table_unusable`); the source is `retryable`.
13503
+ `upstream_contract_insufficient` (a chained `storage=` build
13504
+ compares strings over a stored upstream whose entry carries no
13505
+ column contract the build can read: the table was built before
13506
+ contracts were recorded, or the entry a host supplied for it in
13507
+ `referenceManifest` holds none or an invalid one, so the contract
13508
+ that judges those strings is missing; `staleUpstreams` names those
13509
+ upstreams). It is non-terminal, never a refusal: once each is
13510
+ rebuilt, or supplied with its contract, the source builds over
13511
+ them, and it is `retryable`. A host that retries it without
13512
+ rebuilding or re-supplying them gets the same failure. Its
13513
+ `reason` names, per upstream, the check its contract failed: `it
13514
+ is absent`, or which field made a contract that is present
13515
+ invalid (text that does not parse as JSON, not an object, no
13516
+ version `v`, or a `v` that is not a number).
13517
+ `upstream_contract_unread` (a chained `storage=` build compares a
13518
+ string over a stored upstream whose column contract records it
13519
+ compared `none` only as the fail-closed fallback of a catalog read
13520
+ that did not complete when that upstream was built:
13521
+ `ContractColumn.compareFrom: unread`, or, on a contract recorded
13522
+ before `compareFrom` was, a `none` a release before 0.18.5 could
13523
+ only have recorded as its source's failed read, on any dialect
13524
+ (see `ColumnContract.producer`); `staleUpstreams` names the
13525
+ upstreams to rebuild). It is non-terminal, never a refusal, and
13526
+ handled as `upstream_contract_insufficient` is: rebuilding each
13527
+ upstream reads its catalog again, and once its contract records a
13528
+ verdict this build can use, the source builds; it is `retryable`.
13529
+ A rebuild whose read records a string compared otherwise than the
13530
+ build needs, or a `none` no rebuild changes, leaves the source
13531
+ refused at plan (`upstream_table_unusable`). A rebuild whose
13532
+ catalog read fails again for a reason a rebuild may not repeat
13533
+ (see `ContractColumn.compareFrom`) fails it the same way, bounded
13534
+ only by the caller's retry cap. Reported only when no string the
13535
+ build compares is refused for any other reason. Both
13536
+ `upstream_contract_insufficient` and `upstream_contract_unread`
13537
+ have one shape: on a run's `SourceFailure` only (never a plan's
13538
+ `RefusedSource`, which does not list the source), the value in
13539
+ this `code` field, with the upstreams in `staleUpstreams`,
13540
+ `retryable: true`, and `refused` and `refusalReason` absent.
12644
13541
  `instruction_unresolved` (an instruction no source in the run's
12645
13542
  build plan resolves to, so nothing was built for it; not
12646
13543
  `retryable` until the caller reads the plan again). Every
@@ -12649,6 +13546,18 @@ components:
12649
13546
  plan's reason, and any other unmatched instruction fails with this
12650
13547
  code; none is dropped. An open set; absent for a failure that has
12651
13548
  none.
13549
+ staleUpstreams:
13550
+ type: array
13551
+ items:
13552
+ type: string
13553
+ description: >-
13554
+ With `code: upstream_contract_insufficient`: the stored upstreams
13555
+ whose tables record no column contract, by content address
13556
+ (`sourceEntityId`). With `code: upstream_contract_unread`: the
13557
+ stored upstreams whose contracts record an unread string verdict,
13558
+ followed by any tables those verdicts were inherited from
13559
+ (`ContractColumn.unreadUpstreams`). Rebuilding them lets this
13560
+ source build. Absent otherwise.
12652
13561
  refused:
12653
13562
  type: boolean
12654
13563
  description: >-
@@ -12687,10 +13596,14 @@ components:
12687
13596
  passthrough). Five SQLSTATEs in class 42 are left to the other rules:
12688
13597
  a missing table or column (`42P01`, `42703`, `42S02`, `42S22`, and
12689
13598
  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`.
13599
+ and `42501` (insufficient privilege). A Postgres `42501` reports
13600
+ `false` by its code: no retry acquires the grant, and once it is
13601
+ granted a rebuild succeeds. A Snowflake `42501` stays absent.
13602
+ Transient codes (`40001`, `40P01`, and BigQuery's backend and
13603
+ quota reasons) are never `false`. When a failure carries a
13604
+ SQLSTATE, the message's wording ("syntax error", "access denied")
13605
+ never makes it `false`: a message that echoes SQL could otherwise
13606
+ settle a transient code.
12694
13607
 
12695
13608
 
12696
13609
  `true` is a transient failure, not a property of the inputs: the
@@ -12768,6 +13681,15 @@ components:
12768
13681
  manifest travels without its build plan, and a consumer holding only
12769
13682
  the manifest otherwise cannot tell why it holds a table for a source
12770
13683
  that does not appear in the package.
13684
+ mode:
13685
+ type: string
13686
+ enum: [simulated]
13687
+ description: >-
13688
+ `simulated`: an entry simulated materialization predicted, for a
13689
+ table it never creates. Its address, physical name, schema and
13690
+ contract are those a build would record, and `builtAt` is the
13691
+ simulated build's time. Absent on an entry a build wrote. Never
13692
+ stored, and never on a manifest a run commits.
12771
13693
  materializedTableId:
12772
13694
  type: string
12773
13695
  description: Echoes the caller-assigned id from the BuildInstruction.