@malloy-publisher/app 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/api-doc.yaml +982 -373
  2. package/dist/assets/{EnvironmentPage-B74sWMJb.js → EnvironmentPage-CKUvEX7r.js} +1 -1
  3. package/dist/assets/{HomePage-BOb2eaod.js → HomePage-COpZmm3Z.js} +1 -1
  4. package/dist/assets/{MainPage-D6QvMDBc.js → MainPage-nIyVOgy5.js} +1 -1
  5. package/dist/assets/ModelPage-BelGfTpw.js +2 -0
  6. package/dist/assets/{PackagePage-CpahRMLt.js → PackagePage-CbnVG2uD.js} +1 -1
  7. package/dist/assets/{PackageSplatRoute-BBPH3864.js → PackageSplatRoute-37oqxKyq.js} +2 -2
  8. package/dist/assets/{RenderedResult-D5HJr2Xo.es-CFweT1ny.js → RenderedResult-Ct3z543g.es-QeWq894a.js} +7 -7
  9. package/dist/assets/{RouteError-r7ydeLAE.js → RouteError-CjmVxFgv.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-dxaIYM0S.js → ThemeEditorPage-BjPyhpFF.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-B8CQst36.js → ToggleButtonGroup-bM-WVZrV.js} +1 -1
  12. package/dist/assets/{documentRoutes-Dn5OclPv.js → documentRoutes-BAPDdua3.js} +1 -1
  13. package/dist/assets/{editPageMounted-BXWQAQvv.js → editPageMounted-B4HEQbbz.js} +2 -2
  14. package/dist/assets/{index-jw6yCO3t.js → index-Bx-5B05C.js} +1 -1
  15. package/dist/assets/{index-BiZnC_i6.js → index-C-aFb4Gn.js} +1 -1
  16. package/dist/assets/{index-D3PvzI_V.js → index-DUgED99B.js} +136 -136
  17. package/dist/assets/{index-C2rpVa58.js → index-DbRUcXfe.js} +1 -1
  18. package/dist/assets/{index.es-BfpodLFo.js → index.es-DO67FMt6.js} +19 -19
  19. package/dist/assets/usePackageLinkNavigate-BgdbNERJ.js +1 -0
  20. package/dist/assets/{usePackageRoute-CwvWFoYD.js → usePackageRoute-Cso_p7RX.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/dist/mcp-app/report.js +477 -477
  23. package/package.json +2 -2
  24. package/dist/assets/ModelPage-DOac8VF3.js +0 -2
  25. package/dist/assets/usePackageLinkNavigate-CpjXFkgK.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -995,6 +995,8 @@ paths:
995
995
  $ref: "#/components/responses/BadRequest"
996
996
  "401":
997
997
  $ref: "#/components/responses/Unauthorized"
998
+ "403":
999
+ $ref: "#/components/responses/Forbidden"
998
1000
  "404":
999
1001
  $ref: "#/components/responses/NotFound"
1000
1002
  "424":
@@ -1421,6 +1423,8 @@ paths:
1421
1423
  $ref: "#/components/responses/BadRequest"
1422
1424
  "401":
1423
1425
  $ref: "#/components/responses/Unauthorized"
1426
+ "403":
1427
+ $ref: "#/components/responses/Forbidden"
1424
1428
  "404":
1425
1429
  $ref: "#/components/responses/NotFound"
1426
1430
  "410":
@@ -1500,7 +1504,7 @@ paths:
1500
1504
  424 refusal, or 200 with the package as it would load, its `warnings` included, plus the
1501
1505
  `location` it was loaded from. The 200 also carries what a publish would build and serve:
1502
1506
  the `buildPlan`, and `serveVerdicts`, each materialized source's serve verdict with each
1503
- stored source's named views compiled against a serve shape (no table is built). With package versioning on, the tree's `publisher.json`
1507
+ 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`
1504
1508
  must declare a valid version, as a versioned publish requires (400
1505
1509
  `MANIFEST_VERSION_MISSING` or `MANIFEST_VERSION_INVALID`), and the 200 names it as
1506
1510
  `versionId`. Version lifecycle checks (a version that already exists, `latest`) are not
@@ -1996,9 +2000,22 @@ paths:
1996
2000
  summary: Bind a version to a build manifest
1997
2001
  description: |
1998
2002
  Sets the version's `manifestLocation`, the externally computed build manifest its persist
1999
- references resolve through, and rebinds that version's models to it right away. A null
2000
- `manifestLocation` clears the binding and the version serves live. Only this version is
2001
- affected.
2003
+ references resolve through, and rebinds that version's models to it right away. Only this
2004
+ version is affected.
2005
+
2006
+ A version is owned by the host from then on once a manifest it named, by this route or by
2007
+ a publish, has bound (one whose fetch fails marks nothing), or once a run it instructed
2008
+ with `buildInstructions` has run, even one whose commit failed. The version's record keeps
2009
+ that across an unload and a restart. A null `manifestLocation` then clears the binding and the version serves live:
2010
+ this server never binds tables its own runs built for it, so a host can clear the binding
2011
+ before it drops the tables the manifest named. A reload or restart of that version keeps
2012
+ it live until the host binds a manifest again, and the version answers a local run without
2013
+ `buildInstructions` with 409. Its status reports it the way it reports a version with nothing
2014
+ bound: `manifestBindingStatus` `unbound`, `manifestEntryCount` 0 and `boundManifestUri` null.
2015
+
2016
+ A version no host has bound (standalone, or built only by this server's own runs) serves
2017
+ what this server's own runs built for it when its binding is cleared, or live when they
2018
+ built nothing, as it does when it loads.
2002
2019
 
2003
2020
  This is serving state, not package content, which is why it is the one thing about a
2004
2021
  published version that can change. It replaces the deprecated
@@ -3947,11 +3964,45 @@ paths:
3947
3964
  schema:
3948
3965
  $ref: "#/components/schemas/Materialization"
3949
3966
  "400":
3950
- $ref: "#/components/responses/BadRequest"
3967
+ description: >-
3968
+ The request is malformed, with `reason: BUILD_INSTRUCTIONS_INVALID`
3969
+ and a message naming the case: a body field of the wrong shape
3970
+ (`forceRefresh`, `reseed`, `runContext`, `buildInstructions` and
3971
+ its entries); a package with no persist sources; an unknown
3972
+ `sourceEntityId`; `realization=SNAPSHOT`; one table named by two
3973
+ instructions of a version's run; a ledger entry that appears twice,
3974
+ names a table this run does not build, names a source that is not
3975
+ incremental, or was measured under another definition of its
3976
+ source. Among other checks, every
3977
+ `physicalTableName` a host supplies (a build instruction, a
3978
+ `referenceManifest` entry or a `ledger` entry) must be a usable
3979
+ table path: no empty part, no backslash or control character, and
3980
+ quotes only around whole parts. One that is not is refused,
3981
+ naming the field (for example `Build instruction
3982
+ 'physicalTableName' must be a table path ...`), before any run
3983
+ starts; the bind declines such a name in a stored manifest the
3984
+ same way (`unquotable_name`).
3985
+ content:
3986
+ application/json:
3987
+ schema:
3988
+ $ref: "#/components/schemas/Error"
3951
3989
  "404":
3952
3990
  $ref: "#/components/responses/NotFound"
3953
3991
  "409":
3954
- description: Package already has an active materialization
3992
+ description: >-
3993
+ `reason: MATERIALIZATION_CONFLICT`. Clears on its own, so retry
3994
+ later: the package already has an active materialization, or a
3995
+ table the run would write is being written by another run. Does
3996
+ not clear until something changes: a table the run would write is
3997
+ one the package's versions share, which only an auto-run of its
3998
+ latest version rebuilds (name tables of your own in
3999
+ `buildInstructions`); or the package or version is bound to a host
4000
+ manifest (`manifestLocation`), or is a version a host has bound
4001
+ before, and the request has no `buildInstructions` (it serves the
4002
+ host's tables or live, so a local run would build tables it cannot
4003
+ serve). `reason:
4004
+ BUILD_PLAN_UNAVAILABLE`: the package's build plan could not be
4005
+ derived, or it serves an older model than its files.
3955
4006
  content:
3956
4007
  application/json:
3957
4008
  schema:
@@ -4079,28 +4130,17 @@ paths:
4079
4130
  summary: Delete a materialization
4080
4131
  description: |
4081
4132
  Deletes a terminal (MANIFEST_FILE_READY, FAILED, or CANCELLED)
4082
- materialization record. By default this removes the publisher's record
4083
- only; the caller owns table GC. Set dropTables=true to also drop
4084
- the physical tables this run produced (from the materialization's
4085
- manifest) as a best-effort cleanup.
4133
+ materialization record. A delete is record-only: it never drops a
4134
+ table, and the caller owns table GC. To drop a table this run produced,
4135
+ check that no remaining run, of any version, names a table with that
4136
+ name in any place, then drop it through its connection.
4137
+ `dropTables=true` is refused with 400 and deletes nothing, as is any
4138
+ value other than `true` or `false` (the fix is to omit it);
4139
+ `dropTables=false`, which older clients send, is accepted and ignored.
4086
4140
  parameters:
4087
4141
  - $ref: "#/components/parameters/environmentName"
4088
4142
  - $ref: "#/components/parameters/packageName"
4089
4143
  - $ref: "#/components/parameters/materializationId"
4090
- - name: dropTables
4091
- in: query
4092
- required: false
4093
- description: |
4094
- When true, also drop the physical tables recorded in the
4095
- materialization's manifest before deleting the record. Defaults to
4096
- false (record-only delete; the caller owns table GC).
4097
-
4098
- Only `true` and `false` are accepted. Any other value is refused
4099
- with 400 rather than read as `false`, which would delete the record,
4100
- leave the tables on disk, and still answer 204.
4101
- schema:
4102
- type: boolean
4103
- default: false
4104
4144
  - $ref: "#/components/parameters/versionId"
4105
4145
  responses:
4106
4146
  "204":
@@ -4265,7 +4305,20 @@ components:
4265
4305
  schema:
4266
4306
  $ref: "#/components/schemas/Error"
4267
4307
  Forbidden:
4268
- description: Forbidden - insufficient permissions to perform the operation
4308
+ description: |
4309
+ Forbidden - insufficient permissions to perform the operation. With
4310
+ `reason: STORAGE_ACCESS_DENIED` or `PATH_ACCESS_DENIED` (the query and
4311
+ raw `sqlQuery` routes, and `sqlTemporaryTable`), the database ran the
4312
+ query and an object store refused its read. `STORAGE_ACCESS_DENIED`:
4313
+ the URL lies under a data path the environment configures (a DuckLake
4314
+ catalog's, a storage destination's), so the query and the model are
4315
+ fine and a retry fails the same way until the database's storage
4316
+ credentials are fixed. `PATH_ACCESS_DENIED`: a path the query or the
4317
+ model reads itself refused access, so the path, or the caller's grant
4318
+ to it, is what to fix. With `reason: ACCESS_DENIED`, a gate refused
4319
+ the caller. The body
4320
+ names what the caller read and never a storage path; the full text is
4321
+ logged.
4269
4322
  content:
4270
4323
  application/json:
4271
4324
  schema:
@@ -4631,11 +4684,18 @@ components:
4631
4684
  description: >-
4632
4685
  Where the build manifest to bind is: a gs:// or s3:// URI, a
4633
4686
  file:// URL, or an absolute path on this server (a mounted volume).
4634
- Null, or leaving the field out, clears the binding and serves
4635
- live, so a client that drops a field it meant to send (a value
4636
- left undefined) clears the binding. An empty string or a relative
4637
- path is refused with 400, and so is any other field in the body
4638
- and a body not sent as application/json.
4687
+ Once one binds, the version is the host's from then on, as it is
4688
+ once a host's instructed run of it has run, even one whose
4689
+ commit failed. Null, or
4690
+ leaving the field out, clears the binding: a version a host has
4691
+ bound then serves live, and stays live through a reload or a
4692
+ restart until a manifest is bound again, never serving the tables
4693
+ this server's own runs built for it. A version no host has bound
4694
+ serves what its own runs built, or live when they built nothing.
4695
+ A client that drops a field it meant to send (a value left
4696
+ undefined) therefore clears the binding. An empty string or a
4697
+ relative path is refused with 400, and so is any other field in
4698
+ the body and a body not sent as application/json.
4639
4699
 
4640
4700
  PackageLatestVersion:
4641
4701
  type: object
@@ -4790,6 +4850,16 @@ components:
4790
4850
  message:
4791
4851
  type: string
4792
4852
  description: Why it did not load.
4853
+ codes:
4854
+ type: array
4855
+ items:
4856
+ type: string
4857
+ description: >-
4858
+ The codes of the load failure's coded lines (each line of
4859
+ `message` that ends `[code]`, such as `persist-unknown-key` or
4860
+ `rollup-invalid`), in order, each once, so a client never
4861
+ parses the message for them. Absent when the message carries
4862
+ none.
4793
4863
  stale:
4794
4864
  type: boolean
4795
4865
  description:
@@ -5110,39 +5180,51 @@ components:
5110
5180
  origin:
5111
5181
  type: string
5112
5182
  description: >-
5113
- `persist` for a source a modeler annotated, `preaggregate` for a
5114
- rollup the publisher synthesized. A string, not an enum, so a new
5115
- kind of variant needs no client change.
5183
+ The mechanism that declared the stored source: `persist` for
5184
+ `#@ persist` on a source, `materialize` for `#(materialize)`,
5185
+ `view` for `#@ persist` on a view, `query` for `#@ persist` on a
5186
+ named `query:`, and `rollup` for a rollup the publisher
5187
+ synthesized (`#(rollup)`, or v1's `#@ preaggregate`). A string,
5188
+ not an enum, so a new kind of variant needs no client change.
5189
+ `preaggregate` is retained, no longer produced: releases before
5190
+ this one said it for `rollup`.
5116
5191
  tier:
5117
5192
  type: string
5118
5193
  description: >-
5119
- Where its table lives: `colocated` (the source's own connection) or
5120
- `storage` (a `storage=` destination).
5194
+ Where its table lives: `database` (the source's own connection's
5195
+ database) or `storage` (a `storage=` destination). `colocated` is
5196
+ retained, no longer produced: releases before this one said it for
5197
+ `database`, so a client should accept both.
5121
5198
  verdict:
5122
5199
  type: string
5123
5200
  description: >-
5124
5201
  `serves`: its table is bound and queries can be answered from it.
5125
- `not_built`: nothing is bound yet; queries are answered from its
5126
- table once a build binds it. `live`: no query is answered from it,
5127
- for `reason`, until something changes.
5202
+ `awaiting_build`: nothing is bound yet; queries are answered from
5203
+ its table once a build binds it (unlike a `*-not-built` package
5204
+ warning, which names a declaration that is refused and is never
5205
+ built here). `live`: no query is answered from it, for `reason`,
5206
+ until something changes. `not_built` is retained, no longer
5207
+ produced: releases before this one said it for `awaiting_build`.
5128
5208
  reason:
5129
5209
  type: string
5130
5210
  description: >-
5131
5211
  For a `live` verdict, why: `refused` (the plan refused to build it),
5132
5212
  `storage_mode` (`storage=` while `PERSIST_STORAGE_MODE` is not
5133
- `on`), `rollup_over_stored_base` (a rollup over a `storage=` base,
5134
- left out of the plan), `unreachable` (no source on the package's
5135
- published surface reads it), `row_level_gate` (every query through
5136
- it carries an `#(authorize)` or `#(access_filter)` gate, which the
5137
- storage tier and rollups cannot keep yet), `shadowed` (its storage
5138
- table is bound, but every model's source of that name is another
5139
- source), `destination_missing` (`storage=` names a destination the
5140
- environment does not configure), `connection_cannot_hold_table`
5141
- (colocated, on a connection whose type creates no tables),
5142
- `served_copy` (a `#(materialize)` source, which only the served copy
5143
- reads: the served copy is off, no model's served copy reads its
5144
- table, or it is colocated, which the served copy does not serve
5145
- yet). An open set.
5213
+ `on`), `unreachable` (no source on the package's published surface
5214
+ reads it), `row_level_gate` (every query through it carries an
5215
+ `#(authorize)` or `#(access_filter)` gate its table cannot keep
5216
+ yet, on either tier), `stale` (its table is past its freshness
5217
+ window, and its fallback does not serve stale), `shadowed` (its
5218
+ storage table is bound, but every model's source of that name is
5219
+ another source), `destination_missing` (`storage=` names a
5220
+ destination the environment does not configure),
5221
+ `connection_cannot_hold_table` (database, on a connection whose
5222
+ type creates no tables), `materialization_off` (a `#(materialize)`
5223
+ source, which only the served copy reads, and the served copy is
5224
+ off: `PUBLISHER_MATERIALIZE`, and for `storage=`
5225
+ `PERSIST_STORAGE_MODE`), `served_copy` (a `#(materialize)` source
5226
+ whose table is bound, but no model's served copy re-roots it; the
5227
+ `served-copy-not-served` warning says why). An open set.
5146
5228
  message:
5147
5229
  type: string
5148
5230
  description: What the verdict means for this source, in a sentence.
@@ -5151,31 +5233,49 @@ components:
5151
5233
  items:
5152
5234
  type: string
5153
5235
  description: For a `live` verdict, the changes that would let it serve.
5236
+ servePath:
5237
+ type: string
5238
+ description: >-
5239
+ On a dry run: the path that will answer queries on this source,
5240
+ judged by compiling the package's served copy over bindings
5241
+ declared from the plan's output columns (no table is built):
5242
+ `served_copy` (the served copy re-roots it on its table, or reads
5243
+ it through a base it re-roots), `rollup` (a rollup the rollup leg
5244
+ reads), or `live`, with `servePathReason`. An open string, so a
5245
+ later release can add a path; treat an unknown value as `live`.
5246
+ servePathReason:
5247
+ type: string
5248
+ description: >-
5249
+ Why the path is what it is, when that is not the source's own
5250
+ table. With a `live` `servePath`: `refused` (the plan refused it),
5251
+ `inherited_gate` (a row-level gate declared on a base the served
5252
+ copy replaces, which it cannot graft), the served copy's reason
5253
+ for leaving the source as written (`column_types`,
5254
+ `fields_not_carried`, `read_terms_not_kept`, `compile_failed`, and
5255
+ the like), the verdict's own `reason`, or `not_rerooted` when none
5256
+ names one. With a `served_copy` `servePath`: `through_base` (an
5257
+ extension of a re-rooted source, left as written, which reads that
5258
+ source's table by name). An open string.
5154
5259
  cutoverPath:
5155
5260
  type: string
5261
+ deprecated: true
5156
5262
  description: >-
5157
- On a dry run: the path that will answer queries on this source
5158
- (the v1 cutover's, now the only one),
5159
- judged by compiling the package's served copy over bindings declared
5160
- from the plan's output columns (no table is built): `served_copy`
5161
- (the served copy re-roots it on its table), `rollup` (a rollup the
5162
- rollup leg reads), or `live`, with `cutoverReason`. An open string,
5163
- so a later release can add a path; treat an unknown value as
5164
- `live`.
5263
+ Deprecated: the same value as `servePath`, under its old name.
5264
+ Emitted beside it for this release only.
5165
5265
  cutoverReason:
5166
5266
  type: string
5267
+ deprecated: true
5167
5268
  description: >-
5168
- With a `live` `cutoverPath`, why: the served copy's reason for
5169
- leaving the source as written (`column_types`, `fields_not_carried`,
5170
- `read_terms_not_kept`, `compile_failed`, and the like), or
5171
- `not_rerooted` when it names none. An open string.
5269
+ Deprecated: the same value as `servePathReason`, under its old
5270
+ name. Emitted beside it for this release only.
5172
5271
  views:
5173
5272
  type: array
5174
5273
  description: >-
5175
5274
  On a dry run, for a source stored with `storage=`: each named view
5176
- on it, and whether it compiles against the serve shape. A view that
5177
- does not is answered live, and `detail` carries the compile error
5178
- that says why (usually a field the shape cannot reproduce).
5275
+ on it, and whether it compiles against a compile-only served copy. A
5276
+ view that does not is answered live, and `detail` carries the compile
5277
+ error that says why (usually a field the stored table cannot
5278
+ reproduce).
5179
5279
  items:
5180
5280
  $ref: "#/components/schemas/ViewServeVerdict"
5181
5281
 
@@ -5209,13 +5309,17 @@ components:
5209
5309
  package's models and reading a miss as corruption.
5210
5310
  origin:
5211
5311
  type: string
5212
- enum: [persist, preaggregate]
5312
+ enum: [persist, materialize, view, query, rollup, preaggregate]
5213
5313
  default: persist
5214
5314
  description: >-
5215
- What the bound source IS: `persist` for one a modeler annotated,
5216
- which is the meaning of an absent value, and `preaggregate` for
5217
- a rollup the publisher synthesized from `#@ preaggregate`
5218
- measures. Mirrors `ManifestEntry.origin`.
5315
+ The mechanism that declared the bound table: `persist` for
5316
+ `#@ persist` on a source, which is the meaning of an absent
5317
+ value, `materialize` for `#(materialize)`, `view` and `query` for
5318
+ `#@ persist` on a view or a named query, and `rollup` for a
5319
+ rollup. `preaggregate` is retained, no longer produced: releases
5320
+ before this one said it for `rollup`. Releases before this one said `persist` for every table
5321
+ that was not a rollup; a client must accept a value it does not
5322
+ know as a table that is not a rollup.
5219
5323
  storageDestinationName:
5220
5324
  type: string
5221
5325
  description: >-
@@ -5302,14 +5406,17 @@ components:
5302
5406
  enum:
5303
5407
  - unbound
5304
5408
  - bound
5409
+ - bind_failed
5305
5410
  - live_fallback
5306
5411
  description: >-
5307
5412
  Server-computed, read-only: whether the CONFIGURED build manifest is
5308
5413
  currently bound to this package's served models. `unbound` = no
5309
5414
  manifest configured, so the package serves live. `bound` = the
5310
- configured manifest was fetched and applied. `live_fallback` = a
5415
+ configured manifest was fetched and applied. `bind_failed` = a
5311
5416
  `manifestLocation` is configured but its fetch/bind failed or timed
5312
- out, so the configured manifest is NOT applied. Lets the caller
5417
+ out, so the configured manifest is NOT applied. `live_fallback` is
5418
+ retained, no longer produced: releases before this one said it for
5419
+ `bind_failed`, so a client should read both the same. Lets the caller
5313
5420
  confirm the publisher actually bound the configured manifest rather
5314
5421
  than inferring it from logs.
5315
5422
 
@@ -5325,17 +5432,17 @@ components:
5325
5432
  combination is the signature — `bound` with neither tier populated
5326
5433
  means the manifest carried nothing, not that the bind was missed.
5327
5434
 
5328
- `live_fallback` does NOT imply the package is serving live. It says
5435
+ `bind_failed` does NOT imply the package is serving live. It says
5329
5436
  the configured manifest was not applied — not that nothing is. A
5330
5437
  failed FIRST bind leaves nothing bound (`boundManifestUri` null), but
5331
5438
  a failed REBIND leaves the previously bound manifest in place: its
5332
- colocated substitutions stay compiled in, its storage serve bindings
5439
+ database substitutions stay compiled in, its storage serve bindings
5333
5440
  stay installed, and `boundManifestUri`, `manifestEntryCount` and
5334
5441
  `storageServeBindings` all continue to describe it.
5335
5442
 
5336
5443
  That rebind guarantee covers a failure BEFORE either tier applies —
5337
5444
  the manifest fetch failing or timing out, which is what produces
5338
- `live_fallback` in practice. A failure partway through the recompile,
5445
+ `bind_failed` in practice. A failure partway through the recompile,
5339
5446
  after the new models are installed but before the binding is
5340
5447
  recorded, is out of scope: the new substitutions would be live while
5341
5448
  these fields still described the previous manifest.
@@ -5344,11 +5451,11 @@ components:
5344
5451
  `boundManifestUri` is a LIVE reference to the manifest whose tables
5345
5452
  this package is currently serving from. A caller reclaiming
5346
5453
  superseded physical tables must treat it as one regardless of
5347
- `manifestBindingStatus` — reading `live_fallback` as "not serving
5454
+ `manifestBindingStatus` — reading `bind_failed` as "not serving
5348
5455
  from manifest tables" and reclaiming that generation would drop
5349
5456
  tables out from under a package actively serving them.
5350
5457
 
5351
- Note this value is not the `live_fallback` on a query result's
5458
+ It is named apart from the `live_fallback` on a query result's
5352
5459
  `servedFrom`, which reports that ONE query degraded to the warehouse.
5353
5460
  This one is about the package's binding, and as above does not imply
5354
5461
  any query ran live.
@@ -5357,9 +5464,9 @@ components:
5357
5464
  readOnly: true
5358
5465
  description: >-
5359
5466
  Server-computed, read-only: number of sourceEntityId -> physical-table
5360
- entries currently bound for the COLOCATED (same-connection tableName
5467
+ entries currently bound for the DATABASE (same-connection tableName
5361
5468
  substitution) tier only. 0 when unbound, or when the bound manifest
5362
- carried no colocated entries — so a fully bound `storage=`-only
5469
+ carried no database entries — so a fully bound `storage=`-only
5363
5470
  manifest reports `bound` with a count of 0. Corroborate a
5364
5471
  cross-connection bind with `storageServeBindings`, not this count.
5365
5472
 
@@ -5402,7 +5509,7 @@ components:
5402
5509
 
5403
5510
 
5404
5511
  "Bound" is not the same as "serving", and an entry with
5405
- `origin: preaggregate` is where the two most often part: a rollup is
5512
+ `origin: rollup` is where the two most often part: a rollup is
5406
5513
  listed here once its table exists, but it is only offered to a query
5407
5514
  through a composite re-exposing its base's name, so it does not serve
5408
5515
  when something else already claims that name. Read `origin` before
@@ -5502,6 +5609,7 @@ components:
5502
5609
  enum:
5503
5610
  - unbound
5504
5611
  - bound
5612
+ - bind_failed
5505
5613
  - live_fallback
5506
5614
  description: >-
5507
5615
  Whether the configured build manifest is bound to the served models.
@@ -5699,7 +5807,7 @@ components:
5699
5807
  `BuildPlan.refusedSources` member, carrying that gate's own message),
5700
5808
  a persist-target collision, and materialization-config problems that
5701
5809
  degrade attribution. A refusal is the one materialization finding the
5702
- build plan cannot also be read for: a refused `storage`/`colocated`
5810
+ build plan cannot also be read for: a refused `storage`/`database`
5703
5811
  source is ABSENT from `BuildPlan.sources`, so nothing there records
5704
5812
  that the annotation was written at all. Discovery findings: a model
5705
5813
  on the package's surface whose export closure surfaces no sources or
@@ -5871,10 +5979,16 @@ components:
5871
5979
  deprecated `#(filter)` annotations (one per declaring source,
5872
5980
  `model` naming its file and `subject` the source).
5873
5981
  `deprecated-preaggregate-annotation`: a measure declaring
5874
- `#@ preaggregate`, whose v2 spelling is `#(preaggregate)` (one
5875
- per measure, `model` its file, `subject` the source and the
5982
+ `#@ preaggregate` or the deprecated alias `#(preaggregate)`,
5983
+ whose v2 spelling is `#(rollup)`; the message names the
5984
+ spelling it found (one per measure, `model` its file, `subject` the source and the
5876
5985
  message the measure; `warn`; only while
5877
5986
  `PUBLISHER_MATERIALIZE` is on).
5987
+ `deprecated-rollup-namespace`: a rollup line placed with
5988
+ `namespace=`, the deprecated spelling of its `name=`
5989
+ container; still read, in that container under the readable
5990
+ name (one per measure and container, `subject`
5991
+ `<base>.<measure>`; `warn`).
5878
5992
  `report-name-ambiguous`: two or more grid reports share a
5879
5993
  basename, so the deprecated `GET …/dashboards/{name}` route
5880
5994
  answers 409 for it (one per name, `subject` naming it and the
@@ -5891,48 +6005,211 @@ components:
5891
6005
  cannot tell from a real de-identification, so a review has
5892
6006
  to (one per field, `subject` the source; `warn`; a plain
5893
6007
  copy under `#(carries)` refuses the load instead).
5894
- `preaggregate-over-stored-base`: a source persisted with
5895
- `#@ persist storage=` that also declares `#@ preaggregate
5896
- storage=` rollups, which are left out of the build plan and
5897
- every run because a rollup over a stored base can neither build
5898
- nor serve yet (one per base, `subject` the base; `warn`; the
5899
- base still builds and serves from storage).
5900
- `persist-unparseable`: a `#@` annotation that does not
5901
- parse, so Malloy drops its source from the build and it is
5902
- served live (one per annotation, `model` its file; `error`;
5903
- refused at publish, while a package already published keeps
5904
- loading). `persist-retired-key`: a `#@ persist` key no longer
5905
- read, `sharing=` or `schedule=`, with what to write instead
5906
- (one per key, `subject` the source; `error`; refused at
5907
- publish). `persist-unknown-key`: a `#@ persist` key Publisher
5908
- does not read, such as a misspelled `merge_key=` (one per
5909
- key, `subject` the source; `warn`).
5910
- `persist-not-materializable`: a `#@ persist` source the build
5911
- walk did not recognize, served live (`subject` the source;
5912
- `warn`). `persist-source-refused`: a `#@ persist` source a
5913
- compile-time gate refused (a row-level gate, a free
5914
- parameter, a given in the persisted query, or the `storage=`
5915
- gate), served live, with the gate's message (`subject` the
5916
- source, or a rollup's base; `warn`).
6008
+ Materialization codes follow one rule: the suffix tells the
6009
+ outcome. An INVALID annotation (or invalid code it covers)
6010
+ fails the publish and the load, on every path, so its code
6011
+ appears only in the load failure's message (the publish 4xx
6012
+ and `loadErrors`), never as a warning here:
6013
+ `persist-invalid`, `materialize-invalid`,
6014
+ `rollup-invalid`, `persist-view-invalid` and
6015
+ `persist-query-invalid` (a bad value or contradictory
6016
+ combination: a `storage=` that names nothing, an `@env.`
6017
+ reference, an unusable, unsafe, unquoted or reserved
6018
+ `name=`, an `inline=` that names no join, an incremental
6019
+ key or `refresh="incremental"` on a view or query);
6020
+ `persist-unknown-key`, `materialize-unknown-key` and
6021
+ `rollup-unknown-key` (every route's key set is
6022
+ closed, a `freshness.` group's included);
6023
+ `persist-retired-key` and `materialize-retired-key`
6024
+ (`sharing=`, `schedule=`, `partition=`, and on `#@ persist`
6025
+ `realization=`); `persist-unparseable`,
6026
+ `materialize-unparseable`, `rollup-unparseable`,
6027
+ `persist-view-unparseable` and `persist-query-unparseable`; `persist-not-materializable` (a
6028
+ `#@ persist` on a shape Malloy does not plan);
6029
+ `rollup-not-a-measure`, `rollup-unknown-grain` and
6030
+ `rollup-not-mergeable` (a rollup line on a field that is not
6031
+ a measure, a grain naming no dimension, a measure no rollup
6032
+ can merge);
6033
+ `materialization-table-collision` (two sources whose
6034
+ `name=` puts them on one table; under
6035
+ `PERSIST_COLLISION_ENFORCE=false` a refusal instead); and
6036
+ `materialization-near-miss` (a misspelled materialization
6037
+ route or directive, such as `#(materialise)` or
6038
+ `#@ persits`). `preaggregate-malformed` is retained and no
6039
+ longer produced: it is `rollup-invalid` or
6040
+ `rollup-unparseable` now. Retained, no longer produced:
6041
+ `preaggregate-invalid`, `preaggregate-unknown-key`,
6042
+ `preaggregate-unparseable`, `preaggregate-not-a-measure`,
6043
+ `preaggregate-unknown-grain` and
6044
+ `preaggregate-not-mergeable`, now `rollup-invalid`,
6045
+ `rollup-unknown-key`, `rollup-unparseable`,
6046
+ `rollup-not-a-measure`, `rollup-unknown-grain` and
6047
+ `rollup-not-mergeable`. A measure or
6048
+ source that carries both `#(rollup)` and `#(preaggregate)`
6049
+ is `rollup-invalid`.
6050
+ A VALID annotation Publisher cannot build here is refused
6051
+ alone, answered live, while the package loads, and is
6052
+ severity `warn`, never `error`. Every one is a
6053
+ `BuildPlan.refusedSources` entry with a bounded `reason`,
6054
+ and its warning's code names the mechanism:
6055
+ `persist-not-built` (a `#@ persist` source; `subject` the
6056
+ source), `materialize-not-built` (a `#(materialize)` source;
6057
+ `subject` the source), `persist-view-not-built` and
6058
+ `persist-query-not-built` (a persisted view or named query;
6059
+ `subject` the view or query), and `rollup-not-built`
6060
+ (a `#(rollup)` or `#@ preaggregate` rollup; `subject`
6061
+ the base, or `<base>.<measure>` for one measure). The
6062
+ message says why, and `reason` is the refusal record's
6063
+ bounded reason. `preaggregate-not-built` is
6064
+ `rollup-not-built`'s former name: each `rollup-not-built`
6065
+ warning is repeated under it, with the same message, for
6066
+ this release only. `persist-source-refused`, the former name
6067
+ of `persist-not-built` repeated beside it in 0.14.0, is no
6068
+ longer produced.
6069
+ Retained, no longer produced: the rollup sub-family
6070
+ `preaggregate-hidden-field`, `-access-filter`, `-time-zone`,
6071
+ `-current-time`, `-reads-given`, `-unreadable-measure`,
6072
+ `-join-level` and `-name-clash`, now each
6073
+ `rollup-not-built` with the reasons `hidden_field`,
6074
+ `access_filter` (or `authorize`), `time_zone`,
6075
+ `current_time`, `reads_given`,
6076
+ `inherited_where_with_given` or
6077
+ `given_where_over_unstored_field`, `unreadable_measure`,
6078
+ `join_not_in_grain` and `partial_name_collision`.
6079
+ `materialization-storage-mode`: a `storage=` source the
6080
+ deployment's `PERSIST_STORAGE_MODE` (`off` or `write-only`)
6081
+ does not serve from storage (`subject` the source, or a
6082
+ rollup's base; `reason` `storage_mode`; `warn`).
6083
+ `materialization-unreachable`,
6084
+ `materialization-destination-missing` and
6085
+ `materialization-connection-cannot-hold-table`: a source
6086
+ whose serve verdict is `live` for the reason each names (no
6087
+ published source reaches it; its `storage=` destination is not
6088
+ configured; its connection creates no tables), with the
6089
+ verdict's `message` and `fixes` (`subject` the source;
6090
+ `reason` the verdict's; `warn`).
6091
+ `materialize-pair-full-refresh`: a `#(materialize)` pair
6092
+ table (an inlined `join_many`) whose `refresh="incremental"`
6093
+ is not honoured: it is rebuilt in full on every refresh, and
6094
+ served (`subject` the source; `warn`).
6095
+ `rollup-join-one-key-repeated`: a rollup's last build found
6096
+ a `join_one` key repeated in the data, so queries that read
6097
+ that join beside other aggregates are answered live
6098
+ (`subject` the rollup's base; `warn`). Repeated under its
6099
+ former name `preaggregate-join-one-key-repeated` for this
6100
+ release only.
6101
+ `served-copy-not-served`: the served copy (the author's own
6102
+ files, each stored source re-rooted on its table) leaves a
6103
+ source as written, so it answers live, or serves it with a
6104
+ join read as written or left out; `reason` names why
6105
+ (`compile_failed`, `cross_connection_unbuilt`,
6106
+ `column_types`, `no_declaration`, `definition_not_parsed`,
6107
+ `pair_join_not_found`, `pair_not_compiled`,
6108
+ `fields_not_carried`, `read_terms_not_kept`,
6109
+ `cross_connection_join`, `inline_join_kept`,
6110
+ `reroot_not_compiled`, `classification_not_kept`; an open
6111
+ set) (`subject` the source; `warn`).
6112
+ `row-level-gate-unexpressible`: a row-level gate an entry
6113
+ point inherits, whose field it no longer carries, so that
6114
+ entry point denies every request; `row-level-gate-reads-no-given`:
6115
+ a source-line gate that reads no given, a fixed predicate
6116
+ rather than an access rule keyed on the caller;
6117
+ `row-level-gate-negated-membership`: a source-line gate that
6118
+ negates a membership test, which an empty given turns into
6119
+ match-all, or that is too deep to check for one (its message
6120
+ then says it is too deep to check, not that it negates one)
6121
+ (`model` the
6122
+ entry point's file, `subject` the entry point; `warn`; the
6123
+ model still loads).
6124
+ `annotation-near-miss` and `annotation-malformed-route`: an
6125
+ annotation whose route or directive looks like a misspelled
6126
+ one Publisher reads (`warn`); `annotation-gate-near-miss`: a
6127
+ misspelled gate annotation (`#(authorise)`), which
6128
+ `compile_model` refuses.
5917
6129
  `persist-incremental-no-merge-key`: an incremental source
5918
6130
  with no `merge_key=`, so each refresh replaces its watermark
5919
6131
  range (`subject` the source; `warn`).
5920
6132
  `persist-incremental-shared-address`: sources that compile to
5921
6133
  the same SQL on one connection, so they share one table and
5922
6134
  one boundary, where at least one is incremental (one per
5923
- source; `warn`). `preaggregate-hidden-field`: a `#@ preaggregate` on a
5924
- private or internal field or grain dimension (`warn`).
6135
+ source; `warn`).
6136
+ `rollup-join-one-key-repeated`: a bound rollup whose last
6137
+ build found the key of a `join_one` it reads repeated, so a
6138
+ query reading that join beside other aggregates is answered
6139
+ live; it clears once a build finds the key unique (one per
6140
+ rollup; `warn`). `preaggregate-join-one-key-repeated` is
6141
+ retained, no longer produced: it is
6142
+ `rollup-join-one-key-repeated` now.
5925
6143
  `join-bypass`: an author join from a published source to one
5926
6144
  with a stricter gate, which the join does not carry (one per
5927
6145
  join, or one for a walk cut short at the join bound; always
5928
6146
  a `warn`, never a load refusal; see docs/authorize.md).
5929
- `storage-column-type-mismatch`: a `storage=` table stores a
5930
- column as a type other than the one Malloy declares for it.
5931
- It is read through a cast to the declared type where that is
5932
- faithful, and otherwise answered live (one per source and
5933
- column, `model` the first model binding it, `subject` the
5934
- source, the message naming the column, both types and which
5935
- of the two applies; `warn`; see docs/materialization.md).
6147
+ `storage-column-type-mismatch`: a `storage=` table of any
6148
+ kind (`#@ persist`, `#(materialize)`, a rollup, a persisted
6149
+ view or query) stores a column as a type other than the one
6150
+ its build declares. It is read through a cast to the
6151
+ declared type where that is faithful, and otherwise
6152
+ answered live, never read as its stored type (one per
6153
+ source and column, `model` the model
6154
+ declaring it, `subject` the source, a rollup's base, or a
6155
+ view's or query's build source, the message naming the
6156
+ column, both types and which applies; `warn`; see
6157
+ docs/materialization.md).
6158
+ `database-column-type-mismatch`: a bound table in a source's
6159
+ own database whose column was altered, or dropped, outside a
6160
+ build, so it no longer stores the declared type; it is read
6161
+ through a cast where that is faithful, and otherwise answered
6162
+ live, until the table is rebuilt (one per source and column,
6163
+ `subject` the source; `warn`).
6164
+ `table-kept`: a table an auto-run replaced
6165
+ when its source's table was renamed or moved, which
6166
+ Publisher keeps rather than drops: one at an author's exact
6167
+ `name=` (never dropped), one in a storage destination
6168
+ that is no longer configured (which, when the destination
6169
+ was renamed rather than removed, may be the table served
6170
+ under the new name), or one a `storage=` or tier move left
6171
+ under the name the source is served under now (which may
6172
+ be the very table served, so it is never dropped).
6173
+ Listed on the newest run's
6174
+ `metadata.keptTables` until no committed run names it in
6175
+ its place (its runs deleted; a delete is record-only),
6176
+ a run finds it dropped by hand (never on Snowflake or
6177
+ MySQL, whose catalogs hide tables), or its name is used
6178
+ again in its own place
6179
+ (one per table, `model` the model
6180
+ declaring the source, `subject` the source or a rollup's
6181
+ base, the message naming the table and where it is,
6182
+ `reason` the kept table's `author_name`,
6183
+ `destination_missing` or `may_be_served`; `warn`; see
6184
+ docs/materialization.md).
6185
+ `database-table-unread`: a bound table in a source's own
6186
+ database whose columns could not be read when it was bound
6187
+ (missing, unreadable, slower than the read's bound, or named
6188
+ in more than one schema), so its queries are answered live
6189
+ until a read succeeds; the message names the table or
6190
+ rollup, one fixed reason (its connection could not be
6191
+ opened, the catalog read timed out, the catalog query
6192
+ failed, not found, a name matching more than one table, a
6193
+ name the catalog cannot read; never the driver's text) and
6194
+ whether a retry is pending, and the warning clears once the
6195
+ table is read (only for a table a source of the package
6196
+ reads; one per table, `model` the model declaring
6197
+ its source, `subject` the source, or a rollup's base, when
6198
+ the plan knows the table; `reason` one of
6199
+ `connection_failed`, `timed_out`, `catalog_query_failed`,
6200
+ `not_found`, `ambiguous`, `unparseable`, `not_read`; `warn`;
6201
+ see docs/materialization.md).
6202
+ `database-native-type-missing`: a database table is bound
6203
+ with no captured warehouse type (its manifest entry's
6204
+ `nativeSchema`) for a column whose field Malloy types as a big
6205
+ integer. On BigQuery the column is read as `INT64`, its only
6206
+ integer type, and still serves; on any other dialect it is
6207
+ left out, so a query that reads it is answered live. The next
6208
+ full rebuild captures the types (one per source, `model` the
6209
+ first model binding it, `subject` the source, the message
6210
+ naming the columns and which applies; `warn`; see
6211
+ docs/materialization.md). Repeated under its former name
6212
+ `stored-native-schema-missing` for this release only.
5936
6213
  `entities-…` (`entities-not-a-dimension`,
5937
6214
  `entities-parameterized-source`,
5938
6215
  `entities-multiple-required-filters`,
@@ -5946,6 +6223,19 @@ components:
5946
6223
  curation findings (`report-on-surface`,
5947
6224
  `index-is-not-a-report`). The message wording may change; the
5948
6225
  code does not.
6226
+ reason:
6227
+ type: string
6228
+ description: >-
6229
+ The bounded cause of a materialization finding, so a client
6230
+ branches on it rather than on the message (whose wording may
6231
+ change): the refusal record's `reason` on a `*-not-built`
6232
+ warning; the served copy's reason on
6233
+ `served-copy-not-served`; the unread reason on
6234
+ `database-table-unread`; the kept table's reason on
6235
+ `table-kept`; the serve verdict's reason on a
6236
+ `materialization-*` verdict warning; `storage_mode` on
6237
+ `materialization-storage-mode`. Always snake_case. An open
6238
+ string; absent on a finding that has none.
5949
6239
  severity:
5950
6240
  type: string
5951
6241
  enum:
@@ -6071,6 +6361,7 @@ components:
6071
6361
  enum:
6072
6362
  - unbound
6073
6363
  - bound
6364
+ - bind_failed
6074
6365
  - live_fallback
6075
6366
  description: >-
6076
6367
  **Moved** to `GET …/packages/{packageName}/status` (`PackageServingState.manifestBindingStatus`) and the package's entry in `GET /status`. Present on a package response only while `PUBLISHER_PACKAGE_INLINE_FIELDS` is on, the default in this release; a later release removes it.
@@ -8465,82 +8756,39 @@ components:
8465
8756
  exactly that many rows is a complete answer.
8466
8757
  servedFrom:
8467
8758
  type: ["string", "null"]
8468
- enum: [storage, live_fallback, null]
8759
+ enum: [storage, database, live_fallback, null]
8469
8760
  description: >-
8470
- How this answer was produced, when the query reached the storage
8471
- routing decision at all.
8761
+ Which tier answered this query, when a materialized table did.
8472
8762
 
8473
8763
  `storage` — served from a materialized table in a `storage=`
8474
8764
  destination, via the virtual-source transform. The source's own
8475
8765
  warehouse was not queried.
8476
8766
 
8767
+ `database` — served from a materialized table in the source's own
8768
+ database (`colocated` in releases before this one): a database `#@ persist` table Malloy substituted, a
8769
+ database `#(materialize)` table the served copy read, or a
8770
+ database rollup or persisted view.
8771
+
8477
8772
  `live_fallback` — the query DID route to storage and the store then
8478
8773
  failed underneath it, and the source's freshness fallback allowed it
8479
8774
  to degrade to the live warehouse. **The rows are correct and the
8480
8775
  request succeeded**, which is why this needs its own value: it is
8481
8776
  indistinguishable from a storage hit at the call site, and treating it
8482
- as one would report a healthy hit rate for a broken store. This value
8483
- is NOT the same event as the `live_fallback` label on
8484
- `publisher_storage_serve_routing_total` — see the warning below.
8485
-
8486
- **This field describes the `storage=` tier and nothing else.** It
8487
- records how the storage routing decision came out, so it says nothing
8488
- about the colocated `#@ persist` tier, which answers a query by
8489
- substituting the materialized table into the model and never reaches
8490
- that decision.
8491
-
8492
- **Null is three different outcomes**, and they are worth telling
8493
- apart because two of them mean materialization worked and one means
8494
- it silently did not:
8495
-
8496
- 1. The query never had a storage binding to consider — every query on
8497
- a deployment with no `storage=` sources, which is the default.
8498
- 2. It was answered from a **colocated** materialized table. The
8499
- query never reached the routing decision, so a fully materialized
8500
- answer reports the same null a fully live one does.
8501
- 3. The storage transform was **ineligible** for this query, so it was
8502
- served live. The query DID reach the routing decision and the tier
8503
- declined it — a storage-tier miss, reported identically to "no
8504
- materialization exists anywhere."
8505
-
8506
- Case 3 is the one that costs time, because nothing about this field
8507
- distinguishes it from case 1. `path`, the path report, does: it names
8508
- the table that answered in every tier, and why each table that could
8509
- have answered did not. The server does log it: one
8510
- `storage serve-shape ineligible for this query; serving live` line at
8511
- INFO per routed query, carrying the compile error that made the shape
8512
- ineligible, plus `shapeSources` (what the shape offered) and
8513
- `staleSources` (bound, but withheld by the freshness gate). The
8514
- compile error alone does not separate those: `Reference to undefined
8515
- object 'x'` reads identically whether `x` carries no `#@ persist` at
8516
- all or is materialized and merely past its freshness window. That log
8517
- is currently the only per-query account of a storage-tier miss. It is not a hypothetical shape — a source
8518
- warehouse that folds unquoted identifiers to upper case made every
8519
- query on every `storage=` source in a package ineligible, and the
8520
- whole tier reported null for months while looking exactly like a
8521
- deployment that had never enabled it.
8522
-
8523
- For the colocated tier there is no per-query signal at all. The
8524
- package-grain fields are the nearest thing —
8525
- `manifestBindingStatus`, `manifestEntryCount` and
8526
- `storageServeBindings` — but read what each actually claims:
8527
- `bound` reports that the bind ran to completion, explicitly NOT that
8528
- any query routes to a materialized table, and `manifestEntryCount`
8529
- counts colocated entries only, so a package whose sources are all
8530
- `storage=` reports 0 while being fully bound.
8531
-
8532
- ⚠️ **`live_fallback` names two different things across two surfaces,
8533
- and correlating them on the token is wrong in both directions.** On
8534
- this field it means the store failed at run time. On
8535
- `publisher_storage_serve_routing_total{outcome}` it means the
8536
- transform was ineligible — this field's null case 3 — and that
8537
- metric spells the run-time failure `runtime_live_fallback`. So the
8538
- field's `live_fallback` is the metric's `runtime_live_fallback`, and
8539
- the metric's `live_fallback` is this field's `null`. A third surface,
8540
- `manifestBindingStatus`, uses the same token for a third thing: a
8541
- configured `manifestLocation` whose fetch or bind failed. Each
8542
- surface is internally consistent; none of them means what the others
8543
- do.
8777
+ as one would report a healthy hit rate for a broken store. On
8778
+ `publisher_query_route_total` the same event is the answering leg's
8779
+ `outcome="fallback", reason="RUN_FAILED"`.
8780
+
8781
+ Null means no materialized table answered: the query was served
8782
+ live. `path`, the path report, says why each table that could have
8783
+ answered did not, and `path.servedBy.tier` names the same tier this
8784
+ field does. The server also logs a
8785
+ `served copy cannot answer this query` line at DEBUG, carrying the
8786
+ error that declined the query and its decline code.
8787
+
8788
+ `live_fallback` here means the store failed at run time for this
8789
+ query. A configured `manifestLocation` whose fetch or bind failed is
8790
+ `manifestBindingStatus: bind_failed` (releases before this one
8791
+ spelled that `live_fallback` too).
8544
8792
  executionTimeMs:
8545
8793
  type: integer
8546
8794
  description: >-
@@ -8592,9 +8840,7 @@ components:
8592
8840
  materialized table that served it (or `live`), every materialized
8593
8841
  table on the queried source's chain with the reason each one that
8594
8842
  did not answer was skipped, and nearby tables the query could not
8595
- use. Unlike `servedFrom`, it covers the colocated `#@ persist` tier
8596
- and pre-aggregation rollups as well as `storage=`, so a null
8597
- `servedFrom` no longer hides whether a table answered.
8843
+ use, for every tier.
8598
8844
 
8599
8845
  Absent only when the report could not be assembled; the query's
8600
8846
  answer never depends on it.
@@ -8622,8 +8868,10 @@ components:
8622
8868
  Every materialized table on the queried source's chain, and every
8623
8869
  rollup of a source on it, that could have answered this query: the
8624
8870
  one that served it marked `used`, the rest `skipped` with a reason.
8625
- In the order Publisher tries them: `storage=` tables, then colocated
8626
- rollups, then colocated `#@ persist` tables nearest first. A table
8871
+ Listed as `storage=` tables, then database rollups, then database
8872
+ tables nearest first, which is not the order Publisher tries them
8873
+ (a persisted view or query, then rollups coarsest first, then the
8874
+ served copy). A table
8627
8875
  that was not tried because an earlier one answered is left out.
8628
8876
  Empty when the queried source has no materialized table.
8629
8877
  items:
@@ -8642,7 +8890,7 @@ components:
8642
8890
  warnings:
8643
8891
  type: array
8644
8892
  description: >-
8645
- The serve verdicts behind this query's `WARNED` skips: one per table
8893
+ The serve verdicts behind this query's `NOT_SERVED` skips: one per table
8646
8894
  on the queried source's chain that no query can be answered from,
8647
8895
  each with a code and a sentence for a person. A table whose source
8648
8896
  the caller cannot list is left out, as in `notConsidered`. Empty
@@ -8659,15 +8907,20 @@ components:
8659
8907
  code:
8660
8908
  type: string
8661
8909
  description: >-
8662
- The serve verdict's reason: `storage_mode` (built into storage, but
8663
- the server's PERSIST_STORAGE_MODE routes no query to it),
8910
+ The serve verdict's reason (`ServeVerdict.reason`): `refused` (the
8911
+ package refuses to serve it), `storage_mode` (built into storage,
8912
+ but the server's PERSIST_STORAGE_MODE routes no query to it),
8664
8913
  `unreachable` (no published source reaches it), `row_level_gate`
8665
8914
  (every published entry point over it carries a gate it cannot keep
8666
- yet), `refused` (the package refuses to serve it), `shadowed` (its
8667
- storage table is bound to another source of the same name) or
8668
- `served_copy` (only the served copy reads it, and it does not answer
8669
- from it). An open
8670
- set: treat a code you do not know as a warning like any other.
8915
+ yet), `stale` (past its freshness window, with a fallback that does
8916
+ not serve stale), `shadowed` (its storage table is bound to another
8917
+ source of the same name), `destination_missing` (`storage=` names
8918
+ a destination the environment does not configure),
8919
+ `connection_cannot_hold_table` (its connection creates no tables),
8920
+ `materialization_off` (only the served copy reads it, and the
8921
+ served copy is off) or `served_copy` (only the served copy reads
8922
+ it, and the served copy does not re-root it). An open set: treat a
8923
+ code you do not know as a warning like any other.
8671
8924
  tableId:
8672
8925
  type: string
8673
8926
  description: The table, as `considered` names it.
@@ -8726,9 +8979,24 @@ components:
8726
8979
  properties:
8727
8980
  kind:
8728
8981
  $ref: "#/components/schemas/QueryPathTableKind"
8982
+ origin:
8983
+ type: string
8984
+ enum: [persist, materialize, view, query, rollup]
8985
+ description: >-
8986
+ The mechanism that declared the table, as `PersistSourcePlan.origin`
8987
+ names it. `kind: materialized` is `persist` or `materialize`.
8988
+ Absent when `kind` is `live`, or when the table's mechanism is not
8989
+ known.
8729
8990
  tableId:
8730
8991
  type: string
8731
8992
  description: The table that answered. Absent when `kind` is `live`.
8993
+ tier:
8994
+ type: string
8995
+ enum: [database, storage]
8996
+ description: >-
8997
+ Where the table that answered lives: `database`, the source's own
8998
+ database, or `storage`, a `storage=` destination. The same tier the
8999
+ query result's `servedFrom` reports. Absent when `kind` is `live`.
8732
9000
  dataAsOf:
8733
9001
  type: string
8734
9002
  format: date-time
@@ -8753,22 +9021,35 @@ components:
8753
9021
  type: string
8754
9022
  kind:
8755
9023
  $ref: "#/components/schemas/QueryPathTableKind"
9024
+ origin:
9025
+ type: string
9026
+ enum: [persist, materialize, view, query, rollup]
9027
+ description: >-
9028
+ The mechanism that declared the table, as `PersistSourcePlan.origin`
9029
+ names it. `kind: materialized` is `persist` or `materialize`.
9030
+ Absent when `kind` is `live`, or when the table's mechanism is not
9031
+ known.
8756
9032
  outcome:
8757
9033
  type: string
8758
9034
  enum: [used, skipped]
8759
- description: "`used`, the table answered; `skipped`, it could not, and `reason` says why."
9035
+ description: "`used`, the table answered; `skipped`, it could not, and `reason` says why. A rollup the rollup leg tried carries that rollup's own `reason` and `detail`, so two rollups of one source skipped for different reasons report each its own; one the leg never tried carries the leg's."
8760
9036
  reason:
8761
9037
  $ref: "#/components/schemas/SkipReason"
8762
9038
  code:
8763
9039
  type: string
8764
9040
  description: >-
8765
- For a `WARNED` skip, the serve verdict's reason the table answers no
8766
- query: `storage_mode`, `unreachable`, `row_level_gate`, `refused`,
8767
- `shadowed` or `served_copy` (see `QueryPathWarning`); or, for a table only the served
8768
- copy reads, `served-copy-not-served` (the package warning of that
8769
- code) or `persist-opt-out` (the queried source opts out with
8770
- `#@ -persist`). An open set. Absent on any
8771
- other outcome, and on a `WARNED` skip whose verdict is not known.
9041
+ For a `NOT_SERVED` skip, the serve verdict's reason the table
9042
+ answers no query, from the same set as `QueryPathWarning.code`;
9043
+ for a table only the served copy reads, `served_copy` also when
9044
+ the served copy does not re-root the queried source (the
9045
+ `served-copy-not-served` package warning says why). Always
9046
+ snake_case. An open set. Absent on any other outcome, and on a
9047
+ `NOT_SERVED` skip whose verdict is not known.
9048
+
9049
+
9050
+ Retained, no longer produced (shipped in 0.14.0):
9051
+ `served-copy-not-served`, now `served_copy`; `persist-opt-out`,
9052
+ now the skip reason `OPTED_OUT`.
8772
9053
  detail:
8773
9054
  type: string
8774
9055
  description: >-
@@ -8788,6 +9069,14 @@ components:
8788
9069
  type: string
8789
9070
  kind:
8790
9071
  $ref: "#/components/schemas/QueryPathTableKind"
9072
+ origin:
9073
+ type: string
9074
+ enum: [persist, materialize, view, query, rollup]
9075
+ description: >-
9076
+ The mechanism that declared the table, as `PersistSourcePlan.origin`
9077
+ names it. `kind: materialized` is `persist` or `materialize`.
9078
+ Absent when `kind` is `live`, or when the table's mechanism is not
9079
+ known.
8791
9080
  sourceName:
8792
9081
  type: string
8793
9082
  description: The source the table materializes; for a rollup, the source it rolls up.
@@ -8803,39 +9092,59 @@ components:
8803
9092
 
8804
9093
  QueryPathTableKind:
8805
9094
  type: string
8806
- enum: [view, rollup, materialized, live]
9095
+ enum: [view, query, rollup, materialized, live]
8807
9096
  description: >-
8808
- What kind of answer: `view`, a persisted view's table; `rollup`, a
8809
- pre-aggregation; `materialized`, a materialized source's table; `live`,
8810
- the source's own warehouse.
9097
+ What kind of answer: `view`, a persisted view's table; `query`, a
9098
+ persisted named query's table (`#@ persist` on a top-level `query:`);
9099
+ `rollup`, a pre-aggregation; `materialized`, a materialized source's
9100
+ table (`origin` `persist` or `materialize`; this kind is not
9101
+ extended); `live`, the source's own warehouse. A client treats a kind it
9102
+ does not know as a materialized table it cannot name.
8811
9103
 
8812
9104
  SkipReason:
8813
9105
  type: string
8814
9106
  enum:
8815
9107
  - NOT_BUILT
8816
- - WARNED
9108
+ - NOT_SERVED
9109
+ - OPTED_OUT
8817
9110
  - MISSING_FIELD
8818
- - CONTRACT
9111
+ - SHAPE_MISMATCH
9112
+ - ROW_LEVEL_GATE
8819
9113
  - GRAIN_TOO_COARSE
8820
9114
  - TIME_ZONE
8821
9115
  - CROSS_CONNECTION
8822
9116
  - COUNT_SEMANTICS
8823
9117
  - STALE
9118
+ - READ_FAILED
9119
+ - WARNED
9120
+ - CONTRACT
8824
9121
  - RUN_FAILED
8825
9122
  description: >-
8826
9123
  Why a table could not answer a query. `NOT_BUILT`, it is not bound to
8827
- this package; `WARNED`, its annotation carries a publish warning and
8828
- serves live, and the candidate's `code` says which; `MISSING_FIELD`, the query reads a field the table lacks (or
8829
- otherwise does not compile against it); `CONTRACT`, answering from it
8830
- would bypass an access control on the queried source; `GRAIN_TOO_COARSE`,
8831
- a rollup's grain does not cover the query's groups or filters;
8832
- `TIME_ZONE`, it was built in another time zone than the query's;
8833
- `CROSS_CONNECTION`, the query needs a join the table's connection cannot
8834
- reach; `COUNT_SEMANTICS`, an aggregate the table cannot reproduce as the
8835
- live query computes it; `STALE`, it is past its freshness window;
8836
- `RUN_FAILED`, it was chosen but reading it failed at run time, and its
8837
- freshness fallback allowed live. A closed list to which codes may be
8838
- added, so a client treats an unknown one as a skip it cannot explain.
9124
+ this package yet; `NOT_SERVED`, its serve verdict is `live`, so it
9125
+ answers no query, and the candidate's `code` names the verdict's
9126
+ reason; `OPTED_OUT`, the queried source opts out of its tables with
9127
+ `#@ -persist`; `MISSING_FIELD`, the query reads a field the table
9128
+ lacks (or otherwise does not compile against it); `SHAPE_MISMATCH`,
9129
+ the query is not the shape the stored result answers: it is not a
9130
+ call of the persisted view or query, it refines the call, or its text
9131
+ names beside the call a name the stored result's variant takes over;
9132
+ `ROW_LEVEL_GATE`, answering from it would bypass a row-level gate on
9133
+ the queried source; `GRAIN_TOO_COARSE`, a rollup's grain does not
9134
+ cover the query's groups or filters; `TIME_ZONE`, it was built in
9135
+ another time zone than the query's; `CROSS_CONNECTION`, the query
9136
+ needs a join the table's connection cannot reach; `COUNT_SEMANTICS`,
9137
+ an aggregate the table cannot reproduce as the live query computes
9138
+ it; `STALE`, it is past its freshness window; `READ_FAILED`, it was
9139
+ chosen but reading it failed at run time, and its freshness fallback
9140
+ allowed live.
9141
+
9142
+
9143
+ Retained, no longer produced (shipped in 0.14.0): `WARNED`, now
9144
+ `NOT_SERVED` (or `OPTED_OUT` for `#@ -persist`); `CONTRACT`, now
9145
+ `ROW_LEVEL_GATE`; `RUN_FAILED`, now `READ_FAILED`. A closed list to
9146
+ which codes may be added, so a client treats an unknown one as a
9147
+ skip it cannot explain.
8839
9148
 
8840
9149
  LogMessage:
8841
9150
  type: object
@@ -9865,6 +10174,12 @@ components:
9865
10174
  details:
9866
10175
  type: string
9867
10176
  description: Additional error details or context
10177
+ refusalReason:
10178
+ type: string
10179
+ description: >-
10180
+ With `reason: MATERIALIZATION_REFUSED`: the refusal's bounded
10181
+ reason, from the same open set as `RefusedSource.reason`. Absent
10182
+ otherwise.
9868
10183
  reason:
9869
10184
  type: string
9870
10185
  description: |
@@ -9893,6 +10208,48 @@ components:
9893
10208
  the environment does not have, usually one deleted after the
9894
10209
  package was loaded.
9895
10210
 
10211
+ STORAGE_ACCESS_DENIED, on a 403, means an object store refused the
10212
+ database's read under a data path the environment configures (a
10213
+ DuckLake catalog's, a storage destination's): the query and the
10214
+ model are fine, and whoever configures the database's storage
10215
+ credentials has to fix it. PATH_ACCESS_DENIED, on a 403, means the
10216
+ object store at a path the query or the model reads itself (a file
10217
+ or table URL) refused access: change the path, or get the caller a
10218
+ grant to it. Retrying either fails the same way. The body names the
10219
+ source or connection the caller read and no storage path.
10220
+
10221
+ ACCESS_DENIED, on a 403, means a gate (`#(authorize)` or
10222
+ `#(access_filter)`) refused the caller. Every gate 403 carries it,
10223
+ including a gate that could not be decided, which fails closed and
10224
+ answers the same: only the server's metrics and log tell those
10225
+ apart. A 403 with any other reason is not a gate's.
10226
+
10227
+ MATERIALIZATION_REFUSED, on a 422, means a valid materialization
10228
+ declaration this server will not build. The body's `refusalReason`
10229
+ is the refusal's `RefusedSource.reason`.
10230
+
10231
+ TABLE_OWNED_ELSEWHERE and TABLE_OWNERSHIP_UNVERIFIED, on a 400,
10232
+ mean a build was refused before it wrote because its `name=` is
10233
+ held by a table this package does not own, or because who holds
10234
+ it could not be read.
10235
+
10236
+ BUILD_INSTRUCTIONS_INVALID, on a 400 from creating a
10237
+ materialization, means its body or build instructions are not a
10238
+ run this package can take (a field of the wrong shape, an unknown
10239
+ source, a table named twice, a ledger entry that does not fit);
10240
+ the message names which. Retrying unchanged fails the same way.
10241
+
10242
+ MATERIALIZATION_CONFLICT, on a 409, means a materialization run
10243
+ conflicts with another run or with the package's binding. Two of
10244
+ its cases clear on their own, so retry later: a run already active
10245
+ for the package, and a table another run is writing. Two do not
10246
+ clear until something changes, so a retry fails the same way: an
10247
+ auto-run of a package or version a host manifest serves (pass
10248
+ `buildInstructions`, or clear the binding), and a run of a version
10249
+ that is not latest touching the tables a `scope: package`
10250
+ package's versions share (name tables of its own in
10251
+ `buildInstructions`). The message says which.
10252
+
9896
10253
  Deliberately an open string rather than an enum. Generators render
9897
10254
  an enum closed, so adding a second value here would break every
9898
10255
  client generated before it -- on the one field whose purpose is to
@@ -9933,7 +10290,10 @@ components:
9933
10290
 
9934
10291
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
9935
10292
  CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND,
9936
- MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
10293
+ STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10294
+ MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10295
+ TABLE_OWNERSHIP_UNVERIFIED, BUILD_INSTRUCTIONS_INVALID,
10296
+ MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
9937
10297
  VERSION_CONFLICT, PACKAGE_IS_VERSIONED,
9938
10298
  PACKAGE_INSTALLED_FROM_LOCATION, FILE_EXISTS, VERSION_IS_LATEST,
9939
10299
  VERSION_IS_LAST_ACTIVE, VERSION_BUILDING, VERSION_ID_INVALID,
@@ -10050,8 +10410,12 @@ components:
10050
10410
  against the replacement. It also reports the render-tag findings
10051
10411
  (code "render-tag") and the dashboard, given and drill findings
10052
10412
  (code "dashboard-lint") a reload would put on the package's
10053
- warnings, at their own severity and with no position. The
10054
- package's other warnings (storage, persist, materialization,
10413
+ warnings, at their own severity and with no position, and the
10414
+ load's verdict on the materialization annotations: each line a
10415
+ load fails with as an error with its code, each annotation the
10416
+ load leaves unbuilt as a warning ("file" reports the same verdict
10417
+ when the file names a materialization route or the package plans
10418
+ a table). The package's other warnings (storage, bound tables,
10055
10419
  explores, surface and discovery warnings, among others) are not
10056
10420
  reported. Package diagnostics can name
10057
10421
  files hidden from discovery. No rows or SQL are returned, and
@@ -10243,7 +10607,13 @@ components:
10243
10607
  properties:
10244
10608
  url:
10245
10609
  type: string
10246
- description: URL of the source file
10610
+ description: >-
10611
+ The source file, never where the server keeps it: a package
10612
+ file's path relative to the package root, decoded
10613
+ (`sub dir/orders.malloy`). At scope `append` the problem points
10614
+ into a temporary compile-check overlay beside the model,
10615
+ `__compile_check.malloy` (`model` names the model it extends).
10616
+ A file outside the package reads `<outside package>`.
10247
10617
  range:
10248
10618
  type: object
10249
10619
  description: Character range within the source file
@@ -10374,7 +10744,18 @@ components:
10374
10744
 
10375
10745
  MaterializationStatus:
10376
10746
  type: string
10377
- description: Phase-aware status of a materialization run.
10747
+ description: >-
10748
+ Phase-aware status of a materialization run. `MANIFEST_ROWS_READY`:
10749
+ the tables are built and the manifest is recorded. `MANIFEST_FILE_READY`:
10750
+ the run is done; an auto-run reaches it only after its manifest is
10751
+ loaded into the package it built, so a query sent after it is answered
10752
+ from the new tables (`metadata.autoLoad` is `loaded`). When that load
10753
+ does not take, the run still reaches `MANIFEST_FILE_READY`, since its
10754
+ tables were built, with `metadata.autoLoad` `failed`,
10755
+ `metadata.autoLoadStep` (`reload`, `bind` or `timeout`),
10756
+ `metadata.autoLoadError`, and `error` set; the package's next reload
10757
+ or restart binds the run's manifest. An orchestrated run never loads
10758
+ its manifest, so for it `MANIFEST_FILE_READY` means built.
10378
10759
  enum:
10379
10760
  - PENDING
10380
10761
  - MANIFEST_ROWS_READY
@@ -10398,7 +10779,19 @@ components:
10398
10779
  oneOf:
10399
10780
  - $ref: "#/components/schemas/BuildManifest"
10400
10781
  - type: "null"
10401
- description: Build output. Null until status = MANIFEST_FILE_READY.
10782
+ description: >-
10783
+ Build output. Null until the tables are built (status
10784
+ MANIFEST_ROWS_READY), and on a run that failed or was cancelled
10785
+ before then, with one exception: a run that FAILED because every
10786
+ source it was asked to build failed or was refused carries a
10787
+ manifest whose `failures` holds each such source's own reason and
10788
+ `retryable`, keyed by sourceEntityId, and whose `entries` is
10789
+ empty. A run interrupted at MANIFEST_ROWS_READY (the server
10790
+ stopped while it loaded its manifest) ends FAILED with its
10791
+ manifest. Publisher never serves or binds a FAILED run's
10792
+ manifest; a host may still bind the sources it reused, from its
10793
+ own records. Such a manifest has no `builtAt`, since nothing was
10794
+ built; the run's `completedAt` says when it ended.
10402
10795
  startedAt:
10403
10796
  type: ["string", "null"]
10404
10797
  format: date-time
@@ -10413,19 +10806,68 @@ components:
10413
10806
  description: >-
10414
10807
  Materialization metadata including build options, source counts,
10415
10808
  and durations. Free-form object — fields such as `trigger`
10416
- (ON_DEMAND | SCHEDULER) live here deliberately, so a strict-schema
10809
+ (`on_demand` | `scheduler`, the words `RunContext.trigger` uses;
10810
+ releases before this one wrote `ON_DEMAND` | `SCHEDULER`, which a
10811
+ reader of older runs must still accept) live here deliberately, so a strict-schema
10417
10812
  client does not need to know them. Promoting any such field to a
10418
10813
  top-level `Materialization` property is a breaking schema change
10419
10814
  that orchestrated clients must adopt first; do not do it casually.
10420
10815
  `errorRetryable` (boolean) is set on a FAILED run that built
10421
- nothing, which commits no manifest and so reports no per-source
10422
- `failures`: `false` when every source failed deterministically or
10423
- was refused, `true` when any failure was transient, with the same
10424
- rules as `SourceFailure.retryable`. Absent when unclassified, for a
10425
- cancelled run, and from a Publisher that predates it.
10816
+ nothing, the whole run's answer beside each source's own in
10817
+ `manifest.failures`: `false` when every source failed
10818
+ deterministically or was refused, `true` when any failure was
10819
+ transient, with the same rules as `SourceFailure.retryable`.
10820
+ Absent when unclassified, for a cancelled run, and from a
10821
+ Publisher that predates it.
10426
10822
  `errorAtCancel` (string) is set on a CANCELLED run whose last
10427
10823
  error was not the cancellation itself: the message of the failure
10428
10824
  the cancel raced, which `error` reports only as "Cancelled".
10825
+ `keptTables` (array) is set on an auto-run that lists the tables
10826
+ a rename or move left and Publisher keeps rather than drops (see
10827
+ the `table-kept` warning).
10828
+ additionalProperties: true
10829
+ properties:
10830
+ keptTables:
10831
+ type: array
10832
+ description: >-
10833
+ Tables an auto-run replaced and Publisher keeps, carried
10834
+ forward by later runs until no committed run names the table
10835
+ in its place, the name is built again in its own place, or a
10836
+ run finds the table gone. An older server leaves out an entry
10837
+ whose `reason` it does not know.
10838
+ items:
10839
+ type: object
10840
+ required:
10841
+ [sourceEntityId, physicalTableName, connectionName, reason]
10842
+ properties:
10843
+ sourceEntityId:
10844
+ type: string
10845
+ description: The source the table was built for.
10846
+ sourceName:
10847
+ type: string
10848
+ description: The source's name, when the run recorded it.
10849
+ physicalTableName:
10850
+ type: string
10851
+ description: The kept table, as the run that built it wrote it.
10852
+ connectionName:
10853
+ type: string
10854
+ description: The source's connection.
10855
+ storageDestinationName:
10856
+ type: string
10857
+ description: >-
10858
+ The storage destination holding the table; absent for a
10859
+ table in the connection's own database.
10860
+ reason:
10861
+ type: string
10862
+ enum: [author_name, destination_missing, may_be_served]
10863
+ description: >-
10864
+ `author_name`: at an author's exact `name=`, which
10865
+ Publisher never drops. `destination_missing`: in a
10866
+ storage destination no longer configured, which
10867
+ Publisher cannot reach. `may_be_served`: under the
10868
+ table segment the source is served under now, in
10869
+ another place or container, so it may be the very
10870
+ table served, and is never dropped.
10429
10871
  createdAt:
10430
10872
  type: string
10431
10873
  format: date-time
@@ -10460,17 +10902,26 @@ components:
10460
10902
  refusedSources:
10461
10903
  type: object
10462
10904
  description: >-
10463
- Map of sourceID ("sourceName@modelURL") to the sources the package
10464
- declared `#@ persist` on but that are ineligible to build, so they
10465
- carry no entry in `sources`. A SEPARATE collection rather than a
10466
- field on `PersistSourcePlan`: constructing that plan entry requires
10467
- the source's SQL and content address, and a free-parameter or
10468
- given-referencing source cannot produce either, so a refused
10469
- source needs a wire shape that requires neither. Lets a host
10470
- distinguish "this package declares no persist source" (both maps
10471
- empty) from "every persist source was refused" (empty `sources`,
10472
- populated `refusedSources`) — silence otherwise reads as the
10473
- former.
10905
+ Map of sourceID ("sourceName@modelURL") to every valid
10906
+ materialization declaration the package makes that is not built
10907
+ here: a `#@ persist` or `#(materialize)` source, a persisted view
10908
+ or named query, or a rollup (`#(rollup)` or
10909
+ `#@ preaggregate`). Each is answered live while the rest of the
10910
+ package loads, and each carries its `reason`. An invalid
10911
+ declaration is never here: it fails the publish and the load. A
10912
+ SEPARATE collection rather than a field on `PersistSourcePlan`:
10913
+ constructing that plan entry requires the source's SQL and content
10914
+ address, and a refused declaration may produce neither. Lets a
10915
+ host distinguish "this package declares no materialization" (both
10916
+ maps empty) from "every declaration was refused" (empty `sources`,
10917
+ populated `refusedSources`), which silence otherwise reads as the
10918
+ former. A persisted view or query is keyed by the generated build
10919
+ source it would have had (`<source>__<view>__view@…` or
10920
+ `<query>__query@…`), a `#(materialize)` source by its own
10921
+ sourceID, and a rollup measure refused before its rollup is
10922
+ planned by the measure's path on its base, its grain and its
10923
+ destination (`<base>.<measure>[<grain>]@<model>.preaggregate.malloy`,
10924
+ `[<grain> in <destination>]` for a `storage=` one).
10474
10925
  additionalProperties:
10475
10926
  $ref: "#/components/schemas/RefusedSource"
10476
10927
  omittedSources:
@@ -10537,7 +10988,7 @@ components:
10537
10988
  value); `eligibility_check_failed` (an eligibility gate failed
10538
10989
  with an error rather than a refusal); `projection_failed` (the
10539
10990
  plan entry could not otherwise be computed);
10540
- `rollup_companion_failed` (the generated `#(preaggregate)` rollup
10991
+ `rollup_companion_failed` (the generated `#(rollup)` rollup
10541
10992
  companion, which also plans v1 `#@ preaggregate` rollups, did not
10542
10993
  plan or compile); `rollup_companion_blanking_failed` (that companion was
10543
10994
  not built because a `#@` line of the author's files could not be
@@ -10548,9 +10999,10 @@ components:
10548
10999
  copy of a model file without
10549
11000
  `##! experimental.persistence` did not compile, so none of its
10550
11001
  `#@ persist` sources were planned);
10551
- `persist_annotation_unparseable` (none of the source's `#@` lines
10552
- parse, so Malloy planned nothing for it; the package warning
10553
- names the line).
11002
+ `persist_annotation_unparseable` is retained and no longer
11003
+ produced: a `#@` line that does not parse is an invalid annotation
11004
+ (`persist-unparseable`), which fails the publish and the load, so
11005
+ no served plan carries it.
10554
11006
 
10555
11007
  OmittedFile:
10556
11008
  type: object
@@ -10579,22 +11031,41 @@ components:
10579
11031
  RefusedSource:
10580
11032
  type: object
10581
11033
  description: >-
10582
- One `#@ persist` source refused at compile time, and why. Computed
10583
- from the SAME tier-appropriate eligibility assert the build path
10584
- itself enforces (the colocated tier's post-relaxation admission for a
10585
- proven row-level, fully-attributed authorize gate applies here
10586
- too), so a source this reports as refused is refused for the tier it
10587
- would actually build under — never the unconditional
10588
- `storage=`-destination check applied to a source that declares no
10589
- `storage=`. A `preaggregate`-tier entry can coexist with an entry of
10590
- the same sourceID in `BuildPlan.sources` — the one tier where
10591
- refused-and-present-in-sources is the correct, intended state, unlike
10592
- `storage`/`colocated` where a refusal means absence from `sources`.
11034
+ One valid materialization declaration Publisher does not build here,
11035
+ and why: the one refusal record for every mechanism (`#@ persist`,
11036
+ `#(materialize)`, a persisted view or named query, and a rollup). It
11037
+ is answered live, and the package carries one `*-not-built` warning
11038
+ for it (`persist-not-built`, `materialize-not-built`,
11039
+ `persist-view-not-built`, `persist-query-not-built` or
11040
+ `rollup-not-built`) with this `message`. A `#@ persist`
11041
+ source's gate refusal is computed from the SAME tier-appropriate
11042
+ eligibility assert the build path itself enforces (the database
11043
+ tier's post-relaxation admission for a proven row-level,
11044
+ fully-attributed authorize gate applies here too), so a source this
11045
+ reports as refused is refused for the tier it would actually build
11046
+ under. A rollup's entry (`origin: rollup`) can coexist with an entry
11047
+ of the same sourceID in `BuildPlan.sources`: the one mechanism where
11048
+ refused-and-present-in-sources is the correct, intended state; for
11049
+ every other a refusal means absence from `sources`.
10593
11050
  required: [name, sourceID, tier, reason, message]
10594
11051
  properties:
11052
+ origin:
11053
+ type: string
11054
+ enum: [persist, materialize, view, query, rollup]
11055
+ description: >-
11056
+ The mechanism that declared it, as `PersistSourcePlan.origin` names
11057
+ it: `persist`, `materialize`, `view`, `query`, or `rollup`. Read
11058
+ this, not `tier`, to tell a rollup's refusal. Absent on a record a
11059
+ release before this one wrote, where `tier: preaggregate` marked a
11060
+ rollup.
10595
11061
  name:
10596
11062
  type: string
10597
- description: The source's declared name.
11063
+ description: >-
11064
+ The declaration's name: a source's declared name, a persisted
11065
+ view's or query's generated build source name
11066
+ (`<source>__<view>__view`, `<query>__query`), a planned rollup's
11067
+ generated name, or, for a rollup measure refused before its
11068
+ rollup is planned, `<base>.<measure>`.
10598
11069
  sourceID:
10599
11070
  type: string
10600
11071
  description: "sourceName@modelURL — matches this entry's map key."
@@ -10606,18 +11077,20 @@ components:
10606
11077
  model path could not be resolved.
10607
11078
  tier:
10608
11079
  type: string
10609
- enum: [storage, colocated, preaggregate]
10610
- description: >-
10611
- Which build path this source was evaluated against: `storage` for
10612
- a source declaring `#@ persist storage=<ref>` (evaluated against
10613
- the full storage-destination eligibility gate, which never
10614
- admits an authorize-gated source); `colocated` for a plain
10615
- `#@ persist` (evaluated against the colocated gate, which admits
10616
- a proven row-level, fully-attributed gate); `preaggregate` for a
10617
- `#@ preaggregate` rollup (evaluated against the pre-aggregation
10618
- gate, which refuses unconditionally when the rollup's base is
10619
- authorize-gated — rollups group away the gate column, so
10620
- there is no row-level admission the way colocated has).
11080
+ enum: [storage, database, preaggregate, colocated]
11081
+ description: >-
11082
+ Which build path this declaration was evaluated against: `storage`
11083
+ for one declaring `storage=<ref>` (a `#@ persist` source is
11084
+ evaluated against the full storage-destination eligibility gate,
11085
+ which never admits an authorize-gated source); `database` for one
11086
+ built in its own connection's database (a `#@ persist` source is
11087
+ evaluated against the database gate, which admits a proven
11088
+ row-level, fully-attributed gate). A rollup's is its own placement,
11089
+ as any other mechanism's. `preaggregate` is retained, no longer
11090
+ produced: releases before this one said it for a rollup, whatever
11091
+ its placement; read `origin` for the mechanism. `colocated` is
11092
+ retained, no longer produced: it is what releases before this one
11093
+ said for `database`, and a client should read it as `database`.
10621
11094
  reason:
10622
11095
  type: string
10623
11096
  enum:
@@ -10628,6 +11101,7 @@ components:
10628
11101
  dynamic_projection,
10629
11102
  dynamic_join,
10630
11103
  dynamic_joined_where,
11104
+ inherited_where_with_given,
10631
11105
  partition_without_storage,
10632
11106
  partition_column_unknown,
10633
11107
  partition_column_not_public,
@@ -10637,60 +11111,163 @@ components:
10637
11111
  not_duckdb_portable,
10638
11112
  public_surface_unknown,
10639
11113
  read_only_dialect,
11114
+ connection_cannot_hold_table,
11115
+ storage_source_unsupported,
10640
11116
  env_reference,
10641
11117
  rollup_name_collision,
11118
+ empty_storage,
11119
+ table_name_collision,
11120
+ current_time,
11121
+ reads_given,
11122
+ incremental_unsupported,
11123
+ materialization_off,
11124
+ multi_line_annotation,
11125
+ build_name_collision,
11126
+ run_target_unsupported,
11127
+ nested_result,
11128
+ inherited_persist,
11129
+ inline_unsupported,
11130
+ no_stored_columns,
11131
+ needs_qualified_name,
11132
+ generated_build_failed,
11133
+ hidden_field,
11134
+ access_filter,
11135
+ time_zone,
11136
+ unreadable_measure,
11137
+ join_not_in_grain,
11138
+ partial_name_collision,
11139
+ given_where_over_unstored_field,
11140
+ unreadable_grain,
10642
11141
  ]
10643
11142
  description: >-
10644
- The bounded refusal reason. Only the compile-time reasons can
10645
- appear here — `free_parameter`, `authorize`, the four
10646
- that name where a given the build could not strip sits
10647
- (`given_in_persisted_query`, `dynamic_projection`, `dynamic_join`,
10648
- `dynamic_joined_where`), the three that name an unusable
10649
- `partition=` (`partition_without_storage`,
10650
- `partition_column_unknown`, `partition_column_not_public`),
11143
+ The bounded refusal reason; `message` says the specifics.
11144
+
11145
+
11146
+ On every mechanism: `free_parameter`; a row-level gate the
11147
+ table could not keep, named by the gate's kind, `access_filter`
11148
+ for a row filter (`#(access_filter)`, any of the gates that
11149
+ refused it) and `authorize` for a lock (`#(authorize)`);
11150
+ `reads_given`, the one reason every mechanism gives
11151
+ for a stored result that would read a given, so its table would
11152
+ hold one caller's rows or could not be read per caller (a given in
11153
+ a `#@ persist` source's persisted query, in a field it declares, in
11154
+ a join's `on:` condition or in a source it joins that is not
11155
+ stored per caller; a persisted view or query whose result reads
11156
+ one; a rollup whose build reads one), with `message` naming where
11157
+ the given sits; `inherited_where_with_given` (a
11158
+ given-reading `where:` or dimension the declaration inherits from
11159
+ a source it is built from, in its own file or another, rather than
11160
+ writing it in its own declaration: only the declaration's own
11161
+ terms are re-applied over the stored table at read; move the
11162
+ `where:` onto the persisted source to serve it from a table);
11163
+ `given_where_over_unstored_field` (a given-reading `where:` of the
11164
+ declaration's own over a field its table does not store, so it
11165
+ cannot be re-applied over the table at read: a field the rollup's
11166
+ grain drops, which adding it to the grain fixes, or on
11167
+ `#(materialize)` a field that is not a stored dimension);
10651
11168
  `merge_key_scope_unresolved` (a `merge_key=` whose caller scope
10652
- cannot be expressed over the stored table's own columns),
10653
- `preaggregate_over_dynamic_source` (a rollup whose base is scoped by
10654
- a given, which has no read-time re-application to put the term back),
10655
- `read_only_dialect` (a colocated `#@ persist` on a source whose
10656
- dialect cannot create tables; SQL Server today, whose connection
10657
- reports `canPersist: false`), `env_reference` (a source with an
10658
- `@env.` reference on one of its `#@` lines, whose directives are all
10659
- ignored, so it serves live rather than build into the source
10660
- warehouse), and `rollup_name_collision` (a
10661
- pre-aggregation rollup whose generated name, and so its table, is
10662
- also another model's rollup with different content; neither builds
10663
- or serves, and each model answers from its base) — those being the
10664
- only reasons the two
10665
- compile-time eligibility asserts this collection is computed from
10666
- produce.
10667
-
10668
-
10669
- `given_in_persisted_query` is raised by BOTH gates, for one
10670
- condition: the BUILD would substitute a given's value, so the
10671
- artifact holds one caller's slice. On colocated that is a build that
10672
- runs and lies; on a storage destination the same placement also
10673
- leaves nothing for the read to re-apply. A given in the source's
10674
- extend block is neither — it is left out of the build and applied
10675
- per caller at read — and is admitted on both tiers.
10676
-
10677
-
10678
- `given` is retained for records that already carry it and is no
10679
- longer produced. It was the storage tier's blanket refusal of any
10680
- given reference, and the positional reasons above replaced it: where
10681
- a given sits decides the outcome, so a single reason covering every
10682
- placement can no longer be raised. `not_duckdb_portable` is decided against the
10683
- post-build captured schema, which does not exist at compile time,
10684
- and `public_surface_unknown` is raised by the build-time narrowing
10685
- of a stored table to the source's public columns; both are listed
10686
- only because they share the enum the runtime eligibility metric
10687
- uses.
11169
+ cannot be expressed over the stored table's own columns);
11170
+ `connection_cannot_hold_table` (a database build on a connection
11171
+ that cannot create tables; SQL Server today, whose connection
11172
+ reports `canPersist: false`: the same words as the serve verdict's
11173
+ reason for the same case); `needs_qualified_name` (a database table on
11174
+ BigQuery, where a table needs a dataset, whose `name=` names none:
11175
+ a `#@ persist` source, a persisted view or query, a
11176
+ `#(materialize)` source, or a rollup whose own `name=` and base's
11177
+ give no container; refused at plan, before any warehouse work);
11178
+ `storage_source_unsupported` (`storage=` on a
11179
+ source whose connection the build cannot pass through to a
11180
+ destination, e.g. the package's DuckDB sandbox);
11181
+ `table_name_collision` (under `PERSIST_COLLISION_ENFORCE=false`, a
11182
+ declaration whose `name=` puts it on one table with another, so
11183
+ neither is built; by default such a package does not load; a run
11184
+ also records it in its `metadata.refusedSources` for a source
11185
+ whose readable table name another source's table already takes in
11186
+ that run); `current_time` (the build reads the current time, `now`,
11187
+ or keeps rows older than a moving cut-off it cannot leave out, so
11188
+ its table would hold the rows as of the build; `now` in the
11189
+ source's own extend block is applied at every read and is
11190
+ admitted); `incremental_unsupported` (a valid incremental
11191
+ declaration this deployment's dialect or destination cannot
11192
+ honour).
11193
+
11194
+
11195
+ A persisted view or named query: `materialization_off` (persisted
11196
+ named queries are built only with `PUBLISHER_MATERIALIZE` on),
11197
+ `multi_line_annotation` (its `#@` line spans more than one line),
11198
+ `build_name_collision` (its generated build source's name is one
11199
+ the model, or another persisted view, already takes),
11200
+ `run_target_unsupported` (its source is declared in another file,
11201
+ is not in the model's namespace, or cannot be read),
11202
+ `nested_result` (a result that nests, which its table cannot
11203
+ answer yet), `access_filter` or `authorize` (it reaches a
11204
+ row-level gate its stored result cannot keep, named by the gate's
11205
+ kind), `reads_given` (its result reads a given),
11206
+ `current_time` (its result reads `now`), `no_stored_columns` (it has no stage to store) and
11207
+ `generated_build_failed` (its build does not compile on its own).
11208
+
11209
+
11210
+ A `#(materialize)` source: `inherited_persist` (it inherits
11211
+ `#@ persist`, so it is already its base's table),
11212
+ `inline_unsupported` (an `inline=` join or pair-table layout the
11213
+ build cannot store), `no_stored_columns` (the source has no
11214
+ dimension to store), `needs_qualified_name` (as above),
11215
+ `time_zone` (the source sets its own time zone, which its stored
11216
+ columns cannot follow at read), and
11217
+ `generated_build_failed` (Publisher could not write or compile its
11218
+ generated build, a Publisher bug worth reporting).
11219
+
11220
+
11221
+ A rollup (`#(rollup)` or `#@ preaggregate`): `hidden_field`
11222
+ (a measure or grain dimension the published surface hides, which a
11223
+ rollup would publish), `access_filter` or `authorize` (a
11224
+ row-level gate a rollup cannot re-apply to its rows, named by the
11225
+ gate's kind as on every mechanism), `time_zone` (the source sets its own
11226
+ time zone, so no query reads the rollup), `unreadable_measure` (a
11227
+ measure definition outside what a rollup reads),
11228
+ `join_not_in_grain` (a measure that aggregates through a join its
11229
+ grain does not key, or through a fan-out join),
11230
+ `partial_name_collision` (a field already takes the name of the
11231
+ measure's stored partial), and `unreadable_grain` (a `storage=` rollup
11232
+ over a DuckDB source whose grain dimension is stored as a type no
11233
+ stored read declares, a BLOB, INTERVAL, MAP or JSON, so no query
11234
+ would read its table; database, it is built).
11235
+
11236
+
11237
+ Retained, no longer produced: `given` (replaced by the positional
11238
+ given reasons above), `given_in_persisted_query` (shipped in
11239
+ 0.14.0: a `#@ persist` source's persisted query, or a
11240
+ `#(materialize)` source, whose build reads a given; now
11241
+ `reads_given`, the one name every mechanism gives the case),
11242
+ `preaggregate_over_dynamic_source` (shipped in 0.14.0: a rollup
11243
+ over a caller-scoped source, now `reads_given`,
11244
+ `given_where_over_unstored_field` or `inherited_where_with_given`,
11245
+ as every mechanism names the same case), `dynamic_projection`,
11246
+ `dynamic_join` and `dynamic_joined_where` (a `storage=`
11247
+ `#@ persist` source's given in a field it declares, in a join's
11248
+ `on:` condition, or in a source it joins; now `reads_given`,
11249
+ whose `message` still names the position), `not_duckdb_portable` (a `storage=` table no
11250
+ column of which Malloy can type is now built, and its source is
11251
+ answered live), the three `partition_*` reasons (`partition=` is a
11252
+ retired key, which fails the publish and the load as
11253
+ `persist-retired-key` or `materialize-retired-key`), `env_reference`
11254
+ and `empty_storage` (invalid annotations, which fail the publish
11255
+ and the load, so no served package reports them; the plan keeps
11256
+ refusing such a source as a backstop, so a plan computed without
11257
+ the load's check can still carry one), and `rollup_name_collision` (a rollup's generated
11258
+ name digests its declaring source, so no two rollups share one).
11259
+ `read_only_dialect` (shipped in 0.14.0: now
11260
+ `connection_cannot_hold_table`).
11261
+ `public_surface_unknown` is raised by the build-time narrowing of a
11262
+ stored table to the source's public columns, never by a plan; it
11263
+ shares the enum with the eligibility metric.
10688
11264
  message:
10689
11265
  type: string
10690
11266
  description: >-
10691
- The full, human-readable refusal message the eligibility assert
10692
- produced — the same text a build attempting this source would 422
10693
- with.
11267
+ The full, human-readable refusal message, the text of the
11268
+ declaration's `*-not-built` warning. For a `#@ persist` gate
11269
+ refusal it is the same text a build attempting the source would
11270
+ 422 with.
10694
11271
 
10695
11272
  BuildGraph:
10696
11273
  type: object
@@ -10732,8 +11309,8 @@ components:
10732
11309
  description: >-
10733
11310
  One `where:` conjunct a storage build leaves out of the artifact and the
10734
11311
  read puts back. Its `code` is the author's verbatim expression, which is
10735
- what a serve shape re-emits; `givens` are the names that expression reads,
10736
- which is what the shape must declare for it to compile.
11312
+ what the served copy re-emits; `givens` are the names that expression
11313
+ reads, which the served copy must declare for it to compile.
10737
11314
  properties:
10738
11315
  code:
10739
11316
  type: string
@@ -10784,15 +11361,22 @@ components:
10784
11361
  type: string
10785
11362
  origin:
10786
11363
  type: string
10787
- enum: [persist, preaggregate]
11364
+ enum: [persist, materialize, view, query, rollup, preaggregate]
10788
11365
  default: persist
10789
11366
  description: >-
10790
11367
  Which authoring annotation produced this plan entry. `persist` — the
10791
- modeler wrote `#@ persist` on the source; every entry on a deployment
10792
- that uses no pre-aggregation, and the meaning of an absent value.
10793
- `preaggregate` — the modeler wrote `#@ preaggregate` on measures of
11368
+ modeler wrote `#@ persist` on the source, and the meaning of an
11369
+ absent value. `materialize` — `#(materialize)` on the source.
11370
+ `view` and `query` — `#@ persist` on a view or a named `query:`,
11371
+ whose generated build source this entry is. `rollup` — the
11372
+ modeler wrote `#(rollup)` (or its deprecated alias
11373
+ `#(preaggregate)`) or v1's `#@ preaggregate` on measures of
10794
11374
  `preaggregate.baseSourceName`, and the publisher SYNTHESIZED this
10795
- rollup source to serve them.
11375
+ rollup source to serve them. Releases before this one said
11376
+ `persist` for every entry that was not a rollup, and
11377
+ `preaggregate` for a rollup: `preaggregate` is retained, no longer
11378
+ produced. A client must accept a value it does not know as an
11379
+ entry that is not a rollup.
10796
11380
 
10797
11381
 
10798
11382
  Note that BOTH kinds carry a `#@ persist` annotation by the time they
@@ -10814,7 +11398,7 @@ components:
10814
11398
  description: >-
10815
11399
  What the synthesized rollup covers: the base source it was derived
10816
11400
  from, the one grain it is built at, and the measures served there.
10817
- Present only when `origin` is `preaggregate`; null otherwise.
11401
+ Present only when `origin` is `rollup`; null otherwise.
10818
11402
 
10819
11403
 
10820
11404
  Coverage is complete by construction — a measure that cannot be
@@ -10837,26 +11421,15 @@ components:
10837
11421
  rewrites).
10838
11422
  partition:
10839
11423
  type: array
11424
+ deprecated: true
10840
11425
  items:
10841
11426
  type: string
10842
11427
  description: >-
10843
- The source's declared `#@ persist partition=` columns, resolved
10844
- against its public projection and reported in the author's order,
10845
- which is the order the stored table's directories nest in. Absent or
10846
- empty means the table is written unpartitioned, which is the default
10847
- and what every source built before this field existed means.
10848
-
10849
-
10850
- A layout, not an access control. Every term the build strips from a
10851
- source is re-applied when the artifact is read whether or not its
10852
- column is partitioned, so a list omitting the column a caller is
10853
- scoped by costs a full scan and never widens what that caller sees.
10854
- Consumers should not infer isolation from it.
10855
-
10856
-
10857
- `partition=` requires `storage=`; declared without one it is a
10858
- publish refusal rather than an ignored key, so this is empty for
10859
- every colocated source.
11428
+ Retired and no longer produced: always absent. It reported a
11429
+ source's `#@ persist partition=` columns; `partition=` is now a
11430
+ retired key, refused at publish, and every stored table is written
11431
+ unpartitioned. Kept so generated clients that read it still
11432
+ compile.
10860
11433
  strippedTerms:
10861
11434
  type: array
10862
11435
  items:
@@ -10919,12 +11492,16 @@ components:
10919
11492
  declaring either on a source is a publish-time manifest error.)
10920
11493
 
10921
11494
 
10922
- A synthesized rollup (`origin: preaggregate`) declares nothing of its
10923
- own and gets no freshness policy of its own: it INHERITS its base's,
10924
- so what is reported here is the base source's effective objective
10925
- resolved by the rule above. A rollup and its base therefore go stale
10926
- together, which is what makes "serve the base when the rollup is
10927
- stale" a safe degradation rather than a change of answer.
11495
+ A synthesized rollup (`origin: rollup`) resolves the same way,
11496
+ with its source level being its own `freshness.window=` /
11497
+ `freshness.fallback=` (on `#(rollup)` or `#@ preaggregate`),
11498
+ field by field over its base's own source-level declaration. A
11499
+ rollup that declares nothing therefore goes stale with its base,
11500
+ and a stale rollup is answered from the base, the same answer.
11501
+
11502
+ A standalone run stamps this resolution on the manifest entries it
11503
+ commits (`freshnessWindowSeconds`, `freshnessFallback`, `dataAsOf`),
11504
+ as a control plane does on the manifest it distributes.
10928
11505
  queryMetadata:
10929
11506
  oneOf:
10930
11507
  - $ref: "#/components/schemas/QueryMetadata"
@@ -10960,14 +11537,15 @@ components:
10960
11537
  type: string
10961
11538
  description: >-
10962
11539
  All key=value fields of the source's `#@ persist` annotation (e.g.
10963
- `name`, `realization`). The control plane uses `name` as the
11540
+ `name`, `storage`). The control plane uses `name` as the
10964
11541
  materialized table name (it may carry a dialect container path like
10965
- `dataset.table`). Returned as the full set so new persist directives
10966
- need no publisher change; an unrecognized key rides through here and
10967
- is reported as a package warning, never a rejection.
11542
+ `dataset.table`). The key set is closed: an unrecognized or retired
11543
+ key fails the publish and the load (`persist-unknown-key`,
11544
+ `persist-retired-key`), so a served plan carries only recognized
11545
+ keys.
10968
11546
 
10969
11547
 
10970
- Recognized keys beyond `name`/`realization`/`storage`, both read from
11548
+ Recognized keys beyond `name`/`storage`, both read from
10971
11549
  the EFFECTIVE merged tag (a source extending a persisted parent
10972
11550
  inherits the parent's keys, and its own keys merge over them per key):
10973
11551
 
@@ -10991,7 +11569,7 @@ components:
10991
11569
  existing source must not re-address its table.
10992
11570
 
10993
11571
 
10994
- For a synthesized rollup (`origin: preaggregate`) the annotation was
11572
+ For a synthesized rollup (`origin: rollup`) the annotation was
10995
11573
  generated by the publisher rather than authored, so this reports what
10996
11574
  synthesis emitted. It is still the annotation that governs the build,
10997
11575
  which is why it is reported the same way: a rollup is an ordinary
@@ -11006,7 +11584,7 @@ components:
11006
11584
  the source back to its model.
11007
11585
 
11008
11586
 
11009
- A synthesized rollup (`origin: preaggregate`) is declared by no model,
11587
+ A synthesized rollup (`origin: rollup`) is declared by no model,
11010
11588
  so this is the model of its base — the file holding the
11011
11589
  `#@ preaggregate` annotations it was synthesized from, which is where
11012
11590
  an author would go to change it.
@@ -11128,7 +11706,9 @@ components:
11128
11706
  Realization:
11129
11707
  type: string
11130
11708
  enum: [SNAPSHOT, COPY]
11131
- description: SNAPSHOT = warehouse clone/snapshot; COPY = CREATE TABLE AS SELECT.
11709
+ description: >-
11710
+ COPY = CREATE TABLE AS SELECT, the only realization built. SNAPSHOT
11711
+ (a warehouse clone or snapshot) is refused.
11132
11712
 
11133
11713
  BuildInstructions:
11134
11714
  type: object
@@ -11240,12 +11820,11 @@ components:
11240
11820
  declared now (a source that moved to or from `storage=` keeps its
11241
11821
  content address): a stored upstream is stacked on in its
11242
11822
  destination, and never rendered into warehouse SQL. Optional and
11243
- additive: a reference without it still serves a colocated upstream.
11823
+ additive: a reference without it still serves a database upstream.
11244
11824
 
11245
11825
  BuildInstruction:
11246
11826
  type: object
11247
- required:
11248
- [sourceEntityId, materializedTableId, physicalTableName, realization]
11827
+ required: [sourceEntityId, materializedTableId, physicalTableName]
11249
11828
  properties:
11250
11829
  sourceEntityId:
11251
11830
  type: string
@@ -11271,7 +11850,11 @@ components:
11271
11850
  hyphenated BigQuery project id, a container path) are valid, and
11272
11851
  echoes this logical name back in the manifest.
11273
11852
  realization:
11274
- $ref: "#/components/schemas/Realization"
11853
+ allOf:
11854
+ - $ref: "#/components/schemas/Realization"
11855
+ description: >-
11856
+ Optional; absent means `COPY`, the only realization built.
11857
+ `SNAPSHOT` is refused.
11275
11858
  destination:
11276
11859
  type: string
11277
11860
  description: >-
@@ -11279,7 +11862,7 @@ components:
11279
11862
  `storage=` authoring axis) — an entry in the environment's
11280
11863
  `storageDestinations`, which is a disjoint set from `connections`.
11281
11864
  Absent means build into the persist source's own warehouse — the
11282
- default, unchanged (colocated) path. When present, the build runs
11865
+ default, unchanged (database) path. When present, the build runs
11283
11866
  a native per-engine query-passthrough CTAS on a build-scoped session
11284
11867
  for that destination (the source computes; only results cross), and
11285
11868
  the manifest records the destination + captured schema so
@@ -11355,7 +11938,7 @@ components:
11355
11938
  physical name and its content address when `storage=` is added or
11356
11939
  removed (an annotation enters neither), so without this field a
11357
11940
  boundary measured on the stored table is indistinguishable from one
11358
- measured on a colocated table of the same name — and a delta computed
11941
+ measured on a database table of the same name — and a delta computed
11359
11942
  from the wrong one can skip rows.
11360
11943
 
11361
11944
  A caller that has never recorded this field may omit it. An entry that
@@ -11430,7 +12013,9 @@ components:
11430
12013
  some of its sources still returns the ones that succeeded in
11431
12014
  `entries`, so this is how a consumer tells a partial failure from a
11432
12015
  clean run and learns which source failed. Empty or absent on a run
11433
- where every source built.
12016
+ where every source built. Present on a FAILED run too, when every
12017
+ source it was asked to build failed or was refused: there it names
12018
+ each of them, and `entries` is empty.
11434
12019
  strict:
11435
12020
  type: boolean
11436
12021
  description: Whether unresolved references should error.
@@ -11477,7 +12062,7 @@ components:
11477
12062
  The persist source's own connection (the source warehouse),
11478
12063
  mirroring `ManifestEntry.connectionName`. Without this a failure-only
11479
12064
  source carries no destination discriminator at all, so a consumer
11480
- cannot tell a colocated failure from a `storage=` one and, lacking
12065
+ cannot tell a database failure from a `storage=` one and, lacking
11481
12066
  `storageDestinationName`, would resolve a destination-scoped claim
11482
12067
  against the wrong key.
11483
12068
  storageDestinationName:
@@ -11485,10 +12070,24 @@ components:
11485
12070
  description: >-
11486
12071
  When the source was instructed to build into a `storage=`
11487
12072
  destination, the destination name, mirroring
11488
- `ManifestEntry.storageDestinationName`. Absent for a colocated
12073
+ `ManifestEntry.storageDestinationName`. Absent for a database
11489
12074
  failure. A consumer computes the same destination key a successful
11490
12075
  build would (`storageDestinationName ?? connectionName`) whether the
11491
12076
  source built or failed.
12077
+ refusalReason:
12078
+ type: string
12079
+ description: >-
12080
+ With `refused`: the refusal's bounded reason, from the same open set
12081
+ as `RefusedSource.reason`, so a client branches on it rather than on
12082
+ `reason`'s prose. Absent otherwise.
12083
+ code:
12084
+ type: string
12085
+ description: >-
12086
+ A bounded code for a failure a client may branch on, beside
12087
+ `reason`'s prose: `table-owned-elsewhere` (the build's `name=` is
12088
+ held by a table this package does not own) or
12089
+ `table-ownership-unverified` (who holds it could not be read). An
12090
+ open set; absent for a failure that has none.
11492
12091
  refused:
11493
12092
  type: boolean
11494
12093
  description: >-
@@ -11576,13 +12175,21 @@ components:
11576
12175
  treat a miss as a corrupt manifest.
11577
12176
  origin:
11578
12177
  type: string
11579
- enum: [persist, preaggregate]
12178
+ enum: [persist, materialize, view, query, rollup, preaggregate]
11580
12179
  default: persist
11581
12180
  description: >-
11582
12181
  Mirrors `PersistSourcePlan.origin` for the source this entry was built
11583
12182
  from: `persist` for a source the modeler wrote `#@ persist` on, which
11584
- is the meaning of an absent value, and `preaggregate` for a rollup
11585
- synthesized from `#@ preaggregate` measures. Repeated here because a
12183
+ is the meaning of an absent value, and `rollup` for a rollup
12184
+ synthesized from `#(rollup)` or `#@ preaggregate` measures.
12185
+ `preaggregate`, what releases before this one wrote for a rollup, is
12186
+ retained, no longer produced, and still read as a rollup, since a
12187
+ host echoes the entries it stored. The
12188
+ plan's other values (`materialize`, `view`, `query`) are accepted;
12189
+ `persist` or an absent value stays valid for every entry that is not
12190
+ a rollup, since a host echoes the entries it stored, and Publisher
12191
+ reads only whether an entry is a rollup, taking the mechanism from
12192
+ its own plan. Repeated here because a
11586
12193
  manifest travels without its build plan, and a consumer holding only
11587
12194
  the manifest otherwise cannot tell why it holds a table for a source
11588
12195
  that does not appear in the package.
@@ -11625,7 +12232,7 @@ components:
11625
12232
  nativeSchema:
11626
12233
  type: array
11627
12234
  description: >-
11628
- For a colocated entry (no `storageDestinationName`): each column of
12235
+ For a database entry (no `storageDestinationName`): each column of
11629
12236
  the built table with its type as the warehouse's own catalog names it
11630
12237
  (`bigint`, `numeric`, `NUMBER(38,0)`, `UHUGEINT`), captured after the
11631
12238
  build. The served copy reads a big-integer column through a cast to
@@ -11636,7 +12243,9 @@ components:
11636
12243
  items:
11637
12244
  $ref: "#/components/schemas/Column"
11638
12245
  realization:
11639
- $ref: "#/components/schemas/Realization"
12246
+ allOf:
12247
+ - $ref: "#/components/schemas/Realization"
12248
+ description: Retained; always `COPY`.
11640
12249
  rowCount:
11641
12250
  type: ["integer", "null"]
11642
12251
  buildDurationMs:
@@ -11668,7 +12277,7 @@ components:
11668
12277
 
11669
12278
  **Null is not zero**, and which paths report a figure differs.
11670
12279
 
11671
- A COLOCATED build reports one, taken from the Malloy connection's own
12280
+ A DATABASE build reports one, taken from the Malloy connection's own
11672
12281
  statistics.
11673
12282
 
11674
12283
  A plain `storage=` build reports one when its warehouse read carried
@@ -11681,7 +12290,7 @@ components:
11681
12290
  reach its own job records also reports null; that case is counted by
11682
12291
  `publisher_storage_build_attribution_skipped_total`.
11683
12292
 
11684
- A COLOCATED incremental delta reports null because its statements do
12293
+ A DATABASE incremental delta reports null because its statements do
11685
12294
  not run through a single call whose result reaches here. A delta
11686
12295
  into a `storage=` destination reports whatever its own bounded read
11687
12296
  reported: that read is issued through the same call a full build's
@@ -11710,7 +12319,7 @@ components:
11710
12319
  at least one persisted upstream was recomputed from its definition
11711
12320
  and inlined into this build, because its table could not be read --
11712
12321
  on either tier, an upstream this build neither materialized nor was
11713
- handed by reference; for a colocated build, an upstream that
12322
+ handed by reference; for a database build, an upstream that
11714
12323
  landed in a `storage=` destination; for a `storage=` build, a
11715
12324
  source that reaches the warehouse through a non-persisted source,
11716
12325
  or whose shape does not compile in the destination.