Fix missing user context migration for v4.x upgrades#846
Closed
catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
Closed
Fix missing user context migration for v4.x upgrades#846catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
In v2.5–v3.0, user context files (ABOUTME.md, TELOS/, CONTACTS.md, etc.) lived at skills/PAI/USER/ (or skills/CORE/USER/ in v2.4). v4.0 introduced PAI/USER/ as the canonical location and CONTEXT_ROUTING.md points there, but the installer never migrated existing files during upgrades. This leaves user data stranded at the old path while context routing points to an empty directory, breaking 27 of 47 routed paths. Adds a migration step to runRepository() that: - Copies user files from skills/PAI/USER or skills/CORE/USER to PAI/USER (skip-if-exists to preserve any files already there) - Replaces the legacy directory with a symlink to PAI/USER so the skill's relative USER/ paths continue to resolve correctly - Only runs on upgrades (fresh installs unaffected) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Thank you @catchingknives! The user context migration is merged into PAI v4.0.3. Excellent work — the Fix included in: Releases/v4.0.3 |
HyggeHacker
pushed a commit
to HyggeHacker/Personal_AI_Infrastructure
that referenced
this pull request
Mar 2, 2026
…nielmiessler#836, danielmiessler#817, danielmiessler#846) - PR danielmiessler#800: Inference.ts JSON array parsing (dual-candidate strategy) - PR danielmiessler#836: CONTEXT_ROUTING.md dead reference cleanup (75→31 lines) - PR danielmiessler#817: WorldThreatModelHarness $PAI_DIR portability (10 instances) - PR danielmiessler#846: Installer user context migration (copyMissing + migrateUserContext) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 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
skills/PAI/USER/(v2.5–v3.0) andskills/CORE/USER/(v2.4) to a new canonical location atPAI/USER/, withCONTEXT_ROUTING.mdpointing therePAI/USER/is created empty while user data stays stranded at the oldskills/pathFix
Adds a migration step to
runRepository()that runs on upgrades:skills/PAI/USER/(orskills/CORE/USER/) toPAI/USER/, skipping files that already exist at the destinationskills/PAI/USER → ../../PAI/USER) so the PAI skill's relativeUSER/paths continue to resolve correctlyinstallType === "upgrade"— fresh installs are unaffectedAffected versions
Users upgrading from v2.4, v2.5, or v3.0 to v4.0.0 or v4.0.1.
Test plan
PAI/USER/is created with directories + README, migration is skippedskills/PAI/USER/toPAI/USER/, legacy dir replaced with symlinkskills/CORE/USER/toPAI/USER/PAI/USER/TELOS/BELIEFS.mdexists and contains user data)🤖 Generated with Claude Code