Class: Events::GoalUpdated

Inherits:
Object
  • Object
show all
Defined in:
lib/events/goal_updated.rb

Overview

Emitted after a Goal‘s description is changed and the change is committed. Status-only updates (finish_goal, cascade completion, mark_goal_completed) do not emit — a completed goal carries no new search seed for Mneme.

The drain pipeline’s MeleteEnrichmentJob subscribes for the duration of one Melete run so a refined goal triggers Mneme recall against the updated wording before the user’s message reaches the LLM.

Constant Summary collapse

TYPE =
"goal.updated"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, goal_id:) ⇒ GoalUpdated

Returns a new instance of GoalUpdated.

Parameters:

  • session_id (Integer)

    session that owns the goal

  • goal_id (Integer)

    the updated goal



19
20
21
22
# File 'lib/events/goal_updated.rb', line 19

def initialize(session_id:, goal_id:)
  @session_id = session_id
  @goal_id = goal_id
end

Instance Attribute Details

#goal_idObject (readonly)

Returns the value of attribute goal_id.



15
16
17
# File 'lib/events/goal_updated.rb', line 15

def goal_id
  @goal_id
end

#session_idObject (readonly)

Returns the value of attribute session_id.



15
16
17
# File 'lib/events/goal_updated.rb', line 15

def session_id
  @session_id
end

Instance Method Details

#event_nameObject



24
25
26
# File 'lib/events/goal_updated.rb', line 24

def event_name
  "#{Bus::NAMESPACE}.#{TYPE}"
end

#to_hObject



28
29
30
# File 'lib/events/goal_updated.rb', line 28

def to_h
  {type: TYPE, session_id:, goal_id:}
end