Merge AI caches and add cache key helper

This commit is contained in:
Jordan Wages 2025-06-28 15:46:30 -05:00
commit d69d0cae66
5 changed files with 95 additions and 100 deletions

View file

@ -16,7 +16,7 @@ message meets a specified criterion.
- **Custom system prompts** tailor the instructions sent to the model for more precise results.
- **Filter editor integration** patches Thunderbird's filter editor to accept
text criteria for AI classification.
- **Persistent result caching** classification results are saved to disk so messages aren't re-evaluated across restarts.
- **Persistent result caching** classification results and reasoning are saved to disk so messages aren't re-evaluated across restarts.
- **Advanced parameters** tune generation settings like temperature, topp and more from the options page.
- **Debug logging** optional colorized logs help troubleshoot interactions with the AI service.
- **Automatic rules** create rules that tag or move new messages based on AI classification.
@ -25,6 +25,13 @@ message meets a specified criterion.
- **Status icons** toolbar icons show when classification is in progress and briefly display success or error states.
- **Packaging script** `build-xpi.ps1` builds an XPI ready for installation.
### Cache Storage
Classification results are stored under the `aiCache` key in extension storage.
Each entry maps a SHA256 hash of `"<message id>|<criterion>"` to an object
containing `matched` and `reason` fields. Older installations with a separate
`aiReasonCache` will be migrated automatically on startup.
## Architecture Overview
Sortana is implemented entirely with standard WebExtension scripts—no custom experiment code is required: