feat(data): add transactional canonical schema rename - #623
Draft
seonghobae wants to merge 6 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Buyer and operator outcome
Refs #433. This stacked slice follows #500 and turns the reviewed migration-generation ledger into an executable SQLite cutover primitive. It remains Draft and intentionally unintegrated with startup/runtime until the parent is protected-shipped and the rename transaction can be reconciled to that exact protected head.
Exact stack
refactor/schema-migration-ledger-433@9f2e6818940c749380e6458b509c5f655a2670ca(feat(data): add fail-closed schema migration ledger #500)81072df8f4dd2e2df269710eb7cc852312ff75432927e682b0d6ee87998053505d83faa82a398d5dfeat/schema-canonical-rename-433Any parent or child movement invalidates revision-sensitive evidence until fresh refetch.
TDD and repair evidence
The slice started RED by registering
tests/unit/schema-canonical-rename.test.mjsbefore the production module existed. Hosted Server Tests run33139011439failed at the intended first boundary withERR_MODULE_NOT_FOUNDforserver/schema_rename.mjs.The production repair then added
runCanonicalSchemaRename()with:BEGIN IMMEDIATEtransaction;PRAGMA foreign_keys = ONandlegacy_alter_table = OFFenforcement;foreign_key_checkandintegrity_checkbefore commit;BEGIN IMMEDIATEitself cannot start.The first hosted implementation run exposed a test-representation defect:
node:sqliterows have a null prototype, so strict object equality failed although the returned values were correct. The regression was repaired by normalizing database rows to plain objects; production migration behavior was not weakened.The current head further strengthens fail-closed coverage for missing foreign-key pragma evidence, inability to disable legacy ALTER TABLE mode, canonical-state foreign-key and integrity violations, and rollback failure while preserving the original causal cutover error.
Current-head hosted evidence for contributor head
81072df8f4dd2e2df269710eb7cc852312ff7543/ PR merge2927e682b0d6ee87998053505d83faa82a398d5d:33140351886: GREEN (unit-and-api,cloud-e2e);2927e682b0d6ee87998053505d83faa82a398d5d, whose commit message binds child head81072df8f4dd2e2df269710eb7cc852312ff7543to parent9f2e6818940c749380e6458b509c5f655a2670ca;33140351742: GREEN;33140352091: GREEN.The hosted checkout above is the synthesized PR merge, not the contributor head itself. It is valid integration/product evidence but is not represented here as corrected exact-contributor-head merge authority.
package.jsonincludesserver/schema_rename.mjsin the owned c8 coverage surface and includes the rename regression in coverage cases. Exact 100% owned production coverage remains an explicit merge gate and is not inferred from the Server Tests workflow.Scope boundary
This PR does not wire canonical tables into application startup or application queries and does not close #433. Runtime query migration, compatibility-view decisions, PostgreSQL parity, backup/restore rehearsal, deployment cutover and final rejection of remaining single-word owned production database objects remain later bounded work.
Merge gate
Keep Draft and do not merge independently of #500. Merge is prohibited until the parent is protected-shipped, this child is reconciled to the resulting protected head, every applicable exact-head test/browser/owned coverage/docstring/security/dependency/supply-chain/package/provenance/migration-recovery gate is terminal-passing under corrected checkout controls, valid unresolved findings are zero, and a qualifying independent current-head approval exists under live governance.