Awesome Reviewers

Reviewer · Configurations

Centralize and validate config

Configuration values that are related or interdependent (e.g. an interval and the lookback window it must stay within, or a set of allowed durations used by both validation and cleanup logic) must be defined once in a shared constant/source of truth, not duplicated as separate magic numbers in different files. Derive dependent limits from that single source...

Instruction

Configuration values that are related or interdependent (e.g. an interval and the lookback window it must stay within, or a set of allowed durations used by both validation and cleanup logic) must be defined once in a shared constant/source of truth, not duplicated as separate magic numbers in different files. Derive dependent limits from that single source so a future change (e.g. adding a longer rolling window) automatically propagates everywhere it’s used:

// domain/models/time_window.ts
export const ROLLING_TIME_WINDOW_DAYS = [7, 30, 90];

// cleanup task
const SLI_MAX_LOOKBACK_DAYS = Math.max(...ROLLING_TIME_WINDOW_DAYS) + 1;

In addition, validate configuration inputs as strictly as they will be used at runtime. A schema check that only verifies “looks like a URL” or “is a number” is not enough if downstream code (e.g. new URL(), parseDuration) can still throw or misbehave on technically-valid-looking values (invalid ports, intervals longer than the window they’re meant to cover, etc.). Add the same checks to the config/schema validation layer so bad configuration is rejected with a clear 400-style error at setup time instead of failing later.

Finally, when a setting or its documentation/error messages assume a particular deployment type (self-managed/ECH vs serverless), make the configuration and any user-facing guidance aware of that distinction — e.g. don’t tell serverless users to edit kibana.yml if they can’t. Gate messaging or defaults by build flavor rather than assuming one environment for all.</description> </invoke>