Skip to content

Hook bus kernel: actions + filters with priority ordering #178

@tayebmokni

Description

@tayebmokni

Summary

Implement the hook bus (actions + filters) that the comment, post-transition, permalink, and meta subsystems use to fan events out to plugin handlers. WASM dispatch is owned by doc 02 — this issue ships the in-process kernel.

Design reference

  • docs/00-architecture-overview.md §3.1 (Hook model: actions + filters)
  • docs/01-core-cms.md §5.3 (hook on post.transitioned)
  • docs/01-core-cms.md §6.3 (pre_comment filter)
  • docs/01-core-cms.md §7.4 (permalink.changed hook)

Acceptance criteria

  • internal/hooks package exports Bus with RegisterAction(name, prio, fn), RegisterFilter(name, prio, fn), DoAction(name, args), ApplyFilters(name, value, args) value
  • Priority ordering: lower runs first; stable for equal priorities
  • Filters chain: each filter receives the result of the previous one
  • Action panics are caught, logged, and do not crash the request
  • Bus is goroutine-safe
  • Hooks fire in the documented places: post.transitioned, pre_comment, comment.transitioned, permalink.changed
  • WASM-side dispatch is a NO-OP in this issue (interface defined for future)
  • Unit tests cover priority ordering, panic isolation, filter chaining

Dependencies

#22

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiGo HTTP API serverarea:plugin-hostWASM plugin runtimephase:P1-cms-corePhase 1 — CMS Corepriority:P1Important — should land in phaseskill:goGo programmingtype:featNew feature or implementation task

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions