The tag-driven model
This is the key concept: an alert triggers on tags, not on a raw metric threshold.- The metric → threshold logic lives in tagging rules (a metric condition tags the matching entities).
- An alert then watches for entities carrying those tags, within a perimeter and at a check level, and notifies.
Alert definition
Analerts row has:
| Field | Meaning |
|---|---|
name | Display name. |
category / subcategory | Classification (e.g. INVENTORY / STOCK). |
rules | The tag-based trigger — see Rules & perimeter. |
scope | The perimeter (stores / brands / products / taxonomies / collections). |
destination | Notifications — see Notifications & actions. |
isActive | Whether the alert is evaluated. |
The metric catalog
Metrics live in a separatealert_metrics catalog (referenced by tagging-rule metric
conditions). Each metric is GLOBAL (shared) or ORG-scoped, has a kind
(precomputed_column, aggregation, time_windowed_aggregation, formula, composite),
a calculation body, a grain, and an output. The standard metrics:
| Metric | Measures |
|---|---|
CURRENT_STOCK_LEVEL | Current stock. |
GROSS_SALES_VALUE / GROSS_SALES_QUANTITY | Sales value / units. |
GROSS_SALES_VALUE_PREVIOUS | Previous-period sales (for trend). |
FORECASTED_SALES_QUANTITY | Forecast demand. |
INVENTORY_TURN_OVER_RATE | Turnover rate. |
DAYS_OF_STOCK | Days of cover at current velocity. |
RISK_SCORE | Intelligence-layer risk. |
UNACTIONED_RECOMMENDATIONS_COUNT | Open recommendations. |
SALES_TREND_PERCENT | Sales trend %. |
The catalog attributes (
scope, kind, body, grain) are populated at the
data-platform/seed level — they are part of the stored metric definition, not the
app-side create form (which only sets category, subcategory, metricName,
description, selectors).These metrics are consumed by tagging-rule metric conditions,
which is where the operator (incl. percentiles) and threshold are set. Alerts then watch
the resulting tags.
Lifecycle
An alert is just active or not (isActive). Each evaluation produces instances with
their own lifecycle — see Instances & runs.
