Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions openspec/specs/go-event-system/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Purpose

This document specifies the event dispatching infrastructure for the Go task runner. It defines a central, asynchronous event dispatcher and strongly-typed listener interfaces that allow components to react to task lifecycle events without tight coupling.

## Requirements

### Requirement: Central Event Dispatcher
The system SHALL provide a central event dispatcher to broadcast lifecycle events asynchronously.

#### Scenario: Dispatching an event
- **WHEN** the runner emits a lifecycle event (e.g., TaskStart)
- **THEN** the dispatcher pushes the event to a buffered channel for asynchronous processing

### Requirement: Interface-Based Event Listeners
The system SHALL define strongly-typed interfaces for each lifecycle event type.

#### Scenario: Defining event listeners
- **WHEN** a new event type is needed
- **THEN** a specific interface (e.g., `TaskStartListener`) with a typed method is provided
19 changes: 19 additions & 0 deletions openspec/specs/go-plugin-architecture/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Purpose

This document specifies the plugin architecture for the Go task runner. It defines how external plugins are registered with the event dispatcher and how events are selectively delivered to plugins based on the listener interfaces they implement.

## Requirements

### Requirement: Plugin Registration
The system SHALL allow plugins to be registered with the central event dispatcher.

#### Scenario: Registering a plugin
- **WHEN** a plugin struct is passed to the dispatcher registration function
- **THEN** the dispatcher evaluates which listener interfaces the plugin implements and registers it for those specific events

### Requirement: Event Delivery to Plugins
The system SHALL deliver events only to plugins that have implemented the corresponding listener interface.

#### Scenario: Delivering TaskStart event
- **WHEN** a TaskStart event is broadcast
- **THEN** only plugins implementing `TaskStartListener` have their `OnTaskStart` method called with the event payload
Loading