String names the stop for diagnostics — telemetry attributes, log lines and test failure messages. Without it a MainLoopStop formats as a bare integer, which tells the reader nothing about which exit fired.
()
| 278 | // test failure messages. Without it a MainLoopStop formats as a bare integer, |
| 279 | // which tells the reader nothing about which exit fired. |
| 280 | func (s MainLoopStop) String() string { |
| 281 | switch s { |
| 282 | case StopNone: |
| 283 | return "none" |
| 284 | case StopMaxRounds: |
| 285 | return "max_rounds" |
| 286 | case StopEmptyRounds: |
| 287 | return "empty_rounds" |
| 288 | case StopCompression: |
| 289 | return "compression" |
| 290 | default: |
| 291 | return fmt.Sprintf("MainLoopStop(%d)", int(s)) |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | // Reason is the safe, human-facing sentence for a stop, and the single source of |
| 296 | // truth for it: the diff-review manifest reason and the scan subtask warning |
no outgoing calls