@malloy-publisher/skills 0.1.67 → 0.2.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 (46) hide show
  1. package/CHANGELOG.md +385 -128
  2. package/package.json +62 -61
  3. package/skills/eval-answer/SKILL.md +1 -1
  4. package/skills/eval-diagnose/SKILL.md +1 -1
  5. package/skills/eval-import/SKILL.md +1 -1
  6. package/skills/eval-improve/SKILL.md +1 -1
  7. package/skills/eval-judge/SKILL.md +1 -1
  8. package/skills/eval-loop/SKILL.md +1 -1
  9. package/skills/eval-report/SKILL.md +1 -1
  10. package/skills/malloy-analysis/SKILL.md +1 -1
  11. package/skills/malloy-analysis-report/SKILL.md +1 -1
  12. package/skills/malloy-charts/SKILL.md +1 -1
  13. package/skills/malloy-classify/SKILL.md +1 -1
  14. package/skills/malloy-compliance-review/SKILL.md +1 -1
  15. package/skills/malloy-dashboards/SKILL.md +1 -1
  16. package/skills/malloy-define/SKILL.md +1 -1
  17. package/skills/malloy-define-workflow/SKILL.md +1 -1
  18. package/skills/malloy-discover/SKILL.md +1 -1
  19. package/skills/malloy-document/SKILL.md +1 -1
  20. package/skills/malloy-excel-review/SKILL.md +1 -1
  21. package/skills/malloy-getting-started/SKILL.md +1 -1
  22. package/skills/malloy-gotchas-modeling/SKILL.md +1 -1
  23. package/skills/malloy-html-data-apps/SKILL.md +2 -2
  24. package/skills/malloy-lookml-review/SKILL.md +1 -1
  25. package/skills/malloy-materialization/SKILL.md +17 -18
  26. package/skills/malloy-materialization/reference/access-filter.md +3 -3
  27. package/skills/malloy-materialization/reference/annotation.md +6 -7
  28. package/skills/malloy-materialization/reference/chaining.md +10 -30
  29. package/skills/malloy-materialization/reference/estimating.md +2 -2
  30. package/skills/malloy-materialization/reference/refresh.md +4 -4
  31. package/skills/malloy-materialization/reference/serving.md +61 -0
  32. package/skills/malloy-materialization/reference/tuning.md +5 -6
  33. package/skills/malloy-materialization/reference/why-live.md +8 -8
  34. package/skills/malloy-model/SKILL.md +2 -2
  35. package/skills/malloy-model-as-you-go/SKILL.md +1 -1
  36. package/skills/malloy-modeling/SKILL.md +1 -1
  37. package/skills/malloy-notebooks/SKILL.md +1 -1
  38. package/skills/malloy-phrase-detection/SKILL.md +1 -1
  39. package/skills/malloy-powerbi-review/SKILL.md +1 -1
  40. package/skills/malloy-publish/SKILL.md +1 -1
  41. package/skills/malloy-queries/SKILL.md +1 -1
  42. package/skills/malloy-reports/SKILL.md +1 -1
  43. package/skills/malloy-review/SKILL.md +1 -1
  44. package/skills/malloy-run-workflow/SKILL.md +1 -1
  45. package/skills/malloy-source-unreachable/SKILL.md +1 -1
  46. package/skills/malloy-materialization/reference/storage.md +0 -85
package/CHANGELOG.md CHANGED
@@ -1,231 +1,488 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.67 — 2026-12-04
3
+ ## 0.2.0 — 2026-12-06
4
+
5
+ Also released: `@malloy-publisher/skills` 0.2.0, `@malloy-publisher/create-malloy-package` 0.0.86.
6
+
7
+ ### Breaking changes
8
+
9
+ #### A `storage=` declaration is now read as an extract, never answered live
10
+
11
+ `#(materialize) storage=` and `#@ persist storage=` are retired. At load, each one is rewritten into
12
+ an extract of its source, view or named query, in the managed DuckLake connection over the
13
+ destination's catalog. That source, view or query is then answered only from the extract's copy.
14
+ The rewrite is never written to disk. Each rewritten declaration raises a `storage-rewritten`
15
+ package warning naming its extract (`<connection>.<file>__<target>__<4 hex>`, or `name=`'s leaf).
16
+ The warning also names what the rewrite inferred: `compare="exact"` on columns that compare
17
+ case-insensitively at the origin, a cast on a numeric with no fixed scale, and the connection's
18
+ project for a BigQuery table that names none. It names what was not applied as well:
19
+ `freshness.fallback`, `queryMetadata`, and `#@ -persist` on a reader. A `#(rollup) storage=` over a
20
+ source that is not rewritten drops `storage=` and becomes a database rollup. A rollup over a
21
+ rewritten source is refused on its own.
22
+
23
+ Whether a source converts is the compiler's answer: one whose root, through aliases, `extend`,
24
+ `include` and imports, is a query or a `.sql()` read is copied as a query over the name it starts
25
+ from (`source: b is a extend { … }` reads as `b is a -> { select: * } extend { … }`). When that
26
+ name is itself a rewritten source, the extract reads its copy, as a chained extract. A copy holds
27
+ only `a`'s columns, so when `a` defines anything else, `b` fails to load (below).
28
+
29
+ **What to do before upgrading.**
30
+
31
+ - Add a managed DuckLake connection (`"managed": true`) over the catalog of each storage destination
32
+ a `storage=` names. Otherwise the package fails to load with
33
+ `[extract-destination-unconfigured] <dest> has no managed DuckLake connection over its catalog: add one`.
34
+ - Build each extract once. An extract cannot adopt a `storage=` table, so every rewritten
35
+ declaration answers 409 `EXTRACT_AWAITING_BUILD` until its first generation binds. A host builds it once
36
+ it plans the release; a standalone server's first run builds it.
37
+ - Some declarations fail the whole package's load, one `<file>:<line>: [<code>] <message>` line
38
+ each, until you edit the source or drop `storage=`:
39
+ - a declaration the rewrite cannot convert: `inline=`, a nested result (a `nest:`) in its
40
+ output, a source whose own connection is a managed database (drop `storage=`: it builds in that
41
+ connection itself), or a source rooted on a table (`conn.table('x')`, directly or under other
42
+ sources): `[extract-not-query] <q>'s storage="<dest>" is retired, and <q> is not a query: write
43
+ it as a query, e.g. source: <name> is <connection>.table('x') -> { select: * } extend { … }, or
44
+ drop storage=`;
45
+ - a source built on another (`b is a extend { … }`, `a include { … }`, or a bare `b is a`) whose
46
+ head `a` defines anything a copy of its rows cannot carry: a measure, a view, a join, a
47
+ dimension read through a join, a `primary_key`, a `timezone:`, an internal or private field, a
48
+ classified field, or a `#(classification)` or `#(carries)` on `a`. These sources fail to load
49
+ until rewritten, even when `b` reads none of it, and an `include` that leaves such a field out
50
+ fails the same way:
51
+ `[extract-not-query] <q>'s storage="<dest>" is retired, and <q> builds on <head>, whose
52
+ measures (…) a copy of its rows cannot carry: write <q> as a query that selects the columns it
53
+ needs, then extend it, or drop storage=`;
54
+ - a declaring file that does not compile as written (the rewrite never decides from the text);
55
+ when what failed is a read at the origin, the declaration keeps serving a generation already
56
+ bound at its address; without one, an origin that cannot be reached refuses that extract
57
+ alone (`extract-origin-unreachable`, readers answer 409) and one that answers without a table
58
+ the file reads fails the load (`extract-origin-incompatible`, a new finding code). A bound
59
+ generation is held only while the text it was decided from, notes included, is unchanged,
60
+ which its build records in its snapshot tag; a generation built before this release records
61
+ none, and is refused while its origin cannot be read until it is rebuilt;
62
+ - two `storage=` declarations on one definition, or one note over a statement of several;
63
+ - a copied query that reads a given or a gated source;
64
+ - an access gate, or a `where:`, that reads a column inferred to compare exactly, through any
65
+ dimension, rename or join, on the source itself or on any source or query that reads it;
66
+ - a target whose query reads a field with a class, by lineage (renamed, computed or joined),
67
+ which its copy cannot carry;
68
+ - a column no stored type holds;
69
+ - an origin that cannot be described, unless a generation is already bound.
70
+
71
+ - A generated extract is described at its origin at load. On an origin with no describer yet (any
72
+ connection but Postgres, BigQuery, DuckDB and a `publisher` proxy), the package fails to load
73
+ with `extract-origin-unsupported`; drop `storage=` there until that origin is supported.
74
+ - When more than one managed DuckLake connection, or more than one storage destination, is over a
75
+ destination's catalog, name the managed connection after the destination, or the load fails
76
+ naming the candidates.
77
+
78
+ See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md#rewritten-storage-declarations).
79
+
80
+ ([#2272](https://github.com/malloydata/publisher/pull/2272) by @kylenesbit)
81
+
82
+ #### The storage tier is removed: a stored table builds only in its source's own connection
83
+
84
+ Publisher no longer builds or serves a table in a storage destination, except an extract's. A
85
+ `storage=` declaration is rewritten into an extract (see the entry above), and every other stored
86
+ table (`#@ persist`, `#(materialize)`, a rollup, a persisted view or named query) is built in its
87
+ source's own connection and served from there. A storage destination now holds only extracts, and
88
+ backs managed DuckLake catalogs.
89
+
90
+ **What breaks, and what a host must change.**
91
+
92
+ - **`BuildInstruction.destination` on a stored table is refused.** A build instruction that names
93
+ `destination` for a source that is not an extract answers 400 `BUILD_INSTRUCTIONS_INVALID`, and
94
+ its message names `BuildInstruction.destination`. Omit `destination`: the source builds in its own
95
+ connection. An extract's instruction still names the storage destination over its target
96
+ catalog, as before.
97
+ - **A persist source on a managed database is a database build.** A host that sent
98
+ `destination=<the managed database>` for a `#@ persist` or `#(materialize)` source whose own
99
+ connection is that managed database (a same-catalog build into its `materialized` schema) must
100
+ now send no `destination`. The table is built in the source's own connection, at the name the
101
+ plan gives it, like any database table.
102
+ - **`LedgerEntry.storageDestinationName` and `ManifestReference.storageDestinationName` are
103
+ refused**, each with a 400 naming the field, and `ManifestReference.schema` is gone. Omit them.
104
+ - **A manifest entry for a stored table that names a storage destination is not bound.** Such an
105
+ entry, written by an earlier release's storage build, serves nothing: its source answers live
106
+ until the host builds it in its own connection and binds the new entry. Extract entries are bound
107
+ as before.
108
+ - **The `DELETE …/storageDestinations/{destinationName}/schemas/{schemaName}/tables/{tableName}`
109
+ route (`delete-storage-destination-table`) is removed.** Drop a destination's table through the
110
+ admin API (`DELETE /catalogs/{catalog}/schemas/{schema}/tables/{table}`), or an extract
111
+ generation through `drop-storage-materialized-table`.
112
+ - **Wire values removed:** the `storage` tier (on `RefusedSource.tier`, `MaterializationItem.tier`,
113
+ the `/status` digest and the path report's server), `Package.storageServeBindings` and
114
+ `PackageServingState.storageServeBindings` (and the `StorageServeBinding` schema), and
115
+ `PersistSourcePlan.joinedTerms` (only a `storage=` table read it; a join to a given-scoped source
116
+ is still served from the database table, with the joined source's givens applied per caller at
117
+ read, as live applies them).
118
+ An extract's refusal reports `RefusedSource.tier` `extract`.
119
+ - **In the v1 API, `PersistedSource.destinationName` is removed**, with the `storage` value of the
120
+ tier enums (the served answer's tier and `RefusedSource.tier`). A persisted source builds in its
121
+ own connection, so there is no destination to report. `TableAddress.destinationName` stays, and
122
+ now names only an extract's table.
123
+ - **Refusal reason `storage_source_unsupported` is renamed `managed_author_sql`.** It is the reason
124
+ a source on a `managed` DuckLake connection that carries author SQL (an `.sql()` source, a `sql_*`
125
+ expression, or a file or URL read as a table) is refused, on `RefusedSource.reason` and the
126
+ `publisher_materialization_eligibility_refused_total` metric's `reason` label. A client that
127
+ switches on the old value should switch on the new one; which sources are refused is unchanged.
128
+ - **The `PUBLISHER_PERSIST_ADDRESS_INCLUDES_DESTINATION` setting** (`persist.addressIncludesDestination`)
129
+ is retired: it is ignored, with a startup warning.
130
+
131
+ **Behaviour that changes with it.**
132
+
133
+ - **Incremental refresh on DuckDB.** An incremental `#@ persist` or `#(materialize)` source on a
134
+ DuckDB connection is built and served in that connection, a full build then deltas, with
135
+ `merge_key=`, `lookback=`, late-row checks and `--reseed` as on Postgres. It was refused at plan
136
+ as `incremental_unsupported`.
137
+ - **An incremental pair table rebuilds in full.** A pair table (`inline=` on a join_many) has no
138
+ incremental delta in a database table: its `refresh="incremental"` is accepted, the table is
139
+ rebuilt in full on each refresh and served, and `materialize-pair-full-refresh` says so.
140
+
141
+ Tables an earlier release built in a storage destination are not dropped by Publisher. Reclaim them
142
+ through the admin API once nothing binds them.
4
143
 
5
- Also released: `@malloy-publisher/skills` 0.1.67, `@malloy-publisher/create-malloy-package` 0.0.82.
144
+ ([#2287](https://github.com/malloydata/publisher/pull/2287) by @kylenesbit)
6
145
 
7
- ### Features
146
+ #### A connection's digest no longer hashes a credential or setupSQL, so some stored tables rebuild once
8
147
 
9
- #### The build plan lists the persisted sources each dimensional index reads through
148
+ **[BREAKING] A stored table's address no longer depends on a password, token, secret key or a
149
+ connection's `setupSQL`.** A connection's digest is hashed into the address (`sourceEntityId`) of
150
+ every stored table built on it, and that address is returned by the API, kept in the run store and
151
+ logged. Some drivers hashed text that can carry a credential, so a credential's hash could reach
152
+ those places. Publisher now masks each credential in a connection string or URL before hashing,
153
+ and leaves a user's `setupSQL` out of the digest entirely. Host, port, database, user, path,
154
+ catalog and the other identifying fields are hashed as before.
10
155
 
11
- **[feature] `BuildPlan.indexes`: for each `#(index)` dimension, the planned sources a run can change its values through.** A host's scheduled refresh can now re-embed only the indexes a run made stale. Before, an index over a live source that reads a stored one (`orders_live is orders extend { … }`) could not be connected to a rebuild of `orders`: the plan's `dependsOn` edges join persisted sources only, and the index's `sqlHash` names its logical definition, so a rebuild beneath it never changes it.
156
+ The address moves, once, only for these connections without a `fingerprint`:
12
157
 
13
- Each entry carries the dimension's `/entities` identity (`modelPath`, `sourceName`, `fieldName`), the two inputs a host derives an index's id from (`sqlHash`, `requiredFilterDimensions`), and `readsSourceEntityIds`. That is the `sourceEntityId` of every planned source whose table the index's queries may read, transitively: through extends, joins at any depth, query stages and `%{}` embeds, on every tier, plus every rollup over a source on that reach. `[]` means no run changes the index. `null` means not known (a `compose()` source on the reach, an upstream whose build is refused or reads a given, a source the plan omitted), so re-embed it after every run. The ids are content addresses, the keys of a run's manifest, though `BuildNode.dependsOn` names sourceIDs. A connection edit's re-derived plan lists the moved addresses.
158
+ - **Postgres** with a password in its `connectionString` (in the userinfo or as a `password=`
159
+ parameter, under any spelling of the name), or a secret setting in its `options`; or with a
160
+ password and an `sslmode` (or the deployment's `PGSSLMODE`), which makes Publisher build a
161
+ connection string with the password in it.
162
+ - **DuckDB** and **Databricks** connections with any `setupSQL`.
163
+ - **Trino** whose `server` URL carries a password.
164
+ - **Postgres reached through a `proxy`**, every one. Its digest hashed the local tunnel's address,
165
+ whose port is chosen afresh each time the tunnel opens, so its address could move on any reopen.
166
+ It now hashes the database it reaches (host, port, user, database) and the bastion's host, so it
167
+ moves once and then holds.
14
168
 
15
- The field is in the v0 spec (`GET …/packages/{pkg}/build-plan`, and the dry run's `buildPlan`) and the v1 spec (`partitionDimensionNames` in place of `requiredFilterDimensions`, as v1's `IndexFingerprint` names it). [The refresh recipe](docs/materialization.md#re-embedding-dimensional-indexes-after-a-run) says how to read it: union the lists of entries that share one index, only within the plan of the version the run built. This is additive: a plan from an older Publisher has no `indexes`, which means every index is unknown, which is what a host does today. A load records the time it spends under `publisher_package_load_phase_duration_ms{phase="index_upstreams"}`, and each unknown entry on `publisher_index_upstreams_unknown_total` by reason. **What to do:** nothing, unless you run a control plane that re-embeds indexes.
169
+ **What to do.** Run a build after upgrading. A stored table on one of these connections is not
170
+ found at its new address until a build writes it there, and is then served as before. Connections
171
+ with a `fingerprint`, and every other connection (MySQL, SQL Server, Snowflake, BigQuery,
172
+ MotherDuck, DuckLake, the Publisher proxy, and the kinds above without those fields), keep their
173
+ addresses.
16
174
 
17
- ([#2190](https://github.com/malloydata/publisher/pull/2190) by @kylenesbit)
175
+ **Editing `setupSQL` no longer moves an address**, and neither does rotating a credential. After a
176
+ `setupSQL` edit that changes the data a connection reads (a different `ATTACH`, a secret, a search
177
+ path), run a full build, so no table built from the old data keeps serving.
18
178
 
19
- #### `#(rollup)` stores a distinct count when its field is in the grain
179
+ ([#2297](https://github.com/malloydata/publisher/pull/2297) by @kylenesbit)
20
180
 
21
- **[new] `#(rollup)` now stores `count(x)` when `x` is one of its grain entries.** Before, every distinct count failed the publish and the load (`rollup-not-mergeable`), because distinct counts do not add up across groups. With `x` in the grain, the rollup keeps one row per value of `x`, and a query that groups or filters by other grain fields counts the distinct stored values. The answer is exact.
181
+ #### A chained extract sits in a later level of the build graph than the extract it reads
22
182
 
23
- ```malloy
24
- #(rollup) grain=["region", "customer_id"]
25
- measure: buyers is count(customer_id)
26
- ```
183
+ **[fix] In the build plan's `graphs`, an extract is now placed in a level after every level of its graph that holds a source it reads.** Before, every extract went into the graph's first level beside its upstream, so a host that builds a level's sources in parallel could start a chained extract before the extract it reads. `dependsOn` is unchanged, and every persist source stays in the first level, in build order.
27
184
 
28
- - `x` may be a one-hop join path in the grain (`count(customers.segment)` with `customers.segment` in the grain). The measure may carry its own filter on the source's own fields (`count(customer_id) { where: status = 'shipped' }`), or be combined with other stored aggregates (`amount.sum() / count(customer_id)`). A filter that reads a joined field is a warning, and that measure is answered live.
29
- - `count(x)` with `x` not in the grain still fails the publish and the load, and the message now says to put `x` in the grain. A distinct count of an expression (`count(upper(email))`) fails too: declare it as a dimension and put that in the grain.
30
- - A distinct count is read from its own source's rollup only. A query that reads it through a join from another source is answered live.
185
+ **Who is affected:** hosts that read `BuildGraph.nodes` as levels. **What to do:** nothing; a host that follows `dependsOn` already built in the right order. See "The build plan" in docs/extracts.md.
31
186
 
32
- **Who is affected:** models whose `#(rollup)` measures use `count(x)`. **What to do:** nothing for existing models, since every such measure failed the load before. To store one, add its field to the grain.
187
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
33
188
 
34
- ([#2140](https://github.com/malloydata/publisher/pull/2140) by @jswir)
189
+ #### A hand-written `#(extract)` accepts a `.sql()` source and a source built on a query-shaped name
35
190
 
36
- #### Simulated materialization plans a source on a `publisher` proxy as the host would
191
+ **[feature] `#(extract)` on a source not written as a query is copied as one when the compiler roots it on a query or a `.sql()` read.** `source: s is pg.sql("…") extend { … }` and `source: b is q extend { … }`, where `q` is itself a query-shaped source, are copied as `pg.sql("…") -> { select: * }` and `q -> { select: * }`, with the source's own extension applied over the copy, as a rewritten `storage=` declaration already was. Before, both failed the load with `extract-not-query`. A source rooted on a table, and one built on a name whose definition holds what a copy of its rows cannot carry (a measure, a view, a join and the like), still fail the load with `extract-not-query`. An origin that cannot be read at load never fails it: such a source is refused alone until its origin answers, while a generation bound at its address keeps serving.
37
192
 
38
- **A `storage=` source on a `publisher` proxy is now simulated.** Under `--materialize-simulate`, a source whose connection is a proxy to a host Publisher was refused with `storage_source_unsupported` before any other check ran. That is the normal case for an author whose connections all proxy to the host. Now, in an unversioned package, the source is planned as the type of the host connection the proxy stands for. A Postgres, BigQuery or Snowflake source is admitted. A DuckLake source keeps the host's rule against author SQL. Any other type is refused, and the message says the host would refuse it too. The rest of the checks (parameters, givens, merge keys, gates, the served copy) now run, and the source gets a simulated table.
193
+ **Who is affected:** packages that declared an extract over a `.sql()` source or a query-shaped source's alias. **What to do:** nothing; see docs/extracts.md, "Targets, and running them".
39
194
 
40
- - Its row count, bytes and build cost come from the host's stats route (`method: "host"`). A table named without a schema on a host other than DuckLake is the exception: its catalog is read through the proxy.
41
- - A query is served from the simulated table when the destination `storage=` names is declared on this server and its catalog exists.
42
- - When the destination is not declared here (it is the host's), the table is still simulated, its queries are answered live, and a `destination` fact says why.
43
- - The package-scope compile (`compile_model` at `scope: "package"`) plans the source the same way as the reload, so it reports the host's verdict too.
44
- - For a source on one of this server's own connections, a `storage=` destination this server does not declare is now reported as a configuration error, with the fix (`basis: "exact"`), instead of as the host's.
195
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
45
196
 
46
- A published version on a simulating server, and every server without simulation, still refuses a proxy source as before: the host builds it. A proxy whose host did not report its connection type is refused too.
197
+ #### A hand-written `#(extract)` reads its origin's types and collations at load
47
198
 
48
- ([#2188](https://github.com/malloydata/publisher/pull/2188) by @jswir)
199
+ **[breaking] A hand-written `#(extract)` is now described at its origin when its package loads, as a generated one already was, so the extract outcome rule decides it the same way.** With no generation bound, a finding of the origin's state fails the package's load. Those findings are `extract-type-unmapped`, `extract-numeric-unconstrained`, `extract-collation-unacknowledged`, `extract-collation-unsupported`, `extract-watermark-unsupported` and `extract-origin-incompatible`. With a generation bound, the extract keeps serving that generation with a warning, and its builds fail. An origin that cannot be reached never fails the load: with nothing bound, that extract alone is refused (409 `EXTRACT_REFUSED`), and with a generation bound it keeps serving it, warned. Before, a hand-written extract's types and collations were read only at build, so a new extract over a case-insensitive column loaded and then failed every build. `/status` now reports an extract refused by an origin-state finding as `refused`, with its `finding`, as its readers are refused.
49
200
 
50
- #### The authorize-bypass secret can rotate without a window where callers and servers disagree
201
+ **Who is affected:** packages with a hand-written extract whose origin column needs an acknowledgement, such as a case-insensitive column with no `#(column) compare="exact"`, or a numeric with no precision. **What to do:** fix the line the load error names; see docs/extracts.md, "Findings". A chained extract, which reads another extract's copy, is not described.
51
202
 
52
- **[feat] A previous authorize-bypass secret, `authorize.bypassSecretPrevious` (`PUBLISHER_AUTHORIZE_BYPASS_SECRET_PREVIOUS`).** The `x-publisher-bypass-authorize` header is accepted with it as well as with `authorize.bypassSecret`, compared the same way: exactly and in constant time. It is ignored while `authorize.bypassSecret` is unset. Each request it admits counts in `publisher_authorize_bypass_previous_secret_total`. Rotating the secret no longer has to change callers and servers at the same moment: set the previous secret to the old value and the current one to the new, move every caller, then unset the previous secret once the counter has stopped increasing on every server for a full caller cycle ([authorize-bypass-deployment.md § Rotating the secret](docs/authorize-bypass-deployment.md#rotating-the-secret)). **What to do:** nothing unless you rotate; leave it unset otherwise, since it turns gates off exactly as the current secret does.
203
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
53
204
 
54
- ([#2204](https://github.com/malloydata/publisher/pull/2204) by @housejester)
205
+ #### A misspelled `#(extract)` fails the load
55
206
 
56
- #### Publisher.db changes shape only through recorded migrations
207
+ **[breaking] A note that reaches for `#(extract)` but misspells it (`#(extrct)`, `#(Extract)`, `# (extract)`, `#(extracts)`, or a malformed `#(extract into=…)`) now fails the publish and the load with `materialization-near-miss`, naming `#(extract)`.** It used to be an `annotation-near-miss` warning, so the extract silently did not exist. This matches every other materialization route. Only spellings within one edit of `extract` are caught. Ordinary words two edits away that another app may route on (`#(exact)`, `#(extra)`, `#(retract)`) are not.
57
208
 
58
- **[new] `publisher.db` keeps a migration ledger, `schema_migrations`, and each boot applies the migrations it has not recorded.** The schema's whole history up to 0.18.10 is migrations 0001 to 0019, one per change, so the first boot of an existing store records all 19 without changing its data: the column additions, re-keys and drops each earlier boot ran, run once more and recorded. Each migration runs in its own transaction with its ledger row, so a crash inside one leaves the store at the migration before it, and the next boot finishes. How to write one is in [docs/migrations.md](docs/migrations.md).
209
+ **Who is affected:** a package with such a misspelling. **What to do:** correct the spelling the error names. See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md#targets-and-running-them).
59
210
 
60
- **[change] A store whose schema no migration explains now stops startup, with `PUBLISHER_STORE_SCHEMA_MISMATCH`.** Before, the boot logged that `publisher.db` "does not match the schema this build declares" and carried on, and the writes naming the missing or different column failed later. Now `PUBLISHER_INIT_FAILED` names each difference (a table or column missing, or a column whose type, nullability, default or constraints changed) and readiness never turns `200`. What a store holds beyond the declaration, such as a table an older release left behind, is still left alone.
211
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
61
212
 
62
- **[new] A store that applied a migration since changed is refused, with `PUBLISHER_STORE_MIGRATION_CHANGED`, before anything is changed.** The ledger records the SHA-256 of each migration's file, and every boot compares each recorded migration with this release's copy.
213
+ #### A stored source whose build reads an extract's address says it is never built
63
214
 
64
- **[new] A store migrated by a newer release that this one cannot read is refused, with `PUBLISHER_STORE_TOO_NEW`, before anything is changed.** Each migration records whether the release before it can still read the store. Every migration so far says it can, so rolling back to the previous release keeps working; the first that says it cannot will be called out in these notes.
215
+ **[fix] The `upstream_unread` warning on a stored source whose build reads an extract's address no longer promises that a reload will plan it.** Such a source (an extension that writes only `#@ name=` over a `#@ persist` base that reads an extract, say) is never built: an extract's address names no table, and a reader reads the extract's bound generation. The warning now says so, and names the two fixes: read it without storing it, or store over the extract query's own source. It is still answered from the extract it reads, never from the extract's origin.
65
216
 
66
- **[change] `--initialize-storage` drops every table `publisher.db` holds except the search index's, read from the store rather than from a list,** so a table no release declares any more (such as `build_manifests` from 0.0.205 and earlier) goes too, and then runs every migration again.
217
+ **Who is affected:** nobody's answers change. **What to do:** nothing.
67
218
 
68
- **Who is affected:** everyone, on the first boot after the upgrade; nothing to do. A store edited by hand, or one an unreleased build changed, may now be refused with `PUBLISHER_STORE_SCHEMA_MISMATCH`: restore a backup of `publisher.db`, or start once with `--initialize-storage`.
219
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
69
220
 
70
- ([#2216](https://github.com/malloydata/publisher/pull/2216) by @sagarswamirao)
221
+ #### An extract's address is read from its connection's configuration, so an outage holds what is bound
71
222
 
72
- #### A GitHub package location is cloned at the branch or tag it names
223
+ **[fix] An extract's address no longer depends on opening its origin's connection.** Its dataset identity is read from the environment's configuration of the connection. So an outage keeps the address, and the generation bound there keeps serving with an `extract-origin-unreachable` warning, on a running server and after a restart alike, standalone and hosted. An outage here means a lookup of the connection that fails, a DuckDB connection whose `ATTACH` of a remote database fails, or an origin that refuses every read. With nothing bound, that extract alone is refused (409 `EXTRACT_REFUSED`) and the load succeeds. A generated extract's hold still needs its decision digest to match.
73
224
 
74
- A `location` of the form `https://github.com/<owner>/<repo>/tree/<ref>/<path>` is now cloned at `<ref>`. Before, every GitHub location was cloned at the repository's default branch, whatever ref it named, so `tree/v0.18.8/…` served `main`. A `<ref>` that is not a branch or a tag of the repository, such as a commit SHA, a deleted branch, or `tree/main` on a repository whose default branch is `master`, is still cloned at the default branch, as before, and the server logs a warning naming it.
225
+ Before, a connection whose lookup failed was refused whatever was bound. A lookup error that named credentials or configuration was read as an incompatible origin and could fail the load; a read that the origin refuses for its login is still incompatible.
75
226
 
76
- The server's bundled example packages are fetched at the release's own tag, so a release serves the examples it was tested with. See [docs/configuration.md](docs/configuration.md).
227
+ Only two cases give no address. A connection missing from the environment's configuration is refused alone, whatever is bound. A configuration that does not say which dataset it reaches (`extract-connection-identity-incomplete`) fails the load. See docs/extracts.md, "The outcome rule".
77
228
 
78
- ([#2196](https://github.com/malloydata/publisher/pull/2196) by @housejester)
229
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
79
230
 
80
- ### Fixes
231
+ #### A query answered from an extract reports `servedFrom: "extract"`
81
232
 
82
- #### A documented joined field is served from a stored table
233
+ **[feature] A query whose run read an extract's generation now reports `servedFrom: "extract"`, never null.** Null means a live answer, and an extract never answers live, so the value said the opposite of what happened. The same value is on the access record's `servedFrom` and the `publisher.query` span's `malloy.model.query.served_from`, and the route counter `publisher_query_route_total` counts the query as `leg="extract"`, `outcome="used"`, in place of `live`. A query that read a database table beside an extract (a mixed answer) also reports `extract`; its path report's `servedBy` is `kind: extract` with each extract listed, and now also names the database table that answered by its `tableId`, `origin`, `tier` and `via` (its `dataAsOf` is left out, since each extract carries its own). MCP `execute_query` describes the value, and no longer lists the retired `storage`.
83
234
 
84
- **[fix] A query that returns an annotated joined field as its own column is now answered from the stored table.** Before, `group_by: account.region` was answered live whenever `region` carried a `#(doc)`, a `#(classification)` or a render tag such as `# label`. That held for a `#(rollup)` whose grain names the path, and for an `inline=` join's stored columns (a join_one, or a join_many's pair table). The path report said `MISSING_FIELD`, and renaming the field in the query (`group_by: r is account.region`) was the workaround. The stored table answers the join with a record of its columns, and Malloy cannot annotate a record's field. Publisher now gives each such field the joined field's annotations before any query is compiled against the table, so the column comes back exactly as live returns it: the same `#(doc)`, classification, render tags and drill metadata. Still answered live: a view of the source read by name that returns the field (`run: subs -> by_region`, or `nest: by_region`), since the stored table's views are compiled before the record is given the annotations. Writing the same `group_by:` in the query, or in a `nest:` of it, is served.
235
+ **Who is affected:** clients that branch on `servedFrom`, and dashboards over `publisher_query_route_total{leg}`. A client generated from the spec gains one enum value. **What to do:** treat `extract` as an answer from a copy, read at its `dataAsOf`. See [the path report](https://github.com/malloydata/publisher/blob/main/docs/extracts.md#the-path-report).
85
236
 
86
- **Who is affected:** packages with a `#(rollup)` grain through a join, or an `inline=` join, whose joined dimensions carry docs or tags. **What to do:** nothing. More of their queries are answered from the stored tables.
237
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
87
238
 
88
- ([#2141](https://github.com/malloydata/publisher/pull/2141) by @jswir)
239
+ #### An extract build fails when a value cannot be cast to its column's declared type
89
240
 
90
- #### Serve verdicts stay honest after a recompile, an inlined join's native column is left out, and inline= key advice names a native cast
241
+ **[fix] An extract's build now fails, and writes no generation, when a value cannot be cast to its column's declared type** (a boolean the origin returns as `'Y'`, an integer past 38 digits). Before, it retried without that class of casts and stored the types the warehouse computed, leaving the later findings check to catch a lost value. The failure is not retryable (v0 `retryable: false`), its `reason` never quotes the value, and the previous generation keeps serving. `publisher_storage_column_type_mismatch_total{stage="build",declared="cast_failed"}` still counts it.
91
242
 
92
- **[fix] A serve verdict no longer reads `serves` for a source the served copy declines, after the copy is recompiled.** Several things drop a model's compiled served copy without compiling it again: a change to the environment's storage destinations, a DuckLake destination reopened, the destinations attached again when a version is loaded or reloaded, and a rebind of the same tables. Until a query compiled the copy again, the verdict of a source that copy declined fell through to `serves`, in the bind response, `/status`, `GET …/packages/{pkg}/status` and the package resource, and its `served-copy-not-served` warning disappeared, while every query on it still answered live (`NOT_SERVED`, `served_copy`). Now each of those compiles the copy again at once, behind any bind in flight, as a bind does, and until it lands the verdicts and warnings read what the dropped copy judged, never a copy that has not judged. A rebind of the same tables compiles any copy dropped since, and so does a first compile an invalidation overtook. These recompiles read no warehouse catalog (the string capabilities read at the last bind hold), run at most two packages at a time across the process, and each counts its declined sources on `publisher_served_copy_outcome_total` again, as a bind's compile does. **What to do:** nothing.
243
+ **Who is affected:** extracts whose origin returns a value its declared column type cannot hold. **What to do:** fix the column's type in the extract query (cast it in Malloy), then build again. See "Build failures" in docs/extracts.md.
93
244
 
94
- **[fix] An `inline=` join_one's warehouse-native or JSON column no longer sends the whole source live.** When the joined source held a column with no stored declaration (a BigQuery `GEOGRAPHY`, a DuckDB `UUID` or `MAP`, a JSON column), the served copy declined the whole source, so every query on it was answered live, and the `served-copy-not-served` warning (`column_types`) did not say which column. Such a column is now left out of the join's record, as the source's own native columns are: a query that reads it (`j.geo`) is answered live, its path report's `detail` naming the column, and every other query on the source is answered from its table. A source whose own fields read such a column (a measure over `j.geo`, or an extension's dimension) still answers live as a whole, since its served copy cannot compile without it; its warning now names the column. The publish and the load warn before any build with a new advisory, `materialize-inline-column-live`, naming each such column. A column the table lacks for any other reason still declines the source, and its warning now names the column. **Who is affected:** `#(materialize)` sources with an `inline=` join_one to a source holding such a column. **What to do:** nothing; more of their queries are answered from the table.
245
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
95
246
 
96
- **[fix] An `inline=` key refused for a number of no recorded width says which side has none, and the native cast that records one.** A Malloy `::number` cast records no width, so a key it reads cannot be proven to compare in one type, and the join is refused (`materialize-not-built`, the source answers live). The refusal used to advise "a dimension of this source that casts to it" in every case, even when the joined side was the one with no width, and following it with `::number` was refused again. It now names the side with no width: the joined source's declaration when it is the joined key, this source's dimension when it is the other side, or both. It suggests a native bigint cast in the dialect's own type name (`::"INT64"` on BigQuery, `::"bigint"` on Postgres, `::"BIGINT"` on DuckDB, `::"DECIMAL(20,0)"` on MySQL, whose `CAST` names no integer type), never `::number`: a bigint whatever the other side's integer width, since a narrower cast could overflow a bigint-valued key. When the other side is a string it says to compare like with like, and when it is fractional, which no key is proven on, to key on integer or string columns. **What to do:** follow the new advice; a bare `::number` key is still refused.
247
+ #### An extract over a stored source is built from the stored table, never the origin
97
248
 
98
- ([#2194](https://github.com/malloydata/publisher/pull/2194) by @kylenesbit)
249
+ **[feature] An extract whose query reads a `#(materialize)` or `#@ persist` source, a `#(rollup)` base, a `#@ persist` named query, or a `#@ persist` view it calls is now built over that stored table.** Its build routes the extract's own query through the serve router, pinned to the run's stored tables, and builds from the answering leg's SQL. Before, such an extract read the origin's raw rows, so its copy could differ from the table every other reader saw.
99
250
 
100
- #### A table read through a connection that cannot be opened says why
251
+ - The build plan makes the extract's node depend on each stored table it reads, a level after them.
252
+ - `extract.upstreams` on its manifest entry is now a union by `kind`: `{kind: "extract", target, generation}` for a chained extract (the existing entries, now with `kind`), and `{kind: "stored", sourceEntityId, physicalTableName, builtAt}` for a stored table. The extract's `dataAsOf` is the oldest of its upstreams': for a stored table, the start of the run that built it.
253
+ - An extract whose stored upstream the build plan refused is refused alone, with the new finding code `extract-upstream-refused`: its readers answer 409 `EXTRACT_REFUSED` naming the upstream, and the package still loads.
254
+ - A persisted view is read wherever the extract's compiled query reaches it. Its table answers only a call of the view on its declaring source at the head of the query; any other read (a nest, a join, an extension, a query-shaped source over it, another view built on it, a call through an extension or an import alias, a refined call) refuses the extract at plan time with `extract-upstream-refused`. A refined call of a persisted query (`pq + { limit: 10 }`) is refused the same way.
255
+ - A build fails, the previous generation serving, when no stored table answers the query (a regroup finer than a rollup's grain), when the run holds no table for an upstream, or when a table's age is unknown.
101
256
 
102
- **[fix] A model that reads a table through a connection Publisher cannot open now reports the reason at that line, in `--check`, in `get_status` `loadErrors`, in a reload and in `compile_model`.** Before, the line said only `import reference failure (failed-to-fetch-table-schema)`, and the reason appeared nowhere, not even in the log. Two cases change most:
257
+ **Who is affected:** packages with an extract over a stored source, and hosts that read `extract.upstreams`. **What to do:** a host reads `kind` on each `extract.upstreams` entry, sends a stored upstream's entry (with its `dataAsOf`) in the `referenceManifest` of a run that builds such an extract, and builds in graph order. See docs/extracts.md, "An extract over a stored source".
103
258
 
104
- - A connection the environment does not have: `No connection named "nosuch_connection" found in config; the connections configured here are "bq_demo", and each package's own "duckdb"`. A query caller's 424 for a deleted connection keeps its old text, without the list, so a caller behind a gateway learns no connection names from it.
105
- - A `publisher` proxy connection whose remote answers 401: `Connection "bq_demo": the remote Publisher refused this connection's access token (HTTP 401).`, followed by the fix for a Credible connection, which is `cred login`. A 403 says the token is not allowed to use the connection.
259
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
106
260
 
107
- Any other failure to open the connection is reported as its own error, with the connection's configured credentials and secret shapes masked as the connection test masks them. Errors that follow from the unreadable table, such as `'order_id' is not defined`, are still listed after it.
261
+ #### An incremental refresh of a stored table now reads the rows whose watermark is NULL
108
262
 
109
- ([#2183](https://github.com/malloydata/publisher/pull/2183) by @girishjeswani)
263
+ **[fix] Every delta of a `refresh="incremental"` stored table (`#(materialize)`, `#@ persist`) now re-reads the source's rows whose watermark is NULL, beside its range.** A NULL watermark falls in no range, so before this release a stored table differed from live until its next full rebuild in three ways: a new NULL-watermark row never arrived; without `merge_key=`, a NULL-watermark row the source dropped was never deleted; and with `merge_key=`, a row whose watermark became NULL kept its old values. The range replace's delete and the Snowflake merge's repeated-key probe cover the same rows. Extracts already read NULL-watermark rows on every refresh.
110
264
 
111
- #### The data-app skill replays an app's own queries before publishing
265
+ **Who is affected:** incremental stored tables whose watermark column can be NULL. **What to do:** nothing. The next refresh brings the table level with live; a source with many NULL-watermark rows re-reads them on every refresh. See "Incremental refresh" in docs/materialization.md.
112
266
 
113
- **[skills] `malloy-html-data-apps` asks, for a package that materializes anything, that each query the app sends be run in simulation and its path report written down, so a query the author expects a table to answer that comes back live is found before publishing.** `malloy-materialization` and the data-app skill both say that simulation answers from live rows, so a table's read time is known only after a real build. `malloy-materialization`'s description is shortened to fit the 200-character budget a plugin build keeps, so the hosted Credible plugin can carry it whole.
267
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
114
268
 
115
- ([#2183](https://github.com/malloydata/publisher/pull/2183) by @girishjeswani)
269
+ #### A compile check describes only the extracts it changes
116
270
 
117
- #### A column named `minutes`, `hours` or another plural timeframe word no longer leaves its source unbuilt
271
+ **[fix] `compile_model`, and any what-if compile of edited text, no longer describes every hand-written or generated extract against its origin on each call.** An extract the text leaves as the load read it reuses the load's describe, so its origin is not asked again. An extract the text adds or changes is described, all at once, waiting on its origin at most 5 seconds, past which the check reports it as `extract-origin-unreachable`. Before, each call described every extract one after another, waiting up to 30 seconds on each. See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md).
118
272
 
119
- **[fix] A `#(materialize)` source or a `#(rollup)` over a column named by a plural timeframe word is built and served.** Malloy reads `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, `quarters` and `years` as keywords, so an author writes such a column quoted (`` `minutes`.sum() ``). The Malloy that Publisher generates for the build and the read wrote it bare, did not compile, and the source answered live with no table: for example `#(materialize)` on a source with `` measure: total_minutes is `minutes`.sum() ``. The singular words were already quoted. **What to do:** nothing; the next build creates the table.
273
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
120
274
 
121
- ([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
275
+ #### Every stored table's manifest entry carries `dataAsOf`
122
276
 
123
- #### A declared average over rolled-up measures is served from the rollup
277
+ **[feature] Every database entry a run builds now carries `dataAsOf`, whether or not its table declares a `freshness.window`.** It is the start of the run that built or last refreshed the table, or the oldest stored table that build read. A carried entry keeps its own. A host-orchestrated run stamps it too, and still leaves the window and fallback to the host. An extract over a stored table measures its own `dataAsOf` from this value. Before, the entry carried it only when the table declared a window, or when an extract read it in the same run. So an extract over a table built in an earlier run, and unchanged since, could not build. This is additive output.
124
278
 
125
- **[fix] A measure declared over rolled-up measures is served from the rollup, with no `#(rollup)` line of its own.** For example, `#(rollup) grain=["rider_type"]` on `ride_seconds is duration.sum()` and on `rides is count()`, then `measure: avg_minutes is ride_seconds / nullif(rides, 0) / 60`. A query that asked for `avg_minutes` answered live, and the path report skipped the rollup with `MISSING_FIELD`, although the same expression written in the query was served. A declared measure is now read the way that expression is when every field it reads is a measure the rollup stores, or another measure read that way, and it has no aggregate of its own, no `all()` or `exclude()` and no raw SQL. A grain dimension that fans out applies to it as to the measures it reads. An extension's own measure of that shape is served from its base's rollups too. Answers do not change; they come from the rollup instead of the warehouse. A measure of any other shape, a filter on a dimension included, and a query that reaches the measure through a join, still answer live with `MISSING_FIELD`; `docs/preaggregation.md` has the rule. **What to do:** nothing; a `#(rollup)` line already on such a measure keeps working.
279
+ **Upgrade note.**
280
+ - **Tables built before this release.** A stored table built by an earlier release has no `dataAsOf` on its entry. An extract over it fails its build with a message to rebuild the table, until that table is built again once (a reseed, or any change that rebuilds it).
281
+ - **Hosts.** A host that echoes entries in a `referenceManifest` or a bound manifest must echo `dataAsOf` unchanged. Without it, an extract over that table fails its build.
126
282
 
127
- ([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
283
+ See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md).
128
284
 
129
- #### The path report names each table it considered
285
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
130
286
 
131
- **[feature] Each `considered` entry in a query's path report carries `sourceName`, and a rollup's carries `grain`.** `sourceName` is the source the table materializes, or for a rollup the source it rolls up, as `notConsidered` already names it; `grain` is the rollup's grain dimensions, so two rollups of one source skipped for different reasons can be told apart. Both are optional and additive. Neither is given for a source the caller cannot list, nor for a persisted view's or named query's table. A `private` or `internal` grain dimension is left out of `grain`, and a rollup of a source with a row-level gate, or one read past an entry point's gate, carries no `grain` at all, since a gate's fields are grain dimensions and the report never names what a gate reads. MCP `execute_query`'s `firstSkip` now prefers, after the source's own table, a rollup skipped for `MISSING_FIELD`, the one reason that says its grain covered the query, then another rollup's skip, with `GRAIN_TOO_COARSE` last: with four rollups of one source, three too coarse and one missing the measure asked for, it named a too-coarse one, and now names the missing measure.
287
+ #### `#(extract)` with `#(materialize)` or `#@ persist` on one definition fails the load
132
288
 
133
- ([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
289
+ **[breaking] A definition whose own notes declare `#(extract)` together with `#(materialize)`, or with `#@ persist`, now fails the package's load with `extract-and-stored`:** `<file>:<line>: [extract-and-stored] <q> declares both #(extract) and #(materialize): an extract is a copy that replaces its origin, and #(materialize) stores a table in the source's own database, so keep one`. The two mechanisms cannot both own one definition's table. `#@ -persist` beside `#(extract)` is not a declaration and still loads.
134
290
 
135
- #### A fatal DuckDB error no longer breaks a connection until restart
291
+ **Who is affected:** packages that annotate one source, view or named query with both. **What to do:** keep one of the two annotations; see docs/extracts.md, "Findings".
136
292
 
137
- **[fix] A DuckDB `INTERNAL` or `FATAL` error now costs the statements in flight, not the connection (pre-existing, 0.18.10 and earlier).** The error invalidated the shared DuckDB instance, and every later query on that connection failed on that server until it restarted; its other connections were unaffected. Now the statement that crashed the instance answers a `400` (`reason: CONNECTION_CRASHED_BY_QUERY`, below). Every other statement in flight on that instance is interrupted, so a long query does not hold the replacement, and answers a retryable `503` (`reason: CONNECTION_REPLACING`, `Retry-After: 5`), since the same query succeeds on the fresh instance. The next lookup gets a fresh instance. What recovers:
293
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
138
294
 
139
- - `duckdb` environment connections that attach no catalog;
140
- - `ducklake` environment connections, and `motherduck` through the same lookup path (exercised by unit stubs only, not against MotherDuck), each death abandoning the dead instance, until more than four have been abandoned in the process; past that, one whose instance dies stays down (below);
141
- - a pooled storage destination (the DuckLake session pool, `duckdb.sessionsPerDestination`): a death retires the whole pool and the next lookup builds a fresh one. A session whose own join statement killed the instance logs `destination_session_join_killed_instance` once, and that pool never joins again;
142
- - a package's DuckDB sandbox;
143
- - the `publisher.db` store, which reopens in place;
144
- - the SQL parser, which resets.
295
+ #### BREAKING: an unbuilt extract answers 409 `EXTRACT_AWAITING_BUILD`, and an extract's entry names its place in `destination`
145
296
 
146
- A `duckdb` connection that attaches a catalog (a DuckLake through its `setupSQL`, say) does not recover in-process: that connection stays down until the server restarts (below).
297
+ **[breaking] The 409 a reader of an extract with no generation bound gets is now `reason: EXTRACT_AWAITING_BUILD`, renamed from `EXTRACT_NOT_BUILT`.** A client or router that retries or routes on the old code must match the new one. The message is unchanged.
147
298
 
148
- A lookup on a file whose dead instance is still closing waits up to 45 seconds for it and usually succeeds. Past that wait, or when its replacement dies too, it is refused with a `503`: on the query, table and SQL-source routes, and for a package load, which answers it instead of a compile error. A sibling request that already holds the connection when its instance dies gets the same `503`, not "connection is closed". (A lookup refused while Malloy compiles a query that names `duckdb.table()` or `duckdb.sql()` surfaces as a translator error, a `400`, as every lookup refusal did before.) Both refusals are the server's own fault and the query never ran to an answer, so a router reruns a `503` on another replica. The first carries `reason: CONNECTION_REPLACING` and `Retry-After: 5` while the instance is being replaced, which is transient. The second carries `reason: CONNECTION_UNRECOVERABLE` and no `Retry-After` for a connection this server cannot reopen until it restarts or is redeployed, so a client tells a retry from a restart without reading the message. A connection held down because its dead instance was still draining after a second 45 seconds is freed when that instance closes; an edit that opens the connection fresh frees it too, except a file whose instance was abandoned, which stays refused until a restart. An MCP tool's error carries the same `reason` with fixed advice instead of an internal-error message. A DuckLake catalog lost from its locked instance, which a lookup or a schema read raises for the same state, now answers that retryable `503` as well (`reason: CONNECTION_REPLACING`, `Retry-After: 5`) instead of a `400`, `500` or `502` (the table and SQL-source routes answered `502`); its message and error code are unchanged. A package load whose own read crashed the instance keeps its compile error rather than answering the `503` its sibling reads meet, and a reload refused with any of these keeps serving the models compiled before it, as one refused by a busy database already did. When it keeps them, the package stays marked stale (`loadErrors` with `stale: true`, and `/health/readiness?strict=true` answers `503`) until a later reload compiles.
299
+ **[breaking] `ExtractStatus.state` `not_built` is now `awaiting_build`**, the word a stored table's serve verdict already uses for "nothing bound yet". The other states (`bound`, `refused`, `expired`) are unchanged.
149
300
 
150
- **[change] The request that crashed its instance answers `400` with `reason: CONNECTION_CRASHED_BY_QUERY`.** It was a `400` with no reason, and an MCP tool advised fixing the Malloy. The message now reads "this request crashed the connection's database engine (a DuckDB `INTERNAL` error); do not resend it unchanged", and an MCP tool's error says not to resend it and to report it. It no longer quotes DuckDB's text, which can quote a value from the query and carried a native stack trace with server file paths. A raw SQL statement keeps its generalized `500`. A lookup whose own setup step crashed the instance (an `ATTACH` in `attachedDatabases`, a `setupSQL` statement, a DuckLake attach) is a fault of the connection's configuration, not the caller's query, so it answers `424` with `reason: CONNECTION_SETUP_CRASHED` instead, a fixed message that names the error class, and a retry fails the same way while a restart reruns the same setup. No request reruns the crashing step on a fresh instance, each of which would be abandoned: the crash is latched under that connection's own config, so only an edit of that connection clears it, not an unrelated edit. It is not listed in `unrecoverable`, never fails `/health/liveness?strict=true` (a restart would rerun it), and is logged once as `duckdb_connection_setup_crashed`; a package load that meets it records a `loadErrors` entry that is not `transient`. A file connection whose `ATTACH` crashed also keeps its file refused until a restart.
301
+ **[breaking] An extract's manifest entry and its `ExtractStatus` name the storage destination in `destination`, renamed from `storageDestinationName`.** The value is unchanged: the name of the storage destination over the target connection's catalog, the same field name the build instruction already uses. For this release only, an extract's entry that still names its destination in `storageDestinationName` is accepted on input and bound as if it named it in `destination`. Publisher writes only `destination`, and the old name stops being read in the next release. `storageDestinationName` stays on `ManifestEntry` as a retained field, for an earlier release's storage entry, which is never bound. An extract's plan entry still reports its target's kind in `origin`; its `extract` block is what marks it as an extract.
151
302
 
152
- **[change] `/health/liveness` fails only when Publisher's own database is lost; `/health/liveness?strict=true` also fails exactly while `/status` lists an `unrecoverable` entry.** Plain `/health/liveness` answers `503 {"status":"DOWN","reason":"STORE_UNRECOVERABLE"}` when the `publisher.db` store fails to reopen twice, or to close its invalidated instance or a replacement that did not open; its requests answer `503` with `reason: STORE_UNRECOVERABLE` and `Retry-After: 30`. `/health/liveness?strict=true` answers that too, and `503 {"status":"DOWN","reason":"CONNECTION_UNRECOVERABLE"}` while any connection, storage destination or package sandbox is down until a restart. Past the four-instance cap with nothing held down (a late failed close, say), the probe stays up and `publisher_duckdb_abandoned_instances` shows it. `strict` takes `true` or `false`; anything else answers `400`. `GET /health` still answers `200` and reports `livenessState` as `DOWN` when the plain probe fails; readiness is unchanged.
303
+ **Who is affected:** a control plane that builds, binds or reports extracts. **What to do:** read and echo `destination` on extract entries (a host that still sends `storageDestinationName` keeps working for this release), read `awaiting_build`, and match `EXTRACT_AWAITING_BUILD`, all in the same upgrade. See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md).
153
304
 
154
- **[new] `GET /api/v0/status` and MCP `get_status` list what is down in `unrecoverable`.** Each entry is `{environment, kind, name, versionId?}`, where `kind` is `connection`, `destination` or `package` (its private `duckdb` sandbox), and `versionId` names a package loaded as a version. The field is absent when nothing is down. The v1 spec carries it as a boolean on each affected `WarehouseHandleStatus` and `VersionStatus`. A scope nothing live owns (a deleted environment, a connection test, a build session) is in neither the list nor the probe; the `duckdb_connection_unrecoverable` log names it.
305
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
155
306
 
156
- **[new] DuckDB death metrics.** `publisher_duckdb_instance_deaths_total` counts fatal errors, `publisher_duckdb_instance_abandons_total{cause}` the instances kept for good (`catalog`, `failed_disconnect`, `failed_close`), `publisher_duckdb_instance_replacements_total` the replacement attempts, and `publisher_duckdb_refusals_total{reason}` the answers refused with each wire reason code (`CONNECTION_REPLACING`, `CONNECTION_UNRECOVERABLE`, `CONNECTION_SETUP_CRASHED`, `STORE_UNRECOVERABLE`). The gauge `publisher_duckdb_abandoned_instances` is the instances kept now.
307
+ #### An extract's build is counted, timed and costed like any other build
157
308
 
158
- **[change] An instance being replaced and a lost DuckLake catalog are transient, and are retried like any other transient database error.** Under the transient-database rule ([docs/connections.md](docs/connections.md)), a `CONNECTION_REPLACING` refusal and a lost DuckLake catalog are retried on a package's first load, at a manifest bind, and on a publish, and a stored table over an upstream refused this way keeps serving. `/status` reports them with `transient: true`. A fatal error is never retried, and a refusal that is `CONNECTION_UNRECOVERABLE` is never transient.
309
+ **[feature] Each extract build is reported through the build metrics and log events**: `publisher_materialization_build_total{kind="extract",tier="extract"}` with its outcome and failure class (`billed_read_lost` included), `publisher_materialization_build_duration_ms` (`method` `full` or `delta`), `publisher_materialization_build_read_bytes{tier="extract"}`, and the `materialization.build.finished` / `materialization.build.failed` log events. Before, an extract build was only counted in the run's tally. An extract's manifest entry now carries `queryCostBytes`, the bytes its origin read scanned, when the warehouse reports them (null for a chained extract, which reads no warehouse, and for a delta).
159
310
 
160
- **[change] Only DuckDB's own "invalidated" text marks an instance dead at once.** Any other fatal error (a catalog-side `INTERNAL` error such as duckdb#28650) is confirmed first by a `SELECT 1` on a fresh connection to the same instance, and answers as itself when the instance survived, with nothing replaced. The checks log `duckdb_fatal_probe` and, when the instance survived, `duckdb_fatal_survived`. A connection released while a call on it is still running keeps its instance open until that call finishes, so a failing call's probe asks a live instance.
311
+ **Who is affected:** operators with dashboards over the build metrics. **What to do:** nothing; a new `kind` and `tier` value appear.
161
312
 
162
- **[fix] A dead instance's paused or abandoned result streams are returned, so the instance drains and closes.** A reader that resumes one of those streams gets a retryable `503` with `reason: CONNECTION_REPLACING`, not an end of rows that reads as a complete result. A stream read short (a row or byte cap, a timeout, a reader that stops, a death) now closes its DuckDB result at once, so the instance it ran on frees its file when it closes and a replacement does not open that file a second time.
313
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
163
314
 
164
- **[change] An abandoned instance keeps its memory, and the cap does not bound it.** The four-instance cap holds connections down; it does not free anything. An abandoned instance is never closed, so each keeps its buffer pool, up to its `memory_limit`, until the server restarts. Set `PUBLISHER_DUCKDB_MEMORY_LIMIT`, and alert on any non-zero `publisher_duckdb_abandoned_instances`. [Deployment](docs/deployment.md#a-connection-publisher-cannot-recover) has the measurements.
315
+ #### The extracts contract is served, and two retired values are deleted
165
316
 
166
- **A fatal error on a plain `duckdb` file recovers in-process, inside a materialization swap or incremental apply too; an instance that attached a catalog is abandoned instead.** A plain connection (its `setupSQL` only sets options, loads extensions or creates secrets, and its `attachedDatabases` are S3, GCS or Azure) rolls any transaction back, closes the dead instance and reopens the file with its committed rows. An instance that attached a catalog (a DuckLake, Postgres, BigQuery or Snowflake `ATTACH`, in `attachedDatabases` or `setupSQL`) or opened as a MotherDuck one is abandoned when it dies, held for good, and its file is never opened a second time. DuckDB 1.5.5 never frees an instance that died in a statement on a DuckLake it attached, with or without a transaction, and closing one with a transaction open aborts the process (a DuckLake always, a Postgres once its server connection has died). Publisher cannot tell which statement touched a catalog, and does not tell catalogs apart: a Postgres or native DuckDB attach measured clean to close when no transaction was open, but is abandoned the same way, and BigQuery, Snowflake and MotherDuck were not measured. An instance whose handle failed to disconnect, or whose close failed (`failed_disconnect`, `failed_close`), is abandoned the same way. A file-backed one (a `duckdb` environment connection, `<name>.duckdb`, including one that attaches a DuckLake through its `setupSQL`) takes its connection down until a restart. An in-memory one (a `ducklake` connection's main database, MotherDuck) is replaced on the next lookup while the process holds no more than 4 abandoned instances; past that cap, one whose instance dies is held down too, and editing its config makes it a new connection that opens fresh. A fatal error is rare (a DuckDB bug such as duckdb#24311, or a `FATAL` I/O error such as a full disk), but a user's query that meets one is enough: a `duckdb` file connection with any `ATTACH` is one such query from down on that server. The cap is process-wide and counts every abandon, a file's included, so past it any in-memory catalog connection that dies stays down. One error that recurs on every query, a corrupt data file say, abandons an instance at each, so a `ducklake` connection is held down within a few queries.
317
+ **[feature] Every extract surface in the API specs is now served.** The specs no longer mark the extract components, codes and routes as "in development; not yet emitted by any release": the build plan's `extract` block, the build instruction's and the manifest entry's `extract`, `/status` `extracts`, the finding codes, the path report's `extract` kind, the `EXTRACT_*` 409 and 400 reasons, `describe-extract`, and `drop-storage-materialized-table`. See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md).
167
318
 
168
- **When you upgrade:** anyone serving DuckDB, DuckLake or MotherDuck connections gets the recovery with no change. A connection Publisher cannot recover costs that connection, not the server: plain `/health/liveness` keeps a shared server up for its other tenants and connections. Where a server serves one deployment (Docker, Compose, one Publisher per customer), point its liveness probe at `/health/liveness?strict=true`, so the orchestrator restarts it and brings the connection back. The Docker image's healthcheck and `docker-compose.example.yml` now use the strict form. Docker and Compose only mark a container unhealthy: plain Docker and `restart: unless-stopped` do not restart it, while Kubernetes, an autoheal sidecar and Swarm do. A local or `npx` server has no orchestrator: restart it by hand when it logs `duckdb_connection_unrecoverable` or `duckdb_instance_unrecoverable`, or when `/status` lists `unrecoverable`. The log table in `docs/deployment.md` lists every code this recovery writes and what each one means.
319
+ **[breaking] `RefusedSource.tier` no longer lists `colocated`.** No release has produced it since `database` replaced it, and no client reads it. `ServeVerdict.tier` still accepts it as retained.
169
320
 
170
- ([#2167](https://github.com/malloydata/publisher/pull/2167) by @nthuff)
321
+ **[change] `publisher_materialization_drop_tables_total{occasion}` no longer has the value `delete`.** Nothing produced it. A caller's drop, through either drop route, is `caller`; Publisher's own is `reclaim`.
171
322
 
172
- #### A transient database error during a manifest bind keeps the previous binding serving, and a remote package's boot publish is retried
323
+ **Who is affected:** a client generated from the spec that matches `colocated` on `RefusedSource.tier`, and a dashboard that selects `occasion="delete"`. **What to do:** drop those matches.
173
324
 
174
- **[fix] A manifest bind that cannot read the tables it binds, because the database is out of sessions for a moment, no longer sends their sources live.** A bind reads the columns of every table it binds. When that read failed on a transient database error (the database out of sessions, a session lost, a connect refused or timed out), the bind went ahead without those tables, so their sources answered live, on the database that had just refused a read, until a later read succeeded. When such a table is one the package serves from a stored table now, the bind now applies nothing: the tables bound before keep serving, `manifestBindingStatus` reads `bind_failed`, and `boundManifestDigest` still names the manifest bound before. The bind is tried again in the background, with the same backoff and five-minute window #2177 gives other transient work (a new bind of a different manifest, not a retry, starts a window of its own), and after the window `/status` reports it under `loadErrors` with `stale: true`, `transient: true`, `attempts` and `lastError`, while the previous binding keeps serving until a bind succeeds. A refusable bind (`PUT …/versions/{version}/manifest`, or a `PATCH` naming a `manifestLocation`) answers **503** `MANIFEST_BIND_FAILED` with `Retry-After` in that case, with nothing applied; before, it answered 200 with those sources live. The manifest bound now, named again, stays `bound`. A table served live now (nothing bound yet, a new source, a table unread before), and a read that fails for any other reason, bind as before. **What to do:** a host that retries a refused bind on a 500 should also retry on a 503.
325
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
175
326
 
176
- **[fix] A configured package from a remote location (GitHub, `gs://`, `s3://`) whose boot publish failed on a transient database error is published again, not left failed until a restart.** #2177 retried a local package's boot publish, and a first load, for five minutes after a transient error, but a remote package was refused until the next `--init`, because the copy boot fetched was removed after boot. That copy is now kept for the retry, so the package is published again in the background from what boot fetched, with the same backoff and window, without fetching the location again. While it is retried it is not in `loadErrors`; once the window passes it is, with `transient: true`, `attempts` and `lastError`, and its next read publishes it again, as a local package's does. The copy is removed once the package publishes, or when a retry fails for another reason, which refuses it until the next `--init` as before. A remote package whose boot publish fails for any other reason is refused at once, as before. **What to do:** nothing.
327
+ #### A keyed load accepts a column widened into an unconstrained `numeric`
177
328
 
178
- ([#2201](https://github.com/malloydata/publisher/pull/2201) by @kylenesbit)
329
+ **[fix] A keyed load no longer refuses an object whose column moved from an integer or a decimal into an unconstrained `numeric`, or stayed `numeric`, as a `type_change`.** Those moves lose no value, and the load now accepts them. Before, an unconstrained `numeric` was compared as if it held no digits at all, so `INTEGER` → `numeric` and `numeric` → `numeric` were refused. A decimal written with spaces inside its parentheses, as in `decimal( 10, 2 )`, is now read as a decimal. Before, it compared only to the same spelling.
179
330
 
180
- #### A stored table binds only the connection it was built from
331
+ **Who is affected:** loads of objects into a table whose columns include an unconstrained `numeric`, or a decimal spelled with spaces. **What to do:** nothing.
181
332
 
182
- **[fix, security-relevant] A stored table is served only to sources on the connection it was built from.** A stored table is keyed by a content address computed from the connection's digest and the source's SQL. When two connections share a digest, identical SQL on both gave their sources one address, and a table built on one connection could be bound to a source on the other, or read while building one. Now:
333
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
183
334
 
184
- - An address, or the key the compiler files a table under, that sources on more than one connection share is withheld from all of them, and so is every source that reads one of those sources (transitively) or shares a table with one. None of them is planned, built or served; each answers live, from its own connection. The build plan lists each in `omittedSources` with a new reason: `address_shared_across_connections` for a source whose own address is shared, `upstream_address_shared_across_connections` for one that reads such a source. A host should stop serving and binding whatever it holds at those addresses.
185
- - No bind serves an entry at a withheld address, whatever connection it names, on either tier. No manifest a model compiles over, a query reads over or a build renders over holds one.
186
- - An entry whose `connectionName` names another connection than its address's planned sources is declined on every bind path and is not read as a build's upstream. It is counted on `publisher_served_copy_bind_total` with the new decline reason `connection_mismatch`.
187
- - An entry that names no connection is trusted only when no other configured connection may share its connection's digest. Which connections may share one is read from each connection's own digest, as builds and serves resolve it, without opening the connection: its `fingerprint` from config, else the driver's digest of its configuration (no attach, no catalog, no login). Only a connection reached through a proxy tunnel is opened to read it, under a 5-second timeout. A digest that cannot be read makes its connection a peer of the connections it could collide with (its own driver family, and every fingerprinted connection), never of the whole environment, and it is read again at the next bind or run; a build refused only for want of that reading is `retryable: true`, and says so. Otherwise the entry is declined (`connection_mismatch`). As a build upstream it is never read: a build that reads it fails with the new `SourceFailure.code` `upstream_connection_unproven` (`retryable: false`), and its table is not written. With no planned source at an entry's address (including when no build plan computed), an entry naming a connection whose digest another may share is declined too.
188
- - A source whose connection did not resolve no longer gets an address hashed from an undefined digest, which every such connection's identical SQL shared. It has no address (`address_unresolved` when a run meets it), is not built, and answers live.
335
+ #### execute_query tells an agent how old an extract answer is
189
336
 
190
- **Hosts whose connections may share a digest (one fingerprint, two BigQuery connections in one project, two MotherDuck connections on one database name, …) must set `connectionName` on every manifest entry and build reference.** Credible's control plane must ship that before this release is deployed: until it does, a chained build in such a project whose reference lacks `connectionName` fails with `upstream_connection_unproven`.
337
+ **[feature] On an answer that read an extract, MCP `execute_query`'s compact `path.servedBy` carries `dataAsOf`: the oldest `dataAsOf` among the extracts the query read.** The answer is no fresher than that instant. No other answer carries it; the full per-extract list stays on the REST path report (`path.servedBy.extracts[].dataAsOf`). See [docs/ai-agents.md](https://github.com/malloydata/publisher/blob/main/docs/ai-agents.md).
191
338
 
192
- **Who is affected:**
193
- - Any deployment where two configured connections can have one digest. That includes connections given one `fingerprint`, and also, with no fingerprint, connections whose driver hashes the same settings. Two BigQuery connections on one project have one digest whatever their credentials, because the driver hashes only the project and setup SQL. Connections configured identically under two names have one digest too.
194
- - Sources whose SQL is identical across such connections now answer live.
195
- - Unnamed manifest entries and references on such connections are no longer bound or read.
339
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
196
340
 
197
- **What to do:**
198
- - Give each connection a fingerprint of its own, then rebuild.
199
- - A stored table built before this release over a shared address, or downstream of one, may hold another connection's rows. Its sources answer live from now on, but the table is not rebuilt through Publisher while the connections still share a digest. Once they have distinct fingerprints, rebuild the affected downstream tables.
200
- - The two new `omittedSources` reasons, the new decline reason and the new `SourceFailure.code` `upstream_connection_unproven` are additions to open sets. `OmittedSource.reason` is a plain string in the v0 spec, documented as an open set, so a generated client accepts the new values. The v1 spec has no `omittedSources`.
341
+ #### A generated extract refused because a notebook imports a model says so
201
342
 
202
- ([#2203](https://github.com/malloydata/publisher/pull/2203) by @kylenesbit)
343
+ **[fix] When a notebook in the package imports a model, each generated extract that a finding about its origin would otherwise hold on its bound generation is refused, and the refusal now says why.** The message used to say the extract's "text, its notes included, changed since its bound generation was decided", even when nothing had changed. It now says that a notebook in the package imports a model whose cells are not read, so no generated extract in the package keeps its bound generation. This applies to every generated extract in the package, whichever model the notebook imports. A notebook's cells are also no longer folded into a generated extract's decision digest. The notebook check already refuses the hold, so the fold added nothing.
203
344
 
204
- #### A malformed `#(filter)` annotation no longer drops the well-formed filters beside it
345
+ **Who is affected:** packages with a `storage=` declaration rewritten into an extract and a notebook that imports a model. **What to do:** nothing. [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md#rewritten-storage-declarations) describes the hold.
205
346
 
206
- **[fix] One malformed `#(filter)` annotation on a source no longer turns off every filter on it (pre-existing, 0.18.10 and earlier).** The notes were parsed together and the first bad one threw, so the source got no filters at all: required filters stopped being required, supplied filter values were ignored, and queries answered unfiltered, with no error and nothing in `Package.warnings`. Now each note is parsed on its own:
347
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
207
348
 
208
- - **A malformed note is dropped alone** and the source's well-formed filters still apply. The package carries a `filter-annotation-invalid` warning naming the note (`warn`).
209
- - **A malformed note that is `required` or `implicit`**, including one that misspells the flag (`requried`, `implict`) or gives it a value that is not false (`required=true`), makes the source answer no query until it is fixed: each query is refused with the same 400 a missing required value gets (`required_filter`), saying which filter cannot be applied, and the warning is an `error`. Answering without a filter the author declared required is what this fix stops; an `implicit` filter is set by infrastructure such as row-level security, whose value would otherwise match no filter and restrict nothing.
210
- - **A `#(filter)` written between `source:` and the source's name** is filed by Malloy where filters are not read, so it still does not apply; the package now carries a `filter-annotation-not-read` warning for it. Move the note above the `source:` statement.
349
+ #### Warnings and refusals no longer advise `storage=`
211
350
 
212
- **Who is affected:** a package whose source has a malformed `#(filter)` beside well-formed ones. Its queries now apply the well-formed filters, so a query that omits a required filter's value answers 400 where it answered unfiltered. A source whose required or implicit filter itself is malformed answers 400 to every query until the annotation is fixed. Check `Package.warnings` for `filter-annotation-invalid` and `filter-annotation-not-read` after upgrading.
351
+ **[fix] The messages that still told an author to use, drop or move a `storage=` destination now name what applies today.** Every stored table is built on its source's own connection, and a `storage=` is rewritten into an extract, so that advice no longer led anywhere useful:
213
352
 
214
- ([#2208](https://github.com/malloydata/publisher/pull/2208) by @sagarswamirao)
353
+ - `rollup-unknown-key` lists the keys a `#(rollup)` reads as `grain=`, `name=` and `freshness.window=` / `freshness.fallback=`. A `storage=` on a rollup is still dropped with its `storage-rewritten` warning. An empty `storage=""` on a rollup is refused as `rollup-invalid`, with a message saying to remove it.
354
+ - `materialization-table-collision`, and the warning for `#@ persist` sources that share a table, say `on connection "<name>"`, not `in destination "<name>"`.
355
+ - The `sql_embed_bare` warning and serve-verdict fix say to embed the source as a query, `%{ <source> -> { select: * } }`, and no longer mention a storage destination.
356
+ - The `served-copy-not-served` warning for a hidden column says "its stored table", not "its v1 `storage=` table".
215
357
 
216
- - the 0.18.11 platform-test failures (MotherDuck digest read logs in; Windows lake reopen) ([#2226](https://github.com/malloydata/publisher/pull/2226) by @kylenesbit)
358
+ The served copy's `cross_connection_join`, `cross_connection_unbuilt` and `sql_embed_cross_connection` reasons, and the path report's `CROSS_CONNECTION` skip, are no longer produced. They could not happen: Malloy refuses a join or a `%{}` across connections when it compiles the author's file. They stay in the spec, marked retained. `publisher_served_copy_outcome_total` no longer lists them as `reason` values.
217
359
 
218
- ### Other changes
360
+ **Who is affected:** anyone who matches on these message texts. **What to do:** nothing; the codes are unchanged.
361
+
362
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
363
+
364
+ #### BREAKING: a stored source over an extract is refused under its own mechanism's not-built warning code
365
+
366
+ **[breaking] The warning code `extract-reader-stored` is retired.** A stored source that builds on, derives from or joins a definition reading an extract's target is still refused alone, never failing the load, with `RefusedSource.reason` `extract_reader_stored` (v1 `EXTRACT_READER_STORED`) and the same message. Its warning code and route are now the stored source's own mechanism's, as any other refusal of it:
367
+
368
+ - `#(materialize)`: `materialize-not-built`, route `materialize`;
369
+ - `#(rollup)` or `#@ preaggregate`: `rollup-not-built`, route `rollup`;
370
+ - a persisted view or query: `persist-view-not-built` or `persist-query-not-built`, route `@`;
371
+ - a `#@ persist` source: `persist-not-built`, route `@`.
372
+
373
+ The load warning line reads `<file>:<line>: [<code>] <message>`, and `publisher_annotation_findings_total{code}` counts it under that code; `extract-reader-stored` is no longer a label value.
374
+
375
+ **Who is affected:** a client, dashboard or alert that matches the warning code `extract-reader-stored`. **What to do:** match `RefusedSource.reason` `extract_reader_stored` to find these refusals, or the mechanism's `*-not-built` code. See [docs/extracts.md](https://github.com/malloydata/publisher/blob/main/docs/extracts.md).
376
+
377
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
378
+
379
+ #### One outcome rule for extract findings, decided at load, standalone and hosted alike
380
+
381
+ **[breaking] A hand-written `#(extract)` whose finding comes from the author's text or the configuration now fails the package's load, as a generated extract already did.** That covers `extract-caller-dependent`, `extract-key-not-output`, `extract-table-unqualified`, `extract-file-outside-package`, `extract-connection-identity-incomplete` and `extract-origin-unsupported`: each is reported as a `<file>:<line>: [<code>] <message>` line in the package's load error. Before, such an extract was refused alone and its readers failed 409 `EXTRACT_REFUSED`.
382
+
383
+ A finding of the origin's state (`extract-type-unmapped`, `extract-numeric-unconstrained`, `extract-collation-unacknowledged`, `extract-collation-unsupported`, `extract-watermark-unsupported`, `extract-origin-incompatible`) fails the load when no generation is bound at the extract's address. With one bound, the extract keeps serving it with a warning and its builds fail, as before; `extract-watermark-unsupported` now holds this way too. An origin that cannot be reached (`extract-origin-unreachable`) never fails the load: with nothing bound, that extract alone is refused (409 `EXTRACT_REFUSED`). The rule is the same on a standalone server, whose bound generations come from its own run store, and on a host, whose come from its manifest. `/status` now reports an extract held this way as `bound` with its `finding` set, where it said `refused`. The host rule that rejected a publish carrying a refusal with an empty `fix` is no longer part of the contract.
384
+
385
+ **Who is affected:** packages whose hand-written extracts were refused at load for one of those reasons. **What to do:** fix the line the load error names; see docs/extracts.md, "Findings".
386
+
387
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
388
+
389
+ #### The drop metric spells an extract's tier `extract`
390
+
391
+ **[change] `publisher_materialization_drop_tables_total{tier}` counts a dropped extract generation (or a table an older release recorded in a storage destination) as `tier="extract"`, not `tier="storage"`.** `extract` is now the one word for the place an extract lives, on every wire field and metric label: it is already `RefusedSource.tier`'s value for an extract's refusal, and the build metrics use it too.
392
+
393
+ **Who is affected:** operators with a dashboard or alert on `publisher_materialization_drop_tables_total{tier="storage"}`. **What to do:** change the selector to `tier="extract"`. The series under `storage` stops growing after the upgrade.
394
+
395
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
396
+
397
+ #### A persisted view called on a source imported from another file is served from its table
398
+
399
+ **[fix] A query that calls a `#@ persist` view on a source the model imports from the file that declares it (`import "f.malloy"`, then `run: a -> by_id`) is now answered from the view's stored table.** Before, the view leg declined it as `SHAPE_MISMATCH` ("the query does not call `by_id` on the source that declares it"), so the query ran live. An extract over such a view failed its build ("no stored table answers its query") instead of reading the stored table. A call through an import alias, or through an extension, is still not answered by the view leg. A `#(rollup)` over an imported base, and a `#@ persist` query whose source is imported, were already answered from their tables, with the base's gates re-applied for each caller, and still are: the three legs now read an imported run target by one rule.
400
+
401
+ **Who is affected:** packages that call a persisted view from a file other than the one that declares it. **What to do:** nothing.
402
+
403
+ ([#2294](https://github.com/malloydata/publisher/pull/2294) by @kylenesbit)
404
+
405
+ ### Features
406
+
407
+ - **server:** extracts, phase 4: readers fail closed on every surface; runs rules; neverLive is emitted ([#2199](https://github.com/malloydata/publisher/pull/2199) by @kylenesbit)
408
+ - **server:** extracts, a staged origin read for origins with no passthrough ([#2283](https://github.com/malloydata/publisher/pull/2283) by @kylenesbit)
409
+ - **server:** extracts, SQL Server origin: describe, collation, qualification, the exact staged read and watermarks ([#2289](https://github.com/malloydata/publisher/pull/2289) by @kylenesbit)
410
+ - **server:** extracts, the DuckDB origin read and DuckLake chains ([#2286](https://github.com/malloydata/publisher/pull/2286) by @kylenesbit)
411
+ - **server:** extracts, Snowflake origin: describe, collation, identity, qualification and the exact read ([#2217](https://github.com/malloydata/publisher/pull/2217) by @kylenesbit)
412
+
413
+ ### Fixes
414
+
415
+ #### Table metadata routes quote the table path
416
+
417
+ **[fix] A table read (`GET …/connections/{conn}/schemas/{schema}/tables/{table}`, with or without `include=collations`, the package-scoped and legacy `/projects` forms, and `search_database_schema`) now reads the table path as a dotted list of names, each quoted in the connection's dialect, as the `stats` route already did.** A name with a space or other character that needs quoting, such as the `main.Odd Name` a table listing returns, is now found. Text that is not a name is read as part of one, so it answers 404, and a path that does not parse (an unclosed quote, an empty part) answers 400. Ordinary names, quoted names and DuckDB file names such as `orders.csv` read as before, and the answer names the table as it was requested. BigQuery, which reads a table through its API, and `publisher` proxy connections, whose remote reads the path, are unchanged.
219
418
 
220
- #### Malloy 0.0.442
419
+ A `publisher` connection hands the table path to the Publisher it proxies to, which reads and quotes it there, so upgrade those remote Publishers along with this one. A DuckLake connection now places a quoted one- or two-part path under its catalog as it does an unquoted one.
221
420
 
222
- **[fix] `all()` and `exclude()` give the right answer inside a nest and alongside `having:`.** Malloy 0.0.442 fixes four cases where they returned wrong numbers (malloydata/malloy#3301). A query that used one of them in those places can now return different, correct numbers.
421
+ ([#2280](https://github.com/malloydata/publisher/pull/2280) by @kylenesbit)
223
422
 
224
- **[change] A streaming SQL read can report the bytes it scanned.** Malloy 0.0.442 adds `onRunStats` to its streaming read (malloydata/malloy#3302). This is the driver half of reporting BigQuery query cost through a `publisher` proxy connection; Publisher's half ships separately.
423
+ #### Text that only looks like an extract no longer breaks a package that declares none
225
424
 
226
- ([#2229](https://github.com/malloydata/publisher/pull/2229) by @jswir)
425
+ **[fix] A notebook that mentions `(extract)` no longer fails its package's load.** Any `.malloynb` holding the text `(extract)` anywhere, a markdown cell included, was refused as an `extract-in-notebook` finding, and the whole package failed to load. Now only an extract note in a code cell is refused, as Malloy reads one: not text in prose, a comment or a string.
426
+
427
+ **[fix] A model whose comment or tag only looks like `#(extract)` compiles again on the main thread.** A file holding `// #(extract …)` in a comment, a tag on another route such as `#(extract-later)`, or a malformed one such as `#(extract into=…)` loaded and queried, but `compile_model` (`POST …/compile`) refused it as "could not be loaded", as did every other compile that runs outside the load worker. A comment's `(extract)` did the same once the file was edited and not yet reloaded. Both the load's scan and those compiles now read a file as declaring an extract only when Malloy reads an extract note in it.
428
+
429
+ **[change] `#[extract]`, `#<extract>` and `#{extract}` declare an extract, as `#(extract)` does.** Malloy routes all four spellings to `extract`, and Publisher already enforced `#[authorize]` and the like as gates. These three spellings were not read as declarations by the load, and a compile outside the load worker refused the file instead. A package that uses one now binds it, or fails its load with the finding a miswritten `#(extract)` gets.
430
+
431
+ **[fix] A compile that reads a declaring file edited since the package loaded answers `424`, saying to reload, not a generic `500`.** Its extract targets are answered only from their copies, which are bound at load, so the file is never compiled live. The answer is the one a model that does not compile gets (`424`, with the file and "reload the package" in the message), and an MCP tool reports it with Malloy advice instead of an internal error. Everything else that sorts errors now reads it as a compile failure too: a materialization build that meets it is classed not retryable, the report lint counts it as a compile failure rather than reporting the lint incomplete, the package-load metrics label it `compilation_error`, and a `.malloynb` cell's `run:` that meets it is refused as not queryable.
432
+
433
+ **[fix] A package whose extract declarations cannot be bound fails its load with a `400`, not a retryable `503`.** The load answered `503` "Package-load worker pool unavailable: The package's #(extract) declarations cannot be bound: …", which told a client and a router to retry a load that fails the same way every time, and an MCP tool advised retrying. It now answers the declaration error itself: `400`, the same message without the prefix, Malloy advice over MCP, and a `/status` `loadErrors` entry whose message is that error, never `transient`. A version's rebind no longer retries it as a busy worker either. The load-failure `status` label on the package-load metrics moves from `pool_unavailable` to `policy_rejected`, the label every other `400` load refusal carries. A managed connection that cannot be looked up for now (a DuckLake catalog being replaced or lost, a DuckDB instance being replaced, a transient database error) is not miswritten: the load fails as that refusal, a retryable `503` that `/status` reports as `transient`, and only a name the environment does not have is refused as `extract-into-invalid`. Any other failure to look the connection up fails the load as itself.
434
+
435
+ **[fix] `compile_model` at `append` scope says why it cannot check a model whose extracts were bound from other text.** It answered `400` "the model could not be loaded to check it against". It now answers the same `424` a query does, naming the file and saying to reload the package.
436
+
437
+ **[fix] Storage file cleanup and extract generation expiry work at any snapshot count.** Past about 125,000 snapshots in a DuckLake destination's catalog under Node (about a million under Bun), both failed with "Maximum call stack size exceeded" before expiring anything. They now expire any number; 10,000 snapshots expire in one call in well under a second.
438
+
439
+ **[fix] An extract is never answered live because the load missed its declaration.** The load looked for declarations only in the package's listed `.malloy` files, and in what they import once one of them declared, and it read imports its own way. A declaration in a file imported under another name (`import "i.txt"`) or from a dot directory (`import ".hidden/i.malloy"`), imported in a triple-quoted string, or imported through the package's realpath (a linked package root, watch mode, macOS `/var`) could be compiled without being bound, and its target's readers then resolved through the managed connection, live. Now the load also follows the imports of every model and every notebook code cell, nested, whatever each imported file is named, so a declaration imported by a plain relative path binds, or fails the load with its finding. Whatever the load's scan misses, the compile's own file reader refuses: a file holding an extract note that the load did not bind fails the load with `[extract-invalid] declares an extract the package's load did not bind`, in the load worker, in every compile on the main thread, and in a served copy's compile, on the worker or inline. An import that leaves the package is still refused by the compile, and a malformed import (`import i.malloy`, an unterminated string) now fails with Malloy's syntax error instead of a retryable `503`.
440
+
441
+ **[fix] A linear report's tile is one query expression.** A tile runs as `run: <tile>`, so a tile whose text went on past the expression (an `import`, another statement, a definition) compiled that text too, outside what the report's model declares. Such a report is now refused at load: it shows no tiles, and the package carries a `notebook-cells-unreadable` error naming the tile, as for any other notebook the reader cannot show.
442
+
443
+ ([#2271](https://github.com/malloydata/publisher/pull/2271) by @kylenesbit)
444
+
445
+ #### An extract note nothing can bind fails the load
446
+
447
+ **[change] Packages that loaded before can now fail to load: a `#(extract)` that no definition carries fails the load with `extract-invalid`.** A note on a `run:`, an import, a join, a field, a query stage, a view inside a query, or the model (`##(extract)`, a `##|(extract)` block) was ignored. Nothing was declared, so the target its author meant to copy was read through the managed connection, as any table is. The load now refuses it with a finding that says where the note sits and that an extract annotates a named query, a view, or a source written as a query, such as `#(extract) on a run: statement is not read: …`. Move the note onto one of those, or delete it. A note on a named query, a view or a query-shaped source declares as before, and a file with a syntax error gets Malloy's error, not this finding. See [Targets, and running them](docs/extracts.md#targets-and-running-them).
448
+
449
+ **[fix] A view declared in a join's own source is never read as a view of the outer source.** `#(extract)` on `view: v` inside `join_one: u is … extend { … }` was declared as the outer source's `s.v`. Its copy could not build when `s` has no view `v`; when `s` has one, it copied and served `s`'s view, which nothing annotated. Such a note is now refused as `#(extract) on a view inside a join`, so a package that relied on it fails to load.
450
+
451
+ ([#2282](https://github.com/malloydata/publisher/pull/2282) by @kylenesbit)
452
+
453
+ #### DuckDB secrets created by a connection's setupSQL stay with that connection
454
+
455
+ **[fix] A secret a DuckDB connection's `setupSQL` creates is now visible only to that connection (pre-existing, 0.18.14 and earlier).** A `duckdb` connection that attaches databases runs its `setupSQL` before Publisher locks it down. A `CREATE PERSISTENT SECRET` (or `CREATE SECRET … IN local_file`) there was stored in a directory every such connection on the server, and later servers on the same host, also read. Each DuckDB instance now opens with a secret directory of its own, removed when the instance closes; a process exit (a shutdown or a crash) leaves it, and nothing reads it again. A persistent secret in `setupSQL` still works for the connection that created it, for as long as that connection is open; it is no longer kept across restarts or seen by any other connection. `setupSQL` is accepted only when `PUBLISHER_ALLOW_DUCKDB_SETUP_SQL` is set.
456
+
457
+ **When you upgrade:** nothing to change. Earlier versions kept those secrets in `publisher-duckdb/no-persistent-secrets` under the DuckDB temp directory (`PUBLISHER_DUCKDB_TEMP_DIRECTORY`, or the system temp directory). Publisher no longer reads it, and deletes it at startup (on Windows, delete it by hand).
458
+
459
+ ([#2284](https://github.com/malloydata/publisher/pull/2284) by @kylenesbit)
460
+
461
+ #### An extract cannot read a DuckDB connection that has setupSQL
462
+
463
+ **[change] An extract that reads a DuckDB connection with any `setupSQL` is refused with `extract-connection-identity-incomplete`.** An extract's table name hashes the dataset each connection it reads reaches, and a DuckDB connection's `setupSQL` is not read for that yet: any statement in it, a comment included, could change which data a name reads. This includes `setupSQL` kept only as filler, such as `SELECT 1` on a connection that reads files or URLs. The finding says `<q> reads <conn>, whose setupSQL is not read for an extract's identity yet`. Read the data through the package's built-in `duckdb` connection, or attach it with the connection's `attachedDatabases`, or extract from another connection. A DuckDB connection with no `setupSQL` keeps its extracts' table names. See [The table's name](docs/extracts.md#the-tables-name).
464
+
465
+ ([#2291](https://github.com/malloydata/publisher/pull/2291) by @kylenesbit)
466
+
467
+ #### The retired shared DuckDB secret directory is deleted at startup
468
+
469
+ **[change] At startup, Publisher deletes `publisher-duckdb/no-persistent-secrets` under the DuckDB temp directory (`PUBLISHER_DUCKDB_TEMP_DIRECTORY`, or the system temp directory).** Earlier versions kept secrets that a connection's `setupSQL` created there, and nothing reads that directory any more. The cleanup is best effort. It removes only that exact path, and only when it is a real directory owned by the server's user, never a symlink. It logs one line when the directory exists and never fails startup. On Windows it leaves the directory in place; delete it by hand.
470
+
471
+ ([#2292](https://github.com/malloydata/publisher/pull/2292) by @kylenesbit)
472
+
473
+ #### A rollup, persisted view or persisted query in a file that declares an extract is served from its table
474
+
475
+ **[fix] A database-tier `#(rollup)`, `#@ persist` view or `#@ persist` query (`query:`) is now answered from its stored table when the file that declares it, or a file that imports it, also declares an `#(extract)`.** Before, the table was built, but every query on the source was answered live: the path report said `MISSING_FIELD` (`the query does not compile against the rollup`), and the log warned `A #(rollup) rollup variant did not compile` with `<file> is not the text its extracts were bound from`. The text Publisher generates over the stored table for the declaring file, and for each file that imports it, was checked as if it were an unreloaded edit of that file. It is now read as written. Every author file is still checked as before.
476
+
477
+ **Who is affected:** packages that declare an extract in the same file as a database-tier rollup, persisted view or persisted query, or in a file that imports one. **What to do:** nothing. Those queries are answered from the stored tables.
478
+
479
+ ([#2293](https://github.com/malloydata/publisher/pull/2293) by @kylenesbit)
480
+
481
+ - **server:** the lockdown classifies whitespace as DuckDB does ([#2279](https://github.com/malloydata/publisher/pull/2279) by @kylenesbit)
482
+
483
+ ### Other changes
227
484
 
228
- - **release:** 0.18.10 ([#2191](https://github.com/malloydata/publisher/pull/2191) by @kylenesbit)
229
- - **skills:** say what to do when a get_context search answers with the packages to pick from ([#2038](https://github.com/malloydata/publisher/pull/2038) by @jswir)
485
+ - **server:** the unbound-extract realpath specs import by file URL, which Windows reads ([#2295](https://github.com/malloydata/publisher/pull/2295) by @kylenesbit)
486
+ - **server:** one materialization model for stored tables and extracts ([#2296](https://github.com/malloydata/publisher/pull/2296) by @kylenesbit)
230
487
 
231
488
  Every release's notes: https://github.com/malloydata/publisher/releases