saboteur 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1024 -0
  3. data/README.md +199 -952
  4. data/exe/saboteur +34 -7
  5. data/lib/saboteur/baseline/workflow.rb +2 -1
  6. data/lib/saboteur/baseline_health.rb +40 -6
  7. data/lib/saboteur/cli/exit_status.rb +80 -4
  8. data/lib/saboteur/cli/help_options.rb +17 -0
  9. data/lib/saboteur/cli/history_command.rb +135 -0
  10. data/lib/saboteur/cli/presets.rb +40 -0
  11. data/lib/saboteur/cli/run_budget_options.rb +37 -0
  12. data/lib/saboteur/cli/run_reporting.rb +74 -5
  13. data/lib/saboteur/cli/selection_options.rb +31 -0
  14. data/lib/saboteur/cli/shard_options.rb +17 -0
  15. data/lib/saboteur/cli/source_set.rb +53 -0
  16. data/lib/saboteur/cli/survivors_command.rb +157 -0
  17. data/lib/saboteur/cli.rb +136 -98
  18. data/lib/saboteur/config.rb +163 -15
  19. data/lib/saboteur/config_file.rb +8 -0
  20. data/lib/saboteur/constant_reads.rb +182 -0
  21. data/lib/saboteur/constant_subject.rb +70 -0
  22. data/lib/saboteur/constant_subject_finder.rb +281 -0
  23. data/lib/saboteur/coverage_reads.rb +29 -0
  24. data/lib/saboteur/crash_report.rb +154 -0
  25. data/lib/saboteur/custom_map.rb +3 -1
  26. data/lib/saboteur/dirty_tree_warning.rb +128 -0
  27. data/lib/saboteur/doctor.rb +49 -1
  28. data/lib/saboteur/engine/baseline_guard.rb +136 -14
  29. data/lib/saboteur/engine/boot.rb +16 -1
  30. data/lib/saboteur/engine/canary.rb +41 -10
  31. data/lib/saboteur/engine/candidate_selection.rb +28 -1
  32. data/lib/saboteur/engine/candidates.rb +43 -3
  33. data/lib/saboteur/engine/coverage_guard.rb +29 -0
  34. data/lib/saboteur/engine/coverage_store.rb +79 -15
  35. data/lib/saboteur/engine/defined_order_prefix.rb +43 -0
  36. data/lib/saboteur/engine/diagnostics.rb +41 -2
  37. data/lib/saboteur/engine/diff_scope.rb +24 -5
  38. data/lib/saboteur/engine/distribution.rb +134 -8
  39. data/lib/saboteur/engine/early_stop_recording.rb +47 -0
  40. data/lib/saboteur/engine/gated_run.rb +35 -0
  41. data/lib/saboteur/engine/load_coverage.rb +45 -0
  42. data/lib/saboteur/engine/out_of_scope_guard.rb +21 -0
  43. data/lib/saboteur/engine/pipelines.rb +107 -0
  44. data/lib/saboteur/engine/result_cache.rb +67 -9
  45. data/lib/saboteur/engine/run_budget.rb +90 -0
  46. data/lib/saboteur/engine/run_fingerprint.rb +4 -0
  47. data/lib/saboteur/engine/sandbox_policy.rb +56 -11
  48. data/lib/saboteur/engine/scheduler.rb +222 -20
  49. data/lib/saboteur/engine/selection_announcement.rb +54 -0
  50. data/lib/saboteur/engine/shard.rb +69 -0
  51. data/lib/saboteur/engine/subject_selection.rb +373 -19
  52. data/lib/saboteur/engine/suite_files.rb +3 -1
  53. data/lib/saboteur/engine/test_guess.rb +438 -25
  54. data/lib/saboteur/engine/thread_warnings.rb +53 -0
  55. data/lib/saboteur/engine/unchanged_syntax.rb +17 -2
  56. data/lib/saboteur/engine/unscoped_suite_warning.rb +41 -0
  57. data/lib/saboteur/engine/verdict_check.rb +54 -18
  58. data/lib/saboteur/engine.rb +202 -158
  59. data/lib/saboteur/execution/external_runner.rb +471 -0
  60. data/lib/saboteur/execution/marker_sweep.rb +79 -0
  61. data/lib/saboteur/execution/peak_memory.rb +28 -0
  62. data/lib/saboteur/execution/process_table.rb +12 -0
  63. data/lib/saboteur/execution/process_tree.rb +65 -5
  64. data/lib/saboteur/execution/protocol.rb +2 -1
  65. data/lib/saboteur/execution/reevaluator.rb +68 -12
  66. data/lib/saboteur/execution/runner.rb +225 -24
  67. data/lib/saboteur/execution/sandbox.rb +21 -3
  68. data/lib/saboteur/execution/seatbelt.rb +226 -0
  69. data/lib/saboteur/execution/supervisor.rb +45 -13
  70. data/lib/saboteur/execution/worker_pool.rb +110 -8
  71. data/lib/saboteur/frameworks/sqlite_memory_database.rb +49 -0
  72. data/lib/saboteur/gates.rb +43 -2
  73. data/lib/saboteur/help.rb +108 -13
  74. data/lib/saboteur/ignore_list.rb +40 -7
  75. data/lib/saboteur/install.rb +4 -3
  76. data/lib/saboteur/integration/base.rb +7 -2
  77. data/lib/saboteur/integration/rspec.rb +175 -9
  78. data/lib/saboteur/mutation_source/argument_removal.rb +1 -1
  79. data/lib/saboteur/mutation_source/builtin.rb +44 -14
  80. data/lib/saboteur/mutation_source/chain_removal.rb +1 -1
  81. data/lib/saboteur/mutation_source/condition_negation.rb +1 -1
  82. data/lib/saboteur/mutation_source/constant_literals.rb +66 -0
  83. data/lib/saboteur/mutation_source/element_removal.rb +73 -0
  84. data/lib/saboteur/mutation_source/endpoint_replacement.rb +1 -1
  85. data/lib/saboteur/mutation_source/entry_edits.rb +44 -0
  86. data/lib/saboteur/mutation_source/filter_replacement.rb +1 -1
  87. data/lib/saboteur/mutation_source/hazard_guard.rb +129 -3
  88. data/lib/saboteur/mutation_source/interpolation_removal.rb +41 -0
  89. data/lib/saboteur/mutation_source/literal_replacement.rb +1 -1
  90. data/lib/saboteur/mutation_source/method_swap.rb +193 -0
  91. data/lib/saboteur/mutation_source/mutation.rb +5 -3
  92. data/lib/saboteur/mutation_source/operand_replacement.rb +54 -0
  93. data/lib/saboteur/mutation_source/operator_assignment.rb +1 -1
  94. data/lib/saboteur/mutation_source/operator_examples.rb +6 -1
  95. data/lib/saboteur/mutation_source/operator_registry.rb +7 -2
  96. data/lib/saboteur/mutation_source/operator_visit.rb +39 -0
  97. data/lib/saboteur/mutation_source/pair_removal.rb +13 -31
  98. data/lib/saboteur/mutation_source/range_replacement.rb +1 -1
  99. data/lib/saboteur/mutation_source/regex_replacement.rb +93 -0
  100. data/lib/saboteur/preview.rb +122 -13
  101. data/lib/saboteur/refinement_activations.rb +60 -0
  102. data/lib/saboteur/reporter/agent.rb +9 -1
  103. data/lib/saboteur/reporter/agent_commands.rb +47 -15
  104. data/lib/saboteur/reporter/agent_incomplete.rb +38 -2
  105. data/lib/saboteur/reporter/agent_summary.rb +4 -3
  106. data/lib/saboteur/reporter/findings.rb +5 -2
  107. data/lib/saboteur/reporter/history_policy.rb +11 -0
  108. data/lib/saboteur/reporter/history_reader.rb +47 -0
  109. data/lib/saboteur/reporter/html.rb +26 -4
  110. data/lib/saboteur/reporter/mutation_text.rb +6 -0
  111. data/lib/saboteur/reporter/next_steps.rb +14 -4
  112. data/lib/saboteur/reporter/score_history.rb +5 -1
  113. data/lib/saboteur/reporter/stryker.rb +40 -7
  114. data/lib/saboteur/reporter/survivor_classification.rb +101 -0
  115. data/lib/saboteur/reporter/survivor_hints.rb +3 -0
  116. data/lib/saboteur/reporter/survivor_list.rb +15 -9
  117. data/lib/saboteur/reporter/terminal.rb +74 -17
  118. data/lib/saboteur/result.rb +38 -7
  119. data/lib/saboteur/selection/coverage_map.rb +107 -11
  120. data/lib/saboteur/selection/dependency_shield.rb +80 -0
  121. data/lib/saboteur/selection/external_test_map.rb +27 -0
  122. data/lib/saboteur/selection/git_diff.rb +105 -13
  123. data/lib/saboteur/selection/layout_only_lines.rb +80 -0
  124. data/lib/saboteur/selection/recorder.rb +22 -4
  125. data/lib/saboteur/selection/source_scope.rb +22 -0
  126. data/lib/saboteur/selection/untracked_changes.rb +126 -0
  127. data/lib/saboteur/subject.rb +53 -7
  128. data/lib/saboteur/subject_finder.rb +173 -29
  129. data/lib/saboteur/text.rb +42 -0
  130. data/lib/saboteur/version.rb +1 -1
  131. data/lib/saboteur/working_tree.rb +38 -15
  132. data/lib/saboteur.rb +29 -1
  133. metadata +50 -2
data/lib/saboteur.rb CHANGED
@@ -6,11 +6,26 @@ require_relative "saboteur/version"
6
6
  module Saboteur
7
7
  class Error < StandardError; end
8
8
 
9
+ # A phase timeout that --max-duration shortened: budget exhaustion, not a
10
+ # broken suite. The engine turns it into the budget partial-report path
11
+ # instead of a phase error (#296).
12
+ class BudgetPhaseTimeout < Error; end
13
+
9
14
  # Invalid configuration or input files (exit code 2).
10
15
  class ConfigError < Error; end
11
16
 
12
17
  # Files vanished from the working tree while mutants ran (exit code 3).
13
- class CanaryTripped < Error; end
18
+ class CanaryTripped < Error
19
+ # Set by the per-mutant probe (the mutant whose run just ended, #235);
20
+ # nil for a subject-end check, whose "most recent mutant" is only the
21
+ # likely cause and must not outrank a per-mutant report (#285).
22
+ attr_reader :culprit_digest
23
+
24
+ def initialize(message = nil, culprit_digest: nil)
25
+ @culprit_digest = culprit_digest
26
+ super(message)
27
+ end
28
+ end
14
29
 
15
30
  class << self
16
31
  # Set while hook files from config load, so they can call Saboteur.hook.
@@ -28,25 +43,36 @@ module Saboteur
28
43
  end
29
44
  end
30
45
 
46
+ require_relative "saboteur/coverage_reads"
31
47
  require_relative "saboteur/hooks"
32
48
  require_relative "saboteur/mutation_source/base"
33
49
  require_relative "saboteur/mutation_source/builtin"
34
50
  require_relative "saboteur/integration/base"
35
51
  require_relative "saboteur/subject"
52
+ require_relative "saboteur/refinement_activations"
36
53
  require_relative "saboteur/subject_finder"
54
+ require_relative "saboteur/constant_subject"
55
+ require_relative "saboteur/constant_subject_finder"
56
+ require_relative "saboteur/constant_reads"
57
+ require_relative "saboteur/mutation_source/constant_literals"
37
58
  require_relative "saboteur/execution/protocol"
38
59
  require_relative "saboteur/execution/process_table"
39
60
  require_relative "saboteur/execution/process_tree"
61
+ require_relative "saboteur/execution/marker_sweep"
40
62
  require_relative "saboteur/execution/supervisor"
41
63
  require_relative "saboteur/execution/reevaluator"
42
64
  require_relative "saboteur/execution/wrapper"
43
65
  require_relative "saboteur/execution/runner"
66
+ require_relative "saboteur/execution/external_runner"
44
67
  require_relative "saboteur/execution/worker_pool"
45
68
  require_relative "saboteur/execution/fork_readiness"
46
69
  require_relative "saboteur/execution/sandbox"
70
+ require_relative "saboteur/execution/seatbelt"
47
71
  require_relative "saboteur/selection/coverage_map"
72
+ require_relative "saboteur/selection/external_test_map"
48
73
  require_relative "saboteur/selection/recorder"
49
74
  require_relative "saboteur/selection/git_diff"
75
+ require_relative "saboteur/selection/source_scope"
50
76
  require_relative "saboteur/result"
51
77
  require_relative "saboteur/custom_map"
52
78
  require_relative "saboteur/gates"
@@ -57,8 +83,10 @@ require_relative "saboteur/reporter/diff"
57
83
  require_relative "saboteur/reporter/findings"
58
84
  require_relative "saboteur/reporter/agent"
59
85
  require_relative "saboteur/working_tree"
86
+ require_relative "saboteur/dirty_tree_warning"
60
87
  require_relative "saboteur/agent_skill"
61
88
  require_relative "saboteur/reporter/terminal"
62
89
  require_relative "saboteur/reporter/stryker"
90
+ require_relative "saboteur/reporter/survivor_classification"
63
91
  require_relative "saboteur/reporter/html"
64
92
  require_relative "saboteur/engine"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saboteur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vamsi Pavan Mahesh Gunturu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-14 00:00:00.000000000 Z
11
+ date: 2026-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddle
@@ -73,10 +73,24 @@ files:
73
73
  - lib/saboteur/baseline_health.rb
74
74
  - lib/saboteur/cli.rb
75
75
  - lib/saboteur/cli/exit_status.rb
76
+ - lib/saboteur/cli/help_options.rb
77
+ - lib/saboteur/cli/history_command.rb
78
+ - lib/saboteur/cli/presets.rb
79
+ - lib/saboteur/cli/run_budget_options.rb
76
80
  - lib/saboteur/cli/run_reporting.rb
81
+ - lib/saboteur/cli/selection_options.rb
82
+ - lib/saboteur/cli/shard_options.rb
83
+ - lib/saboteur/cli/source_set.rb
84
+ - lib/saboteur/cli/survivors_command.rb
77
85
  - lib/saboteur/config.rb
78
86
  - lib/saboteur/config_file.rb
87
+ - lib/saboteur/constant_reads.rb
88
+ - lib/saboteur/constant_subject.rb
89
+ - lib/saboteur/constant_subject_finder.rb
90
+ - lib/saboteur/coverage_reads.rb
91
+ - lib/saboteur/crash_report.rb
79
92
  - lib/saboteur/custom_map.rb
93
+ - lib/saboteur/dirty_tree_warning.rb
80
94
  - lib/saboteur/doctor.rb
81
95
  - lib/saboteur/engine.rb
82
96
  - lib/saboteur/engine/baseline_guard.rb
@@ -85,33 +99,50 @@ files:
85
99
  - lib/saboteur/engine/canary.rb
86
100
  - lib/saboteur/engine/candidate_selection.rb
87
101
  - lib/saboteur/engine/candidates.rb
102
+ - lib/saboteur/engine/coverage_guard.rb
88
103
  - lib/saboteur/engine/coverage_store.rb
89
104
  - lib/saboteur/engine/data_inputs.rb
105
+ - lib/saboteur/engine/defined_order_prefix.rb
90
106
  - lib/saboteur/engine/diagnostics.rb
91
107
  - lib/saboteur/engine/diff_scope.rb
92
108
  - lib/saboteur/engine/distribution.rb
109
+ - lib/saboteur/engine/early_stop_recording.rb
110
+ - lib/saboteur/engine/gated_run.rb
111
+ - lib/saboteur/engine/load_coverage.rb
112
+ - lib/saboteur/engine/out_of_scope_guard.rb
113
+ - lib/saboteur/engine/pipelines.rb
93
114
  - lib/saboteur/engine/result_cache.rb
115
+ - lib/saboteur/engine/run_budget.rb
94
116
  - lib/saboteur/engine/run_fingerprint.rb
95
117
  - lib/saboteur/engine/sandbox_policy.rb
96
118
  - lib/saboteur/engine/scheduler.rb
119
+ - lib/saboteur/engine/selection_announcement.rb
120
+ - lib/saboteur/engine/shard.rb
97
121
  - lib/saboteur/engine/subject_selection.rb
98
122
  - lib/saboteur/engine/suite_files.rb
99
123
  - lib/saboteur/engine/test_guess.rb
124
+ - lib/saboteur/engine/thread_warnings.rb
100
125
  - lib/saboteur/engine/unchanged_syntax.rb
126
+ - lib/saboteur/engine/unscoped_suite_warning.rb
101
127
  - lib/saboteur/engine/verdict_check.rb
128
+ - lib/saboteur/execution/external_runner.rb
102
129
  - lib/saboteur/execution/fork_readiness.rb
130
+ - lib/saboteur/execution/marker_sweep.rb
131
+ - lib/saboteur/execution/peak_memory.rb
103
132
  - lib/saboteur/execution/process_table.rb
104
133
  - lib/saboteur/execution/process_tree.rb
105
134
  - lib/saboteur/execution/protocol.rb
106
135
  - lib/saboteur/execution/reevaluator.rb
107
136
  - lib/saboteur/execution/runner.rb
108
137
  - lib/saboteur/execution/sandbox.rb
138
+ - lib/saboteur/execution/seatbelt.rb
109
139
  - lib/saboteur/execution/stale_captures.rb
110
140
  - lib/saboteur/execution/supervisor.rb
111
141
  - lib/saboteur/execution/worker_pool.rb
112
142
  - lib/saboteur/execution/wrapper.rb
113
143
  - lib/saboteur/frameworks/database_hosts.rb
114
144
  - lib/saboteur/frameworks/rails.rb
145
+ - lib/saboteur/frameworks/sqlite_memory_database.rb
115
146
  - lib/saboteur/gates.rb
116
147
  - lib/saboteur/help.rb
117
148
  - lib/saboteur/hooks.rb
@@ -126,18 +157,27 @@ files:
126
157
  - lib/saboteur/mutation_source/builtin.rb
127
158
  - lib/saboteur/mutation_source/chain_removal.rb
128
159
  - lib/saboteur/mutation_source/condition_negation.rb
160
+ - lib/saboteur/mutation_source/constant_literals.rb
129
161
  - lib/saboteur/mutation_source/edit.rb
162
+ - lib/saboteur/mutation_source/element_removal.rb
130
163
  - lib/saboteur/mutation_source/endpoint_replacement.rb
164
+ - lib/saboteur/mutation_source/entry_edits.rb
131
165
  - lib/saboteur/mutation_source/filter_replacement.rb
132
166
  - lib/saboteur/mutation_source/hazard_guard.rb
167
+ - lib/saboteur/mutation_source/interpolation_removal.rb
133
168
  - lib/saboteur/mutation_source/literal_replacement.rb
169
+ - lib/saboteur/mutation_source/method_swap.rb
134
170
  - lib/saboteur/mutation_source/mutation.rb
171
+ - lib/saboteur/mutation_source/operand_replacement.rb
135
172
  - lib/saboteur/mutation_source/operator_assignment.rb
136
173
  - lib/saboteur/mutation_source/operator_examples.rb
137
174
  - lib/saboteur/mutation_source/operator_registry.rb
175
+ - lib/saboteur/mutation_source/operator_visit.rb
138
176
  - lib/saboteur/mutation_source/pair_removal.rb
139
177
  - lib/saboteur/mutation_source/range_replacement.rb
178
+ - lib/saboteur/mutation_source/regex_replacement.rb
140
179
  - lib/saboteur/preview.rb
180
+ - lib/saboteur/refinement_activations.rb
141
181
  - lib/saboteur/replay.rb
142
182
  - lib/saboteur/reporter/agent.rb
143
183
  - lib/saboteur/reporter/agent_clipping.rb
@@ -148,6 +188,7 @@ files:
148
188
  - lib/saboteur/reporter/findings.rb
149
189
  - lib/saboteur/reporter/history_paths.rb
150
190
  - lib/saboteur/reporter/history_policy.rb
191
+ - lib/saboteur/reporter/history_reader.rb
151
192
  - lib/saboteur/reporter/history_record.rb
152
193
  - lib/saboteur/reporter/html.rb
153
194
  - lib/saboteur/reporter/mutation_text.rb
@@ -157,6 +198,7 @@ files:
157
198
  - lib/saboteur/reporter/score_history.rb
158
199
  - lib/saboteur/reporter/score_table.rb
159
200
  - lib/saboteur/reporter/stryker.rb
201
+ - lib/saboteur/reporter/survivor_classification.rb
160
202
  - lib/saboteur/reporter/survivor_hints.rb
161
203
  - lib/saboteur/reporter/survivor_list.rb
162
204
  - lib/saboteur/reporter/survivor_ranking.rb
@@ -165,10 +207,16 @@ files:
165
207
  - lib/saboteur/result.rb
166
208
  - lib/saboteur/score.rb
167
209
  - lib/saboteur/selection/coverage_map.rb
210
+ - lib/saboteur/selection/dependency_shield.rb
211
+ - lib/saboteur/selection/external_test_map.rb
168
212
  - lib/saboteur/selection/git_diff.rb
213
+ - lib/saboteur/selection/layout_only_lines.rb
169
214
  - lib/saboteur/selection/recorder.rb
215
+ - lib/saboteur/selection/source_scope.rb
216
+ - lib/saboteur/selection/untracked_changes.rb
170
217
  - lib/saboteur/subject.rb
171
218
  - lib/saboteur/subject_finder.rb
219
+ - lib/saboteur/text.rb
172
220
  - lib/saboteur/version.rb
173
221
  - lib/saboteur/working_tree.rb
174
222
  homepage: https://github.com/vamsipavanmahesh/saboteur