Skip to content

simplify pkg/hooks: drop unused EventSpec abstraction#2591

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/simplify-hooks-package-code-without-brea-1f7fe923
Apr 29, 2026
Merged

simplify pkg/hooks: drop unused EventSpec abstraction#2591
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/simplify-hooks-package-code-without-brea-1f7fe923

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 29, 2026

Drops the EventSpec table from pkg/hooks/events.go (deleted) and
inlines the only two facts the executor actually used:

  • failClosed(event) — true only for EventPreToolUse
  • stdoutAsContext(event) — true for the six events whose runtime
    consumes Result.AdditionalContext

The ToolScoped field was unused, and the exported EventSpecs() /
EventSpec / StdoutPolicy types had no callers anywhere in the
workspace. All public extension points are preserved
(RegisterResponseShape, RegisterResponseSchema, ResponseShape,
NewModelFactory, …). Behaviour is identical for hook authors and for
the runtime; the diff is purely dead/over-engineered code removal plus
some doc trimming.

Net: -73 source lines, one fewer file, no behaviour change.

@dgageot dgageot requested a review from a team as a code owner April 29, 2026 10:09
@dgageot dgageot merged commit 6b3cef7 into docker:main Apr 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants