馃 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
add_hookspecs(): if _verify_hook raises for an already-registered impl, the spec stays installed via set_specification(). A retry then raises ValueError: Hook 'h' is already registered within namespace ..., even after unregistering the bad plugin.
register(): if a historic replay (_maybe_apply_history) raises, the plugin stays in the registry with only the hookimpls processed before the failure. The code comment there acknowledges this.
Proposal: validate first and install afterwards in add_hookspecs. For the replay case, roll back on exception.
Found while working on #759.
馃 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
add_hookspecs(): if_verify_hookraises for an already-registered impl, the spec stays installed viaset_specification(). A retry then raisesValueError: Hook 'h' is already registered within namespace ..., even after unregistering the bad plugin.register(): if a historic replay (_maybe_apply_history) raises, the plugin stays in the registry with only the hookimpls processed before the failure. The code comment there acknowledges this.Proposal: validate first and install afterwards in
add_hookspecs. For the replay case, roll back on exception.Found while working on #759.