feat(kt-db): execute_migration full-lifecycle executor (Phase 7 #57)#266
Merged
charlie83Gs merged 1 commit intomainfrom Apr 20, 2026
Merged
feat(kt-db): execute_migration full-lifecycle executor (Phase 7 #57)#266charlie83Gs merged 1 commit intomainfrom
charlie83Gs merged 1 commit intomainfrom
Conversation
Pure async function composing the three Phase 7 primitives into the single call graph_migration_wf will make per graph: - begin_migration (advisory-locked read_only flip) - for hop in hops: run_hop (audit-row lifecycle + savepoint) - commit_migration (target_version, status='active', unlock) OR fail_migration (status='error', stamped at last_applied_version) Stops at the first raising hop. Returns MigrationResult carrying final_version (what data actually reached), applied_hops, and repr'd error — workflow surfaces these in its final progress event without re-querying. Not the Hatchet workflow itself (#57 wraps this in a task for durability); not the auto-dispatch hook (#58 composes plan_auto_dispatch + this executor). Pure function, single session in, no commits — caller owns tx boundaries. 8 integration tests: single/multi-hop success, workflow_run_id propagates, read_only visible during hop, first-hop + mid-plan failure stamps correct version, re-migrate resume short-circuits completed hops + clears error status via commit, empty plan still begin->commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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
What this is NOT
Keeps the orchestration logic unit-testable against a real DB without Hatchet; the workflow layer becomes thin glue.
Test plan
All 8 pass. Full `libs/kt-db/tests/integration` suite: 230 passed.
🤖 Generated with Claude Code