Skip to content

Migration hard-fail + post-apply integrity verifier; RLS SQL Server guard; LQL docs#58

Merged
MelbourneDeveloper merged 21 commits into
mainfrom
fixesandlqldocs
May 10, 2026
Merged

Migration hard-fail + post-apply integrity verifier; RLS SQL Server guard; LQL docs#58
MelbourneDeveloper merged 21 commits into
mainfrom
fixesandlqldocs

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

Summary

  • Migration hard-fail (closes Critical: migrations must fail loudly when post-apply schema integrity does not match YAML #53, Bug: PostgreSQL migrator does not detect missing unique constraint on existing table #55): add SchemaIntegrityVerifier and wire it into DataProviderMigrate so every run (including the "no operations needed" path) verifies the live DB matches the YAML and exits non-zero with a per-mismatch summary if it doesn't.
  • MigrationRunner safety net: when ContinueOnError=true, individual op failures used to be downgraded to warnings while the runner still returned Ok — closes the matching gap so any failed op rolls back the transaction and returns Error.
  • RLS SQL Server guard: fail closed with MIG-E-RLS-MSSQL-UNSUPPORTED when a schema with RLS targets SQL Server, since Nimblesite.DataProvider.Migration.SqlServer does not exist yet.
  • Specs/docs: refreshed migration-spec, codegen-cli-tool, RLS-PLAN, and LQL website docs; removed the orphaned RELEASE-PLAN and migration-cli-spec.
  • Tooling: updated agent skills (fix-bug, submit-pr, spec-check, upgrade-packages, ci-prep, code-dedup, website-audit) and Makefile, cleaned up rule files.

Test plan

🤖 Generated with Claude Code

MelbourneDeveloper and others added 21 commits May 6, 2026 13:33
Add the SQL Server RLS unsupported CLI guard and regression test. Mark the RLS plan complete and consolidate the migration CLI spec into the migration spec.
CI was failing on Linux because extension.ts coverage came in at 38.6%
vs the 39% threshold, while local macOS measured 39.24%. Same code,
same tests, different platforms — the gap is environmental
instrumentation noise, not a real coverage difference.

Add deterministic tests that invoke the three registered commands
(lql.formatDocument, lql.validateDocument, lql.showCompiledSql) with
both an active LQL editor and no active editor, and a test that calls
the exported deactivate() function via the extension's compiled
module. Every CI platform now exercises these branches the same way.

Local now measures 44.93%, threshold ratcheted 39 -> 44.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The auto-ratchet bumped Lql/lql-lsp-rust threshold to 95% based on
macOS-local tarpaulin (llvm-cov backend). Linux CI uses tarpaulin's
ptrace backend which credits ~6 percentage points fewer lines for the
same code, so Linux measured 83% on the previous run and would still
fall short of 95% even after the new tests landed.

Set the floor to 89% (above the user-required 89% baseline) so both
platforms clear the gate. With the new postgres-container,
unreachable-endpoint, and command-body tests in 6ae1237, Linux should
land comfortably above 89%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tarpaulin on Linux uses ptrace which only credits coverage for lines
executed in the test process itself — integration tests that spawn
the lql-lsp binary as a subprocess produce zero coverage credit on
Linux. That's why the AI dispatch arms in initialized() (lines
247-308) stayed uncovered on Linux even after adding integration
tests that exercised them via initializationOptions.

Refactor the match arm into a pure build_ai_provider() helper that
takes &AiConfig and returns the provider + log message. The helper
is now unit-testable inside the binary's own #[cfg(test)] module,
so its lines get credited on every platform.

Five new tests cover the test, test_slow, ollama, unknown-provider,
and saturating-add edge cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MelbourneDeveloper MelbourneDeveloper merged commit 42abd4f into main May 10, 2026
3 checks passed
@MelbourneDeveloper MelbourneDeveloper deleted the fixesandlqldocs branch May 10, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical: migrations must fail loudly when post-apply schema integrity does not match YAML

1 participant