# Deployment fixtures

Generated by `npm run conformance` in `gasp-wiki-mcp`. Do not edit.

These follow the deployment specification proposed in apache/ossie #869 (`deployment/deployment.md`, 2026-12-02): a deployment is a separate document that points at a model through `semantic_model_ref` and binds each base dataset (a dataset whose source is a table) to the relation that implements it, with a `columns` map for stored names that differ. A derived dataset, whose source is a query, stays in the model. `naming` says how an unmapped column name meets its stored name: `exact` (the default, the normalized name unchanged), `upper` or `lower`. A source is the table object of apache/ossie #704 (`kind: table` with an `identifier` of parts, each a name or `{name, level}`). Neither pull request is merged yet.

## One model, two physical copies

The direct conformance cases read one table each and no query, so a deployment can move them whole. Each has two deployments over two copies of the same rows:

- `postgres.deployment.yaml` binds the tables of `../data/` under their own names. They are stored in lower case, so `naming: lower` resolves every column and the document has no column entries.
- `warehouse.deployment.yaml` binds the copy in `data/warehouse.sql`: schema `WAREHOUSE`, upper-case names, other table names and three renamed columns per table. It writes no `naming`: a normalized name is upper case, so the default resolves every column but the three renamed ones, which have entries.

| Model's source | Copy | Columns stored under another name |
| --- | --- | --- |
| `gasp.customer` | `WAREHOUSE.ACCOUNTS` | `customer_id` as `ACCOUNT_ID`, `customer_status` as `STATUS`, `snapshot_date` as `AS_OF_DATE` |
| `gasp.subscription` | `WAREHOUSE.SUBSCRIPTIONS` | `mrr` as `MONTHLY_AMOUNT`, `subscription_status` as `STATUS`, `snapshot_date` as `AS_OF_DATE` |

Every other column is the field id in upper case.

Both deployments must return the case's own `expected.sql`. Three checks hold them to it when the set is written:

1. `apply.py` applies the deployment (`*.ossie.yaml` beside it) and checks every bound column against `catalog.json`, which lists each relation's exact stored names.
2. `*.ost` runs the case's query over the applied model through the upstream view expander on DuckDB, with only that copy's tables created, so a query that still read the model's own source would fail. It was written by `ost` at `apache/ossie` `7fb92a7`.
3. The case's reference query runs on Postgres (PGlite) over the applied source, where a quoted name must match its stored name exactly. DuckDB matches names without regard to case, so this is the run that would catch a wrong naming policy.

| Deployment | Checks | Row of the proposal's conformance table | Outcome |
| --- | --- | --- | --- |
| `cases/c12_snapshot_mrr_month/postgres.deployment.yaml` | the tables of data/ under their lower-case names, resolved by naming lower alone | Unmapped name with an exact stored match under the naming policy | accept |
| `cases/c12_snapshot_mrr_month/warehouse.deployment.yaml` | the upper-case copy in WAREHOUSE under the default naming, with other table names and three column entries | Different table names, different column names | accept |
| `cases/c13_snapshot_mrr_quarter/postgres.deployment.yaml` | the tables of data/ under their lower-case names, resolved by naming lower alone | Unmapped name with an exact stored match under the naming policy | accept |
| `cases/c13_snapshot_mrr_quarter/warehouse.deployment.yaml` | the upper-case copy in WAREHOUSE under the default naming, with other table names and three column entries | Different table names, different column names | accept |
| `cases/c14_snapshot_total_customers_month/postgres.deployment.yaml` | the tables of data/ under their lower-case names, resolved by naming lower alone | Unmapped name with an exact stored match under the naming policy | accept |
| `cases/c14_snapshot_total_customers_month/warehouse.deployment.yaml` | the upper-case copy in WAREHOUSE under the default naming, with other table names and three column entries | Different table names, different column names | accept |

## Rejections

Each is one change to the `warehouse` deployment of `c12_snapshot_mrr_month`, except the last, which binds a derived dataset of `c02_lag_mrr_growth_rate`. `outcome.txt` beside each holds what `apply.py` reports.

| Deployment | Checks | Row of the proposal's conformance table | Outcome |
| --- | --- | --- | --- |
| `rejections/missing_binding/deployment.yaml` | subscription has no binding | Unknown, duplicate or missing dataset binding | reject (stage 2) |
| `rejections/unknown_dataset/deployment.yaml` | a binding names subscriptions, which the model does not have | Unknown, duplicate or missing dataset binding | reject (stage 2) |
| `rejections/duplicate_binding/deployment.yaml` | subscription is bound twice | Unknown, duplicate or missing dataset binding | reject (stage 2) |
| `rejections/wrong_model_reference/deployment.yaml` | semantic_model_ref names a model other than the one its iri finds | Wrong or ambiguous model reference | reject (stage 2) |
| `rejections/duplicate_column_key/deployment.yaml` | the columns map of subscription has MRR twice | Duplicate map key (stage 2 rules) | reject (stage 2) |
| `rejections/missing_column/deployment.yaml` | the entry for MRR names a column the relation does not hold | Missing required source column | reject (stage 3) |
| `rejections/unmapped_no_match/deployment.yaml` | SNAPSHOT_DATE has no entry and the copy stores it as AS_OF_DATE | Unmapped name with no stored match under the naming policy | reject (stage 3) |
| `rejections/wrong_naming_policy/deployment.yaml` | naming lower over a copy stored in upper case: every unmapped column misses | Unmapped name with no stored match under the naming policy | reject (stage 3) |
| `rejections/unknown_relation/deployment.yaml` | the binding names WAREHOUSE.SUBSCRIPTION, which the catalog does not hold | Missing required source column (the relation itself) | reject (stage 3) |
| `rejections/entry_without_dependency/deployment.yaml` | an entry for ARR, which no expression of subscription names: a warning, and the deployment applies | Map entry with no known dependency | accept (stage 2 warning) |
| `rejections/binding_for_derived_dataset/deployment.yaml` | a binding for gasp_staged_gasp_mrr_growth_rate, whose source is a query in the model | Binding for a derived dataset | reject (stage 2) |

Not covered, since no GASP model has the shape: measures and the `measures` map, quoted mixed-case identifiers (so `upper` and `exact` resolve every GASP name alike), unused dialect entries, execution contexts, connection details on an overridden source, key violations and the choice among several deployments.

## The staged cases

The other conformance cases each have a derived dataset whose query computes the metric. That query names tables (`FROM gasp.customer`), and those names are the model's own sources for its base datasets. Several also read `gasp.period_spine`, which is no dataset at all, so nothing can bind it. Each deployment here binds every base dataset to the `WAREHOUSE` copy, the way a team moving warehouse would write it. Under the proposal it is valid: a derived dataset is never bound and its query is left as it is. So the metric still reads the `gasp` tables. Where they exist it returns their rows, whatever the deployment binds, and where they do not the query fails when it runs. The proposal has no diagnostic for this. `apply.py` accepts each deployment and warns once for each table the query names.

| Deployment | Checks | Outcome |
| --- | --- | --- |
| `gap/c01_cohort_nrr/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_account_cohorts reads gasp.subscription, gasp.revenue_event, gasp.period_spine, gasp.customer by name | accept (4 stage 2 warnings) |
| `gap/c02_lag_mrr_growth_rate/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_mrr_growth_rate reads gasp.subscription, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c03_at_period_start_logo_churn_rate/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_logo_churn_rate reads gasp.revenue_event, gasp.customer, gasp.period_spine by name | accept (3 stage 2 warnings) |
| `gap/c04_total_ticket_distribution_by_type/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_ticket_distribution_by_type reads gasp.ticket, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c05_period_bound_in_filter_win_rate/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_win_rate reads gasp.opportunity, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c06_to_date_ticket_backlog/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_ticket_backlog reads gasp.ticket, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c07_period_days_uptime/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_uptime reads gasp.service_metrics, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c08_bucket_aging_buckets/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_aging_buckets reads gasp.invoice, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c09_window_dau_mau/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_dau_mau reads gasp.product_event, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c10_distinct_pair_breadth_of_adoption/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_breadth_of_adoption reads gasp.product_event, gasp.period_spine by name | accept (2 stage 2 warnings) |
| `gap/c11_all_time_user_retention_day_n/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_user_retention_day_n reads gasp.product_event, gasp.user, gasp.period_spine by name | accept (3 stage 2 warnings) |
| `gap/c15_at_period_start_logo_churn_rate_four_weeks/warehouse.deployment.yaml` | every base dataset bound to WAREHOUSE; the query of gasp_staged_gasp_logo_churn_rate reads gasp.revenue_event, gasp.customer, gasp.period_spine by name | accept (3 stage 2 warnings) |

A deployment would reach these if a query could read another dataset of the model in place of a table, which is the question the list opened on 2026-11-30.

## apply.py

A reference reading of the proposal, for these fixtures. It needs PyYAML and sqlglot:

```bash
python apply.py cases/<case>/warehouse.deployment.yaml --catalog catalog.json --out applied.ossie.yaml
```

It prints `accept` or `reject` and one line per diagnostic, with its stage and the names it is about. It finds the model through `semantic_model_ref.iri`, relative to the deployment. The required columns come from each field's portable expression, parsed, so a string literal or a function name is never taken for a column (rule 5 of its name resolution). The default `substitute` form writes each stored name into the parsed field expressions. `--form view` leaves the expressions alone and makes the source a query that projects each stored column under the name the expressions use; the two are equivalent, and the applied models here use the view form because the upstream view expander takes no field expression other than a column of the same name. Its source is `gasp-wiki-mcp/ossie-deploy/apply.py` in the GASP repository.

`manifest.json` lists every deployment with its group, case, the row it answers and the outcome it should get.
