# AI 分數（AI Score）計算方法 — 公開說明
IDAEO 數據專欄《GSC 沒壞，是客人搬家了》證據附件・2026-08-10 自 rank 產線程式碼逐字抽出
（來源檔：idaeo-rank `src/lib/dental.ts` AI_SCORE_SQL／`src/lib/vertical-board.ts` ai_score_live——兩處公式逐字相同；名次算法 `src/lib/board-rank.ts`）

## 量什麼
Cloudflare 實際記錄的 AI 爬蟲對該機構 **IDA 大使館頁**（site.idaeo.ai）的請求，逐日、逐 bot 落盤後合成。
⚠️ 量的是大使館頁被 AI 取用的頻率與廣度——**不是**診所自家官網，**更不是**業績或答案採用。

## 公式（滿分 100＝廣度 40＋深度 60）
- **觀測窗**：30 天滾動（Asia/Taipei 日界），逐日重算，分數每天會變動。
- **廣度分（上限 40）**：每一種來過的 bot 計分——AI bot（GPTBot、ClaudeBot、ChatGPT-User 等）30 天內來 ≥2 次得 10 分、只來 1 次得 5 分；傳統搜尋 bot（bingbot、Googlebot）半權：≥2 次 5 分、1 次 2.5 分。加總封頂 40。
- **深度分（上限 60）**：N＝30 天總造訪次數。
  `36 × min( ln(1+N)/ln(31), 1 ) ＋ 24 × min( ln(1+max(0, N−30))/ln(971), 1 )`
  （對數飽和：第一段 N=30 滿 36 分；第二段 N−30=970 滿 24 分——衝量遞減，防灌次數）
- 四捨五入到小數一位。
- ⚠️ 誠實注記：深度分的 N＝**全部** bot 的請求總和（含 bingbot/Googlebot 全權計入）；只有廣度分對搜尋型 bot 做半權。這是產線現行公式的如實描述。

## 名次規則（competition rank）
分數高者在前；**同分同名次**；30 天窗內**無任何 AI 造訪＝不給分也不入名次**（null≠0：「未偵測到造訪」不等於「最後一名」，不給比給錯好）。

## 原始 SQL（產線逐字）
```sql
SELECT CASE WHEN count(*) = 0 THEN NULL ELSE round((
    LEAST(sum(CASE WHEN b.bot IN ('bingbot','Googlebot')
                   THEN CASE WHEN b.h >= 2 THEN 5 ELSE 2.5 END
                   ELSE CASE WHEN b.h >= 2 THEN 10 ELSE 5 END END), 40)
  + LEAST(ln(1 + COALESCE(sum(b.h), 0)) / ln(31), 1) * 36
  + LEAST(ln(1 + GREATEST(COALESCE(sum(b.h), 0) - 30, 0)) / ln(971), 1) * 24
)::numeric, 1) END
FROM (SELECT a.bot, sum(a.hits) AS h FROM ai_crawler_site_daily a
      WHERE a.slug = <館代碼> AND a.host = 'site.idaeo.ai'
        AND a.day >= ((now() AT TIME ZONE 'Asia/Taipei')::date - 30)
      GROUP BY a.bot) b
```

## 文章引用值的快照性質
文中「82.0＝同類 358 家第 1、贏 99.7%、+41.4（16 天）」為 **2026-08-05 快照**；358＝當日牙醫榜上有分數（30 天窗內有 AI 造訪）的機構數。因為是滾動窗，數字每日變動——例如 2026-08-10 以同一公式實算，該診所為 99.5、排第 2，當日榜首 100.0。**引用時請帶快照日。**

## 誠實界線（一句版）
這個分數只能證明「AI 常來取資料」（第二本帳），不能證明答案採用、真人到站或生意（第三～五本帳）。

---
*English summary*: AI Score (0–100) = breadth (≤40: 10 pts per AI bot with ≥2 visits in a rolling 30-day window, 5 pts for single-visit bots; bingbot/Googlebot at half weight) + depth (≤60: `36·min(ln(1+N)/ln 31,1) + 24·min(ln(1+max(0,N−30))/ln 971,1)`, N = total visits). Competition ranking; no visits → no score, no rank (null ≠ 0). It measures AI retrieval of the IDA embassy page on site.idaeo.ai — not the clinic's own website, and never revenue. Figures quoted in the article (82.0, #1/358, 99.7%, +41.4/16 days) are a 2026-08-05 snapshot; scores move daily with the rolling window.
