Module: Legion::Extensions::Agentic::Integration::Synthesis::Runners::CognitiveSynthesis

Includes:
Helpers::Lex
Included in:
Client
Defined in:
lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb

Instance Method Summary collapse

Instance Method Details

#add_stream(stream_type:, content:, weight: Helpers::Constants::DEFAULT_WEIGHT, confidence: Helpers::Constants::DEFAULT_WEIGHT, engine: nil) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 13

def add_stream(stream_type:, content:, weight: Helpers::Constants::DEFAULT_WEIGHT,
               confidence: Helpers::Constants::DEFAULT_WEIGHT, engine: nil, **)
  target = engine || synthesis_engine
  result = target.add_stream(stream_type: stream_type, content: content,
                             weight: weight, confidence: confidence)
  log.debug("[cognitive_synthesis] runner add_stream type=#{stream_type}")
  result
end

#average_coherence(window: 10, engine: nil) ⇒ Object



58
59
60
61
62
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 58

def average_coherence(window: 10, engine: nil, **)
  target = engine || synthesis_engine
  log.debug("[cognitive_synthesis] runner average_coherence window=#{window}")
  target.average_coherence(window: window)
end

#check_conflict(stream_id_a:, stream_id_b:, engine: nil) ⇒ Object



40
41
42
43
44
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 40

def check_conflict(stream_id_a:, stream_id_b:, engine: nil, **)
  target = engine || synthesis_engine
  log.debug("[cognitive_synthesis] runner check_conflict #{stream_id_a[0..7]}<>#{stream_id_b[0..7]}")
  target.stream_conflict?(stream_id_a: stream_id_a, stream_id_b: stream_id_b)
end

#decay_streams(engine: nil) ⇒ Object



34
35
36
37
38
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 34

def decay_streams(engine: nil, **)
  target = engine || synthesis_engine
  log.debug('[cognitive_synthesis] runner decay_streams')
  target.decay_all!
end

#dominant_stream(engine: nil) ⇒ Object



46
47
48
49
50
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 46

def dominant_stream(engine: nil, **)
  target = engine || synthesis_engine
  log.debug('[cognitive_synthesis] runner dominant_stream')
  target.dominant_stream
end

#remove_stream(stream_id:, engine: nil) ⇒ Object



22
23
24
25
26
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 22

def remove_stream(stream_id:, engine: nil, **)
  target = engine || synthesis_engine
  log.debug("[cognitive_synthesis] runner remove_stream id=#{stream_id[0..7]}")
  target.remove_stream(stream_id: stream_id)
end

#status(engine: nil) ⇒ Object



64
65
66
67
68
69
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 64

def status(engine: nil, **)
  target = engine || synthesis_engine
  stats  = target.to_h
  log.debug("[cognitive_synthesis] runner status streams=#{stats[:stream_count]}")
  { success: true }.merge(stats)
end

#synthesis_history(limit: 10, engine: nil) ⇒ Object



52
53
54
55
56
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 52

def synthesis_history(limit: 10, engine: nil, **)
  target = engine || synthesis_engine
  log.debug("[cognitive_synthesis] runner synthesis_history limit=#{limit}")
  target.synthesis_history(limit: limit)
end

#synthesize(engine: nil) ⇒ Object



28
29
30
31
32
# File 'lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb', line 28

def synthesize(engine: nil, **)
  target = engine || synthesis_engine
  log.debug('[cognitive_synthesis] runner synthesize')
  target.synthesize!
end