@malloy-publisher/server 0.18.2 → 0.18.3

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.
@@ -8812,9 +8812,13 @@ components:
8812
8812
  a destination the environment does not configure),
8813
8813
  `connection_cannot_hold_table` (its connection creates no tables),
8814
8814
  `materialization_off` (only the served copy reads it, and the
8815
- served copy is off) or `served_copy` (only the served copy reads
8816
- it, and the served copy does not re-root it). An open set: treat a
8817
- code you do not know as a warning like any other.
8815
+ served copy is off), `served_copy` (only the served copy reads
8816
+ it, and the served copy does not re-root it), `incompatible` (the
8817
+ table no longer matches the column contract its build recorded) or
8818
+ `contract_missing` (its build recorded no usable contract); a
8819
+ `storage=` table with either of the last two is reported
8820
+ `NOT_SERVED`, not `NOT_BUILT`. An open set: treat a code you do not
8821
+ know as a warning like any other.
8818
8822
  tableId:
8819
8823
  type: string
8820
8824
  description: The table, as `considered` names it.
@@ -167085,7 +167085,7 @@ var init_telemetry = __esm(() => {
167085
167085
  });
167086
167086
 
167087
167087
  // package.json
167088
- var version = "0.18.2";
167088
+ var version = "0.18.3";
167089
167089
  var init_package = () => {};
167090
167090
 
167091
167091
  // src/version.ts
@@ -31546,13 +31546,26 @@ function duckdbTableCollations(definition) {
31546
31546
  function unquoted(name) {
31547
31547
  return /^".*"$/.test(name) ? name.slice(1, -1).replace(/""/g, '"') : name;
31548
31548
  }
31549
+ function bigqueryNamesNoCollation(name) {
31550
+ return typeof name !== "string" || BQ_NO_COLLATION.includes(name.trim().toUpperCase());
31551
+ }
31552
+ function bigqueryCollatedSql(column) {
31553
+ return `UPPER(TRIM(COALESCE(${column}, ''))) NOT IN (${BQ_NO_COLLATION.map((v) => `'${v}'`).join(", ")})`;
31554
+ }
31549
31555
  function bigqueryColumnCollation(name) {
31550
- return typeof name === "string" && name.trim() !== "" ? `bigquery:${name.trim()}` : BINARY_COLLATION;
31556
+ return bigqueryNamesNoCollation(name) ? BINARY_COLLATION : `bigquery:${name.trim()}`;
31557
+ }
31558
+ function canonicalCollation(identity) {
31559
+ const prefix = "bigquery:";
31560
+ return identity.startsWith(prefix) && bigqueryNamesNoCollation(identity.slice(prefix.length)) ? BINARY_COLLATION : identity;
31551
31561
  }
31552
31562
  function postgresColumnCollation(identity, judged) {
31553
31563
  return judged === "binary" ? BINARY_COLLATION : `postgres:${identity}`;
31554
31564
  }
31555
- var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
31565
+ var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, BQ_NO_COLLATION, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
31566
+ var init_collation = __esm(() => {
31567
+ BQ_NO_COLLATION = ["", "NULL"];
31568
+ });
31556
31569
 
31557
31570
  // src/service/materialization/domain/vocabulary.ts
31558
31571
  var init_vocabulary = () => {};
@@ -31728,7 +31741,7 @@ function parseContract(raw) {
31728
31741
  columns.push({
31729
31742
  name: c.name,
31730
31743
  nativeType: c.nativeType,
31731
- collation: typeof c.collation === "string" ? c.collation : null,
31744
+ collation: typeof c.collation === "string" ? canonicalCollation(c.collation) : null,
31732
31745
  compare: typeof c.compare === "string" && COMPARES.has(c.compare) ? c.compare : "none",
31733
31746
  gateExact: c.gateExact === true,
31734
31747
  ...typeof c.declaredType === "string" && c.declaredType !== "" ? { declaredType: c.declaredType } : {}
@@ -31771,13 +31784,16 @@ function columnNamed(columns, name) {
31771
31784
  const folded = columns.filter((c) => c.name.toLowerCase() === name.toLowerCase());
31772
31785
  return folded.length === 1 ? folded[0] : undefined;
31773
31786
  }
31774
- function spelledType(nativeType) {
31775
- return nativeType.replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
31787
+ function committedNativeType(nativeType, dialect) {
31788
+ return dialect === STORAGE_DIALECT ? nativeType.replace(DUCKDB_GEOMETRY_CRS, "GEOMETRY") : nativeType;
31789
+ }
31790
+ function spelledType(nativeType, dialect) {
31791
+ return committedNativeType(nativeType, dialect).replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
31776
31792
  }
31777
31793
  function contractDigest(contract) {
31778
31794
  const canonical = contract.columns.map((c) => [
31779
31795
  c.name,
31780
- spelledType(c.nativeType),
31796
+ spelledType(c.nativeType, contract.dialect),
31781
31797
  c.collation
31782
31798
  ]);
31783
31799
  return createHash("sha256").update(JSON.stringify(canonical)).digest("hex").slice(0, 32);
@@ -31817,7 +31833,7 @@ function deriveContract(args) {
31817
31833
  const collation = c.isString && stored.collations ? collationOf(stored.collations, c.name) : null;
31818
31834
  return {
31819
31835
  name: c.name,
31820
- nativeType: c.nativeType,
31836
+ nativeType: committedNativeType(c.nativeType, stored.dialect),
31821
31837
  collation,
31822
31838
  compare: columnCompare(args, c.isString, collation, c.name),
31823
31839
  gateExact: tier === "database" ? c.storedAsDouble !== true : gateColumnTypeExact(c.nativeType, upstreamTypeNamed(args.upstreamTypes, c.name)),
@@ -31877,7 +31893,7 @@ function compatible(contract, observed) {
31877
31893
  continue;
31878
31894
  }
31879
31895
  const type = now.nativeType ?? now.type;
31880
- if (type === undefined || spelledType(type) !== spelledType(c.nativeType)) {
31896
+ if (type === undefined || spelledType(type, contract.dialect) !== spelledType(c.nativeType, contract.dialect)) {
31881
31897
  retyped.push(c.name);
31882
31898
  continue;
31883
31899
  }
@@ -31910,10 +31926,13 @@ function declaredMoves(contract, declared) {
31910
31926
  return now !== undefined && now !== "" && now !== c.declaredType ? [c.name] : [];
31911
31927
  });
31912
31928
  }
31913
- var CONTRACT_VERSION = 1, COMPARES, COMPARE_RANK;
31929
+ var CONTRACT_VERSION = 1, COMPARES, DUCKDB_GEOMETRY_CRS, COMPARE_RANK;
31914
31930
  var init_column_contract = __esm(() => {
31931
+ init_collation();
31932
+ init_dialect();
31915
31933
  init_gate_policy();
31916
31934
  COMPARES = new Set(["exact", "equality", "none"]);
31935
+ DUCKDB_GEOMETRY_CRS = /\bGEOMETRY\s*\(\s*'(?:[^']|'')*'\s*\)/gi;
31917
31936
  COMPARE_RANK = {
31918
31937
  none: 0,
31919
31938
  equality: 1,
package/dist/server.mjs CHANGED
@@ -135178,13 +135178,26 @@ function duckdbTableCollations(definition) {
135178
135178
  function unquoted(name) {
135179
135179
  return /^".*"$/.test(name) ? name.slice(1, -1).replace(/""/g, '"') : name;
135180
135180
  }
135181
+ function bigqueryNamesNoCollation(name) {
135182
+ return typeof name !== "string" || BQ_NO_COLLATION.includes(name.trim().toUpperCase());
135183
+ }
135184
+ function bigqueryCollatedSql(column) {
135185
+ return `UPPER(TRIM(COALESCE(${column}, ''))) NOT IN (${BQ_NO_COLLATION.map((v) => `'${v}'`).join(", ")})`;
135186
+ }
135181
135187
  function bigqueryColumnCollation(name) {
135182
- return typeof name === "string" && name.trim() !== "" ? `bigquery:${name.trim()}` : BINARY_COLLATION;
135188
+ return bigqueryNamesNoCollation(name) ? BINARY_COLLATION : `bigquery:${name.trim()}`;
135189
+ }
135190
+ function canonicalCollation(identity) {
135191
+ const prefix = "bigquery:";
135192
+ return identity.startsWith(prefix) && bigqueryNamesNoCollation(identity.slice(prefix.length)) ? BINARY_COLLATION : identity;
135183
135193
  }
135184
135194
  function postgresColumnCollation(identity, judged) {
135185
135195
  return judged === "binary" ? BINARY_COLLATION : `postgres:${identity}`;
135186
135196
  }
135187
- var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
135197
+ var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, BQ_NO_COLLATION, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
135198
+ var init_collation = __esm(() => {
135199
+ BQ_NO_COLLATION = ["", "NULL"];
135200
+ });
135188
135201
 
135189
135202
  // src/service/materialization/domain/vocabulary.ts
135190
135203
  var init_vocabulary = () => {};
@@ -135360,7 +135373,7 @@ function parseContract(raw) {
135360
135373
  columns.push({
135361
135374
  name: c.name,
135362
135375
  nativeType: c.nativeType,
135363
- collation: typeof c.collation === "string" ? c.collation : null,
135376
+ collation: typeof c.collation === "string" ? canonicalCollation(c.collation) : null,
135364
135377
  compare: typeof c.compare === "string" && COMPARES.has(c.compare) ? c.compare : "none",
135365
135378
  gateExact: c.gateExact === true,
135366
135379
  ...typeof c.declaredType === "string" && c.declaredType !== "" ? { declaredType: c.declaredType } : {}
@@ -135403,13 +135416,16 @@ function columnNamed(columns, name) {
135403
135416
  const folded = columns.filter((c) => c.name.toLowerCase() === name.toLowerCase());
135404
135417
  return folded.length === 1 ? folded[0] : undefined;
135405
135418
  }
135406
- function spelledType(nativeType) {
135407
- return nativeType.replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
135419
+ function committedNativeType(nativeType, dialect) {
135420
+ return dialect === STORAGE_DIALECT ? nativeType.replace(DUCKDB_GEOMETRY_CRS, "GEOMETRY") : nativeType;
135421
+ }
135422
+ function spelledType(nativeType, dialect) {
135423
+ return committedNativeType(nativeType, dialect).replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
135408
135424
  }
135409
135425
  function contractDigest(contract) {
135410
135426
  const canonical = contract.columns.map((c) => [
135411
135427
  c.name,
135412
- spelledType(c.nativeType),
135428
+ spelledType(c.nativeType, contract.dialect),
135413
135429
  c.collation
135414
135430
  ]);
135415
135431
  return createHash5("sha256").update(JSON.stringify(canonical)).digest("hex").slice(0, 32);
@@ -135449,7 +135465,7 @@ function deriveContract(args) {
135449
135465
  const collation = c.isString && stored.collations ? collationOf(stored.collations, c.name) : null;
135450
135466
  return {
135451
135467
  name: c.name,
135452
- nativeType: c.nativeType,
135468
+ nativeType: committedNativeType(c.nativeType, stored.dialect),
135453
135469
  collation,
135454
135470
  compare: columnCompare(args, c.isString, collation, c.name),
135455
135471
  gateExact: tier === "database" ? c.storedAsDouble !== true : gateColumnTypeExact(c.nativeType, upstreamTypeNamed(args.upstreamTypes, c.name)),
@@ -135509,7 +135525,7 @@ function compatible(contract, observed) {
135509
135525
  continue;
135510
135526
  }
135511
135527
  const type = now.nativeType ?? now.type;
135512
- if (type === undefined || spelledType(type) !== spelledType(c.nativeType)) {
135528
+ if (type === undefined || spelledType(type, contract.dialect) !== spelledType(c.nativeType, contract.dialect)) {
135513
135529
  retyped.push(c.name);
135514
135530
  continue;
135515
135531
  }
@@ -135542,10 +135558,13 @@ function declaredMoves(contract, declared) {
135542
135558
  return now !== undefined && now !== "" && now !== c.declaredType ? [c.name] : [];
135543
135559
  });
135544
135560
  }
135545
- var CONTRACT_VERSION = 1, COMPARES, COMPARE_RANK;
135561
+ var CONTRACT_VERSION = 1, COMPARES, DUCKDB_GEOMETRY_CRS, COMPARE_RANK;
135546
135562
  var init_column_contract = __esm(() => {
135563
+ init_collation();
135564
+ init_dialect();
135547
135565
  init_gate_policy();
135548
135566
  COMPARES = new Set(["exact", "equality", "none"]);
135567
+ DUCKDB_GEOMETRY_CRS = /\bGEOMETRY\s*\(\s*'(?:[^']|'')*'\s*\)/gi;
135549
135568
  COMPARE_RANK = {
135550
135569
  none: 0,
135551
135570
  equality: 1,
@@ -138623,9 +138642,11 @@ class BigQueryCatalog {
138623
138642
  return bigqueryProbeOnce(this.reads, [this.connectionName, "dataset", dataset], () => bigqueryDatasetTables(this.io, dataset));
138624
138643
  }
138625
138644
  }
138626
- var BQ_COLLATED = "NULLIF(NULLIF(collation_name, 'NULL'), '') IS NOT NULL", MAX_PROJECT_DATASETS = 1e4, TABLE_TYPES, PROJECT_ID, BIGQUERY_COLLATION;
138645
+ var BQ_COLLATED, MAX_PROJECT_DATASETS = 1e4, TABLE_TYPES, PROJECT_ID, BIGQUERY_COLLATION;
138627
138646
  var init_bigquery2 = __esm(() => {
138628
138647
  init_quoting();
138648
+ init_collation();
138649
+ BQ_COLLATED = bigqueryCollatedSql("collation_name");
138629
138650
  TABLE_TYPES = new Set(["BASE TABLE", "CLONE", "SNAPSHOT"]);
138630
138651
  PROJECT_ID = /^(?:[a-z0-9.-]+:)?[a-z][a-z0-9-]{4,28}[a-z0-9]$/;
138631
138652
  BIGQUERY_COLLATION = Object.freeze({ scope: "dataset" });
@@ -138663,6 +138684,7 @@ async function duckdbTableListed(io, tablePath) {
138663
138684
  }
138664
138685
  var DUCKDB_COLLATION;
138665
138686
  var init_duckdb2 = __esm(() => {
138687
+ init_collation();
138666
138688
  DUCKDB_COLLATION = Object.freeze({
138667
138689
  scope: "instance",
138668
138690
  sourceColumns: duckdbCollation,
@@ -138716,6 +138738,7 @@ async function postgresTableListed(io, tablePath) {
138716
138738
  }
138717
138739
  var POSTGRES_COLLATION;
138718
138740
  var init_postgres2 = __esm(() => {
138741
+ init_collation();
138719
138742
  POSTGRES_COLLATION = Object.freeze({
138720
138743
  scope: "column",
138721
138744
  sourceColumns: (io, sql) => postgresCollation(io, unfinalizedPostgresSQL(sql)),
@@ -138734,7 +138757,7 @@ function collationReaderOf(dialect) {
138734
138757
  return name !== undefined && Object.hasOwn(COLLATION_READERS, name) ? COLLATION_READERS[name] : undefined;
138735
138758
  }
138736
138759
  var COLLATION_READERS;
138737
- var init_collation = __esm(() => {
138760
+ var init_collation2 = __esm(() => {
138738
138761
  init_dialect();
138739
138762
  init_bigquery2();
138740
138763
  init_duckdb2();
@@ -139112,6 +139135,8 @@ var init_source_capability = __esm(() => {
139112
139135
  init_malloy_text();
139113
139136
  init_source_reads();
139114
139137
  init_collation();
139138
+ init_collation();
139139
+ init_collation2();
139115
139140
  init_bigquery2();
139116
139141
  init_postgres2();
139117
139142
  init_catalog_io();
@@ -157283,6 +157308,7 @@ var RelationProbeUnsupportedError, CURRENT_SCHEMA_SQL, DUCKDB_CATALOGS_SQL = "SE
157283
157308
  var init_warehouse_sql = __esm(() => {
157284
157309
  init_introspection_sql();
157285
157310
  init_quoting();
157311
+ init_collation();
157286
157312
  init_dialect();
157287
157313
  RelationProbeUnsupportedError = class RelationProbeUnsupportedError extends Error {
157288
157314
  };
@@ -157565,7 +157591,7 @@ function movedColumns(built, read) {
157565
157591
  if (!now)
157566
157592
  return { kind: "moved", reason: `its column '${name}' is gone` };
157567
157593
  const nowType = now.nativeType ?? now.type ?? "";
157568
- if (now.storedAsDouble || spelled(nowType) !== spelled(type)) {
157594
+ if (now.storedAsDouble || spelledType(nowType, read.dialect) !== spelledType(type, read.dialect)) {
157569
157595
  return {
157570
157596
  kind: "moved",
157571
157597
  reason: `its column '${name}' was built as ${type} and is now ` + `${nowType || "of no readable type"}`
@@ -157593,9 +157619,6 @@ function storedUpstreamMove(entry, read) {
157593
157619
  const reason = verdict.code === "column_gone" ? `its column '${name}' is gone` : verdict.code === "column_retyped" ? `its column '${name}' was built as ${built?.nativeType ?? "?"} ` + `and is now ${now?.nativeType ?? now?.type ?? "of no readable type"}` : `its column '${name}' no longer matches the contract its build ` + `recorded (${verdict.code})`;
157594
157620
  return { kind: "moved", reason };
157595
157621
  }
157596
- function spelled(nativeType) {
157597
- return nativeType.replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
157598
- }
157599
157622
  function columnNamed2(columns, name) {
157600
157623
  const exact = columns.find((c) => c.name === name);
157601
157624
  if (exact)
@@ -158127,7 +158150,7 @@ var init_generated_files = __esm(() => {
158127
158150
  });
158128
158151
 
158129
158152
  // package.json
158130
- var version = "0.18.2";
158153
+ var version = "0.18.3";
158131
158154
  var init_package = () => {};
158132
158155
 
158133
158156
  // src/version.ts
@@ -181173,6 +181196,12 @@ function verdictExplains(reason, verdict) {
181173
181196
  return true;
181174
181197
  return reason === "ROW_LEVEL_GATE" && (verdict === "row_level_gate" || verdict === "refused");
181175
181198
  }
181199
+ function contractVerdictOfTwin(candidate, tier, verdicts) {
181200
+ if (tier !== "database" || candidate.reason !== "NOT_BUILT")
181201
+ return;
181202
+ const twin = verdicts.get(liveVerdictKey("storage", candidate.tableId));
181203
+ return twin && CONTRACT_VERDICTS.has(twin.reason) ? twin : undefined;
181204
+ }
181176
181205
  function applyServeVerdicts(considered, tierOf, input) {
181177
181206
  const verdicts = input.catalog?.liveVerdicts ?? new Map;
181178
181207
  const warnings = [];
@@ -181187,7 +181216,7 @@ function applyServeVerdicts(considered, tierOf, input) {
181187
181216
  const tier = tierOf.get(candidate);
181188
181217
  if (!tier)
181189
181218
  continue;
181190
- const verdict = verdicts.get(liveVerdictKey(tier, candidate.tableId));
181219
+ const verdict = verdicts.get(liveVerdictKey(tier, candidate.tableId)) ?? contractVerdictOfTwin(candidate, tier, verdicts);
181191
181220
  if (!verdict || !verdictExplains(candidate.reason, verdict.reason)) {
181192
181221
  if (own && ownVerdictExplains(candidate, own)) {
181193
181222
  candidate.reason = "NOT_SERVED";
@@ -181264,6 +181293,10 @@ function verdictWarningMessage(reason) {
181264
181293
  return "This table's storage destination is not configured on this server, so its queries are answered live.";
181265
181294
  case "connection_cannot_hold_table":
181266
181295
  return "This table's connection cannot hold a table, so its queries are answered live.";
181296
+ case "incompatible":
181297
+ return "This table no longer matches the column contract its build recorded, so its queries are answered live until a build rebuilds it.";
181298
+ case "contract_missing":
181299
+ return "This table carries no column contract, so its queries are answered live until a build rebuilds it in full.";
181267
181300
  case "types_unrecorded":
181268
181301
  return "This table's build recorded no column types, so a change since the build cannot be ruled out; its queries are answered live until it is rebuilt.";
181269
181302
  default:
@@ -181527,10 +181560,11 @@ function fieldPathsIn2(e) {
181527
181560
  }, { skipKeys: FIELD_PATH_SKIPPED_KEYS3 });
181528
181561
  return out;
181529
181562
  }
181530
- var MAX_NOT_CONSIDERED = 10, FIELD_PATH_SKIPPED_KEYS3;
181563
+ var MAX_NOT_CONSIDERED = 10, CONTRACT_VERDICTS, FIELD_PATH_SKIPPED_KEYS3;
181531
181564
  var init_query_path = __esm(() => {
181532
181565
  init_array_query();
181533
181566
  init_leg_decline();
181567
+ CONTRACT_VERDICTS = new Set(["incompatible", "contract_missing"]);
181534
181568
  FIELD_PATH_SKIPPED_KEYS3 = new Set(["overload", "at"]);
181535
181569
  });
181536
181570
 
@@ -373912,6 +373946,7 @@ var init_admission_lookup = __esm(() => {
373912
373946
  init_prepared_query();
373913
373947
  init_source_reads();
373914
373948
  init_collation();
373949
+ init_collation2();
373915
373950
  init_bigquery2();
373916
373951
  init_string_paths();
373917
373952
  init_gate_reads();
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "snowflake"
20
20
  ],
21
21
  "homepage": "https://docs.malloydata.dev/documentation/user_guides/publishing/mcp_agents",
22
- "version": "0.18.2",
22
+ "version": "0.18.3",
23
23
  "main": "dist/server.mjs",
24
24
  "bin": {
25
25
  "malloy-publisher": "dist/server.mjs"