Skip to content

fix(opencode,kilo): scope instructions ownership to the managed rules directories - #2554

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-scrap-issue-2548-instructions-ownership
Aug 1, 2026
Merged

fix(opencode,kilo): scope instructions ownership to the managed rules directories#2554
dyoshikawa merged 3 commits into
mainfrom
resolve-scrap-issue-2548-instructions-ownership

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Fixes #2548 (follow-up from the PR #2547 review): fromInstructions merged the existing instructions array with the generated list by plain union, so an entry registered for a since-deleted non-root rule persisted in opencode.json / kilo.jsonc forever, and at global scope a legacy full-prefix spelling (.config/opencode/memories/x.md) could coexist with the stripped memories/x.md as a duplicate (file loaded twice).

  • rulesync now owns the entries pointing under its managed rules directories — .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.
  • Mirrors the managed-name ownership pattern established for Rovo Dev's disabledMcpServers in PR feat(rovodev): project-scoped config.yml and mcp.json, author disabledMcpServers #2545.
  • The two tests that pinned the accumulate-forever union now pin the ownership semantics (stale managed entry dropped, user entry preserved); docs for both tool notes updated.

Testing

  • pnpm cicheck green.

Closes #2548

🤖 Generated with Claude Code

cm-dyoshikawa and others added 3 commits July 31, 2026 20:20
… 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>
@dyoshikawa
dyoshikawa merged commit aa7b1c7 into main Aug 1, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-2548-instructions-ownership branch August 1, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCode/Kilo instructions arrays accumulate stale entries (union merge never removes deleted rules)

2 participants