feat(implementation): add NormalImpl, WrapperImpl, and CompletionHook setup API - #707
Draft
RonnyPfannschmidt wants to merge 3 commits into
Draft
RonnyPfannschmidt wants to merge 3 commits into
RonnyPfannschmidt wants to merge 3 commits into
Conversation
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
2 times, most recently
from
July 24, 2026 16:54
c5cf018 to
6338f75
Compare
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
3 times, most recently
from
August 12, 2026 11:14
94a0f13 to
d059564
Compare
This was referenced Aug 12, 2026
Open
RonnyPfannschmidt
marked this pull request as draft
September 9, 2026 20:20
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
from
September 12, 2026 19:04
d059564 to
ff3f28b
Compare
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
from
September 12, 2026 19:14
ff3f28b to
7112526
Compare
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
3 times, most recently
from
September 24, 2026 11:24
71942e0 to
e6d8487
Compare
Markers attach HookspecConfiguration/HookimplConfiguration objects. Registration discovers those privately; parse_hookimpl_opts and parse_hookspec_opts remain a deprecated pytest concession that returns legacy dicts and is only called when a subclass overrides them and no modern configuration attribute was found. Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Cursor Grok 4.5 <grok@cursor.com>
Complete design step 03: markers already attach configuration objects since step 02; this finishes the step by storing the spec configuration as HookSpec.config (try-claude naming) with a deprecated .opts alias, reading .config in HookCaller firstresult resolution, and covering decoration-time historic+firstresult validation and configuration attachment with tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… setup API Complete design step 04: - HookImpl becomes a base class storing hookimpl_config (deprecated .opts alias kept) with arg binding moved to _get_call_args. - NormalImpl / WrapperImpl subclasses validate their configuration; HookimplConfiguration.create_hookimpl() returns the right subclass (fixing the try-claude footgun of bare HookImpl for normals). - WrapperImpl.setup_and_get_completion_hook() runs wrapper setup and returns a CompletionHook (runtime-checkable Protocol) that owns teardown, adapting old-style hookwrappers uniformly. - Registration and call_extra construct impls via create_hookimpl; multicall binds args via _get_call_args. Full dual-sequence multicall rewiring lands with design step 05. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RonnyPfannschmidt
force-pushed
the
refactor/hookimpl-wrapper-types
branch
from
September 24, 2026 11:48
e6d8487 to
885bf8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
Step 4 of 7, merges bottom-up:
#703→ #704 → #706 → #707 → #708 → #709 → #710The diff here is cumulative (steps 2–4); RonnyPfannschmidt#8 shows this step alone.
HookImplbecomes a base class holdinghookimpl_config(optsstays as a deprecated alias), withNormalImplandWrapperImplsubclasses that validate their configuration.HookimplConfiguration.create_hookimpl()picks the subclass; registration andcall_extrause it.WrapperImpl.setup_and_get_completion_hook()exposes wrapper setup/teardown as a runtime-checkableCompletionHook, for old- and new-style wrappers alike.