@malloy-publisher/app 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/api-doc.yaml +371 -645
  2. package/dist/assets/{EnvironmentPage-Y9IWPC9J.js → EnvironmentPage-DF2PahCR.js} +1 -1
  3. package/dist/assets/{HomePage-BOUo0MEl.js → HomePage-DIYlgPCz.js} +1 -1
  4. package/dist/assets/{MainPage-BkM5UDRU.js → MainPage-C7PGAA5k.js} +1 -1
  5. package/dist/assets/ModelPage-BMoBnrW7.js +2 -0
  6. package/dist/assets/PackagePage-DD2vLSFe.js +1 -0
  7. package/dist/assets/{PackageSplatRoute-BLC29ek-.js → PackageSplatRoute-BYIMwnLL.js} +2 -2
  8. package/dist/assets/{RenderedResult-vyM2wQbC.es-ha8dF24T.js → RenderedResult-CYJ2Y9Fm.es-C8nokn71.js} +7 -7
  9. package/dist/assets/{RouteError-BolMqTuz.js → RouteError-B8dE60Vs.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-CPv1eHkI.js → ThemeEditorPage-D0wf74fh.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-DZtImN0S.js → ToggleButtonGroup-CX0_J2zR.js} +1 -1
  12. package/dist/assets/{documentRoutes-DI5cX3ty.js → documentRoutes-DgSMAc0m.js} +1 -1
  13. package/dist/assets/{editPageMounted-C--4kcld.js → editPageMounted-BUGVg-_g.js} +2 -2
  14. package/dist/assets/{index-DyYEltlF.js → index-BQL8UUcK.js} +1 -1
  15. package/dist/assets/{index-D9wSfMZN.js → index-BiOT4K_d.js} +1 -1
  16. package/dist/assets/{index-CbsrzNSp.js → index-DAQjZOAL.js} +1 -1
  17. package/dist/assets/index-DRkw60sj.js +512 -0
  18. package/dist/assets/{index.es-D8SVyfmS.js → index.es-DgNl8IqU.js} +20 -20
  19. package/dist/assets/usePackageLinkNavigate-bHr_AFYo.js +1 -0
  20. package/dist/assets/{usePackageRoute-A_YQMrax.js → usePackageRoute-BhB6txS6.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/dist/mcp-app/report.js +2683 -757
  23. package/package.json +2 -2
  24. package/dist/assets/ModelPage-PgDTkS5C.js +0 -2
  25. package/dist/assets/PackagePage-Dn7FrQ5r.js +0 -1
  26. package/dist/assets/index-DLToSg1f.js +0 -512
  27. package/dist/assets/usePackageLinkNavigate-DxHGKrmZ.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -13,7 +13,7 @@ info:
13
13
  ## Key Features
14
14
 
15
15
  - **Discovery**: List environments, packages, and the models, notebooks, data apps, and data a package contains
16
- - **Query Execution**: Run queries against models, execute notebooks a cell at a time, and compile-check Malloy without running it
16
+ - **Query Execution**: Run queries against models and compile-check Malloy without running it
17
17
  - **Data Apps**: In-package HTML data apps served from a package's `public/` directory
18
18
  - **Materializations**: Persist Malloy sources as tables, on a schedule or on demand
19
19
  - **Connection Management**: Configure and test warehouse connections, and browse their schemas and tables
@@ -32,7 +32,7 @@ info:
32
32
  └── Packages
33
33
  ├── Versions published, immutable versions and `latest`
34
34
  ├── Models query and compile
35
- ├── Notebooks execute a cell at a time
35
+ ├── Reports dashboards and notebooks, run as model queries
36
36
  ├── Data Apps static HTML data apps from public/
37
37
  ├── Databases embedded data files
38
38
  ├── Materializations persisted sources
@@ -71,10 +71,6 @@ tags:
71
71
  Reports - any `.malloy` file in a package carrying an artifact tag,
72
72
  wherever it lives, with a linear or grid layout - their listing,
73
73
  manifests, and cells
74
- - name: notebooks
75
- description: Deprecated aliases for the linear reports. Use the `reports` routes.
76
- - name: dashboards
77
- description: Deprecated aliases for the grid reports. Use the `reports` routes.
78
74
  - name: data-apps
79
75
  description:
80
76
  In-package HTML data apps (static pages served from a package's public/
@@ -1684,7 +1680,7 @@ paths:
1684
1680
  DEPRECATED. In-place mutation of a package contradicts immutable versions, so this
1685
1681
  operation will be removed. On a package that has published versions it changes only
1686
1682
  what is not content: a `manifestLocation` URI is bound to the package's `latest` version
1687
- (as `PUT .../packages/{packageName}/versions/{version}/manifest` does for any version),
1683
+ (as `PUT .../packages/{packageName}/versions/{versionId}/manifest` does for any version),
1688
1684
  while a null or empty one leaves the binding as it is (clear it with that route), and
1689
1685
  `description` is the package's. `name` and the `location` the version was published from
1690
1686
  may be sent back unchanged. Any other change is refused with 409 (`reason`
@@ -1784,8 +1780,8 @@ paths:
1784
1780
  background, cleans up each version as deleting it alone does: its own auto-runs still
1785
1781
  running are stopped and its own `scope: version` tables reclaimed. To take one
1786
1782
  version out of service while keeping the rest, archive it with
1787
- `PATCH .../packages/{packageName}/versions/{version}`; to remove one version for good,
1788
- delete it with `DELETE .../packages/{packageName}/versions/{version}`.
1783
+ `PATCH .../packages/{packageName}/versions/{versionId}`; to remove one version for good,
1784
+ delete it with `DELETE .../packages/{packageName}/versions/{versionId}`.
1789
1785
  parameters:
1790
1786
  - name: environmentName
1791
1787
  in: path
@@ -1850,7 +1846,7 @@ paths:
1850
1846
  "503":
1851
1847
  $ref: "#/components/responses/ServiceUnavailable"
1852
1848
 
1853
- /environments/{environmentName}/packages/{packageName}/versions/{version}:
1849
+ /environments/{environmentName}/packages/{packageName}/versions/{versionId}:
1854
1850
  get:
1855
1851
  tags:
1856
1852
  - versions
@@ -1897,7 +1893,7 @@ paths:
1897
1893
  table is tried once: one that cannot be dropped is left, and its run record goes all
1898
1894
  the same. Its
1899
1895
  files stay on disk, so it can be unarchived. To remove them, delete the version with
1900
- `DELETE .../versions/{version}`.
1896
+ `DELETE .../versions/{versionId}`.
1901
1897
  - `unarchive` puts it back in service. It loads again on its next read, and serves live
1902
1898
  until it is built again.
1903
1899
 
@@ -2000,7 +1996,7 @@ paths:
2000
1996
  "503":
2001
1997
  $ref: "#/components/responses/ServiceUnavailable"
2002
1998
 
2003
- /environments/{environmentName}/packages/{packageName}/versions/{version}/manifest:
1999
+ /environments/{environmentName}/packages/{packageName}/versions/{versionId}/manifest:
2004
2000
  put:
2005
2001
  tags:
2006
2002
  - versions
@@ -2411,6 +2407,10 @@ paths:
2411
2407
  fails only at the grammar and names no source to run (for example `run` with no colon) is also
2412
2408
  a 400, because a grammar error says nothing about the model, unless the model carries any
2413
2409
  `#(authorize)` or `#(access_filter)`, or the text joins a source off the surface.
2410
+
2411
+ The version queried may be named in the body (`QueryRequest.versionId`), in the URL
2412
+ (`?versionId=`), or both. When both name a version and they differ, the request answers
2413
+ 400 with `reason` VERSION_ID_INVALID; an empty value in either names none.
2414
2414
  parameters:
2415
2415
  - name: environmentName
2416
2416
  in: path
@@ -2431,6 +2431,7 @@ paths:
2431
2431
  schema:
2432
2432
  $ref: "#/components/schemas/PathPattern"
2433
2433
  - $ref: "#/components/parameters/includeHiddenFilesAndSources"
2434
+ - $ref: "#/components/parameters/versionId"
2434
2435
  requestBody:
2435
2436
  required: true
2436
2437
  content:
@@ -2651,8 +2652,9 @@ paths:
2651
2652
  `startingGivens`, `autorun`, `givens`): its tiles run through the model
2652
2653
  query endpoint with `givens`, using `path` as the model. A
2653
2654
  `.malloynb`, the one cell format left, carries `notebook` instead: its
2654
- cells as get-notebook returned them, run through the deprecated
2655
- execute-notebook-cell.
2655
+ cells and model. Its code cells run through the same model query
2656
+ endpoint, using `path` as the model, where every cell compiles into one
2657
+ model, so a cell's imports and declarations are in scope.
2656
2658
  parameters:
2657
2659
  - name: environmentName
2658
2660
  in: path
@@ -3270,398 +3272,6 @@ paths:
3270
3272
  "503":
3271
3273
  $ref: "#/components/responses/ServiceUnavailable"
3272
3274
 
3273
- # ── DEPRECATED ──────────────────────────────────────────────────────────
3274
- # The `…/dashboards*` and `…/notebooks*` routes, kept for clients that still
3275
- # read them, until a later release removes them. Use `…/reports*` above.
3276
- # Their schemas (`Dashboard`, `DashboardManifest`, `DashboardTile`,
3277
- # `Notebook`, `RawNotebook`) are in the deprecated section of the schemas;
3278
- # no report schema references them.
3279
- /environments/{environmentName}/packages/{packageName}/dashboards:
3280
- get:
3281
- tags:
3282
- - dashboards
3283
- operationId: list-dashboards
3284
- deprecated: true
3285
- summary: List package dashboards (deprecated; use list-reports)
3286
- description: |
3287
- **DEPRECATED**: use list-reports, which lists every report of either
3288
- layout by path. This route lists the package's grid reports (see
3289
- list-reports for what makes a file a report and which layout it has),
3290
- wherever they live in the package. Two may share a `name`; their `path`
3291
- tells them apart. A file with no artifact tag is an ordinary model and is
3292
- not listed, whether or not it compiles.
3293
-
3294
- **Contract change since reports.** This route used to list only
3295
- `.malloy` files directly under `dashboards/`, so every `name` was unique
3296
- and every `path` was `dashboards/<name>.malloy`. It now lists grid
3297
- reports from anywhere in the package (`sales/q3.malloy`,
3298
- `notebooks/x.malloy`, `a/b/c.malloy`), so `path` may have any depth and
3299
- `name` may repeat. Key on `path`.
3300
-
3301
- A tagged dashboard that failed to compile is listed carrying its
3302
- `error` where that state can arise at all, so a broken dashboard is
3303
- visibly broken rather than silently absent. In practice it rarely does:
3304
- a package whose model fails to compile is not loaded, and a reload that
3305
- would break one is refused and leaves the previously loaded package
3306
- serving, so `error` is only reachable on the paths that keep per-model
3307
- placeholders. Treat it as present-but-uncommon rather than the normal
3308
- way a broken dashboard surfaces.
3309
-
3310
- Every tagged dashboard is listed, whatever the package's surface. To
3311
- hide one, remove its `# artifact` tag. On a package with a surface (a
3312
- root `index.malloy`, or a legacy `explores`) with `queryableSources`
3313
- left at `"declared"`, a dashboard's tiles, its single query and its
3314
- filter `suggest` queries may read only sources the surface exports. A
3315
- source the dashboard declares on top of a surface source may be read;
3316
- one over a hidden source may not. The dashboard file's own
3317
- `export {}` and named queries add nothing to the surface. A tile over a
3318
- hidden source answers 404 when it runs, and the package's `warnings`
3319
- report each such tile, single query and suggest, with severity
3320
- `error`, as of the last load, naming the source and the fix. Under
3321
- `"all"` nothing is refused, so the situation does not arise.
3322
- parameters:
3323
- - name: environmentName
3324
- in: path
3325
- description: Name of the environment
3326
- required: true
3327
- schema:
3328
- $ref: "#/components/schemas/IdentifierPattern"
3329
- - name: packageName
3330
- in: path
3331
- description: Name of the package
3332
- required: true
3333
- schema:
3334
- $ref: "#/components/schemas/IdentifierPattern"
3335
- - $ref: "#/components/parameters/versionId"
3336
- responses:
3337
- "200":
3338
- description: A list of dashboards in the package
3339
- content:
3340
- application/json:
3341
- schema:
3342
- type: array
3343
- items:
3344
- $ref: "#/components/schemas/Dashboard"
3345
- "400":
3346
- $ref: "#/components/responses/BadRequest"
3347
- "401":
3348
- $ref: "#/components/responses/Unauthorized"
3349
- "404":
3350
- $ref: "#/components/responses/NotFound"
3351
- "410":
3352
- $ref: "#/components/responses/Gone"
3353
- "500":
3354
- $ref: "#/components/responses/InternalServerError"
3355
- "503":
3356
- $ref: "#/components/responses/ServiceUnavailable"
3357
-
3358
- /environments/{environmentName}/packages/{packageName}/dashboards/{dashboardName}:
3359
- get:
3360
- tags:
3361
- - dashboards
3362
- operationId: get-dashboard
3363
- deprecated: true
3364
- summary: Get a dashboard manifest (deprecated; use get-report)
3365
- description: |
3366
- **DEPRECATED**: use get-report, which addresses a report by its path.
3367
- Retrieves everything a viewer needs to render one grid report: the
3368
- artifact tag's declarations plus the control contract derived from the
3369
- givens its query references. Running it needs no further endpoint — its
3370
- query, each tile, and each control's suggest query all run
3371
- through the model query endpoint with `givens`, using the manifest's
3372
- `path` as the model.
3373
-
3374
- `dashboardName` is a basename, which is not an identity: it resolves
3375
- only when exactly one grid report in the package has it. When several
3376
- do, the answer is 409 naming every matching path; address the report
3377
- by path with get-report instead.
3378
-
3379
- **Contract change since reports.** This route never answered 409
3380
- before: a dashboard lived directly under `dashboards/`, so its name was
3381
- unique. A grid report may now live anywhere, two may share a basename,
3382
- and a client of this route must handle 409. The match also covers grid
3383
- reports outside `dashboards/`.
3384
- parameters:
3385
- - name: environmentName
3386
- in: path
3387
- description: Name of the environment
3388
- required: true
3389
- schema:
3390
- $ref: "#/components/schemas/IdentifierPattern"
3391
- - name: packageName
3392
- in: path
3393
- description: Name of the package
3394
- required: true
3395
- schema:
3396
- $ref: "#/components/schemas/IdentifierPattern"
3397
- - name: dashboardName
3398
- in: path
3399
- description: >-
3400
- The report's name: its filename basename. Conventionally letters,
3401
- digits, "-" and "_", and a package is warned when one of its
3402
- grid reports falls outside that. It is NOT constrained to it, because
3403
- the name comes from a filename rather than being chosen: a file such
3404
- as `v1.2.malloy` is served, and its published `resource`
3405
- carries the name percent-encoded. Send it percent-encoded.
3406
- required: true
3407
- schema:
3408
- type: string
3409
- minLength: 1
3410
- - $ref: "#/components/parameters/versionId"
3411
- responses:
3412
- "200":
3413
- description: The dashboard manifest
3414
- content:
3415
- application/json:
3416
- schema:
3417
- $ref: "#/components/schemas/DashboardManifest"
3418
- "400":
3419
- $ref: "#/components/responses/BadRequest"
3420
- "401":
3421
- $ref: "#/components/responses/Unauthorized"
3422
- "404":
3423
- $ref: "#/components/responses/NotFound"
3424
- "409":
3425
- description:
3426
- More than one grid report in the package has this basename. The
3427
- message names every matching path; use get-report with one.
3428
- content:
3429
- application/json:
3430
- schema:
3431
- $ref: "#/components/schemas/Error"
3432
- "410":
3433
- $ref: "#/components/responses/Gone"
3434
- "500":
3435
- $ref: "#/components/responses/InternalServerError"
3436
- "503":
3437
- $ref: "#/components/responses/ServiceUnavailable"
3438
-
3439
- /environments/{environmentName}/packages/{packageName}/notebooks:
3440
- get:
3441
- tags:
3442
- - notebooks
3443
- operationId: list-notebooks
3444
- deprecated: true
3445
- summary: List package notebooks (deprecated; use list-reports)
3446
- description: |
3447
- **DEPRECATED**: use list-reports. Lists the package's linear reports (see
3448
- list-reports): every `.malloynb` file outside `public/`, and every tagged
3449
- `.malloy` report whose layout is linear, wherever it lives. Each entry
3450
- includes the relative path, package name, title, description, and any
3451
- compilation or reading error.
3452
-
3453
- **Contract change since reports.** This route used to list `.malloy`
3454
- notebooks only directly under `notebooks/`. It now lists linear reports
3455
- from anywhere in the package, including `dashboards/` and nested
3456
- directories, and no longer lists a kindless tiled file in `notebooks/`,
3457
- which is now grid.
3458
- parameters:
3459
- - name: environmentName
3460
- in: path
3461
- description: Name of the environment
3462
- required: true
3463
- schema:
3464
- $ref: "#/components/schemas/IdentifierPattern"
3465
- - name: packageName
3466
- in: path
3467
- description: Name of the package
3468
- required: true
3469
- schema:
3470
- $ref: "#/components/schemas/IdentifierPattern"
3471
- - $ref: "#/components/parameters/versionId"
3472
- responses:
3473
- "200":
3474
- description: A list of notebooks in the package
3475
- content:
3476
- application/json:
3477
- schema:
3478
- type: array
3479
- items:
3480
- $ref: "#/components/schemas/Notebook"
3481
- "400":
3482
- $ref: "#/components/responses/BadRequest"
3483
- "401":
3484
- $ref: "#/components/responses/Unauthorized"
3485
- "404":
3486
- $ref: "#/components/responses/NotFound"
3487
- "410":
3488
- $ref: "#/components/responses/Gone"
3489
- "500":
3490
- $ref: "#/components/responses/InternalServerError"
3491
- "503":
3492
- $ref: "#/components/responses/ServiceUnavailable"
3493
-
3494
- /environments/{environmentName}/packages/{packageName}/notebooks/{path}:
3495
- get:
3496
- tags:
3497
- - notebooks
3498
- operationId: get-notebook
3499
- deprecated: true
3500
- summary: Get Malloy notebook cells (deprecated; use get-report)
3501
- description: |
3502
- **DEPRECATED**: use get-report. Retrieves a linear report with its raw
3503
- cell contents (markdown and code). A `.malloy` report's cells run
3504
- through the model query endpoint (each cell's `text` as the query); a
3505
- `.malloynb`'s through execute-notebook-cell. A linear `.malloy`
3506
- report, wherever it lives, answers here as well as a `.malloynb`.
3507
- On a package with a surface, the response shows only the sources the notebook may read.
3508
- parameters:
3509
- - name: environmentName
3510
- in: path
3511
- description: Name of the environment
3512
- required: true
3513
- schema:
3514
- $ref: "#/components/schemas/IdentifierPattern"
3515
- - name: packageName
3516
- in: path
3517
- description: Name of the package
3518
- required: true
3519
- schema:
3520
- type: string
3521
- - name: path
3522
- in: path
3523
- description: Path to notebook within the package.
3524
- required: true
3525
- schema:
3526
- type: string
3527
- - $ref: "#/components/parameters/versionId"
3528
- responses:
3529
- "200":
3530
- description: A Malloy notebook with raw cell contents.
3531
- content:
3532
- "application/json":
3533
- schema:
3534
- $ref: "#/components/schemas/RawNotebook"
3535
- "400":
3536
- $ref: "#/components/responses/BadRequest"
3537
- "401":
3538
- $ref: "#/components/responses/Unauthorized"
3539
- "404":
3540
- $ref: "#/components/responses/NotFound"
3541
- "410":
3542
- $ref: "#/components/responses/Gone"
3543
- "500":
3544
- $ref: "#/components/responses/InternalServerError"
3545
-
3546
- /environments/{environmentName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}:
3547
- get:
3548
- tags:
3549
- - notebooks
3550
- operationId: execute-notebook-cell
3551
- deprecated: true
3552
- summary: Execute a specific notebook cell (deprecated)
3553
- description: |
3554
- **DEPRECATED**: removed with the other notebook routes. For a `.malloy`
3555
- report, run a cell through the model query endpoint instead: the
3556
- report's path as the model, the cell's `text` (from get-report) as
3557
- `query`, and `givens` in the body, which applies the same surface,
3558
- `#(authorize)` and row-level gates. A `.malloynb` has no other route.
3559
- Executes a specific cell in a linear report by index.
3560
- For code cells, this compiles and runs the Malloy code, returning query
3561
- results and any new sources defined. For markdown cells, this simply
3562
- returns the cell content. A linear `.malloy` report, wherever it lives,
3563
- answers here as well as a `.malloynb`.
3564
-
3565
- On a package with a surface (a root `index.malloy`, or a legacy `explores`) with
3566
- `queryableSources` left at `"declared"`, a code cell may read only sources the surface
3567
- exports. A cell over a hidden source answers 404, and 404 rather than 403 even when the
3568
- source is also `#(authorize)`-gated. A source an earlier cell declares on top of a
3569
- published source still works. A cell's own source over a raw table (`duckdb.table(...)`
3570
- or `.sql(...)`) has no published source under it, so it is refused. The response shows
3571
- only the sources the notebook may read.
3572
- parameters:
3573
- - name: environmentName
3574
- in: path
3575
- description: Name of the environment
3576
- required: true
3577
- schema:
3578
- $ref: "#/components/schemas/IdentifierPattern"
3579
- - name: packageName
3580
- in: path
3581
- description: Name of the package
3582
- required: true
3583
- schema:
3584
- type: string
3585
- - name: path
3586
- in: path
3587
- description: Path to notebook within the package
3588
- required: true
3589
- schema:
3590
- type: string
3591
- - name: cellIndex
3592
- in: path
3593
- description: Index of the cell to execute (0-based)
3594
- required: true
3595
- schema:
3596
- type: integer
3597
- - $ref: "#/components/parameters/versionId"
3598
- - name: filter_params
3599
- in: query
3600
- deprecated: true
3601
- description: |
3602
- **DEPRECATED**: Use `givens` (native Malloy runtime parameters) instead.
3603
- Targets the deprecated `#(filter)` annotation path. See docs/givens.md
3604
- for migration recipes.
3605
-
3606
- JSON-encoded filter parameter values keyed by filter name.
3607
- required: false
3608
- schema:
3609
- type: string
3610
- - name: bypass_filters
3611
- in: query
3612
- deprecated: true
3613
- description: |
3614
- **DEPRECATED**: Use `givens` (native Malloy runtime parameters) instead.
3615
- See docs/givens.md for migration recipes.
3616
-
3617
- When true, skip filter injection entirely.
3618
- required: false
3619
- schema:
3620
- type: string
3621
- enum:
3622
- - "true"
3623
- - "false"
3624
- - name: givens
3625
- in: query
3626
- description:
3627
- A `GivenValues` object, JSON-encoded so it can travel in a query
3628
- string. Values are typed as `GivenValues` describes them, not
3629
- string-encoded as `EncodedGivenValues` would be. The parameter keeps
3630
- its name for compatibility; the schema it carries is the one named
3631
- here.
3632
- required: false
3633
- schema:
3634
- type: string
3635
- responses:
3636
- "200":
3637
- description: Cell execution result
3638
- content:
3639
- "application/json":
3640
- schema:
3641
- $ref: "#/components/schemas/NotebookCellResult"
3642
- "400":
3643
- $ref: "#/components/responses/BadRequest"
3644
- "401":
3645
- $ref: "#/components/responses/Unauthorized"
3646
- "403":
3647
- $ref: "#/components/responses/Forbidden"
3648
- "404":
3649
- $ref: "#/components/responses/NotFound"
3650
- "410":
3651
- $ref: "#/components/responses/Gone"
3652
- "413":
3653
- $ref: "#/components/responses/PayloadTooLarge"
3654
- "500":
3655
- $ref: "#/components/responses/InternalServerError"
3656
- "424":
3657
- $ref: "#/components/responses/ConnectionUnavailable"
3658
- "502":
3659
- $ref: "#/components/responses/DatabaseUnreachable"
3660
- "503":
3661
- $ref: "#/components/responses/ServiceUnavailable"
3662
- "504":
3663
- $ref: "#/components/responses/GatewayTimeout"
3664
-
3665
3275
  /environments/{environmentName}/packages/{packageName}/databases:
3666
3276
  get:
3667
3277
  tags:
@@ -3956,6 +3566,12 @@ paths:
3956
3566
  plan (read off `Package.buildPlan`). Returns the materialization already building.
3957
3567
  * Auto-run (standalone, default) — omit `buildInstructions`; the publisher
3958
3568
  self-assigns names and runs all phases in one pass.
3569
+
3570
+ The version to build is named in the body (`versionId`). A `?versionId=` in the URL,
3571
+ as every other materialization operation takes, is read too; when both name a version
3572
+ and they differ, the request answers 400 with `reason` VERSION_ID_INVALID, and an empty
3573
+ value in either names none. It is not declared as a parameter here: an optional query
3574
+ parameter would move the optional body argument of every generated client.
3959
3575
  parameters:
3960
3576
  - $ref: "#/components/parameters/environmentName"
3961
3577
  - $ref: "#/components/parameters/packageName"
@@ -4554,9 +4170,9 @@ components:
4554
4170
  * The response could not be serialized at all, past the JavaScript
4555
4171
  engine's own limit (V8 refuses the string; JSC fails the
4556
4172
  allocation). No cap was necessarily exceeded here, and raising one
4557
- does not help. This third case applies to the model-query and
4558
- notebook-cell endpoints; the connection SQL endpoints have no such
4559
- guard and answer 500.
4173
+ does not help. This third case applies to the model-query
4174
+ endpoint; the connection SQL endpoints have no such guard and
4175
+ answer 500.
4560
4176
  In every case, refine the query (add a LIMIT, a more selective WHERE,
4561
4177
  project fewer columns, or filter out wide values); retrying unchanged
4562
4178
  will not succeed. Raising the relevant cap is an option for the first
@@ -4591,6 +4207,13 @@ components:
4591
4207
  succeed. That reason is what marks the customer's database being down
4592
4208
  rather than this server failing. The body carries a fixed message,
4593
4209
  because the driver's text can name an internal host; it is logged.
4210
+ With `reason: RESULT_TRUNCATED` the database answered, but with fewer
4211
+ rows than it reported and no row limit cut them (a BigQuery answer past
4212
+ one results page of about 10 MB); the query is refused rather than
4213
+ answered short, and a retry fails the same way. With
4214
+ `reason: RESULT_SHAPE_MISMATCH` the database answered, but a row does
4215
+ not fit the schema Malloy declared for the result, so the result could
4216
+ not be built; the message is fixed and the cause is logged.
4594
4217
  content:
4595
4218
  application/json:
4596
4219
  schema:
@@ -4773,7 +4396,7 @@ components:
4773
4396
  description: >-
4774
4397
  The build manifest this version is bound to (see
4775
4398
  `Package.manifestLocation`); null when it serves live. Set with
4776
- `PUT .../versions/{version}/manifest`.
4399
+ `PUT .../versions/{versionId}/manifest`.
4777
4400
  gitCommitSha:
4778
4401
  type: ["string", "null"]
4779
4402
  readOnly: true
@@ -4918,9 +4541,7 @@ components:
4918
4541
  description: >-
4919
4542
  Which page the Console shows for a model (`PUBLISHER_MODEL_PAGE`,
4920
4543
  "explorer" by default). "explorer" is the Malloy Explorer, which
4921
- writes the queries it builds back to Malloy text with string
4922
- values unescaped, so a drilled value holding a double quote
4923
- rewrites its query. "viewer" shows a page that builds no query,
4544
+ builds queries. "viewer" shows a page that builds no query,
4924
4545
  and takes the Explorer out of the legacy notebook too. Absent from
4925
4546
  a server that predates the setting, which reads as "explorer".
4926
4547
  emptyReason:
@@ -5355,9 +4976,29 @@ components:
5355
4976
  type creates no tables), `materialization_off` (a `#(materialize)`
5356
4977
  source, which only the served copy reads, and the served copy is
5357
4978
  off: `PUBLISHER_MATERIALIZE`, and for `storage=`
5358
- `PERSIST_STORAGE_MODE`), `served_copy` (a `#(materialize)` source
5359
- whose table is bound, but no model's served copy re-roots it; the
5360
- `served-copy-not-served` warning says why). An open set.
4979
+ `PERSIST_STORAGE_MODE`), `served_copy` (a source the served copy
4980
+ reads, `#(materialize)` or `#@ persist`, whose table is bound and
4981
+ built, but no model's served copy re-roots it, so its queries are
4982
+ answered live; `notServedIn` says where and why). An open set.
4983
+ notServedIn:
4984
+ type: array
4985
+ items:
4986
+ $ref: "#/components/schemas/NotServedIn"
4987
+ description: >-
4988
+ Each model file whose served copy holds this source (declares or
4989
+ imports it) but does not read its table, sorted by model, the same
4990
+ for a `#(materialize)` source and a `#@ persist` one. Present
4991
+ exactly when some model that holds the source does not read its
4992
+ table. With a `served_copy` reason it lists every such model (a
4993
+ model whose whole copy is off lists every stored source it holds,
4994
+ not only the one whose join failed it; a source no model's copy
4995
+ holds lists its declaring model, `not_rerooted`). On a `serves`
4996
+ verdict it lists the models that answer the source's queries
4997
+ live while another model serves it, so a consumer must read it:
4998
+ `serves` alone does not mean every model reads the table. Absent
4999
+ while a served copy has yet to compile. Read from the same compile
5000
+ of record as the `served-copy-not-served` warnings, never by
5001
+ running a query.
5361
5002
  message:
5362
5003
  type: string
5363
5004
  description: What the verdict means for this source, in a sentence.
@@ -5412,6 +5053,35 @@ components:
5412
5053
  items:
5413
5054
  $ref: "#/components/schemas/ViewServeVerdict"
5414
5055
 
5056
+ NotServedIn:
5057
+ type: object
5058
+ description: >-
5059
+ One model whose served copy holds a materialized source but does not
5060
+ read its table, and why.
5061
+ required: [model, reasons]
5062
+ properties:
5063
+ model:
5064
+ type: string
5065
+ description: The model file.
5066
+ reasons:
5067
+ type: array
5068
+ items:
5069
+ type: string
5070
+ description: >-
5071
+ Every reason the served copy gives for not reading the source's
5072
+ table in this model: the `reason` of each `served-copy-not-served`
5073
+ package warning on that model that names the source or the model's
5074
+ whole copy, the codes `publisher_served_copy_bind_total` counts,
5075
+ most actionable first (for example `cross_connection_join` before
5076
+ `fields_not_carried`): `cross_connection_join`,
5077
+ `cross_connection_unbuilt`, `inline_join_kept`,
5078
+ `read_terms_not_kept`, `fields_not_carried`, `column_types`,
5079
+ `classification_not_kept`, `pair_join_not_found`,
5080
+ `pair_not_compiled`, `definition_not_parsed`, `compile_failed`,
5081
+ `no_declaration`, `reroot_not_compiled`. `not_rerooted` alone when
5082
+ no warning names one (also `servePathReason`'s value for that
5083
+ case). Never empty. An open set: treat an unknown value as
5084
+ `not_rerooted`.
5415
5085
  ViewServeVerdict:
5416
5086
  type: object
5417
5087
  required: [view, verdict]
@@ -6108,7 +5778,39 @@ components:
6108
5778
  acts on it rather than only showing it; absent for a family that
6109
5779
  has none yet. `deprecated-malloynb-notebook`: a `.malloynb`
6110
5780
  notebook, the deprecated cell format (one per file, `model`
6111
- naming it). `deprecated-filter-annotation`: a source declaring
5781
+ naming it). `malloynb-cell-refused`: a `.malloynb` code cell
5782
+ whose `run:` statement the query route refuses for every
5783
+ reader in the Console, which sends no privilege and no
5784
+ `filterParams`, so the cell never runs there. One per cell,
5785
+ up to the bound below, `model` naming the notebook, severity `warn`. The message
5786
+ names the cell by its 1-based position among the notebook's
5787
+ cells, markdown cells included, and the fix. `reason` names
5788
+ the rule: `off_surface` is the 404 for a source the package
5789
+ surface does not publish, which a source the notebook
5790
+ declares never is on a package with a curated surface, an
5791
+ `index.malloy` or the deprecated `explores`; a caller with `includeHiddenFilesAndSources` still runs such a
5792
+ cell. `caller_annotation` is the 400 for text carrying an
5793
+ annotation only the model author may write, such as
5794
+ `#(authorize)`, comments included. `required_filter` is the
5795
+ 400 for a source with a required `#(filter)`.
5796
+ `restricted_mode` is the 400 for a `sql_*` call or a direct
5797
+ table read. `compile_error` is the 400 for any other failure
5798
+ of the statement to compile on its own. A cell that only a
5799
+ reader's givens refuse, by `#(authorize)` or a row-level
5800
+ gate, is not reported. Markdown cells are not read, as the
5801
+ Console does not run them. A notebook lists at most 10
5802
+ refused cells one by one, and the package at most 50. The
5803
+ rest of a notebook that lists some are named by number and
5804
+ reason in one `malloynb-cells-unlisted` warning (`model` the
5805
+ notebook; `warn`). The notebooks after the package limit
5806
+ share one `malloynb-cells-unlisted` warning with no `model`,
5807
+ which counts their cells by reason and names the first 10 of
5808
+ them. The report lint metric still counts each refused cell
5809
+ under `malloynb-cell-refused`.
5810
+ `malloynb-cell-check-failed`: a notebook whose cell check
5811
+ could not run, so a refused cell of it may have no warning;
5812
+ the cause is in the server log (one per notebook, `warn`).
5813
+ `deprecated-filter-annotation`: a source declaring
6112
5814
  deprecated `#(filter)` annotations (one per declaring source,
6113
5815
  `model` naming its file and `subject` the source).
6114
5816
  `deprecated-preaggregate-annotation`: a measure declaring
@@ -6122,10 +5824,7 @@ components:
6122
5824
  container; still read, in that container under the readable
6123
5825
  name (one per measure and container, `subject`
6124
5826
  `<base>.<measure>`; `warn`).
6125
- `report-name-ambiguous`: two or more grid reports share a
6126
- basename, so the deprecated `GET …/dashboards/{name}` route
6127
- answers 409 for it (one per name, `subject` naming it and the
6128
- message every path; `warn`). `classification-coverage`: a
5827
+ `classification-coverage`: a
6129
5828
  published source with a dimension or measure that carries no
6130
5829
  `#(classification)` while some field in the package does (one
6131
5830
  per source, `model` naming its file and `subject` the source;
@@ -6194,9 +5893,9 @@ components:
6194
5893
  the base, or `<base>.<measure>` for one measure). The
6195
5894
  message says why, and `reason` is the refusal record's
6196
5895
  bounded reason. `preaggregate-not-built` is
6197
- `rollup-not-built`'s former name: each `rollup-not-built`
6198
- warning is repeated under it, with the same message, for
6199
- this release only. `persist-source-refused`, the former name
5896
+ `rollup-not-built`'s former name, retained, no longer
5897
+ produced: 0.15.0 and 0.16 repeated each `rollup-not-built`
5898
+ warning under it. `persist-source-refused`, the former name
6200
5899
  of `persist-not-built` repeated beside it in 0.14.0, is no
6201
5900
  longer produced.
6202
5901
  Retained, no longer produced: the rollup sub-family
@@ -6228,9 +5927,9 @@ components:
6228
5927
  `rollup-join-one-key-repeated`: a rollup's last build found
6229
5928
  a `join_one` key repeated in the data, so queries that read
6230
5929
  that join beside other aggregates are answered live
6231
- (`subject` the rollup's base; `warn`). Repeated under its
6232
- former name `preaggregate-join-one-key-repeated` for this
6233
- release only.
5930
+ (`subject` the rollup's base; `warn`). Its former name,
5931
+ `preaggregate-join-one-key-repeated`, is retained, no longer
5932
+ produced.
6234
5933
  `served-copy-not-served`: the served copy (the author's own
6235
5934
  files, each stored source re-rooted on its table) leaves a
6236
5935
  source as written, so it answers live, or serves it with a
@@ -6355,8 +6054,9 @@ components:
6355
6054
  full rebuild captures the types (one per source, `model` the
6356
6055
  first model binding it, `subject` the source, the message
6357
6056
  naming the columns and which applies; `warn`; see
6358
- docs/materialization.md). Repeated under its former name
6359
- `stored-native-schema-missing` for this release only.
6057
+ docs/materialization.md). Its former name,
6058
+ `stored-native-schema-missing`, is retained, no longer
6059
+ produced.
6360
6060
  `entities-…` (`entities-not-a-dimension`,
6361
6061
  `entities-parameterized-source`,
6362
6062
  `entities-multiple-required-filters`,
@@ -6373,15 +6073,16 @@ components:
6373
6073
  reason:
6374
6074
  type: string
6375
6075
  description: >-
6376
- The bounded cause of a materialization finding, so a client
6377
- branches on it rather than on the message (whose wording may
6378
- change): the refusal record's `reason` on a `*-not-built`
6379
- warning; the served copy's reason on
6076
+ The bounded cause of a finding, so a client branches on it
6077
+ rather than on the message (whose wording may change): the
6078
+ refusal record's `reason` on a `*-not-built` warning; the served copy's reason on
6380
6079
  `served-copy-not-served`; the unread reason on
6381
6080
  `database-table-unread`; the kept table's reason on
6382
6081
  `table-kept`; the serve verdict's reason on a
6383
6082
  `materialization-*` verdict warning; `storage_mode` on
6384
- `materialization-storage-mode`. Always snake_case. An open
6083
+ `materialization-storage-mode`; the rule a cell breaks on
6084
+ `malloynb-cell-refused` (`off_surface`, `caller_annotation`,
6085
+ `required_filter`, `restricted_mode`, `compile_error`). Always snake_case. An open
6385
6086
  string; absent on a finding that has none.
6386
6087
  severity:
6387
6088
  type: string
@@ -6403,8 +6104,7 @@ components:
6403
6104
  findings use both: `error` for something that cannot work as
6404
6105
  written, such as a tile naming a view the source does not
6405
6106
  have, and `warn` for something that works but not as the
6406
- author probably intended, such as a dashboard name outside
6407
- the conventional shape. The two findings about Publisher rather than about
6107
+ author probably intended. The two findings about Publisher rather than about
6408
6108
  the package split across both: a file that carries an artifact
6409
6109
  tag and could not be read is `error`, because the dashboard it
6410
6110
  should have produced does not exist, and a lint that stopped
@@ -7303,9 +7003,10 @@ components:
7303
7003
  allOf:
7304
7004
  - $ref: "#/components/schemas/ReportCells"
7305
7005
  description: >-
7306
- For a `.malloynb`: its cells and model, each cell run with
7307
- execute-notebook-cell. Absent on a `.malloy` report, and on a
7308
- `.malloynb` that failed to compile.
7006
+ For a `.malloynb`: its cells and model, each code cell run
7007
+ through `POST …/models/{path}/query` with `givens`, using the
7008
+ report's `path` as the model. Absent on a `.malloy` report, and
7009
+ on a `.malloynb` that failed to compile.
7309
7010
 
7310
7011
  ReportTile:
7311
7012
  type: object
@@ -7390,8 +7091,8 @@ components:
7390
7091
  in `tiles=[…]`, or else from a `# break` on the view or query it
7391
7092
  names; `break=false` on the entry turns off the view's. Named for the tag, so every per-tile field on this
7392
7093
  schema is spelled the way an author writes it. A generated client
7393
- escapes the attribute where the word is reserved (the Python client
7394
- exposes `break_`) while the wire key stays `break`.
7094
+ escapes the attribute where the word is reserved (a generated Python
7095
+ client exposes `break_`) while the wire key stays `break`.
7395
7096
  borderless:
7396
7097
  type: boolean
7397
7098
  description: >-
@@ -7427,8 +7128,9 @@ components:
7427
7128
  ReportCells:
7428
7129
  type: object
7429
7130
  description: >-
7430
- A `.malloynb`, or a linear `.malloy` report read as cells (its
7431
- definitions, then its tiles): its cells, unexecuted, and its model.
7131
+ A `.malloynb` read as cells: its cells, unexecuted, and its model.
7132
+ `GET …/reports/{path}` serves it for a `.malloynb` only; a `.malloy`
7133
+ report carries its manifest instead.
7432
7134
  properties:
7433
7135
  type:
7434
7136
  type: string
@@ -7443,11 +7145,11 @@ components:
7443
7145
  format:
7444
7146
  type: string
7445
7147
  enum: ["malloynb", "malloy"]
7446
- description:
7447
- The file format the notebook is written in. `malloynb` is the
7448
- cell-separated format; `malloy` is a linear `.malloy` report (see
7449
- list-reports), wherever it lives, whose cells are
7450
- its statements and its floating `(markdown)` notes in file order.
7148
+ description: >-
7149
+ The file format the notebook is written in. Always `malloynb`, the
7150
+ cell-separated format. `malloy`, a linear `.malloy` report read
7151
+ statement by statement, is no longer returned: no route serves a
7152
+ `.malloy` report as cells.
7451
7153
  malloyVersion:
7452
7154
  type: string
7453
7155
  description: Version of the Malloy compiler used to generate the notebook data
@@ -7462,30 +7164,23 @@ components:
7462
7164
  annotations:
7463
7165
  type: array
7464
7166
  description:
7465
- Array of file-level (##) annotations attached to the notebook. For
7466
- a `.malloy` notebook, every own note that is not a floating
7467
- `(markdown)` cell, in file order, each note once. A `"` or `(text)`
7468
- note below the `## artifact` tag is dropped and not listed.
7167
+ Array of file-level (##) annotations attached to the notebook.
7469
7168
  items:
7470
7169
  type: string
7471
7170
  startingGivens:
7472
7171
  allOf:
7473
7172
  - $ref: "#/components/schemas/EncodedGivenValues"
7474
7173
  description:
7475
- Starting values for the notebook's controls. A `.malloy` notebook
7476
- declares them in its artifact tag (`## artifact { givens { … } }`),
7477
- a `.malloynb` in its file-level tags (`## givens { … }`). URL
7478
- parameters override these, which is why the two share a shape.
7479
- Omitted when the notebook declares none.
7174
+ Starting values for the notebook's controls, from its file-level
7175
+ tags (`## givens { … }`). URL parameters override these. Omitted
7176
+ when the notebook declares none.
7480
7177
  autorun:
7481
7178
  type: boolean
7482
7179
  description:
7483
7180
  False batches control changes behind an Apply button instead of
7484
- re-running on every change. Defaults to true. A `.malloy` notebook
7485
- reads it from its artifact tag (`## artifact { autorun=false }`), a
7486
- `.malloynb` from its file-level tags (`## autorun=false`). The same
7487
- flag, with the same default, that `DashboardManifest.autorun`
7488
- carries.
7181
+ re-running on every change. Defaults to true. Read from the
7182
+ notebook's file-level tags (`## autorun=false`). The same flag, with
7183
+ the same default, that `DashboardManifest.autorun` carries.
7489
7184
  sources:
7490
7185
  type: array
7491
7186
  description: Sources defined in the notebook's model
@@ -7548,85 +7243,9 @@ components:
7548
7243
  content-driven app, which keeps content-height auto-sizing.
7549
7244
 
7550
7245
  # ── DEPRECATED ────────────────────────────────────────────────────────
7551
- # The shapes of the deprecated `…/dashboards*` and `…/notebooks*` routes.
7246
+ # The shapes the compile response's `manifest` still answers in.
7552
7247
  # No report schema references them; each removal deletes its block here.
7553
7248
 
7554
- Notebook:
7555
- type: object
7556
- deprecated: true
7557
- description: DEPRECATED, use `Report`. A linear report as the deprecated
7558
- list-notebooks route lists it.
7559
- properties:
7560
- environmentName:
7561
- type: string
7562
- description: Name of the environment containing this notebook
7563
- packageName:
7564
- type: string
7565
- description: Name of the package containing this notebook
7566
- path:
7567
- type: string
7568
- description: Relative path to the notebook file within its package directory
7569
- title:
7570
- type: string
7571
- description:
7572
- Human title. For a `.malloynb`, resolved from its own `## title="…"`,
7573
- then its `#"` doc comment, then its first markdown heading. For a
7574
- `.malloy` notebook, from the `title` in its `## artifact` tag, then
7575
- the first line of the `"` notes above that tag, then its first
7576
- markdown heading when no prose precedes it. Absent when none of
7577
- those resolve, leaving the caller to show the path.
7578
- description:
7579
- type: string
7580
- description:
7581
- The notebook's doc comment, when it has one. For a `.malloy`
7582
- notebook that is the `"` notes above the `## artifact` line; prose
7583
- below it is a `##(markdown)` or `##|(markdown)` cell.
7584
- error:
7585
- type: string
7586
- description: Error message if the notebook failed to compile or load
7587
-
7588
- Dashboard:
7589
- type: object
7590
- deprecated: true
7591
- description: |
7592
- DEPRECATED: use `Report`. A grid report (see list-reports), as the
7593
- deprecated list-dashboards route lists it. The list entry; see
7594
- DashboardManifest for the detail a viewer needs to render one.
7595
- properties:
7596
- resource:
7597
- type: string
7598
- description: Resource path to the dashboard
7599
- packageName:
7600
- type: string
7601
- description: Name of the package containing this dashboard
7602
- name:
7603
- type: string
7604
- description: >-
7605
- The report's filename basename: a display label, and the segment of
7606
- the deprecated get-dashboard URL. Not an identity: two reports may
7607
- share it. A change since reports: it used to be unique within the
7608
- package (every dashboard was directly under `dashboards/`), and a
7609
- client that keyed a map on it must key on `path` instead.
7610
- path:
7611
- type: string
7612
- description:
7613
- Relative path to the report file within its package directory,
7614
- which is its identity
7615
- title:
7616
- type: string
7617
- description:
7618
- Human title from the artifact tag, falling back to the file's `#"`
7619
- doc comment and then to the slug
7620
- description:
7621
- type: string
7622
- description: >-
7623
- The file's unnamed `"` notes above the `## artifact` tag; when it
7624
- has none there, the ones below it (a legacy spot the lint flags). For
7625
- a dashboard whose tag sits on one query, that query's `#"` notes.
7626
- error:
7627
- type: string
7628
- description: Error message if the dashboard file failed to compile
7629
-
7630
7249
  DashboardManifest:
7631
7250
  type: object
7632
7251
  deprecated: true
@@ -7647,11 +7266,11 @@ components:
7647
7266
  name:
7648
7267
  type: string
7649
7268
  description: >-
7650
- The report's filename basename: a display label, and the segment of
7651
- the deprecated get-dashboard URL. Not an identity: two reports may
7652
- share it. A change since reports: it used to be unique within the
7653
- package (every dashboard was directly under `dashboards/`), and a
7654
- client that keyed a map on it must key on `path` instead.
7269
+ The report's filename basename: a display label. Not an identity:
7270
+ two reports may share it. A change since reports: it used to be
7271
+ unique within the package (every dashboard was directly under
7272
+ `dashboards/`), and a client that keyed a map on it must key on
7273
+ `path` instead.
7655
7274
  path:
7656
7275
  type: string
7657
7276
  description: |
@@ -7687,10 +7306,7 @@ components:
7687
7306
  deprecated: true
7688
7307
  description: >-
7689
7308
  DEPRECATED: read `layout`. The same thing in the old vocabulary:
7690
- `dashboard` for a grid report, `notebook` for a linear one. Always
7691
- `dashboard` on `GET …/dashboards/{dashboardName}`; a linear
7692
- report's manifest is the `dashboard` field of
7693
- `GET …/notebooks/{path}`.
7309
+ `dashboard` for a grid report, `notebook` for a linear one.
7694
7310
  tiles:
7695
7311
  type: array
7696
7312
  description: >-
@@ -7753,30 +7369,11 @@ components:
7753
7369
  DashboardTile:
7754
7370
  deprecated: true
7755
7371
  description: >-
7756
- DEPRECATED: `ReportTile`, under the name the deprecated dashboard
7372
+ DEPRECATED: `ReportTile`, under the name the removed dashboard
7757
7373
  routes gave it.
7758
7374
  allOf:
7759
7375
  - $ref: "#/components/schemas/ReportTile"
7760
7376
 
7761
- RawNotebook:
7762
- deprecated: true
7763
- description: >-
7764
- DEPRECATED: `ReportCells`, as get-notebook answers them, plus the tile
7765
- layout of a linear report written as tiles.
7766
- allOf:
7767
- - $ref: "#/components/schemas/ReportCells"
7768
- - type: object
7769
- properties:
7770
- dashboard:
7771
- allOf:
7772
- - $ref: "#/components/schemas/DashboardManifest"
7773
- description: >-
7774
- The tile layout of a linear report written as one (`## artifact {
7775
- layout=linear tiles=[…] }`), in the shape a dashboard has, with
7776
- `layout` `linear` and one column. Absent on a `.malloynb`. Its tiles run through the model query endpoint at
7777
- `modelPath`; `notebookCells` carries the same content as cells for
7778
- readers that do not draw a layout.
7779
-
7780
7377
  CompiledModel:
7781
7378
  type: object
7782
7379
  description: Compiled Malloy model with sources, queries, and metadata
@@ -8455,7 +8052,7 @@ components:
8455
8052
  The role it names: a surface's URL parameters and the starting values a
8456
8053
  document declares share this shape, so the two can merge and then be
8457
8054
  decoded once against the declarations and sent as `GivenValues`.
8458
- `RawNotebook.startingGivens` and `DashboardManifest.startingGivens` are
8055
+ `ReportCells.startingGivens` and `DashboardManifest.startingGivens` are
8459
8056
  both typed as it and both populated, so this schema now describes live
8460
8057
  traffic rather than only the contract. A `filter<…>` value is unwrapped
8461
8058
  to its body and every other type is published as declared, keyed on the
@@ -8625,10 +8222,9 @@ components:
8625
8222
  empty, the query runs against the package's `latest` version. An unknown version
8626
8223
  answers 404 (`reason` VERSION_NOT_FOUND) and an archived one 410
8627
8224
  (`reason` VERSION_ARCHIVED). A `versionId` in the request's query
8628
- string, as a proxy forwarding a page's URL sends, is read the same way;
8629
- when both name a version they must agree, or the request answers 400.
8630
- It is not declared as a query parameter, so generated clients keep
8631
- their argument order.
8225
+ string (the operation's `versionId` parameter) is read the same way;
8226
+ when both name a version they must agree, or the request answers 400
8227
+ with `reason` VERSION_ID_INVALID.
8632
8228
  filterParams:
8633
8229
  type: object
8634
8230
  deprecated: true
@@ -8688,17 +8284,21 @@ components:
8688
8284
  kind:
8689
8285
  type: string
8690
8286
  enum: ["markdown", "query", "definition"]
8691
- description:
8692
- What a cell is, on a `.malloy` notebook. A definition cell
8693
- (`source:`, `import`, `query:`, `given:`, `type:`, `export`) has type `code`
8694
- and produces no result. Absent on a `.malloynb`.
8287
+ description: >-
8288
+ What a cell is, on a cell of a compiled document
8289
+ (`CompileResult.document.cells`), where every cell is a definition:
8290
+ a `source:`, `import`, `query:`, `given:`, `type:` or `export`
8291
+ statement, with type `code`, that produces no result. Absent on a
8292
+ `.malloynb`'s cells. `markdown` and `query` are no longer returned:
8293
+ they marked a linear `.malloy` report's prose and query cells, which
8294
+ no route serves as cells now.
8695
8295
  text:
8696
8296
  type: string
8697
8297
  description: Text contents of the notebook cell (either markdown or Malloy code)
8698
8298
  markdown:
8699
8299
  type: string
8700
8300
  description:
8701
- On a `.malloy` notebook's code cell, the prose written on the
8301
+ On a compiled document's code cell, the prose written on the
8702
8302
  `(markdown)` route in its own tag lines (`#(markdown) text` lines,
8703
8303
  `#|(markdown)` … `|#` blocks), which `text` still contains. Blocks
8704
8304
  join with a blank line, adjacent lines with a newline. Author
@@ -8707,8 +8307,8 @@ components:
8707
8307
  proseLines:
8708
8308
  type: array
8709
8309
  description:
8710
- Present on every code cell of a `.malloy` notebook, and absent on
8711
- a `.malloynb` or from a server that predates it. The lines of
8310
+ Present on every code cell of a compiled document, and absent on
8311
+ a `.malloynb`'s cells or from a server that predates it. The lines of
8712
8312
  `text` that hold `markdown`, as `[start, end]` pairs in file order;
8713
8313
  `[]` when the cell has none. Lines are 0-based and inclusive,
8714
8314
  counted on `text` split at `\n`. Strip exactly these lines to get
@@ -8729,7 +8329,7 @@ components:
8729
8329
  codeLine:
8730
8330
  type: integer
8731
8331
  description:
8732
- Present on every code cell of a `.malloy` notebook, as `proseLines`
8332
+ Present on every code cell of a compiled document, as `proseLines`
8733
8333
  is. The 0-based line of `text` (split at `\n`) where the
8734
8334
  statement's code starts, its first token that is neither a note nor
8735
8335
  a comment, so the `source`, `run`, `given` or `import` keyword sits
@@ -8737,7 +8337,7 @@ components:
8737
8337
  caption:
8738
8338
  type: string
8739
8339
  description:
8740
- On a `.malloy` notebook's code cell, the joined text of its leading
8340
+ On a compiled document's code cell, the joined text of its leading
8741
8341
  `#"` lines (space-joined, trimmed). Author prose, so it is served
8742
8342
  even when `queryInfo` is withheld. Absent when the cell has none,
8743
8343
  which is authoritative wherever `proseLines` is present.
@@ -8754,52 +8354,21 @@ components:
8754
8354
  JSON string containing QueryInfo object for the query in this cell
8755
8355
  (if the cell contains a query). On a package with a surface, left out
8756
8356
  for a cell whose query reads a source the notebook may not read.
8757
-
8758
- NotebookCellResult:
8759
- type: object
8760
- description: Result of executing a notebook cell
8761
- properties:
8762
- type:
8763
- type: string
8764
- enum: ["markdown", "code"]
8765
- description: Type of notebook cell
8766
- kind:
8767
- type: string
8768
- enum: ["markdown", "query", "definition"]
8769
- description: The cell's kind, on a `.malloy` notebook. Absent on a `.malloynb`.
8770
- text:
8771
- type: string
8772
- description: Text contents of the notebook cell
8773
- markdown:
8774
- type: string
8775
- description:
8776
- A `.malloy` notebook code cell's own `(markdown)` prose, as on
8777
- `NotebookCell`. Absent when the cell has none.
8778
- proseLines:
8779
- type: array
8780
- description: The lines of `text` that hold `markdown`, as on `NotebookCell`; `[]` when none.
8781
- items:
8782
- type: array
8783
- minItems: 2
8784
- maxItems: 2
8785
- items:
8786
- type: integer
8787
- codeLine:
8788
- type: integer
8789
- description: The line of `text` where the statement's code starts, as on `NotebookCell`.
8790
- caption:
8791
- type: string
8792
- description: The cell's leading `#"` caption, as on `NotebookCell`. Absent when the cell has none.
8793
- result:
8794
- type: string
8795
- description: JSON string containing the execution result for this cell
8796
- newSources:
8797
- type: array
8798
- description:
8799
- Array of JSON strings containing SourceInfo objects made available
8800
- in this cell
8801
- items:
8802
- type: string
8357
+ runQuery:
8358
+ type: string
8359
+ description: >-
8360
+ On a `.malloynb` code cell, the text to send as `query` to
8361
+ `POST …/models/{path}/query`, with the notebook's own path as the
8362
+ model, to run the cell. It is the cell's last top-level `run:`
8363
+ statement, up to the next top-level statement or `;`, with the
8364
+ render tags written above it: the `#` lines and `#|` … `|#` blocks
8365
+ between the statement before it and the `run:`, and any comment
8366
+ among them. A `##` line or `##|` block, the notebook's own, ends
8367
+ them. The cell's imports and declarations are left out, since the
8368
+ notebook's path compiles every cell. Read by Publisher's own lexer,
8369
+ so a `run:` in a comment, a string or a block annotation does not
8370
+ count. Absent on a markdown cell, on a code cell with no `run:`, on
8371
+ a compiled document's cells, and from a server that predates it.
8803
8372
 
8804
8373
  QueryMetadata:
8805
8374
  type: object
@@ -8917,9 +8486,11 @@ components:
8917
8486
  database `#(materialize)` table the served copy read, or a
8918
8487
  database rollup or persisted view.
8919
8488
 
8920
- `live_fallback` — the query DID route to storage and the store then
8921
- failed underneath it, and the source's freshness fallback allowed it
8922
- to degrade to the live warehouse. **The rows are correct and the
8489
+ `live_fallback` — the query DID route to a stored table (a
8490
+ `storage=` table, a database table the served copy reads, or a
8491
+ rollup on either tier) and that read then failed underneath it, and
8492
+ the source's freshness fallback allowed it to degrade to the live
8493
+ warehouse (a rollup's always does). **The rows are correct and the
8923
8494
  request succeeded**, which is why this needs its own value: it is
8924
8495
  indistinguishable from a storage hit at the call site, and treating it
8925
8496
  as one would report a healthy hit rate for a broken store. On
@@ -10368,6 +9939,19 @@ components:
10368
9939
  are fine; retrying elsewhere will not help, and neither will
10369
9940
  rewriting the query.
10370
9941
 
9942
+ RESULT_TRUNCATED, on a 502, means the database returned fewer rows
9943
+ than it reported and no row limit cut them: a BigQuery answer
9944
+ larger than one results page (about 10 MB) whose later pages were
9945
+ not read. The query is refused rather than answered short.
9946
+ Retrying returns the same page; select fewer columns, aggregate,
9947
+ or return fewer rows.
9948
+
9949
+ RESULT_SHAPE_MISMATCH, on a 502, means the database answered but a
9950
+ row does not fit the schema Malloy declared for the result (a value
9951
+ of another type than its column's), so the result could not be
9952
+ built. The query is not the caller's to fix; the server logs the
9953
+ cause.
9954
+
10371
9955
  CONNECTION_AUTH_FAILED, on a 424, means the database rejected the
10372
9956
  connection's credentials (a wrong password, an invalid key, an
10373
9957
  expired token), so the query never ran. Whoever configures the
@@ -10477,8 +10061,8 @@ components:
10477
10061
  * VERSION_ARCHIVED (410): the version is archived.
10478
10062
 
10479
10063
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
10480
- CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND,
10481
- STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10064
+ CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND, RESULT_TRUNCATED,
10065
+ RESULT_SHAPE_MISMATCH, STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10482
10066
  MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10483
10067
  TABLE_OWNERSHIP_UNVERIFIED, TABLE_IN_USE, BUILD_INSTRUCTIONS_INVALID,
10484
10068
  MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
@@ -10597,9 +10181,15 @@ components:
10597
10181
  reload over every .malloy and .malloynb file, without swapping the
10598
10182
  result into the served package; with a source, importers compile
10599
10183
  against the replacement. It also reports the render-tag findings
10600
- (code "render-tag") and the dashboard, given and drill findings
10601
- (code "dashboard-lint") a reload would put on the package's
10602
- warnings, at their own severity and with no position, and the
10184
+ (code "render-tag"), the dashboard, given and drill findings
10185
+ (code "dashboard-lint") and each .malloynb code cell the query
10186
+ route would refuse (code "malloynb-cell-refused", at most 10 per
10187
+ notebook and 50 per package, with the rest named in
10188
+ "malloynb-cells-unlisted" summaries, one per notebook that lists
10189
+ some and one for the notebooks past the package limit, and
10190
+ "malloynb-cell-check-failed" for a notebook that could not be
10191
+ checked) a reload would put on the package's warnings, at their own severity and with no
10192
+ position, and the
10603
10193
  load's verdict on the materialization annotations: each line a
10604
10194
  load fails with as an error with its code, each annotation the
10605
10195
  load leaves unbuilt as a warning ("file" reports the same verdict
@@ -10823,9 +10413,12 @@ components:
10823
10413
  The published version of the package to build. `latest`, omitted or
10824
10414
  empty, the package's `latest` version is built. An unknown version answers 404
10825
10415
  (`reason` VERSION_NOT_FOUND) and an archived one 410 (`reason`
10826
- VERSION_ARCHIVED). Carried in the body rather than the query string
10827
- because the body is optional: a new optional query parameter ahead
10828
- of it would move the body argument of every generated client.
10416
+ VERSION_ARCHIVED). Carried in the body rather than a declared query
10417
+ parameter because the body is optional: a new optional query
10418
+ parameter ahead of it would move the body argument of every
10419
+ generated client. A `?versionId=` in the URL is read too, and must
10420
+ agree with this one when both name a version (400
10421
+ VERSION_ID_INVALID otherwise).
10829
10422
 
10830
10423
  The run records the version it built in `metadata.versionId`, with
10831
10424
  the package's materialization scope in `metadata.scope`, which
@@ -11331,6 +10924,7 @@ components:
11331
10924
  partial_name_collision,
11332
10925
  given_where_over_unstored_field,
11333
10926
  unreadable_grain,
10927
+ upstream_unread,
11334
10928
  ]
11335
10929
  description: >-
11336
10930
  The bounded refusal reason; `message` says the specifics.
@@ -11370,7 +10964,12 @@ components:
11370
10964
  give no container; refused at plan, before any warehouse work);
11371
10965
  `storage_source_unsupported` (`storage=` on a
11372
10966
  source whose connection the build cannot pass through to a
11373
- destination, e.g. the package's DuckDB sandbox);
10967
+ destination, e.g. the package's DuckDB sandbox; or a source that
10968
+ carries author SQL, an `.sql()` source, a `sql_*` expression or a
10969
+ file or URL read as a table, whose table would be built inside a
10970
+ catalog, which runs only SQL Malloy generated: a `storage=` source
10971
+ on a DuckLake connection, or a source of any tier on a connection
10972
+ configured `managed`);
11374
10973
  `table_name_collision` (under `PERSIST_COLLISION_ENFORCE=false`, a
11375
10974
  declaration whose `name=` puts it on one table with another, so
11376
10975
  neither is built; by default such a package does not load; a run
@@ -11382,7 +10981,13 @@ components:
11382
10981
  source's own extend block is applied at every read and is
11383
10982
  admitted); `incremental_unsupported` (a valid incremental
11384
10983
  declaration this deployment's dialect or destination cannot
11385
- honour).
10984
+ honour); `upstream_unread` (a table its build reads could not be
10985
+ read from its warehouse's catalog when the package loaded, after
10986
+ retrying, and this process has no earlier reading of it, so its
10987
+ content address is not known: it is not built, no run builds it,
10988
+ and a host's instruction for it is refused, until a reload or a
10989
+ plan refresh reads the catalog and plans it at its address; the
10990
+ `*-not-built` warning names the table).
11386
10991
 
11387
10992
 
11388
10993
  A persisted view or named query: `materialization_off` (persisted
@@ -11461,6 +11066,15 @@ components:
11461
11066
  declaration's `*-not-built` warning. For a `#@ persist` gate
11462
11067
  refusal it is the same text a build attempting the source would
11463
11068
  422 with.
11069
+ freshness:
11070
+ $ref: "#/components/schemas/Freshness"
11071
+ description: >-
11072
+ The freshness the refused source declares, resolved as a planned
11073
+ source's is (source, then model file, then package). A package
11074
+ `materialization.schedule` beside it is refused at publish as
11075
+ beside a planned source's: a refused source declares its window
11076
+ all the same. Absent when it declares none, or when the refusal
11077
+ comes from an annotation finding rather than the plan.
11464
11078
 
11465
11079
  BuildGraph:
11466
11080
  type: object
@@ -11737,6 +11351,41 @@ components:
11737
11351
  description: Output schema of the source.
11738
11352
  items:
11739
11353
  $ref: "#/components/schemas/Column"
11354
+ reads:
11355
+ type: array
11356
+ items:
11357
+ $ref: "#/components/schemas/TableRead"
11358
+ description: >-
11359
+ The warehouse tables this entry's build reads, distinct and sorted
11360
+ by connection then table: each `connection.table('...')` in the
11361
+ source's lineage, read off the same fully inlined definition `sql`
11362
+ and `sourceEntityId` are computed from. A table a persisted
11363
+ upstream reads is therefore listed here too, since this source's
11364
+ rows derive from it. A join is listed only when the build reads it
11365
+ (a field, filter or nest of the build reaches it); a join the
11366
+ source declares and the build never uses is not.
11367
+
11368
+
11369
+ Absent when the tables cannot be known: the lineage holds an
11370
+ `.sql()` source (its SQL text names tables Malloy does not parse)
11371
+ or a raw SQL expression such as `sql_number()` (which may hold a
11372
+ subquery). A host that rebuilds only the entries reading a replaced
11373
+ table MUST treat an absent `reads` as possibly reading any table on
11374
+ its connection, and an empty one as reading none. Not part of
11375
+ `sourceEntityId`.
11376
+ upstreamSchemas:
11377
+ type: array
11378
+ items:
11379
+ $ref: "#/components/schemas/UpstreamTableSchema"
11380
+ description: >-
11381
+ Each table in `reads` with its columns' types as its warehouse's
11382
+ catalog named them when this package was loaded (or why it could
11383
+ not be read). Part of `sourceEntityId`: a table whose columns or
11384
+ types change re-addresses every source that reads it, so its table
11385
+ is rebuilt rather than carried or reused. Read at the package's
11386
+ first load in a process and again on every explicit reload or
11387
+ publish. Absent when `reads` is absent: such a source's address is
11388
+ its SQL's alone.
11740
11389
  annotationFields:
11741
11390
  type: object
11742
11391
  additionalProperties:
@@ -11808,6 +11457,68 @@ components:
11808
11457
  `#@ preaggregate` annotations it was synthesized from, which is where
11809
11458
  an author would go to change it.
11810
11459
 
11460
+ UpstreamTableSchema:
11461
+ type: object
11462
+ required: [connectionName, table]
11463
+ description: >-
11464
+ One warehouse table a persist source's build reads, with its columns'
11465
+ types as the warehouse's own catalog names them (`NUMERIC(12,4)`,
11466
+ `FLOAT64`, `DOUBLE`), read when the package was loaded. Exactly one of
11467
+ `columns` and `unread` is present.
11468
+ properties:
11469
+ connectionName:
11470
+ type: string
11471
+ description: The Malloy connection the table is read through, as in `TableRead`.
11472
+ table:
11473
+ type: string
11474
+ description: The table path exactly as the model wrote it, as in `TableRead`.
11475
+ dialect:
11476
+ type: string
11477
+ description: >-
11478
+ The dialect of the connection the types are named in (`snowflake`,
11479
+ `postgres`, `standardsql`, `duckdb`, ...): one type name means
11480
+ different types on different dialects (Snowflake's `FLOAT` is a
11481
+ double, DuckDB's a 4-byte float). Present with `columns`.
11482
+ columns:
11483
+ type: array
11484
+ description: Each column, in catalog order, with its native type.
11485
+ items:
11486
+ type: object
11487
+ required: [name, nativeType]
11488
+ properties:
11489
+ name:
11490
+ type: string
11491
+ nativeType:
11492
+ type: string
11493
+ unread:
11494
+ type: string
11495
+ enum: [no_catalog, not_found, ambiguous, read_failed]
11496
+ description: >-
11497
+ Why the table has no columns here. `no_catalog`: its dialect gives
11498
+ this table no catalog to read (an unqualified BigQuery name, a path
11499
+ the catalog cannot parse). `not_found`: the catalog holds no such
11500
+ table (a BigQuery wildcard table, a table not created yet).
11501
+ `ambiguous`: an unqualified name the catalog holds in more than one
11502
+ schema. These three are stable and fold into the address.
11503
+ `read_failed`: the catalog read failed and no earlier reading of
11504
+ the table was known in this process; the plan refuses each source
11505
+ that reads it (`upstream_unread`), so no address folds it.
11506
+ TableRead:
11507
+ type: object
11508
+ required: [connectionName, table]
11509
+ description: One warehouse table a persist source's build reads.
11510
+ properties:
11511
+ connectionName:
11512
+ type: string
11513
+ description: >-
11514
+ The Malloy connection the table is read through, as the model names
11515
+ it (the `lake` of `lake.table('orders')`).
11516
+ table:
11517
+ type: string
11518
+ description: >-
11519
+ The table path exactly as the model wrote it inside `.table('...')`
11520
+ (e.g. `analytics.orders`), unquoted and unqualified by anything the
11521
+ connection adds; on DuckDB it may be a file path or URL.
11811
11522
  PreaggregatePlan:
11812
11523
  type: object
11813
11524
  description: >-
@@ -12476,6 +12187,18 @@ components:
12476
12187
  producer did not record it.
12477
12188
  items:
12478
12189
  $ref: "#/components/schemas/Column"
12190
+ upstreamSchemas:
12191
+ type: array
12192
+ description: >-
12193
+ The warehouse tables this table's build read, each with its columns'
12194
+ native types as the build's plan read them from the catalog (the
12195
+ plan's `PersistSourcePlan.upstreamSchemas`), on both tiers. The
12196
+ `sourceEntityId` folds them in, so an entry whose upstream was
12197
+ retyped since is never the current address's. A host that stores
12198
+ entries keeps this field as written. Absent on an entry built
12199
+ before 0.17.0, and for a source whose tables cannot be known.
12200
+ items:
12201
+ $ref: "#/components/schemas/UpstreamTableSchema"
12479
12202
  realization:
12480
12203
  allOf:
12481
12204
  - $ref: "#/components/schemas/Realization"
@@ -12709,9 +12432,8 @@ components:
12709
12432
  true }`, which is for authoring servers. Without it the argument is not
12710
12433
  in the tool's schema and is ignored if sent, so an agent answering
12711
12434
  questions stays on the curated surface.
12712
- This route is not affected by that setting. The notebook-cell route, the dashboards
12713
- route, the other MCP tools, and the legacy `/projects/...` aliases of
12714
- these routes ignore it.
12435
+ This route is not affected by that setting. The other MCP tools and the
12436
+ legacy `/projects/...` aliases of these routes ignore it.
12715
12437
 
12716
12438
  Like every route on this server, it is unauthenticated. A deployment
12717
12439
  that authenticates in front of Publisher decides who may send it, and
@@ -12782,10 +12504,14 @@ components:
12782
12504
 
12783
12505
  Build metadata must be percent-encoded: send `1.2.0+build.5` as
12784
12506
  `1.2.0%2Bbuild.5`, since a bare `+` in a query string decodes to a space.
12507
+
12508
+ Accepted: `latest`, empty, or a semantic version. The schema carries no
12509
+ pattern on purpose: a validator generated from one would refuse `latest`
12510
+ and the empty value.
12785
12511
  schema:
12786
12512
  type: string
12787
12513
  versionPath:
12788
- name: version
12514
+ name: versionId
12789
12515
  in: path
12790
12516
  required: true
12791
12517
  description: |