Add self-registration pattern via register_command class macro #102

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

Metadata

  • Commit Message: feat(dispatch): add register_command class macro for self-registration
  • Branch: feature/m1-command-router

Background and Context

Each CommandAction subclass should self-register with the CommandRouter at load time
using a declarative class macro, similar to how CommandHandler currently auto-subscribes
via Wisper.

Expected Behavior

  • register_command "look", aliases: ["l"], priority: 50 class-level macro
  • Macro calls CommandRouter.register for each keyword
  • Registration happens when the class file is loaded
  • Works with Ruby's autoload/require mechanism

Acceptance Criteria

  • register_command class method on CommandAction base class
  • Supports aliases, priority, and metadata options
  • Self-registration at class load time
  • BDD scenarios verifying registration

Subtasks

  • Add register_command class method to CommandAction
  • Wire into CommandRouter.register
  • Test self-registration on file load
  • Write Cucumber scenarios

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the
    Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata.
  • The commit is submitted as a pull request to master, reviewed, and merged.
## Metadata - **Commit Message**: `feat(dispatch): add register_command class macro for self-registration` - **Branch**: `feature/m1-command-router` ## Background and Context Each `CommandAction` subclass should self-register with the `CommandRouter` at load time using a declarative class macro, similar to how `CommandHandler` currently auto-subscribes via Wisper. ## Expected Behavior - `register_command "look", aliases: ["l"], priority: 50` class-level macro - Macro calls `CommandRouter.register` for each keyword - Registration happens when the class file is loaded - Works with Ruby's autoload/require mechanism ## Acceptance Criteria - `register_command` class method on `CommandAction` base class - Supports aliases, priority, and metadata options - Self-registration at class load time - BDD scenarios verifying registration ## Subtasks - [ ] Add `register_command` class method to CommandAction - [ ] Wire into CommandRouter.register - [ ] Test self-registration on file load - [ ] Write Cucumber scenarios ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged**.
freemo added this to the (deleted) milestone 2026-03-15 04:13:14 +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:02 +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#102
No description provided.