# Restore access to old threads that mention rules \(\#58560\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b53b14d2140636713c6d76765d431b562baaee5e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b53b14d2140636713c6d76765d431b562baaee5e

Requested commit: b53b14d2140636713c6d76765d431b562baaee5e

Commit: b53b14d2140636713c6d76765d431b562baaee5e

Tree: 6724416c7a88230718bf3770d161b9d336f448c7

Author: MartinYe1234

Committer: GitHub

## Message

```
Restore access to old threads that mention rules (#58560)

Removing the `Rule` variant from `MentionUri` in #58080 broke
deserialization of any thread saved before the rules-to-skills
migration. Loading one failed with `unknown variant `Rule``, making
those threads inaccessible.

This restores access without bringing back the rules feature:

- Reintroduce a backward-compatible `Rule` mention variant so legacy
threads deserialize again.
- Preserve the original rule `id` through save/load so a thread re-saved
by a newer build still loads on older Zed versions (and synthesize a
valid placeholder when the id is missing).
- Clicking a legacy rule mention now opens the skill the rule was
migrated into, and shows a notification linking the Skills docs. On
remote/collab projects the migrated file lives on the local machine, so
it opens as a read-only buffer. If no matching skill exists, it does
nothing.

Closes https://github.com/zed-industries/zed/issues/58498
Closes AI-371

Release Notes:

- Fixed old threads that mention Rules being inaccessible after Rules
were migrated to Skills
```

## Parents

- [0b87a03a29966b7a7b250ba6fc63b0d3c95be560](https://git.cafe/gitcafe/zed/commit/0b87a03a29966b7a7b250ba6fc63b0d3c95be560?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b53b14d2140636713c6d76765d431b562baaee5e?format=markdown)
