On this page
- Status: Accepted — shipped 2026-06-25 (F0–F8 below). The expert diagnostic
spine runs live on BLO's real 1st-party orders + real Kalodata + seeded
SocialHeat (
is_sample); the MSO suggest→decide→measure→learn loop is wired and rendering for the demo brand (SKINFOOD). - Date: 2026-06-24 (proposed) · 2026-06-25 (accepted/shipped)
Shipped surfaces (file map). Expert spine on the MI overview (
apps/web/src/app/(dashboard)/market-intelligence/_components/market-intelligence-view.tsx): decomposition card → lever-sweep card → benchmark-triad card → social-panel card → recommendation CTA → honest-limits panel. Pure engines:packages/metrics/src/{decomposition,lever-sweep}.ts(LMDI + status rule, unit-tested); tRPC readsmarketIntel.{decomposition,leverSweep,benchmarkTriad,socialPanel}+ the extendedcreatorMomentum(done/not-done) +livestream(you-vs-top-10) inrouters/market-intel{,-trends}.ts. Data-availability matrix: docs/kalodata-api.md. Demo seed:scripts/seed-blo-social-demo.ts(SocialHeat buzz → off-takeact). Behavioural guards:apps/web/e2e/market-intel.spec.ts.Scope-coherence note (learned during F3/F8). The scheduled Open-API connector returns WHOLE-MARKET windows (
scope_category_name = null—category_idis ignored on/rank), while the 0-credit list-API returns the CATEGORY-scoped (skincare) windows the competitor/creator analysis is about. A whole-market window must never displace the category ranking as "latest" (it drops the own shop + shows off-category leaders).loadMarketWindows+ the spine procedures now PREFER category-scoped windows; category GROWTH still comes from the (whole-market-only) category leaderboard. Guarded behaviourally (market-intel.spec.tscompetitors + triad render non-empty), per §57 — not a static audit.
- Related: ADR 0004 (MSO off-take loop), ADR 0005 (AI failover), CLAUDE.md §32/§35 (no fabricated KPIs), §53/§55 (reconciliation/oracle), §57 (MI estimate plane excluded from
verify:data, guard behaviourally), §58 (market data gated in chat). Story/specs:docs/MSO-UCIP-Roadmap/mso-08-demo-storyboard.html(the 9-beat demo),mso-07-blo-scenarios.html,mso-02-explainer.html.
Goal in one line. Turn the existing Market-Intelligence estimate plane into a set of expert diagnostic views that follow how a senior commerce analyst actually reasons (GMV decomposition → commercial levers → benchmark triad → social last), and wire those metrics into the MSO loop (suggest → decide → measure → learn). Run on BLO's real 1st-party orders + Kalodata's real API data + in-house SocialHeat/ECI seeded for the demo (connectors come later).
1. Context#
1.1 What already exists (do NOT rebuild — extend)
The MI plane is substantial. Confirm exact paths before editing.
- Connectors / Kalodata. Workbook parsers (
packages/connectors/core/src/{kalodata,kalodata-tiktok-list,kalodata-shopee}.ts) registered inmarket-data-registry.ts(MarketDataParser,MARKET_DATA_PROVIDER_IDS,parseKalodataWorkbook). An Open-API client exists (packages/connectors/core/src/kalodata-api.ts›KalodataApiClient, secret-key auth, rolling-window presets, 6 datasets) driven by the worker (apps/worker/src/processors/market-intel-sync.ts). Thekalodata-market-dataskill pulls the same 6 datasets via the in-page list API (0 export credits, paced, incremental, resumable). - Tables (
market_intel_*, brand-partitioned, RLS,is_estimate=true):market_intel_snapshots(provenance: source/platform/dataset/range),…_categories,…_products,…_shops,…_creators,…_videos,…_lives,…_settings(org-level:comparison_basisgmv|nmv, AI insight config). Money is*_vndintegers; ratios are signed basis points ×10000 (*_bp) — no floats. - Social signals:
social_signal_daily(packages/schema/src/tables/mso.ts) —org_id, brand_id, platform='social-agg', source='socialheat', metric_type (6 levers: post, object_mention, online_seller, owned_media, consulting, total_buzz), value(int), day(ICT Monday). ParserparseSocialHeatSheets, promoterpromoteSocialSignals. - Routers:
market-intel.ts(ingest/snapshots/credentials),market-intel-trends.ts(trajectory/competitor/creator/whitespace + GMV/NMV basis + AI insight),market-intel-basis.ts,market-intel-signals(-core).ts(signal extraction for off-take),offtake.ts(MSO loop reads: AOV/attach/discount diagnostics, Marketing/Decision Memory). - Pages:
app/(dashboard)/market-intelligence/{page,trends,competitors,creators,products,livestream,data}+admin/market-intelligence; MSO atapp/(dashboard)/marketing-systems/{page,signals,decisions,measure}. - Plugin manifests (
packages/plugin-host/src/registry.ts, familymarket_intel,thirdPartyData:true,dependsOn:['market-intelligence']):mi-mk-commerce-connector(providerIdkalodata, transportboth),mi-eci-connector(eci, file),mi-socialheat-connector(socialheat, file), andmso-offtake.
1.2 The expert framework we encode (interview as INPUT, refined with our own judgment)
The interview gives a starting playbook; we adjust it with engineering + industry sense (NOT followed verbatim). A senior analyst reasons roughly in this order — the durable formula:
- Decompose:
GMV (and NMV) = Traffic × Conversion Rate × AOV. A drop is first localised to one of these three. - Commercial levers, in order, BEFORE social: check the e-commerce levers (see corrected vocabulary in §4.2) — only when those are "clean" do you look at social.
- Benchmark triad — nothing is read in isolation: every metric is shown as You vs Market vs Direct competitor vs Top creator.
−17%means the opposite thing when the category is+12%vs−20%. - Social (last) — what it actually answers: (a) is the brand being disliked / criticised (negative sentiment, crisis)?; (b) does buzz lead orders (~1 week — the off-take correlation)?; (c) demand shift + share-of-voice in the rising niche. SocialHeat measures social conversation (buzz/sentiment/SOV) — NOT ads.
- Competitor + creator → an actionable formula: competitor super-brand-day, AOV moves, bundles/GWP, assortment-vs-demand fit, creators not yet engaged → a recommendation tied to a known kit (brand-day kit, bundle, mini-size GWP). (Stock-out is a playbook check, rarely the driver on normal days.)
- Honesty: per-order attribution to a single creator is not reliably available across platforms — rely on aggregate creator/affiliate GMV (sufficient); the platform ranking algorithm is unknown (assumptions only); Kalodata accuracy ≈70% (acceptable, labelled).
- Durable formula, changing tactics: the formula (this diagnostic spine) is stable; tactics age out as platform behaviour/features change (e.g. "buy banner / dump bandwidth" lost value when TikTok Shop reshaped discovery). → This is exactly why the system must learn (down-weight stale tactics) rather than freeze a slide.
1.3 Gap
The data and many surfaces exist, but the expert diagnostic spine is not surfaced as one coherent flow, the benchmark triad is scattered, GMV decomposition is not first-class, SocialHeat views are thin (no live feed), and the MI metrics are not fully wired into the MSO suggest→decide→measure→learn loop the way the storyboard describes.
2. Decision#
Build "Market Intelligence — Expert Views" on top of the existing MI plane:
- A Diagnostic Report that walks the expert spine (decompose → levers → benchmark → social → competitor/creator → recommendation), grounded in
scene1numbers as the demo case. - Benchmark-triad treatment across competitor/creator/product/livestream views.
- Wire MI metrics into the MSO loop: MI signals feed
Suggest(Decision Inbox), humanDecide,Measureagainst BLO orders (Measure Spine),Learn(off-take weights / track-record). - Data: BLO 1st-party orders (real) + Kalodata (real, via API — investigated first) + SocialHeat/ECI (in-house; seeded for demo, shown as connected & ingesting).
Non-goals: no new market vendor (FastMoss/EchoTik); no change to the off-take math single-source (packages/metrics/src/offtake.ts); MI never becomes a 1st-party KPI (§32/§35).
3. Phase 0 — Kalodata API investigation (DO THIS FIRST; gates §4)#
Before designing any view, connect the Kalodata API and document what is actually available — do not assume fields.
- Use the existing
KalodataApiClient(kalodata-api.ts) +market-intel-syncworker; and/or thekalodata-market-dataskill (in-page list API, 0 export credits). Provider key is pasted viamarket-intel.tsconnector-credential flow (envelope-encrypted, §4 invariant). - Enumerate all 6 datasets —
category, product, shop, creator, video, livestream— for TikTok Shop (and Shopee where supported). For each: list every field returned, its unit, date-window semantics, and map it to themarket_intel_*column it lands in (or flag "no column yet"). - Respect the quota. The plan allows ~50k calls/day for a month — generous, but still: pace requests (5–10s, per the skill), cache every raw pull under
data/market-intel/kalodata/history-{weekly,monthly}/, pull incrementally by ISO week (Mon–Sun), and prefer the 0-credit in-page list API for bulk; reserve the Open API for scheduled deltas. Never re-pull a window already cached. - Deliverable:
docs/architecture/reference/kalodata-api.md— a matrixmetric → dataset → available? → maps-to column → which expert view uses it. This matrix is the source of truth for §4; any metric not backed by a real field is either computed from 1st-party, mocked (SocialHeat only), or dropped with a note.
4. Metric catalog (expert framework → UCIP)#
Money = VND integer; ratios = signed bp ×10000; dates = ICT. Mark each metric's source: 1P (BLO orders), K (Kalodata, real), SH (SocialHeat — in-house, seeded for demo).
4.1 Decomposition (the spine)
| Metric | Định nghĩa | Nguồn | Maps to |
|---|---|---|---|
| GMV / NMV | Doanh thu gộp / thuần (trừ huỷ-hoàn) | 1P | orders rollups |
| Traffic | Lượt vào (proxy: # creator × content/creator, views) | 1P (+K creator/video views as benchmark) | orders + market_ |
| Conversion Rate | Đơn / traffic | 1P | computed (bp) |
| AOV | GMV / số đơn | 1P; benchmark K (avg_) |
computed |
Surface a decomposition card: which of Traffic / CR / AOV moved, vs the prior window. Code-computed (deterministic), not AI.
4.2 Commercial levers — full sweep (most show green; flag only the real culprit)
The interview listed a few; a senior sweep checks more levers and marks almost all OK, flagging only what truly moved. Implement a typed lever set, each with a status vs benchmark. Suggested set (extend as data allows):
| Lever | Là gì | Nguồn |
|---|---|---|
| Pricing | giá vs đối thủ, bậc giá | K + 1P |
| Promotion | độ sâu giảm giá; GWP (gift-with-purchase, "quà giá 0"); bundle | 1P |
| Voucher sàn | tham gia voucher/chiến dịch của sàn | 1P |
| Assortment ↔ cầu | có đang bán đúng dòng thị trường đang muốn? (vs sub-cat đang lên) | 1P + K |
| Creator / Content | số creator × content/creator; độ phủ ở ngách đang lên | 1P + K |
| Livestream | tần suất + hiệu quả live | 1P + K |
| Ad efficiency (ROAS) | hiệu quả quảng cáo — 1st-party từ sàn (KHÔNG phải SocialHeat) | 1P |
| Logistics / huỷ-hoàn | tỷ lệ huỷ/hoàn, giao hàng | 1P |
| Rating / review | điểm sao (tham khảo — việc của CS) | 1P |
| Availability / tồn kho | hết hàng (đặc biệt hero SKU) — mục playbook để kiểm; hiếm khi là vấn đề ngày thường; KHÔNG phải tâm điểm demo | 1P |
Vocabulary: "Assortment" = danh mục bán (không gồm hết-hàng hay quà-tặng); hết-hàng = Availability; "quà giá 0" = GWP (promotion). Trong ca demo, hầu hết lever xanh; hai điểm cờ là Assortment↔cầu + Creator/Content.
4.3 Benchmark triad (apply to every metric above + below)
You vs Market (category, K market_intel_categories) vs Direct competitor (K …_shops/…_products) vs Top creator (K …_creators). Use comparison_basis (GMV/NMV) from market_intel_settings for apples-to-apples.
4.4 Competitor monitor
Hero-SKU tracking (K …_products), super-brand-day detection (spike in competitor …_shops revenue), AOV moves (300k→700k flag, K), bundle/GWP catalogue (K product attributes), cancellation benchmark (1P cancellation vs K/industry where derivable — flag "assumption" if not).
Curated direct-competitor watchlist (F3.5 — shipped 2026-06-25). The raw top-GMV shop leaderboard is NOT a brand's rival set (the #1 skincare-window shop can be an off-category mega-store). The system SUGGESTS competitors from the brand's category-scoped Kalodata shop history + its 1P profile — scored on six signals (category / price-tier / channel-mix / brand-type / size / presence-over-time) with TRANSPARENT reason codes — and the owner confirms / dismisses / adds manually. The curated set (market_intel_competitors, brand-partitioned, RLS, migration 0065) becomes the real "Direct competitor" leg of the triad (§4.3) and the monitor's focus. Pure engine @yng/metrics/competitor-suggest.ts (unit-tested); candidates are drawn only from category-scoped windows so they are in-category by construction (the whole-market Open-API leaderboard is excluded). UI: market-competitor-watchlist.tsx on /market-intelligence/competitors; e2e guard in market-intel.spec.ts. SocialHeat stays is_sample until a connector lands.
4.5 Creator analysis (use aggregate creator/affiliate GMV — not per-order attribution)
Per-order attribution to ONE creator is not reliably available across platforms, and we don't need it. Use the aggregate creator/affiliate GMV (Kalodata …_creators + the brand's affiliate dashboard) — that is sufficient. Show: creators by GMV, by AOV, by follower demographics (…_creators.followers + handle); a done / not-done pie (brand's engaged-creator list vs K top creators in the niche); and top creators in the rising niche not yet engaged.
4.6 Livestream + platform
Livestream benchmark: your brand-account avg vs industry / top-10 (K …_lives). Platform difference note: TikTok Shop (demand/discovery-led) vs Shopee (price/search-led) — affects which levers to pull.
4.7 Honest gaps (render as "không khẳng định")
- Per-order attribution to a single creator is not reliably available → use aggregate creator/affiliate GMV (sufficient); never claim per-order creator credit.
- Platform ranking algorithm is unknown → treat as assumption, not fact.
- Kalodata accuracy ≈70% (acceptable for direction; labelled "3rd · ước lượng").
- On-platform rating = reference only (CS's job).
- SocialHeat measures social conversation only (buzz, sentiment, share-of-voice) — it does NOT measure ads; ad ROAS comes from the platform (1st-party).
5. Screens / dashboards — what to build, what each shows, why#
Wireframes with concrete numbers:
docs/MSO-UCIP-Roadmap/mso-09-screen-mockups.html. Build GENERAL (works for any brand / category / time window — not hard-coded to the demo case), but keep the ⭐ WOW moments below visible end-to-end.
S1 · MI Diagnostic Report — "Vì sao?" (headline)
- Route: deep-view từ
/marketing-systems(param: brand + window). - Mục đích: trả lời "vì sao GMV/NMV đổi" theo xương sống chuyên gia, kết bằng khuyến nghị.
- Hiển thị: (1) symptom banner; (2) decomposition card
GMV=Traffic×CR×AOV(lệch ở đâu); (3) lever sweep ~10 đòn bẩy ecom, mỗi cái 1 status dot, chỉ cờ chỗ lệch (§4.2); (4) benchmark triad; (5) social panel — bị ghét? · buzz→đơn? · độ phủ (§1.2-4); (6) recommendation CTA → Decision Inbox. - Nguồn: 1P + K + SH. ⭐WOW: tách đúng "lệch ở CR/AOV", quét rộng mà chỉ cờ 2 chỗ, social trả lời "có bị ghét / buzz có ra đơn".
S2 · Benchmark dashboard
- Route:
/market-intelligence/competitors(mở rộng). Mục đích: đặt mọi chỉ số cạnh mốc. - Hiển thị: grouped bars GMV-growth / AOV / SOV (mình vs ngành vs đối thủ vs top-creator), thị phần, toggle GMV/NMV. Nguồn: K + 1P. ⭐WOW: "−17% mà ngành +12%".
S3 · Competitor monitor
- Route:
/market-intelligence/competitors. Mục đích: theo dõi đối thủ trực tiếp. - Hiển thị: hero-SKU đối thủ, super-brand-day spikes, AOV moves, bundle/GWP catalogue, growth. Nguồn: K. ⭐WOW: bắt đối thủ chạy super-brand-day + bundle.
S4 · Creator board
- Route:
/market-intelligence/creators. Mục đích: chọn creator đúng ngách. - Hiển thị: creator theo GMV tổng hợp (affiliate) + AOV + chân dung follower; pie done/not-done; top creator ngách đang lên chưa hợp tác. (Không quy kết đơn theo từng creator — §4.5.) Nguồn: K + 1P. ⭐WOW: "3 creator GMV cao ở ngách hot mà mình chưa chạm".
S5 · Livestream benchmark
- Route:
/market-intelligence/livestream. Mục đích: so live mình vs ngành/top-10. - Hiển thị: avg brand-account vs industry/top-10, cadence, GMV/GPM. Nguồn: K + 1P. ⭐WOW: "đứng đâu so top-10".
S6 · Decision Inbox (Suggest → Decide)
- Route:
/marketing-systems/decisions. Mục đích: biến chẩn đoán thành đề xuất + người duyệt. - Hiển thị: proposal cards (kỳ vọng + độ tin + "vì sao" + ca giống + Duyệt/Bỏ qua); abstain card khi tín hiệu yếu; ghi
decisions. ⭐WOW: duyệt 1 bấm; hệ dám "xin không đoán".
S7 · Measure Spine (Measure → Learn)
- Route:
/marketing-systems/measure. Mục đích: đo đề xuất bằng đơn thật, rút bài học. - Hiển thị: kỳ vọng vs thực tế vs nhóm đối chứng → incremental; verdict; track-record/calibration; bài học → cập nhật trọng số (
offtake_models). Nguồn: 1P +decision_outcomes. ⭐WOW: "đo bằng tiền thật, trừ mùa/ngành"; calibration "nói 80% → đúng 78%".
S8 · Connectors (demo)
- Route:
/connectors. Mục đích: cho thấy hệ đang sống. - Hiển thị: 6 nguồn, status "đã kết nối/đang đồng bộ", last-sync, rows-today, next-sync; SH/ECI hiển thị như đang chạy (§6.2). ⭐WOW: tất cả xanh, "đang đổ data".
6. Demo data & connector-status spec (SocialHeat/ECI are in-house; connectors come later)#
SocialHeat and ECI are YouNet's own products — real connectors will exist later. For THIS demo, seed one coherent fabricated dataset and make every 3rd-party connector appear connected and actively ingesting, even with no real backend yet.
6.1 Fabricated demo dataset (all is_sample=true, tagged "3rd" + is_estimate)
- ONE coherent dataset across 1P + Kalodata + SocialHeat + ECI, numbers consistent with
scene1so every screen agrees. - SocialHeat →
social_signal_daily: the 6metric_typelevers, weekly (ICT Monday), trend that leads 1P sales ~1 week (buzz↦sales works). Plus a social-ranking shape for SOV by brand, sentiment split (pos/neu/neg, bp), mentions by demand-cluster ("dưỡng sáng" +41%, "cấp ẩm" -5%), creator momentum — implemented as the dedicatedsocial_intel_*plane (snapshots/topics/brands/topic_months) — see socialheat-sample-data.md. (SOV brand 11% vs competitor 49%.) - ECI / Kalodata →
market_intel_*: category trend (+12%, dưỡng sáng +22%), competitor shops (Competitor B 12,5 tỷ +45%), products (hero SKU), creators (top dưỡng-sáng, done/not-done), lives. Kalodata may be backed by real API pulls (§3); ECI seeded. - Deterministic seed script (pattern of
scripts/seed-mso-demo.ts): brand-partitioned,is_sample=true, reversible, must NOT touch the BLO oracle. Document the toggle.
6.2 Connectors must LOOK live (explicit demo requirement)
On /connectors (+ connector detail), the in-house sources (SocialHeat, ECI — and Kalodata in demo mode) must render as Đã kết nối · đang đồng bộ, even with no real backend:
- "connected/healthy" badge; last-sync = a recent, advancing timestamp ("2 phút trước"); rows-ingested today counter (non-zero, ticking up); next-sync countdown; a small sync-history sparkline.
- A demo/simulated sync job updates this status surface on a schedule and upserts seeded rows — so "đang đổ data" is literally true against the seed. Gated behind a demo/
is_sampleflag; never masquerades as a production sync. - When the real connector lands, it replaces the simulated sync against the SAME tables/status surface — no UI change.
7. Invariants & guards (must hold)#
- Family
market_intel,thirdPartyData:true,is_estimate=true+ "3rd" badge on every market/social number; never a 1st-party KPI (§32/§35). - RLS + org→brand on every new table/column;
is_sampleon all mock rows; credentials envelope-encrypted (§4). - VND integer; ratios as bp ×10000 (no float); ICT dates (§34/§41); named exports.
- §57 — MI estimate plane is excluded from
verify:data. Guard behaviourally instead: add e2e/probe tests — (a) latest Kalodata window has ≥1 row per dataset; (b) Diagnostic Report renders with non-empty decomposition + benchmark; (c) buzz↦sales chart non-empty for the demo brand. (1P numbers that the loop measures DO get a reconciliation assertion — but only the 1P side.) - §58 — market gating in chat stays intact (MI tools only when
marketEnabled). - Quota discipline (Phase 0): cache + incremental + paced; never burn the daily quota on re-pulls.
- Demo connectors fail safe: the simulated "connected & đang đồng bộ" status is gated behind a demo/
is_sampleflag; it must never report a real production sync nor write non-sample rows. - Definition of Done:
pnpm run verifygreen,pnpm --filter @yng/web buildbefore push, browser-verify the new report (vi-first, empty/loading/error states), evidence (screens + the Kalodata availability matrix).
8. Features / work items for Claude Code (backlog → SHIPPED 2026-06-25)#
Each is shippable on its own; do in order. Implement GENERAL; ⭐ marks the wow to keep visible.
- ✅ F0 — Kalodata API investigation (§3) →
docs/kalodata-api.md. Matrix committed (6 datasets × 2 access paths, verified live); livelast7DayOpen-API pull proved the connection (connectordown→healthy); 15 real skincare weeks already cached; no quota overrun. - ✅ F1 — Decomposition engine + card (§4.1 → S1). LMDI
GMV/NMV = Traffic × CR × AOVinpackages/metrics/src/decomposition.ts(pure, Date-free, exactly additive, 8 unit tests);marketIntel.decompositionreadsagg_org_day(§49);market-decomposition-card.tsxshows which lever moved; reconciles to orders (verified). ⭐ - ✅ F2 — Lever sweep (§4.2 → S1).
packages/metrics/src/lever-sweep.ts(typed status rule, 6 unit tests);marketIntel.leverSweepresolves 1P + Kalodata signals;market-lever-sweep-card.tsx— most calm, real culprits flagged (BLO: Assortment + Cancel), Ad-ROAS/Availability/Voucher/Ratingna(playbook, no fake green). ROAS sourced 1st-party. - ✅ F3 — Benchmark triad (§4.3 → S2).
marketIntel.benchmarkTriad+market-benchmark-triad-card.tsx: You vs Market vs Competitor vs Top-creator, basis-aware; growth (You vs category) + AOV bars; entities with no data omitted (§32). ⭐ - ✅ F4 — Competitor monitor + Creator board + Livestream (§4.4–4.6 → S3/S4/S5). Existing competitor/creator/livestream surfaces + NEW done/not-done engagement split (
computeCreatorMomentum.engagement+ creators view) and you-vs-top-10 livestream benchmark (ownLiveBenchmark+ livestream view). Aggregate creator/affiliate GMV (no per-order attribution). ⭐ done/not-done creators - ✅ F5 — MI Diagnostic Report "Vì sao?" (§5 S1). One coherent flow on the overview: decompose → levers → benchmark → social → recommendation CTA → honest limits. Social panel (
marketIntel.socialPanel) answers buzz→đơn from the real off-take model (post leads ~7d, corr +0.68); sentiment + SOV are honest gaps (§4.7). ⭐ headline wow - ✅ F6 — Demo dataset + connector-status simulation (§6 → S8).
scripts/seed-blo-social-demo.tsseeds SocialHeat buzz for BLO (is_sample, buzz leads GMV ~1wk) → off-take modelact; seeds SocialHeat/ECI demo connector rows (healthy); reversible (--clean); no non-sample rows. Connectors render live on the super-admin MI surface (3rd-party connectors stay off the org/connectorspage per the standing UX rule). ⭐ looks live - ✅ F7 — MSO loop wiring (S6/S7). The off-take loop + Decision Inbox + Measure Spine + track-record already shipped; F6's seed makes BLO's loop produce a real proposal (SKINFOOD · push
postbefore 7.7 double-day) + measured outcome. F5's recommendation CTA links the diagnosis into the inbox. Full suggest→decide→measure→learn cycle renders for the demo brand. ⭐ the loop - ✅ F8 — Behavioural guards (§7/§57).
apps/web/e2e/market-intel.spec.ts— 6 new probes (decomposition spine, lever sweep, benchmark triad, social buzz→đơn, done/not-done, livestream benchmark) + the existing row-cap guards; 9/9 pass. Tests fail when a window/report goes empty. - ✅ F9 — Docs sync. This ADR → Accepted with the shipped file map; CLAUDE.md in-flight updated. (mso-07/08/09 storyboard HTML left as the narrative spec.)
- F10 — SocialHeat report plane (the "Vì sao?" social panel) [follow-on]. New tables
social_intel_{snapshots,topics,brands,topic_months}(brand-partitioned, RLS,is_estimate); deterministic generatorscripts/socialheat-demo/generate_socialheat_demo.py(buzz↔GMV Spearman 0.56, story-aligned to Cảnh 1) →scripts/seed-socialheat-demo.ts; addmarketIntel.socialReport+ the 3-question social panel (bị ghét? / buzz→đơn? / độ phủ) to the diagnostic report. Spec + ingest: socialheat-sample-data.md. Done when: panel renders for SKINFOOD; e2e asserts latest snapshot non-empty.
9. Consequences#
- Positive: the demo shows a real senior-analyst diagnosis running live on BLO + Kalodata, then the MSO loop turning it into a tracked, self-improving decision — the storyboard's wow, on real data.
- Cost / risk: Kalodata field coverage may not back every expert metric (mitigate: F0 matrix decides what's real vs computed vs dropped; never fabricate a market KPI — §35). SocialHeat is mocked until a connector exists (clearly
is_sample). Quota misuse could lock the account (mitigate: cache + pace). - Alternatives considered: (a) keep the scattered views — rejected: doesn't tell the expert story; (b) mock Kalodata too — rejected: the user has real API and real data is the trust anchor; (c) put market numbers through
verify:data— rejected by §57 (estimates aren't ground truth; guard by e2e).