Skip to content

Implement Action Stage and Processor #175

@Haydart

Description

@Haydart

Task 007: Implement Action Stage and Processor

Description

Create TrendActionStage that assembles TrendAction from ProcessingContext, and TrendDetectionProcessor that orchestrates the 4-stage pipeline.

Acceptance Criteria

  • Create TrendActionStage in src/domain/processor/stages/
  • Extract memecoin_entry, matched_trend_id, new_trend_response, classification_reasoning from context
  • Validate data completeness (memecoin_entry must exist)
  • Validate either matched_trend_id OR new_trend_response exists
  • Create TrendAction object (NO database writes)
  • Store action in context.results["final_action"]
  • Create TrendDetectionProcessor in src/domain/processor/
  • Extend BaseStageProcessor
  • Define 4-stage StageGraph: Metadata → Classification → Creation (conditional) → Action
  • Implement handle early termination on errors
  • Extract TrendAction from completed context

Technical Details

  • TrendActionStage Location: src/domain/processor/stages/trend_action_stage.py
  • TrendDetectionProcessor Location: src/domain/processor/trend_detection_processor.py
  • Stage Order: TrendMetadataExtractionStage → TrendClassificationStage → NewTrendCreationStage → TrendActionStage
  • ProcessingContext Results: memecoin_entry, matched_trend_id, new_trend_response, classification_reasoning, final_action
  • Important: NO side effects in TrendActionStage (only data assembly)
  • Output: Processor returns TrendAction for executor

Effort Estimate

  • Size: M
  • Hours: 6-8
  • Parallel: false (depends on all stage tasks)

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:trendsTrend Detection System EpictaskImplementation task

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions