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.
()
| 290 | // test failure messages. Without it a MainLoopStop formats as a bare integer, |
| 291 | // which tells the reader nothing about which exit fired. |
| 292 | func (s MainLoopStop) String() string { |
| 293 | switch s { |
| 294 | case StopNone: |
| 295 | return "none" |
| 296 | case StopMaxRounds: |
| 297 | return "max_rounds" |
| 298 | case StopEmptyRounds: |
| 299 | return "empty_rounds" |
| 300 | case StopCompression: |
| 301 | return "compression" |
| 302 | default: |
| 303 | return fmt.Sprintf("MainLoopStop(%d)", int(s)) |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | // Reason is the safe, human-facing sentence for a stop, and the single source of |
| 308 | // truth for it: the diff-review manifest reason and the scan subtask warning |
no outgoing calls