| 231 | // services instead of trusted from the client. |
| 232 | const ANTI_ABUSE_TELEMETRY_MODE = envStr('EVOLVER_ANTI_ABUSE_TELEMETRY', 'heartbeat'); |
| 233 | function antiAbuseTelemetryMode() { |
| 234 | const raw = process.env.EVOLVER_ANTI_ABUSE_TELEMETRY; |
| 235 | const v = String(raw == null ? '' : raw).toLowerCase().trim(); |
| 236 | // Empty / whitespace-only counts as UNSET (same as envStr's '' -> fallback |
| 237 | // above): a blank `EVOLVER_ANTI_ABUSE_TELEMETRY=` line in a .env file must |
| 238 | // not silently disable the documented default-on behavior. Opt-out is |
| 239 | // explicit only. |
| 240 | if (v === '') return 'heartbeat'; |
| 241 | if (v === '0' || v === 'false' || v === 'no' || v === 'off') return 'off'; |
| 242 | return (v === '1' || v === 'true' || v === 'yes' || v === 'on' || v === 'heartbeat') |
| 243 | ? 'heartbeat' |
| 244 | : 'off'; |
| 245 | } |
| 246 | |
| 247 | // --- Validator mode (opt-out) --- |
| 248 | // Node role: the evolver periodically fetches assigned validation tasks from |