feat: Trust-system Arc 6 (first wave) — dialect-portability linter#184
Merged
hugocorreia90 merged 1 commit intomainfrom Apr 20, 2026
Merged
feat: Trust-system Arc 6 (first wave) — dialect-portability linter#184hugocorreia90 merged 1 commit intomainfrom
hugocorreia90 merged 1 commit intomainfrom
Conversation
…inter Adds `rocky compile --target-dialect <dbx|sf|bq|duckdb>` that rejects SQL constructs which don't run on the chosen warehouse. Detection is AST-based (sqlparser visitor) over the same catalog that `rocky_sql::transpile` already translates — NVL, IFNULL, DATEADD, DATE_ADD, TO_VARCHAR, LEN, CHARINDEX, ARRAY_SIZE, DATE_FORMAT, QUALIFY, ILIKE, FLATTEN. Flagged constructs emit error-severity P001 diagnostics with a portable-alternative suggestion; the compile bails, matching the rest of the error path. Wave 1 deliberately omits rocky.toml wiring and per-model pragma opt-out — both deferred to wave 2. The flag is fully opt-in: when unset, compile behaves exactly as before.
hugocorreia90
added a commit
that referenced
this pull request
Apr 20, 2026
- rocky-sql/portability.rs: collapse nested `if !supports_ilike(self.target)` into a match-arm guard. Rust 1.95 clippy promotes `collapsible_match` so the previous shape (landed in Arc 6 PR #184, pre-toolchain bump) now fires under `-D warnings`. - integrations/dagster: regen `lineage/compile.json` to capture the new P002 warning emitted by the lineage POC's stg_orders model (`SELECT * FROM source.raw.orders` with a downstream `fct_revenue` that references `customer_id, amount`). The fixture proves P002 fires end-to-end through the dagster CLI subprocess path with the expected shape.
hugocorreia90
added a commit
that referenced
this pull request
Apr 20, 2026
… linter (P002) (#185) * feat(engine): Trust-system Arc 7 (first wave) — blast-radius SELECT * linter (P002) Adds always-on, warning-severity P002 diagnostic emitted when a model uses `SELECT *` AND at least one downstream model references specific columns of its output. The lint is *blast-radius-aware*: a leaf SELECT * with no downstream consumers is intentionally not flagged — the user inspected the result themselves. The diagnostic only fires when an upstream schema change at the star's source would silently propagate into a downstream that names columns of this model. Detection runs against the existing semantic graph rather than re-parsing SQL: `ModelSchema::has_star` is already set during graph construction by `rocky_sql::lineage`, and `column_consumers(model, column)` enumerates the exact downstream edges that make the radius concrete. No new parser or type-inference machinery is required for this wave; the next wave (Arc 7 type inference over raw `.sql` models) will sharpen which upstream is treated as "typed." Wiring lives in `rocky-compiler::compile_project` (and the incremental path) so both the CLI's `rocky compile` and the LSP's per-keystroke publish loop surface P002 to users without any opt-in flag. Severity is warning — non-blocking on `has_errors`, so existing CI green stays green; the diagnostic is informational pressure to make schema deps explicit. Wave 2 may add a `[lints]` block in rocky.toml + per-model `-- rocky-allow: select-star` pragma, mirroring Arc 6's deferred portability config. Diagnostics include the offending model, list of affected downstream consumers, and the specific columns each downstream references (capped at 3 per consumer for legibility on wide schemas), with an actionable suggestion to switch to an explicit column list. Source spans point at the model file so miette renders the warning in-place in both terminal and LSP clients. * fix(engine,dagster): unblock CI on Arc 7 wave 1 - rocky-sql/portability.rs: collapse nested `if !supports_ilike(self.target)` into a match-arm guard. Rust 1.95 clippy promotes `collapsible_match` so the previous shape (landed in Arc 6 PR #184, pre-toolchain bump) now fires under `-D warnings`. - integrations/dagster: regen `lineage/compile.json` to capture the new P002 warning emitted by the lineage POC's stg_orders model (`SELECT * FROM source.raw.orders` with a downstream `fct_revenue` that references `customer_id, amount`). The fixture proves P002 fires end-to-end through the dagster CLI subprocess path with the expected shape. * fix(engine,dagster): match CI rustfmt + refresh fixture wording - portability.rs: wrap the long ILIKE suggestion string the way CI's rustfmt expects. Local rustfmt accepted the inline form but the CI toolchain enforces the multiline break. - lineage/compile.json: regen against a freshly-built release binary so the fixture reflects the current P002 message ("silently propagates" — tightened from "may silently propagate" mid-PR). Previous regen used a stale release binary cached before the message edit.
3 tasks
hugocorreia90
added a commit
that referenced
this pull request
Apr 20, 2026
Closes the first wave of every trust-system arc (Arcs 1-7) plus the two wave-2 follow-ups landed the same day. Nine feature PRs since v1.10.0. - Arc 1 (#170): rocky lineage --downstream, rocky branch, rocky run --branch, rocky replay - Arc 2 (#171): per-run cost attribution, [budget] block, budget_breach hook - Arc 3 (#172): three-state CircuitBreaker, adapter consolidation - Arc 4 (#173): rocky trace Gantt + feature-gated OTLP metrics export - Arc 5 (#174): schema-grounded rocky ai prompt + project-aware validator - Arc 6 wave 1 (#184): --target-dialect P001 portability lint (12 constructs) - Arc 7 wave 1 (#185): blast-radius P002 SELECT * lint (semantic-graph aware) - Arc 6 wave 2 (#186): [portability] config block + per-model rocky-allow pragma - Arc 7 wave 2 wave-1 (#187): --with-seed source-schema inference Plus #169 fix: install scripts pick latest engine version by semver. Version bump: 20 Cargo.toml files (all workspace members except rocky-bigquery, which tracks its own version). Wave 2/3 work for every arc remains in the deferred backlog — see the changelog Deferred section for the full carry-forward.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rocky compile --target-dialect <dbx|sf|bq|duckdb>rejects SQL constructs that don't run natively on the chosen warehouse.rocky_sql::transpilealready handles —NVL,IFNULL,DATEADD,DATE_ADD,TO_VARCHAR,LEN,CHARINDEX,ARRAY_SIZE,DATE_FORMAT,QUALIFY,ILIKE,FLATTEN.P001diagnostics with a portable-alternative suggestion; the compile bails like any other error path.rocky.tomlwiring and per-model pragma opt-out — both deferred to wave 2.Example
Test plan
rocky-sql/src/portability.rscover every catalog entry plus false-positive guards (identifier shadowing, string literals, parse failures).rocky-cli/src/commands/compile.rsverify: P001 diagnostic shape, BigQuery+NVL bails, no--target-dialect→ unchanged behavior, Snowflake+NVL accepted.cargo clippy -p rocky-sql -p rocky-cli -p rocky --all-targets -- -D warningsclean.cargo fmt --checkclean.just codegen(rust + dagster + vscode) produces no drift.rocky compile --target-dialect bqon a model containingNVLrenders the P001 diagnostic with miette source span and exits 1.