Commit a2063ae
refactor(caller): Protocol HookCaller, split callers, CompletionHook multicall
Complete design step 05:
- HookCaller is now a @runtime_checkable Protocol; concrete callers are
NormalHookCaller (split list[NormalImpl] / list[WrapperImpl] storage),
HistoricHookCaller (memorize/replay, rejects wrappers) and
SubsetHookCaller (read-only filtered proxy). _HookCaller and
_SubsetHookCaller remain as compat aliases.
- _multicall takes dual sequences and orchestrates phases only: wrapper
setup collects CompletionHooks, normals run, completion hooks run LIFO
and may replace (result, exception) - no wrapper flag branching.
- add_hookspecs hands a NormalHookCaller over to a HistoricHookCaller
when a historic spec arrives after impl registration.
- PluginManager._hookexec and tracing use the dual-sequence signature;
monitoring callbacks keep receiving one combined impl list.
- HookSpec.verify_all_args_are_provided replaces the caller-side helper;
set_specification accepts a config object or legacy mapping (shim).
- New tests: protocol isinstance for all concretes, historic handover,
historic direct-call/call_extra rejection.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 53041e2 commit a2063ae
12 files changed
Lines changed: 692 additions & 250 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| 32 | + | |
28 | 33 | | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
0 commit comments