feat(ned): asynchronous post-sync plugin system and isolated typesafe_jev plugin #89
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ned-post-sync-plugins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Architects and implements an optional, generic, asynchronous post-sync plugin subsystem for NED (Notmuch Email Daemon) alongside an isolated TypeSafe System One (Jev) email classification plugin.
Key Changes
ned/plugins/):PostSyncContext: Provides plugins with sync outcome stats, client interface, plugin-scoped logger, and an SSE cache invalidation helper (ctx.invalidate("threads")).PostSyncPluginProtocol: Standardizes theon_post_sync(context)interface while also supporting arbitrary callables.PluginRunner: Runs registered plugins asynchronously in a dedicated FIFO background worker queue afternotmuch newand static filter rules complete, ensuring mail sync is never delayed.resolve_plugin: Resolves plugins defined as instances, classes, callables, or import path strings ('module.ClassName'or'module:ClassName').ned/plugins/typesafe_jev/):from) andsubjectmetadata against the classification criteria. Email message bodies are never read or transmitted.~/.config/ned/plugins/typesafe_jev/taxonomy.pycontaining the full two-facet taxonomy rubrics (Document Type and Domain) and thresholds. The plugin strictly reads this user-owned file; no fallback dictionaries exist in code.ned.settings.post_sync_plugins: Setting declaring active post-sync plugins.ned --init-config: Generates a dedicated commented-out Section 4 demonstrating plugin configuration, and automatically scans and comments any detected user plugins in~/.config/ned/plugins/.ned/sync.py: Dispatches post-sync stats todefault_runnerafter sync completes.ned/daemon.py: Gracefully shuts downdefault_runneron daemon stop.README.md: Added 'Post-sync plugins (optional)' section with architecture overview andtypesafe_jevconfiguration.agent.md: Updated project layout, subsystem guide, configuration table, architecture lifecycle, and added Durable Invariant 14 (Post-Sync Plugin Safety & Isolation).tests/test_ned_plugins.py(23 tests) verifying runner lifecycle, resolution, error resilience, taxonomy file generation, custom rubrics, threshold logic, mocked API payload safety, and config generation.Verification
pytesttest suite passes (551/551 tests passed).