Add context migration for version upgrades#19
Open
th3nate wants to merge 1 commit intoromiluz13:mainfrom
Open
Conversation
Preserve accumulated project knowledge (patterns, decisions, learnings, verification evidence) when STATE_VERSION bumps by merging content from previous version directories into the new one on first SessionStart. - Add parse_markdown_sections, extract_bullets, normalize_bullet to hooklib - New cc10x_context_migration.py with section-aware merge, dedup, idempotency - SessionStart hook in hooks.json triggers migration before context injection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
STATE_VERSIONbumps (e.g., v10 → v11)SessionStartafter upgrade, merging content from all previous version directories (including legacy root-level files) into the new version.migratedmarker file; section-aware merge with bullet-level dedup; atomic writes with.pre-migration.bakbackupsChanges
plugins/cc10x/scripts/cc10x_hooklib.pyparse_markdown_sections(),extract_bullets(),normalize_bullet()utilitiesplugins/cc10x/scripts/cc10x_context_migration.pyplugins/cc10x/hooks/hooks.jsonstartup-only SessionStart hook before existing context injectionMerge strategy per file
Test plan
parse_markdown_sections,extract_bullets,normalize_bullet🤖 Generated with Claude Code