Epic: Action Middleware Pipeline #104

Open
opened 2026-03-15 04:13:15 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: feat(dispatch): implement action middleware pipeline
  • Branch: feature/middleware-pipeline

Background and Context

The specification describes a composable middleware pipeline that wraps action execution
with before_action and after_action filters. Each middleware has a numeric priority that
determines execution order. This replaces the current pattern of duplicating guard checks
(permission, balance, position) inside each command handler.

Expected Behavior

Middleware classes register for before_action or after_action phases with a priority.
The pipeline executes before_action middleware in priority order, then the action, then
after_action middleware. Any middleware can halt the chain.

Acceptance Criteria

  • Middleware base class with call(action, context) interface
  • MiddlewarePipeline executor with priority ordering
  • Built-in middleware: Permission, Alive, Balance, Position, Cooldown, Logging, EventSourcing
  • CommandAction metadata DSL for declaring requirements
  • BDD test coverage

Subtasks

  • Implement Middleware base and MiddlewarePipeline
  • Implement PermissionCheck and AliveCheck middleware
  • Implement BalanceCheck and PositionCheck middleware
  • Implement CooldownMiddleware
  • Implement ActionLoggingMiddleware
  • Implement EventSourcingMiddleware
  • Add CommandAction metadata DSL

Definition of Done

This Epic is complete when all child issues are closed and all acceptance criteria
are satisfied.

## Metadata - **Commit Message**: `feat(dispatch): implement action middleware pipeline` - **Branch**: `feature/middleware-pipeline` ## Background and Context The specification describes a composable middleware pipeline that wraps action execution with before_action and after_action filters. Each middleware has a numeric priority that determines execution order. This replaces the current pattern of duplicating guard checks (permission, balance, position) inside each command handler. ## Expected Behavior Middleware classes register for before_action or after_action phases with a priority. The pipeline executes before_action middleware in priority order, then the action, then after_action middleware. Any middleware can halt the chain. ## Acceptance Criteria - `Middleware` base class with `call(action, context)` interface - `MiddlewarePipeline` executor with priority ordering - Built-in middleware: Permission, Alive, Balance, Position, Cooldown, Logging, EventSourcing - `CommandAction` metadata DSL for declaring requirements - BDD test coverage ## Subtasks - [ ] Implement Middleware base and MiddlewarePipeline - [ ] Implement PermissionCheck and AliveCheck middleware - [ ] Implement BalanceCheck and PositionCheck middleware - [ ] Implement CooldownMiddleware - [ ] Implement ActionLoggingMiddleware - [ ] Implement EventSourcingMiddleware - [ ] Add CommandAction metadata DSL ## Definition of Done This Epic is complete when all child issues are closed and all acceptance criteria are satisfied.
freemo added this to the (deleted) milestone 2026-03-15 04:13:15 +00:00
freemo self-assigned this 2026-03-15 04:25:24 +00:00
freemo modified the milestone from (deleted) to v1.0.0 2026-03-16 00:28:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#104
No description provided.