@malloy-publisher/skills 0.1.66 → 0.1.67
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.
- package/CHANGELOG.md +231 -0
- package/package.json +3 -2
- package/skills/eval-answer/SKILL.md +1 -1
- package/skills/eval-diagnose/SKILL.md +1 -1
- package/skills/eval-import/SKILL.md +1 -1
- package/skills/eval-improve/SKILL.md +1 -1
- package/skills/eval-judge/SKILL.md +1 -1
- package/skills/eval-loop/SKILL.md +1 -1
- package/skills/eval-report/SKILL.md +1 -1
- package/skills/malloy-analysis/SKILL.md +2 -2
- package/skills/malloy-analysis-report/SKILL.md +1 -1
- package/skills/malloy-charts/SKILL.md +1 -1
- package/skills/malloy-classify/SKILL.md +1 -1
- package/skills/malloy-compliance-review/SKILL.md +1 -1
- package/skills/malloy-dashboards/SKILL.md +1 -1
- package/skills/malloy-define/SKILL.md +1 -1
- package/skills/malloy-define-workflow/SKILL.md +1 -1
- package/skills/malloy-discover/SKILL.md +1 -1
- package/skills/malloy-document/SKILL.md +1 -1
- package/skills/malloy-excel-review/SKILL.md +1 -1
- package/skills/malloy-getting-started/SKILL.md +1 -1
- package/skills/malloy-gotchas-modeling/SKILL.md +1 -1
- package/skills/malloy-html-data-apps/SKILL.md +2 -1
- package/skills/malloy-html-data-apps/reference/app-frame.md +1 -1
- package/skills/malloy-lookml-review/SKILL.md +1 -1
- package/skills/malloy-materialization/SKILL.md +5 -5
- package/skills/malloy-materialization/reference/storage.md +2 -0
- package/skills/malloy-model/SKILL.md +1 -1
- package/skills/malloy-model-as-you-go/SKILL.md +1 -1
- package/skills/malloy-modeling/SKILL.md +1 -1
- package/skills/malloy-notebooks/SKILL.md +1 -1
- package/skills/malloy-phrase-detection/SKILL.md +6 -3
- package/skills/malloy-powerbi-review/SKILL.md +1 -1
- package/skills/malloy-publish/SKILL.md +1 -1
- package/skills/malloy-queries/SKILL.md +1 -1
- package/skills/malloy-reports/SKILL.md +1 -1
- package/skills/malloy-review/SKILL.md +1 -1
- package/skills/malloy-run-workflow/SKILL.md +1 -1
- package/skills/malloy-source-unreachable/SKILL.md +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.67 — 2026-12-04
|
|
4
|
+
|
|
5
|
+
Also released: `@malloy-publisher/skills` 0.1.67, `@malloy-publisher/create-malloy-package` 0.0.82.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
#### The build plan lists the persisted sources each dimensional index reads through
|
|
10
|
+
|
|
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.
|
|
12
|
+
|
|
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.
|
|
14
|
+
|
|
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.
|
|
16
|
+
|
|
17
|
+
([#2190](https://github.com/malloydata/publisher/pull/2190) by @kylenesbit)
|
|
18
|
+
|
|
19
|
+
#### `#(rollup)` stores a distinct count when its field is in the grain
|
|
20
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
```malloy
|
|
24
|
+
#(rollup) grain=["region", "customer_id"]
|
|
25
|
+
measure: buyers is count(customer_id)
|
|
26
|
+
```
|
|
27
|
+
|
|
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.
|
|
31
|
+
|
|
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.
|
|
33
|
+
|
|
34
|
+
([#2140](https://github.com/malloydata/publisher/pull/2140) by @jswir)
|
|
35
|
+
|
|
36
|
+
#### Simulated materialization plans a source on a `publisher` proxy as the host would
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
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.
|
|
45
|
+
|
|
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.
|
|
47
|
+
|
|
48
|
+
([#2188](https://github.com/malloydata/publisher/pull/2188) by @jswir)
|
|
49
|
+
|
|
50
|
+
#### The authorize-bypass secret can rotate without a window where callers and servers disagree
|
|
51
|
+
|
|
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.
|
|
53
|
+
|
|
54
|
+
([#2204](https://github.com/malloydata/publisher/pull/2204) by @housejester)
|
|
55
|
+
|
|
56
|
+
#### Publisher.db changes shape only through recorded migrations
|
|
57
|
+
|
|
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).
|
|
59
|
+
|
|
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.
|
|
61
|
+
|
|
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.
|
|
63
|
+
|
|
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.
|
|
65
|
+
|
|
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.
|
|
67
|
+
|
|
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`.
|
|
69
|
+
|
|
70
|
+
([#2216](https://github.com/malloydata/publisher/pull/2216) by @sagarswamirao)
|
|
71
|
+
|
|
72
|
+
#### A GitHub package location is cloned at the branch or tag it names
|
|
73
|
+
|
|
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.
|
|
75
|
+
|
|
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).
|
|
77
|
+
|
|
78
|
+
([#2196](https://github.com/malloydata/publisher/pull/2196) by @housejester)
|
|
79
|
+
|
|
80
|
+
### Fixes
|
|
81
|
+
|
|
82
|
+
#### A documented joined field is served from a stored table
|
|
83
|
+
|
|
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.
|
|
85
|
+
|
|
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.
|
|
87
|
+
|
|
88
|
+
([#2141](https://github.com/malloydata/publisher/pull/2141) by @jswir)
|
|
89
|
+
|
|
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
|
|
91
|
+
|
|
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.
|
|
93
|
+
|
|
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.
|
|
95
|
+
|
|
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.
|
|
97
|
+
|
|
98
|
+
([#2194](https://github.com/malloydata/publisher/pull/2194) by @kylenesbit)
|
|
99
|
+
|
|
100
|
+
#### A table read through a connection that cannot be opened says why
|
|
101
|
+
|
|
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:
|
|
103
|
+
|
|
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.
|
|
106
|
+
|
|
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.
|
|
108
|
+
|
|
109
|
+
([#2183](https://github.com/malloydata/publisher/pull/2183) by @girishjeswani)
|
|
110
|
+
|
|
111
|
+
#### The data-app skill replays an app's own queries before publishing
|
|
112
|
+
|
|
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.
|
|
114
|
+
|
|
115
|
+
([#2183](https://github.com/malloydata/publisher/pull/2183) by @girishjeswani)
|
|
116
|
+
|
|
117
|
+
#### A column named `minutes`, `hours` or another plural timeframe word no longer leaves its source unbuilt
|
|
118
|
+
|
|
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.
|
|
120
|
+
|
|
121
|
+
([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
|
|
122
|
+
|
|
123
|
+
#### A declared average over rolled-up measures is served from the rollup
|
|
124
|
+
|
|
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.
|
|
126
|
+
|
|
127
|
+
([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
|
|
128
|
+
|
|
129
|
+
#### The path report names each table it considered
|
|
130
|
+
|
|
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.
|
|
132
|
+
|
|
133
|
+
([#2182](https://github.com/malloydata/publisher/pull/2182) by @girishjeswani)
|
|
134
|
+
|
|
135
|
+
#### A fatal DuckDB error no longer breaks a connection until restart
|
|
136
|
+
|
|
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:
|
|
138
|
+
|
|
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.
|
|
145
|
+
|
|
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).
|
|
147
|
+
|
|
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.
|
|
149
|
+
|
|
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.
|
|
151
|
+
|
|
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.
|
|
153
|
+
|
|
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.
|
|
155
|
+
|
|
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.
|
|
157
|
+
|
|
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.
|
|
159
|
+
|
|
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.
|
|
161
|
+
|
|
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.
|
|
163
|
+
|
|
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.
|
|
165
|
+
|
|
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.
|
|
167
|
+
|
|
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.
|
|
169
|
+
|
|
170
|
+
([#2167](https://github.com/malloydata/publisher/pull/2167) by @nthuff)
|
|
171
|
+
|
|
172
|
+
#### A transient database error during a manifest bind keeps the previous binding serving, and a remote package's boot publish is retried
|
|
173
|
+
|
|
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.
|
|
175
|
+
|
|
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.
|
|
177
|
+
|
|
178
|
+
([#2201](https://github.com/malloydata/publisher/pull/2201) by @kylenesbit)
|
|
179
|
+
|
|
180
|
+
#### A stored table binds only the connection it was built from
|
|
181
|
+
|
|
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:
|
|
183
|
+
|
|
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.
|
|
189
|
+
|
|
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`.
|
|
191
|
+
|
|
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.
|
|
196
|
+
|
|
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`.
|
|
201
|
+
|
|
202
|
+
([#2203](https://github.com/malloydata/publisher/pull/2203) by @kylenesbit)
|
|
203
|
+
|
|
204
|
+
#### A malformed `#(filter)` annotation no longer drops the well-formed filters beside it
|
|
205
|
+
|
|
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:
|
|
207
|
+
|
|
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.
|
|
211
|
+
|
|
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.
|
|
213
|
+
|
|
214
|
+
([#2208](https://github.com/malloydata/publisher/pull/2208) by @sagarswamirao)
|
|
215
|
+
|
|
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)
|
|
217
|
+
|
|
218
|
+
### Other changes
|
|
219
|
+
|
|
220
|
+
#### Malloy 0.0.442
|
|
221
|
+
|
|
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.
|
|
223
|
+
|
|
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.
|
|
225
|
+
|
|
226
|
+
([#2229](https://github.com/malloydata/publisher/pull/2229) by @jswir)
|
|
227
|
+
|
|
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)
|
|
230
|
+
|
|
231
|
+
Every release's notes: https://github.com/malloydata/publisher/releases
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/skills",
|
|
3
3
|
"description": "Agent skills for Malloy and the Malloy Publisher",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.67",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"skills",
|
|
22
|
-
"dist"
|
|
22
|
+
"dist",
|
|
23
|
+
"CHANGELOG.md"
|
|
23
24
|
],
|
|
24
25
|
"keywords": [
|
|
25
26
|
"malloy",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-answer
|
|
3
3
|
description: 'Score one analytical answer against a verified golden, and score which of the entities the golden depends on retrieval delivered to the answerer. Run the contamination checklist, re-execute the submitted query yourself, then spawn a judge subagent per skill:eval-judge. Append attempt, tool_call, score, and retrieval_score events to the file ledger (reference/ledger-schema.md). Never explain the failure (eval-diagnose) or edit the model (eval-improve). Use when asked whether an answer was correct, to score a run, or to baseline a model.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Evaluate One Answer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-diagnose
|
|
3
3
|
description: 'Diagnose why a scored answer failed and who owns the fix, then cluster the failures by shared root cause. Walk dataset, agent-call, get_context/model, get_context/retrieval, construction, then model-definition. Append issue events to the file ledger, linked by traceId, one per cluster. Use after eval-answer, when triaging a run, or before changing a model. Does not edit the model (eval-improve).'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Diagnose One Answer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-import
|
|
3
3
|
description: 'Turn a list of questions into an eval set, whatever shape it arrived in: a JSONL a customer sent, a CSV, a spreadsheet export, a markdown doc, an email thread, or a pull from production logs. Classify each item by what came WITH the question (a query, a number, prose criteria, or nothing), write cases.jsonl and set.json per reference/case-format.md, keep the file as it arrived, and seal each question so a later edit is detectable. Never marks a value-bearing golden verified and never invents a question. Use when questions arrive from outside and need to become a set, or before the first run against a set nobody here authored.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Import questions into an eval set
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-improve
|
|
3
3
|
description: 'Make the smallest safe edit that closes a diagnosed gap the model repo owns: a Malloy model edit, or a package skill in the default skill set. Every factual claim carries a probe receipt. Use after eval-diagnose, or when asked to fix a model so an agent can discover the right answer. Never accepts its own edit; the acceptance check belongs to eval-loop. Does not decide whether an answer was wrong (eval-answer) or why (eval-diagnose).'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Improve the Model
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-judge
|
|
3
3
|
description: 'Decide whether ONE answer matches its golden, and say whether you believe the golden. Read this before emitting any verdict. Covers containment, column pairing, near_match, refusals, and the gold_status judgement. Use when scoring an attempt in an evaluation run; never to conduct a run (eval-loop), diagnose a failure (eval-diagnose) or edit a model (eval-improve).'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# The judge
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-loop
|
|
3
3
|
description: 'Conduct a local Publisher evaluation loop in five steps: scrape/run, eval, diagnose, improve, checkpoint. You are the conductor: import cases into the file ledger, spawn a blind answerer, then run eval-answer, eval-diagnose, and eval-improve. Persistence is plain files: the set in the model package''s evals/ directory, runs in the set''s workdir; checkpoints are git commits of the model repo. `eval.py` runs each step from the set''s eval.toml. Use to score a model, diagnose failures, improve behind an acceptance check, or roll back a bad direction.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# The Evaluation Loop
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eval-report
|
|
3
3
|
description: 'Write the summary a person reads after an evaluation run: what ran, what it scored, which failures were the MODEL and which were the EVAL itself (out of turns, contaminated, unestablished golden, unreadable judge), what was learned, and what to do next. Every claim links to the artifact behind it. Use at the end of any run, before quoting a number to anyone. Never scores an answer (eval-answer) or decides who owns a failure (eval-diagnose).'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Report a Run
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-analysis
|
|
3
3
|
description: "Read before your first get_context call on any business or data question. The required workflow, not background: which source, which rows, how to verify. Skipping it causes confident wrong answers."
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Copyright (c) Credible Data Inc. SPDX-License-Identifier: MIT -->
|
|
@@ -22,7 +22,7 @@ Restate what is being asked: which metric, which breakdown (group-by), which fil
|
|
|
22
22
|
|
|
23
23
|
Find the right entities before writing any query.
|
|
24
24
|
|
|
25
|
-
-
|
|
25
|
+
- **Name the package in `scopes` when you know it.** When you do not, list the packages first: call `get_context` with no `search_targets` and no `scopes`. If that lists environments rather than packages, call again with `environment` set to the one that fits, to list its packages. Pick the package whose name and summary fit the question, and only then search, with `scopes` set to it. Do not send a search without a package to find one. If a server answers a search with a list of packages, or with an error saying a search needs one package, set `scopes` and send the same targets again. Ask the user only when none fits or two fit equally.
|
|
26
26
|
- **Load `skill:malloy-phrase-detection`**, then call `get_context` with entity targets that describe the fields the question needs: a `measure` for the metric, a `dimension` for each breakdown or filter, and a `view` if the question sounds like a canned report. **One concept per target**: never list several in one `search_text` ("revenue, date, category and region"), because they then compete for one target's few picks. **Every target carries a `search_text`**: a target without one enumerates a capped catalog instead of searching, and the cap is blind to your question. The tool description covers what comes back and how to narrow or browse.
|
|
27
27
|
- **A source in the results is not yet every field you need.** Check that each concept the question needs came back as a field. When one did not, when a target is listed in `unresolved_targets`, or when a warning says results were cut, call `get_context` again with `scopes[].source` set to the source that should hold it and one target per missing concept. Do not answer from a source match alone, and do not tell the user a field is missing before that narrower search.
|
|
28
28
|
- **A value the user typed (a brand, a city, a product name) is not yet a filter.** Resolve it to the string the data stores before you filter on it: a `dimensional_value` target in that `get_context` call, or, where value search isn't available, a query of the dimension's distinct values. "ray ban" may be stored as `Ray-Ban` and `Ray-Ban Junior`; a `where:` on the user's own spelling, or a regex guessed from it, can match nothing and still return a result.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-analysis-report
|
|
3
3
|
description: Combine validated Malloy queries into a report (a linear report, read top to bottom). Use when the user asks to "create a report", "combine these into a report", or wants a persistent multi-query artifact.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-charts
|
|
3
3
|
description: Read before choosing a chart or adding a chart annotation. Chart types, tag syntax and scale rules, KPI cards, dashboards, sparklines, and the renderer mistakes that fail silently.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-classify
|
|
3
3
|
description: 'Propose #(classification) annotations for a Malloy model from an access policy''s class scheme, backed by aggregate value evidence from the served data, and show them as a diff before writing anything. Use when the user asks to "classify the model", "tag PHI/PII", "label sensitive fields", or adds fields to a package that a policy governs, and before running malloy-compliance-review on a model nobody has classified.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-compliance-review
|
|
3
3
|
description: 'Check a Malloy package and its controls against a written access policy: turn the policy''s prose into a control register, run compliance.py check against a served package (structure, access as each role, and the values themselves), judge what needs a person, and produce a report and a signable attestation. Use when the user asks whether a model "complies with", "satisfies" or "meets" a policy, HIPAA, SOC 2, PCI or the like, asks for a compliance review or attestation, or wants the review in CI.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-dashboards
|
|
3
3
|
description: "Renamed to malloy-reports. A dashboard is now a report with layout=grid: a .malloy file with an ## artifact tag, written at the package root. Load malloy-reports instead when the user asks for a dashboard, a filterable view, or drill-through between views."
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-define
|
|
3
3
|
description: Propose scope, a source plan and field definitions for a Malloy model. Which tables and questions, which sources at what grain, then renames, dimensions and measures, each backed by querying data.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-define-workflow
|
|
3
3
|
description: Define a package's skill sets (named folders of skills, including `default`, the package's own skills) and workflows (a named job with instructions that lists skill sets), declared in a package's publisher.json. Use when the user asks to create, add, change, fix or migrate a workflow or skill set in a package, to give a package its own skills, or to turn an old package agent into workflows. Not for running a workflow that already exists (that is malloy-run-workflow), and not for a one-off question, which you just answer.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-discover
|
|
3
3
|
description: Silent data discovery for Malloy modeling. Used at Step 1 of the modeling workflow. Scans tables, columns, distributions, and relationships without user interaction. The agent builds an internal picture before presenting anything.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-document
|
|
3
3
|
description: 'Add documentation with #(doc) tags to Malloy models so fields and sources are described in plain language. Use when user asks to "add documentation", "add doc tags", "document the model", or wants fields and sources described for natural-language search and discovery. For runtime filters, declare given: parameters (see the malloy-model skill); #(filter) is deprecated. Filters are a runtime/modeling construct (governance, latency, correctness), not a documentation tag.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-excel-review
|
|
3
3
|
description: Move an Excel workbook (.xlsx or .xlsm) onto Malloy - recover the model hiding in its cells, translate its formulas and pivots, and prove the numbers match against the values the file already stores. Use when a workbook is present, when a user wants to migrate or switch off a spreadsheet, and whenever a specific formula has to become Malloy - SUMIFS, COUNTIF, SUMPRODUCT, VLOOKUP, XLOOKUP, INDEX/MATCH, pivot tables, assumption cells, roll-forwards, circular references, Monte Carlo, or a Power Pivot model. Carries worked recipes, each labelled executed or semantics-cited in place, and states what each port costs. Works with or without a database connection.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-getting-started
|
|
3
3
|
description: First steps for using a Malloy Publisher deployment through its MCP tools. Use when connecting to Publisher for the first time, when you do not yet know the available environments, packages, or models, or when a user asks what data they can explore. Also use for "malloy help" or which Malloy skill to read. Covers verifying the server, discovering data with get_context, and running a first grounded query.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-gotchas-modeling
|
|
3
3
|
description: Malloy modeling mistakes and compile-error fixes. Read before writing sources, dimensions, measures or joins, and when a .malloy file will not compile. Reserved words, NULLs, dates, field access.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-html-data-apps
|
|
3
3
|
description: "Build or modify an in-package HTML data app for a Malloy Publisher package (a public/ directory the package serves): design it, write its Publisher.query code, embed it. Hand-authored, no build step."
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -88,6 +88,7 @@ You are building for someone who cannot tell a correct dashboard from a broken o
|
|
|
88
88
|
- **Validate every query against the model before wiring it in** (step 4): confirm it compiles and that the column names match what your render code reads.
|
|
89
89
|
- **Load the finished page and confirm every tile shows real numbers**: not stuck on "Loading…", not an error, not an empty state you didn't intend. In a headless browser, wait on `load` plus a content selector, not network idle (`publisher.js` holds an SSE stream open; see `reference/runtime.md`). Don't hand-roll this each time - `reference/verification-harness.md` is a copy-adaptable recipe: a mock `sdk/publisher.js` returning canned rows keyed by `(model, query)`, a `python3 -m http.server` webroot, and Playwright assertions (KPIs non-null, no `.is-error`, no stuck `.kit-skeleton`, a chart/table present). It also documents the false-"stuck skeleton" trap (assert after the mock's async delay, never on `networkidle`).
|
|
90
90
|
- **Check it embedded, for stability, and through its drawers.** Load each page inside the Publisher console (`/<env>/<package>/data-apps/<path>`) as well as on its own, measure layout shift on a first and a repeat visit, confirm the app never scrolls inside its frame, and open a drawer from well down the page after scrolling the host with real wheel events: the page behind must not move, the drawer must span exactly the visible area, and its scroll must stay in it. `reference/verification-harness.md` section 4 has the checks. A tile check alone passed on a build where every one of these was broken.
|
|
91
|
+
- **When the package materializes anything, replay the app's own queries before publishing.** List every query the app sends: each `Publisher.query(model, query)` call and each query text in its tile definitions, with the filter values a reader picks most and the givens a real reader's request carries (a gated source answers differently without them). Run each with `execute_query` on the local Publisher in simulation (`skill:malloy-materialization`, "Validate before publish") and write down its path report, one line per query: the table that would answer it (`path.servedBy`, with its `mode`), or for a live answer why its table was skipped (`path.firstSkip`, with its `reason`). A query the author expects a table to answer that comes back live is a finding to fix before publishing, unless its reason is one that is live by design: `row_level_gate`, `inherited_gate` or `unreachable`. Never weaken an `#(access_filter)`, an `#(authorize)` or a given to make a query serve from a table; report it instead. Simulation answers every query from live rows, so it tells you which table would answer, never how fast: a table's read time can only be measured after a real build. Each replayed query is a live query against the very sources the package materializes because they are expensive, so run each once, at the filter values that matter, not in a loop. Over `cred dev`'s proxy connections a local server does not yet plan a `storage=` source as the host would (it is refused, `storage_source_unsupported`), so those queries show no simulated path; judge them after a real build on the host.
|
|
91
92
|
- **Unit-test any non-trivial pure logic** (a month-join, a de-cumulation, a unit conversion). Keep that logic in DOM-free helpers so `node --test` can cover it, and run it.
|
|
92
93
|
|
|
93
94
|
## Minimal scaffold
|
|
@@ -93,7 +93,7 @@ source: sales is order_items extend {
|
|
|
93
93
|
returned is count() { where: status = 'Returned' }
|
|
94
94
|
#(rollup) grain=["order_date", "category", "channel", "status"]
|
|
95
95
|
return_rate is returned / nullif(items, 0) // a ratio of rolled-up sums rolls up when it says so too
|
|
96
|
-
aov is net_sales / nullif(order_count, 0) // a distinct count
|
|
96
|
+
aov is net_sales / nullif(order_count, 0) // a distinct count rolls up only with its field in the grain: from the stored source
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-lookml-review
|
|
3
3
|
description: Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-materialization
|
|
3
|
-
description:
|
|
4
|
-
version: 0.1.
|
|
3
|
+
description: Use to materialize a Malloy source, roll up a measure or persist a view (`#(materialize)`, `#(rollup)`, `#@ persist`), to check one before publishing, or when a stored table is not built or not read.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -119,11 +119,11 @@ The steps, in order:
|
|
|
119
119
|
5. **Get approval.** The annotations on the existing shape are approved **as a set**. Each shape change (a new or split source, an extracted base, restructured joins, a moved field) is approved **on its own, with its diff**, and only after the annotations are shown not to suffice.
|
|
120
120
|
6. **Annotate.** Apply exactly what was approved, save, and read the summary and the path reports again.
|
|
121
121
|
|
|
122
|
-
**What simulation cannot settle.** The build SQL is compiled and planned, never run, so it is `unvalidated` until a real build: a warehouse permission, a dialect gap or a statement limit first shows there. Freshness on the host and build limits are `not_knowable_locally`. Key uniqueness (behind an inlined `join_many` and key-dependent rollups) is `predicted`, from one aggregate per key check (only a count comes back; a `storage=` table's own key compares `count()` with `count(distinct key)`); a real build confirms it. Stored types are predicted (a Postgres `numeric` with no modifier is predicted `DECIMAL(38,0)`). Simulation answers live under live's ceiling, so it can deny a query a served copy would answer. A `storage=` destination no build has ever created cannot be attached, so its tables bind but are reported answered live, with a `destination` fact `not_knowable_locally`. Each metadata read is bounded (15 s, 2 minutes per package); one that fails or runs out of time makes its fact `not_knowable_locally`. Metadata is cached per table, so only `reload_package` sees a warehouse schema or permission change.
|
|
122
|
+
**What simulation cannot settle.** The build SQL is compiled and planned, never run, so it is `unvalidated` until a real build: a warehouse permission, a dialect gap or a statement limit first shows there. How fast a table answers is not measured either: every simulated query reads live rows, so a table's read time is known only after a real build. Freshness on the host and build limits are `not_knowable_locally`. Key uniqueness (behind an inlined `join_many` and key-dependent rollups) is `predicted`, from one aggregate per key check (only a count comes back; a `storage=` table's own key compares `count()` with `count(distinct key)`); a real build confirms it. Stored types are predicted (a Postgres `numeric` with no modifier is predicted `DECIMAL(38,0)`). Simulation answers live under live's ceiling, so it can deny a query a served copy would answer. A `storage=` destination no build has ever created cannot be attached, so its tables bind but are reported answered live, with a `destination` fact `not_knowable_locally`. Each metadata read is bounded (15 s, 2 minutes per package); one that fails or runs out of time makes its fact `not_knowable_locally`. Metadata is cached per table, so only `reload_package` sees a warehouse schema or permission change.
|
|
123
123
|
|
|
124
124
|
**A real local build** means restarting the server with `--no-materialize-simulate` (or `PUBLISHER_MATERIALIZE_SIMULATE=false`): its builds then run for real and report `mode: "local"`. Under simulation, a build request (`malloy-pub materialize`, `POST …/materializations`), a run delete, a table drop and a manifest binding all answer **409 `SIMULATION_ACTIVE`**, and the scheduler does not start. A server cannot start with simulation on under a frozen config or with no watched environment, and a watched package whose `publisher.json` declares a `manifestLocation` still loads but serves live, with a `simulation-manifest-bound` warning.
|
|
125
125
|
|
|
126
|
-
**Over a proxy connection** (`type: "publisher"`, forwarding to another Publisher),
|
|
126
|
+
**Over a proxy connection** (`type: "publisher"`, forwarding to another Publisher), an unpublished package plans a `storage=` source as the type of the host connection the proxy stands for: a Postgres, BigQuery or Snowflake source is admitted, a DuckLake source is refused for author SQL, any other type is refused because the host would refuse it too, and its stats are the host's. What depends on the host's configuration (its build times, limits, same-catalog and managed verdicts, its DuckLake lake) is still `not_knowable_locally`. The one planning setting, `persist.addressIncludesDestination`, is read locally; hosted cells pin it `false`, so a local server with it on predicts addresses, names and reuse that differ from the host's.
|
|
127
127
|
|
|
128
128
|
## Building and refreshing (standalone vs. hosted)
|
|
129
129
|
|
|
@@ -145,7 +145,7 @@ A green run is not proof, and neither is a fast query (on small data a live reco
|
|
|
145
145
|
3. **The query names the table.** Every query result carries a path report, `path`. An answer from a `#(materialize)` table reads `servedBy.kind: "materialized"` with `via: "served_copy"`; a rollup reads `kind: "rollup"`; a persisted view `kind: "view"`; a persisted named query `kind: "query"`. A table that was tried and not used is in `considered` with its `reason`. The full result (the REST query response without `compactJson`) also carries the SQL it ran, whose `FROM` names the physical table.
|
|
146
146
|
4. **Compare served with live.** Declare an opted-out reader in a scratch model file (`#@ -persist source: x_live is x extend {}`, in a file, not in the query text, where it is not opted out), run the same query on both, and compare the rows; delete the file afterwards.
|
|
147
147
|
|
|
148
|
-
A query response's `servedFrom` field names the tier that answered: `database` for a table built in the source's own connection, `storage` for a `storage=` table, `live_fallback` when a `storage=` read failed and live answered, and empty when no table answered. The path report's `servedBy.tier` names the same tier. MCP `execute_query` returns both: `servedFrom`, and a compact `path` whose `servedBy` names the table that answered, and whose `firstSkip`, on a live answer, gives why the source's own table
|
|
148
|
+
A query response's `servedFrom` field names the tier that answered: `database` for a table built in the source's own connection, `storage` for a `storage=` table, `live_fallback` when a `storage=` read failed and live answered, and empty when no table answered. The path report's `servedBy.tier` names the same tier. MCP `execute_query` returns both: `servedFrom`, and a compact `path` whose `servedBy` names the table that answered, and whose `firstSkip`, on a live answer, gives why the source's own table was skipped, else a rollup skipped for `MISSING_FIELD` (its grain covers the query, and a field the query asks for is missing), else another rollup skip, with `GRAIN_TOO_COARSE` last (`NOT_BUILT` means build it).
|
|
149
149
|
|
|
150
150
|
## Why does this answer live?
|
|
151
151
|
|
|
@@ -56,6 +56,8 @@ A stored rollup pays at build time so that reads are cheap; the grain and the in
|
|
|
56
56
|
|
|
57
57
|
- **Grain to the reads, not to the data.** Group by exactly the columns the queries filter or group by. Every extra dimension multiplies the row count, and a rollup that approaches the fact table's size saves nothing.
|
|
58
58
|
- **A source's own filters shrink its table.** The `where:` a materialized source already declares is applied by the build. A term that reads a given is left out of the build and re-applied at read, and a rolling time window is re-applied at every read.
|
|
59
|
+
- **A distinct count needs its field in the grain.** `#(rollup)` stores `count(x)` only when `x` is a grain entry (`grain=["region", "customer_id"]` for `count(customer_id)`); the rollup keeps one row per value of `x`, and a coarser query counts the stored values, exactly. With `x` outside the grain the load fails (`rollup-not-mergeable`). Size the grain before adding `x`: a high-cardinality `x` can make the rollup nearly as large as the fact, so check its rollup reduction and flag it under 10x (`reference/estimating.md`).
|
|
60
|
+
- **An average is a sum and a count, rolled up, and a measure over them.** Put `#(rollup)` on the sum and the count at the grain the reads need, and declare `avg is total / nullif(n, 0)` with no line of its own: it is served from any rollup that stores both. A measure with an aggregate of its own (`total / count()`) or a filter on a dimension is not, without a `#(rollup)` line of its own; one with `all()` or `exclude()` cannot be rolled up. Their queries answer live with `MISSING_FIELD`. Publisher 0.18.9 and earlier serve the declared average only with its own `#(rollup)` line at the parts' grain, so when the path report skips the rollup with `MISSING_FIELD` for it, add that line.
|
|
59
61
|
- **Give a ratio both halves.** A percentage whose numerator is a rollup and whose denominator is a count over the fact table still scans the fact per query. Put `#(rollup)` on the denominator's existing measure at the same grain first.
|
|
60
62
|
|
|
61
63
|
Three more shapings change the model, so each is a tier-2 change (`reference/estimating.md`), proposed only after the annotations above fall short, as its own diff with its own approval: adding a `where:` to bake a filter into a source, a new source holding the denominator at its own grain, and `except:`-ing columns no reader uses from a wide stored copy.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-model
|
|
3
3
|
description: Build Malloy semantic models with base source and joined source files. Use when creating or modifying .malloy files, user asks to "create a malloy model", "add dimensions", "add measures", "create a source", or any Malloy model authoring task.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-model-as-you-go
|
|
3
3
|
description: 'After answering a data question, write down what the answer assumed so the next reader can trust the number. A field with a #(doc) in the model when you can edit it, an extend in the notebook when you can only author reports, or a stated assumption plus a Malloy snippet when you can only chat. Use after every answered question that rested on a judgment call, and whenever a question is asked against tables that have no model yet.'
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-modeling
|
|
3
3
|
description: Build semantic models with Malloy for the Malloy Publisher. Read this skill whenever the user asks about modeling data or specifically mentions Malloy.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-notebooks
|
|
3
3
|
description: "Renamed to malloy-reports. A notebook is now a report with layout=linear: a .malloy file with an ## artifact tag, written at the package root. Load malloy-reports instead when the user asks for a notebook, a data story, or a report that reads top to bottom."
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-phrase-detection
|
|
3
3
|
description: How to phrase search_text on a get_context call so retrieval returns the fields you need instead of a truncated catalog. Covers target-type classification and decomposition patterns.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!-- Copyright (c) Credible Data Inc. SPDX-License-Identifier: MIT -->
|
|
7
7
|
|
|
@@ -19,13 +19,15 @@ The `get_context` tool description defines each field and what a call returns. T
|
|
|
19
19
|
|
|
20
20
|
**Do not enumerate.** Omitting `search_text` lists a catalog rather than searching it. Knowing the package narrows *where* to look; it does not substitute for saying *what* you need: if you know the package, that is a reason to scope, not a reason to skip `search_text`. Enumerated listings are capped per source and per entity type, and with no relevance signal the cap drops the fields your question is about while keeping join-path noise.
|
|
21
21
|
|
|
22
|
-
A bare listing has
|
|
22
|
+
A bare listing has four legitimate uses. The first is answering "what data is here?" when the user has named no subject at all. The second is reading a specific entity you already have the exact name of: scope to its source, set `entity_name`, and pass `search_text: null`, which returns that entity's docstring and Malloy code without spending a search. The third is checking whether a source you can name is in the catalog at all, after a ranked search did not return it (`malloy-source-unreachable` covers this). The fourth is listing the packages to pick the one to search, when you do not know which holds the data; if the listing shows environments instead, list again with `environment` set to one of them. Every other call carries `search_text` on every target.
|
|
23
|
+
|
|
24
|
+
**When a search comes back as a list of packages, or as an error asking for one.** A server may decline to search when the call names no package and more than one is in reach. Some servers answer with the packages, each with a one-line summary, and a warning that nothing was searched. Others answer with an error saying a search needs one package, with a Fix that names the packages to pick from. Neither is an empty result, and rephrasing will not change either. Set `scopes` to the package that holds the data and send the same targets again, unchanged. When you do not know the package, list the packages first rather than searching to find out; when you do, put it in `scopes` on the first call.
|
|
23
25
|
|
|
24
26
|
## Authoring `search_text` for entity targets
|
|
25
27
|
|
|
26
28
|
Write `search_text` as a brief semantic **description** of what you're looking for, not an echo of the user's word. This applies even when you already know the entity name from a prior result: still describe it, don't just repeat the name. That is a rule about how to *phrase* a search, and it does not conflict with the exact-entity lookup above: if you want that one entity's code and docstring rather than a ranked set, pin it with `entity_name` and skip the search entirely. Sending its name back as `search_text` is the move this rule forbids, because it searches for a name instead of either describing a concept or asking for the entity.
|
|
27
29
|
|
|
28
|
-
One target per concept
|
|
30
|
+
One target per concept, in both directions. Don't pile up targets that point at the same field: the tool handles phrasing variants internally. And never put several fields or concepts in one `search_text` (a list joined by commas or "and", a breakdown plus its filter, a metric plus its grouping): each target's text is matched as one phrase and returns only its few best fields, so a blended text finds few of them. "customer age, gender and state" is not one `dimension` target `"customer age, gender and state"`; it is three: `"the age of the customer"`, `"the gender of the customer"`, `"the state where the customer lives"`. "Non-obvious decomposition patterns" below covers the phrases that need more than one target.
|
|
29
31
|
|
|
30
32
|
## Target-type decision guide
|
|
31
33
|
|
|
@@ -58,6 +60,7 @@ These are the rules you won't apply correctly by default:
|
|
|
58
60
|
7. **Multiple values for one concept, one dimension target.** Several values ("premium and basic") still map to a single dimension target for the parent field, plus one `dimensional_value` target per value (`"premium"`, `"basic"`), or `execute_query` where value search comes back empty.
|
|
59
61
|
8. **The quantity asked for is a measure, even when nothing names it.** "How many titles were released in 2019?" is asking for a count, but no noun in it is the count: the visible phrases are the subject ("titles") and the filter ("2019"), and mapping only those yields a `source` and a `dimension` target with no way to answer. Always add a measure target for the quantity itself (`"the number of titles"`). This holds for every interrogative that IS the aggregation -- "how many", "how much", "how often" -- and it is the pattern most easily lost when a filter or grouping is the loud part of the sentence. Measured: an answerer got this right on "How many titles are in the dataset?" and dropped it on "How many titles were released in 2019?", where the year took the attention.
|
|
60
62
|
9. **A population qualifier is a target, and so is the one the question omits.** Words like "real", "actual", "genuine", "live" or "production" are not filler: they name rows the model marks for exclusion. Target the flag itself (`"the flag marking synthetic, test or monitoring traffic"`), not just the noun they modify. Add one such target even when the question carries no qualifier at all, because a table of events, requests, sessions or logs usually holds test, internal or cancelled rows and nothing in the wording will say so. Resolve it to the model's own flag rather than inventing a filter on an id or a name; a hand-rolled exclusion and the documented one rarely select the same rows.
|
|
63
|
+
10. **One dimension target per breakdown.** A question naming N breakdowns or attributes is N dimension targets. "Revenue by region and category" is one measure plus two dimensions (`"the geographic region"`, `"the product category"`), never one dimension for `"region and category"`.
|
|
61
64
|
|
|
62
65
|
## Worked example
|
|
63
66
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-powerbi-review
|
|
3
3
|
description: Move a Power BI semantic model (TMDL, PBIP, or .pbix) onto Malloy - read their model, transpile its DAX, and prove the numbers match. Use when Power BI artifacts are present, when a user wants to migrate or switch off Power BI, and whenever a specific DAX measure has to become Malloy - CALCULATE, ALL/ALLSELECTED/ALLEXCEPT, RANKX and top-N, time intelligence, USERELATIONSHIP, calculation groups, what-if parameters, or an RLS role. Carries a worked, executed transpile per construct and states what each port costs. Works with or without a database connection.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-publish
|
|
3
3
|
description: Package Malloy models for serving by Malloy Publisher. Use when user asks to "publish", "package", "deploy", or wants to share models with others.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-queries
|
|
3
3
|
description: Read before writing or debugging a Malloy query. Dates, aggregates vs dimensions, joins, filters, strings, window functions, chart annotations, and the compile errors a SQL habit produces.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-reports
|
|
3
3
|
description: "Build or modify a Malloy Publisher report: a .malloy file with an ## artifact tag, written at the package root unless asked otherwise, laid out as a grid (a dashboard, scanned at a glance) or linear (a notebook or data story, read top to bottom), with filter controls rendered from givens and # drill click-through. Use when the user asks for a dashboard, a notebook, a report, a data story, a filterable view, or drill-through between views, and no code is wanted."
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-review
|
|
3
3
|
description: Malloy semantic-model code review. Invoke when the user asks to review, audit, or critique a `.malloy` file, a folder of Malloy models, or a GitHub PR that touches Malloy. Enforces project modeling standards and emits a navigable review file.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-run-workflow
|
|
3
3
|
description: Use a workflow or skill set a Malloy package declares, by name. Use only when the user names a package workflow or skill set, for example "run the weekly-report workflow on storefront" or "use the analyst skill set in this package". Fetches the definition with get_workflow or the set with get_skill_set, installs the skill sets, and runs the workflow's instructions when asked to run it.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!--
|
|
7
7
|
Copyright (c) Credible Data Inc.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: malloy-source-unreachable
|
|
3
3
|
description: Work out why a source is missing from get_context, or why a query against it was refused with a 404 or a 403, and what to do next. Use when a source you expect is absent from discovery, when execute_query answers "No queryable source", when a query that used to work stops working, or when deciding whether a package's curation is hiding something you need.
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
---
|
|
6
6
|
<!-- Copyright (c) Credible Data Inc. SPDX-License-Identifier: MIT -->
|
|
7
7
|
|