On this page
- Status: Accepted (2026-08-23; design, implementation phased)
- Owners: platform / decision-intelligence
- Extends: §57/§58/§60d (data-plane isolation), §79 (notification audience), §65 (signal/rule DSL), ADR 0008 (marketing plane), the existing
/briefingsurface.
A daily/weekly/monthly digest that tells an ORG ADMIN what needs attention and which signal rules fired, tailored to the org's TYPE. The surface, the persisted digest (briefings), the cadence spine (briefing-cadence.ts), the rule engine (alert_rules/alert_events + per-user mute/snooze in alert_rule_user_states), the feature store (signals/signal_values), and the 07:00 ICT scheduler already exist — wired ECOM-only. This is a generalization + org-admin rule config, not a greenfield build.
Decisions#
D1 — Extend the existing /briefing, gated on org PILLARS, not a new surface
Morning Brief is the existing /briefing page generalized. The surface gate changes from requiresConnectorFamily: 'marketplace' to the org's resolved planes (resolveOrgMetricPillars). The generator and the cadence spine branch per pillar. Content-Intelligence (the audience-only pillar, isAudienceOnlyPillarSet) is EXCLUDED — a corpus deck is not an operational surface. One surface, per-type content; never a parallel brief per plane.
D2 — A brief rule is an alert rule reading the SIGNAL store; it is NOT a playbook
A "signal rule" = { signal, grain, op, trigger, severity, cadence, audience, channels }, evaluated over signal_values (the versioned per-org/brand/entity feature store), firing an alert_event that the brief ranks and surfaces. This UNIFIES the rule inputs onto the signal store instead of the bespoke eCom AlertEvaluationInput, so the engine is plane-agnostic by construction. A rule is NOT a playbook: a playbook produces a guardrailed ACTION with a proposed→approved→activated lifecycle (§60/§64/§65); a brief rule produces a NOTIFICATION. The two share the numeric Rule-DSL predicate grammar (§65) — never a second predicate language — and the brief MAY surface "a playbook wants your confirmation" as one ranked item, but the brief is a surfacing layer, not the decision engine. The scheduler home is the existing BullMQ declarative schedulers (apps/worker/src/schedules.ts), not a new "scheduled-agent" concept.
D3 — Detection ops for v1: threshold · anomaly-vs-baseline · trend-streak · goal-pacing
Threshold and anomaly-vs-baseline (ratio bands over a trailing mean) exist today (eCom-only); generalize the baseline mechanic to any signal slug. Add the two missing operators to the engine: trend-streak (N consecutive periods one direction) and goal-pacing (actual vs plan/year_progress). Statistical/forecast anomaly is DEFERRED — an anomaly without an auto-generated "why" (top contributing dimension) is a mute magnet; ship the legible, trustworthy ops first.
D4 — Default rule packs are config-DATA per pillar; org admin adopts-and-tunes
Each org type gets a default rule pack — an array keyed by MetricPillar, pure config-data (no per-client code), seeded per org from resolveOrgMetricPillars. An org receives exactly the packs for the planes it runs. Org admins tune thresholds, channels, and mute/snooze, and add pack items, through a new org-admin "Cảnh báo / Bản tin" settings surface (mirroring the existing per-user alerts.upsertPreference router); stored overrides merge onto the code default. Full custom-rule authoring is a later power-user layer, not v1.
D5 — In-app brief is canonical; §79 fences infra signals off the org brief
The in-app brief is the one ranked, capped (top 3–5), explained, deep-linked surface; email/Zalo is a POINTER to it, never duplicate content (duplicate content is what gets a digest muted). Weekly and monthly briefs are two additional schedule entries against the same generator with a cadence parameter (the cadence spine already returns day/week/month legs anchored to the latest data day, honest about sync gaps). HARD CONSTRAINT (§79): an org-admin brief surfaces ONLY audience: 'org' rules; platform/infra signals (sync failures, webhook lag, reconciliation, budget-burn) are audience: 'platform', super-admin-only, and MUST NEVER appear in an org brief.
D6 — One shared engine (~80%) + one plane collector per type (~20%); planes never blend
Common and built once: the rule shape, the signal-store reads, the cadence spine, and delivery/dedupe/audience/mute-snooze/persona. Type-specific: the evaluation-input COLLECTOR per plane and the default rule pack. The three collectors (eCom exists; marketing wires the eight per-campaign audit signals already computed into signal_values; market-intel needs a SANCTIONED market-plane reader gated on the market-intelligence plugin, §58) MUST keep their input bags from ever blending — §57/§58/§60d plane isolation is enforced at the collector boundary. Per-type content spine: eCom = GMV/margin/inventory/creator/returns (daily-heavy); marketing = spend/MER/CPL/pacing/funnel (daily-operational + weekly-funnel); market-intel = category/competitor/share/SOV, estimate-badged (monthly-strategic + a social-crisis daily leg). Every rule ties to a metric the system computes; estimate-plane figures always carry the third_party_estimate badge and never enter a 1st-party KPI (§60d).
D7 — Rules are offered by org CAPABILITY, and a dataset org authors its own (2026-09-04)
Every shipped rule pack declares the org capability its data comes from (ALERT_RULE_CAPABILITIES,
@yng/alerts), and /settings/alerts lists a pack only when resolveOrgCapabilities says the org
has that capability — not resolveOrgMetricPillars, whose "an org that matches nothing keeps eCom"
fallback is correct for a metric picker and wrong for a rule list. An org with no matching
capability gets one sentence saying why, never an empty list.
A tenant-dataset org (ADR 0038) has no pack to adopt — no universal threshold exists for a measure
only that tenant has — so it AUTHORS rules instead: measure of a confirmed dataset, optional
breakdown dimension, value or change-vs-previous-period, threshold, brand. Stored as an
alert_rules row whose jsonb condition carries kind: 'org_dataset' (no migration: the column
has always held the rule's predicate), evaluated in the same run as the shipped packs against the
agg_org_dataset_period rollup read path, delivered through the same channels, dedupe and per-user
preferences, and audience: 'org' by construction (§79). The threshold is stated in the unit a
human reads the measure in, never the stored integer. The grain is month, the only grain the
rollup holds; a day rule abstains rather than inventing a number.
Phasing (implementation follows this ADR)#
- P1 — generalize the surface + cadence spine per pillar; the marketing collector (wires existing audit signals); the org-admin rule-config settings page; eCom keeps today's brief + gains the config page.
- P2 — the trend-streak + goal-pacing operators; per-pillar default rule packs as data; the market-intel SOCIAL-pillar brief (reachable via
listMetrics). - P3 — the sanctioned market-plane reader → market-estimate rules; statistical anomaly + auto-generated "why".
Out of scope / non-goals#
- Content-Intelligence org brief (D1).
- A second predicate language or a parallel notification system (D2).
- Forecast/statistical anomaly without an explanation (D3).
- Per-client rule code — packs are config-data (D4).
- Infra/platform signals in an org brief (D5, §79).