[codex] Preserve app rule migration metadata - #26
Merged
Conversation
ygsgdbd
force-pushed
the
codex/preserve-migration-metadata
branch
from
July 21, 2026 10:08
2b5206b to
59ed9fc
Compare
ygsgdbd
marked this pull request as ready for review
July 21, 2026 10:22
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.
Problem
PR #24 introduced migration version 2 to recover legacy per-application input method mappings. When a current
.noneplaceholder already contained a valid application path and display name, the merge replaced the entire record with the legacy record.If the targeted legacy application scan did not find that bundle identifier, the legacy record contained no path and used the bundle identifier as its display name. The replacement therefore discarded metadata that was already available in
app-rules.json.User impact
An installed but non-running application could be moved into the unavailable applications section after migration. The recovered fixed input method strategy remained present, but the user could see the application as missing and remove its rule through the clear-unavailable action.
Root cause
AppRulesStoreMigration.mergetreated a.nonecollision by returning the complete legacy record. The migration only needed the legacy strategy to be authoritative; legacy application metadata is authoritative only when the migration scan actually matched the application.Fix
The merge now starts from the current
.nonerecord, restores the legacy strategy, and records the migration update timestamp. When the legacy scan supplies a path, its current path and display name are adopted. When the legacy path is absent, the existing path and display name are preserved. The original creation timestamp remains unchanged, while existing.fixed,.followLast, and.ignoredrules remain fully authoritative.Migration version 2 and the existing save-before-completion flow are unchanged because the migration has not yet shipped in a release.
Validation
rtk just checkrtk git diff --check