Module: Evilution::MCP::MutateTool::ProgressStreamer Private
- Defined in:
- lib/evilution/mcp/mutate_tool/progress_streamer.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
Class Method Details
.build(server_context:, suggest_tests:, integration:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/evilution/mcp/mutate_tool/progress_streamer.rb', line 8 def self.build(server_context:, suggest_tests:, integration:) return nil unless suggest_tests && server_context.respond_to?(:report_progress) suggestion = Evilution::Reporter::Suggestion.new(suggest_tests: true, integration: integration) survivor_index = 0 disabled = false proc do |result| next unless result.survived? next if disabled begin survivor_index += 1 detail = build_suggestion_detail(result.mutation, suggestion) server_context.report_progress(survivor_index, message: ::JSON.generate(detail)) rescue StandardError => e warn "[evilution] progress stream disabled after error: #{e.class}: #{e.}" disabled = true end end end |