fix(skills): emit lifecycle events for removals - #83316
Conversation
|
Hi @teknium1 — could you take a look when convenient? This closes the lifecycle-observer gap for successful hard deletes and Hub uninstalls, while keeping curator archival on its existing |
fix(skills): emit lifecycle events for removals
|
- skills_hub uninstall: derive provenance from hub lock entry instead of hardcoding "installed" so mixed-provenance dirs report truthfully - skill_usage.forget: document untracked-skill emission semantics (record=None is the explicit marker for observer completeness) - skill_manage delete: log provenance-capture failure instead of silent pass - extract shared forget_with_lifecycle helper for the two removal paths
Summary
deletedafter a successful hard delete throughskill_manageuninstalledafter a successful Skills Hub uninstallarchivedactionWhy
The merged
on_skill_lifecycleobserver from #68883 reports skill creation, mutation, loading, and curator transitions, but successful removal paths were silent. Plugins that maintain an external index therefore cannot invalidate a removed skill when Hermes performs the operation.This extends the existing observer rather than adding another hook. Emission happens only after the authoritative filesystem operation succeeds. Usage-sidecar cleanup remains best-effort because its failure cannot undo a deletion that already occurred.
Scope
Validation
32 passedacross skill usage, hard-delete, archive, and Hub uninstall testsgit diff --checkpassed