Skip to content

fix(compat): close semantic lineages and remediate recovery - #59

Merged
pablontiv merged 16 commits into
mainfrom
pablontiv/issue-58-semantic-lineage
Aug 24, 2026
Merged

fix(compat): close semantic lineages and remediate recovery#59
pablontiv merged 16 commits into
mainfrom
pablontiv/issue-58-semantic-lineage

Conversation

@pablontiv

Copy link
Copy Markdown
Owner

What

  • Replace textual/checksum lineage matching with conservative semantic schema identity keyed by (AppliedVersion, Signature).
  • Separate schema_migrations provenance from semantic hashing while preserving ledger validation and migration planning.
  • Require every physical catalog fixture to migrate losslessly through production OpenCompatible to the exact current head with zero skips.
  • Classify recover as remediation: retain the mutation-grade startup lease while bypassing ordinary compatible-open and pre-handler sync.

Why

ALTER-built V13 databases produced valid but unrecognized V14 signatures, causing every operational command—and recover --dry-run itself—to fail with unsupported_lineage/migration_failed.

This closes the defect class rather than adding V14-specific signature exceptions.

Closes #58.

How

  • Added token-based DDL canonicalization that removes formatting/comments while preserving literals, quoted identifiers, constraints, expressions, triggers, indexes, and virtual-table configuration.
  • Added collision-safe composite catalog lookup and deterministic current-head selection.
  • Regenerated semantic signatures without editing fixture SQL or migration V1–V14 bodies.
  • Replaced skipped lineage coverage with a 19-fixture V1→V14 closure matrix, including both ALTER-built histories.
  • Added explicit remediation startup classification, immediate/busy-owner lease tests, real ALTER-built recovery dry-run immutability, and repeated subprocess contention coverage.
  • Updated living documentation and ADRs 0004–0006.

Verification

  • TestEveryCatalogFixtureReachesCurrentSemanticHead: 19/19 fixtures PASS, zero skips.
  • ALTER-built recover --dry-run: PASS; no circular diagnostics; DB and empty WAL unchanged.
  • Real affected database smoke: PASS on an online SQLite .backup; original database hash unchanged.
  • Remediation contention: PASS with -count=5; sync counter remains exactly 1.
  • Windows internal/startuplock compile: PASS.
  • just ci: PASS, aggregate coverage 86.1%.
  • Independent task reviews and final whole-branch review: PASS.

No new flag, command, lock type, fallback catalog, repair mode, persistent application state, V14 runtime exception, or migration SQL change was added.

Checklist

  • Tests pass (just test)
  • Code is clean (just check)
  • Snapshots updated if needed (cargo insta review) — not applicable
  • Changes are documented if user-facing

@pablontiv
pablontiv merged commit 1e698e5 into main Aug 24, 2026
6 checks passed
@pablontiv
pablontiv deleted the pablontiv/issue-58-semantic-lineage branch August 24, 2026 21:02
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.

v3.5.0: ALTER-built V13 databases fail to migrate to V14 with unsupported_lineage (#52 defect class reappears)

1 participant