feat(review): Promote --dialect auto when before/after resolve the same dialect#143
Merged
feat(review): Promote --dialect auto when before/after resolve the same dialect#143
Conversation
… dialect Under --dialect auto, the review use case now uses the parser-resolved dialect when both before and after parse to the same one, so SQL-only inputs that look unambiguously like Postgres or MySQL pick up the lock-risk caution rules without an explicit --dialect. When the two sides resolve to different dialects, EffectiveDialect stays Auto and a new REVIEW002 warning surfaces the mismatch instead of silently skipping. Schema-JSON inputs carry no parser dialect signal and stay Auto. The resolved dialect is exposed via ReviewResult.requested_dialect / effective_dialect, surfaced inline in the CLI text/markdown reports, returned in the WASM response, and rendered in the playground risk review note. Also rename the lock-risk auto-skipped fixture to a sqlite-skipped variant since auto no longer reliably exercises the skip path; the skip diagnostic is unchanged on sqlite and still covered by both unit and integration tests.
Update README, ARCHITECTURE, the docs/ reference set, the GitHub Action README, and the relune skill so they match the new --dialect auto behavior: SQL-only inputs that resolve to the same concrete dialect now run lock-risk automatically, schema-JSON inputs still need an explicit --dialect, and a REVIEW002 warning calls out the mismatch case.
Code Metrics Report
Details | | main (434dd7f) | #143 (13481cd) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 94.4% | 94.4% | +0.0% |
| Files | 99 | 99 | 0 |
| Lines | 36069 | 36217 | +148 |
+ | Covered | 34065 | 34207 | +142 |
+ | Test Execution Time | 1m37s | 1m36s | -1s |Code coverage of files in pull request scope (92.4% → 92.5%)
Reported by octocov |
Schema reviewTip ✅ No risk findings — schema changes look safe to merge. |
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
relune review --dialect autobehavior so that when the SQL parser resolves both before and after to the same concrete dialect (postgres / mysql / sqlite),autois promoted to that dialect — letting lock-risk caution rules run automatically when the resolution is postgres or mysql.EffectiveDialectatAutoand emit a newREVIEW002warning so the mismatch is no longer a silent skip.ReviewResult.requested_dialect/effective_dialect, in the CLI text/markdown report, in the WASM response, and in the playground risk-review note.Changes
resolve_effective_dialectincrates/relune-app/src/usecases/review.rsto promoteautoto a concrete dialect when both sides agree, and emit aREVIEW002warning when they disagree.resolved_dialectfield throughSchemaInputContextso the SQL parser result and DB URL scheme propagate as the per-input dialect signal, while schema-JSON inputs stayNone(and thereforeAuto).requested_dialect/effective_dialectonReviewResult, the WASM response, and the playground UI, and add a resolved-dialect annotation line to the CLI text/markdown formatters. Rename thelock-risk-auto-skippedfixture to a sqlite-pinned variant and add tests covering auto→postgres/mysql/sqlite promotion, the mismatch warning, mixed SQL + schema-JSON inputs, and the WASM / CLI surface.REVIEW002warning.