fix(opencode,kilo): scope instructions ownership to the managed rules directories - #2554
Merged
Merged
Conversation
… directories The instructions arrays were merged by union, so an entry registered for a since-deleted non-root rule persisted in opencode.json / kilo.jsonc forever, and a legacy full-prefix global spelling could coexist with the stripped one (file loaded twice). rulesync now owns the entries under its managed rules directories (.opencode/memories/, global memories/ incl. the legacy .config/opencode/memories/ spelling, and .kilo/rules/): that subset is rebuilt from the current generate - deleting a rule drops its registration - while entries outside the managed roots pass through verbatim. Mirrors the managed-name ownership pattern from #2545. Closes #2548 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…matching Review follow-ups on PR #2554: a ./-spelled managed entry no longer escapes the ownership filter (mirroring isSharedUserManagedConfigPath's normalization), and the kilo prefix carries a project-only-scope comment so a future global opt-in does not silently reuse it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… is deleted Second-round review follow-ups on PR #2554: - The processor no longer early-returns on an empty instruction list: the registrar owns the managed subset, so deleting the LAST non-root rule must still clear its stale registrations. fromInstructions returns null when there is nothing to register AND no existing config (so a config file is never created just to hold an empty payload), and an emptied instructions list retracts the key instead of writing []. - New tests: stale managed entries cleared on an empty generate (user entries kept), and the global legacy full-prefix spelling dropped as a managed duplicate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
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
Fixes #2548 (follow-up from the PR #2547 review):
fromInstructionsmerged the existinginstructionsarray with the generated list by plain union, so an entry registered for a since-deleted non-root rule persisted inopencode.json/kilo.jsoncforever, and at global scope a legacy full-prefix spelling (.config/opencode/memories/x.md) could coexist with the strippedmemories/x.mdas a duplicate (file loaded twice)..opencode/memories/(project),memories/and the legacy.config/opencode/memories/spelling (global),.kilo/rules/— rebuilding that subset from the current generate, so deleting a rule also drops its registration. Entries outside the managed roots are the user's and pass through verbatim.disabledMcpServersin PR feat(rovodev): project-scoped config.yml and mcp.json, author disabledMcpServers #2545.Testing
pnpm cicheckgreen.Closes #2548
🤖 Generated with Claude Code