feat(kt-config): GraphMigration planner (Phase 7 #56)#254
Merged
charlie83Gs merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
Pure function walking a GraphTypePlugin's declared migrations and returning the ordered list that advances from_version to plugin.current_version. No Hatchet, no DB, no side effects — consumed by the Phase 7 graph_migration_wf, which dispatches one migration at a time and persists audit rows between hops. Deliberately under-specified on execution concerns: - does NOT check that migrations are runnable - does NOT check if a migration was already applied - does NOT enforce downgrade policy beyond rejecting them Those belong to the workflow; the planner only answers "what migrations, in what order, does the plugin declare for this walk?" Error cases: - from_version < 1 raises (v1 is the baseline) - from_version > plugin.current_version raises (downgrades are unsupported; framework is forward-only by the to_version == from_version + 1 invariant) - from_version == current returns [] (startup auto-dispatch's "no migration needed" signal) Migrations within a hop preserve declared order (plugin author encodes dependency via list position). Out-of-window migrations are silently filtered — a plugin may ship a staged v3 → v4 behind a still-at-v3 current_version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) 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. |
3 tasks
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
Ships the migration planner for Phase 7. Pure function (no Hatchet, no DB) that walks a `GraphTypePlugin`'s declared migrations and returns the ordered list advancing `from_version` to `plugin.current_version`. The Phase 7 `graph_migration_wf` (next PR) consumes this output to dispatch one migration at a time, persisting audit rows between hops.
Unblocks #57 (Hatchet workflow), #58 (startup auto-dispatch), #60 (first v1→v2 bump), #62 (integration test), #63 (PR #7 rollup).
Contract
Trusts the plugin's shape — the registry already validates at `register_graph_type` that `current_version >= 1`, every migration is single-step, and every hop is covered. Planner is a walker, not a validator.
Error cases:
Ordering: hops run in ascending order; migrations within a hop preserve declared list order (plugin author encodes dependencies via list position).
Out-of-window filtering: migrations whose `from_version` falls outside `[from_version, current_version)` are silently dropped. Covers two real cases:
Test plan
🤖 Generated with Claude Code