日期 / Date:2026-03-20 依據 / Based on:C02-spec.md、C03-schema.sql、C05-review.md、C09-import.md、C12-dbx.md [Verified]
建議閱讀方式 / Suggested reading order:
[Verified]+----------------------------------+
| 我們先收到很多商品相關資料 |
| 發票名稱 / 通路頁 / 條碼 / 圖片 |
| 群眾回報 / 品牌分類提示 |
+----------------+-----------------+
|
v
+----------------------------------+
| 先全部當成證據 |
| 不先相信任何單一來源就是答案 |
+----------------+-----------------+
|
v
+----------------------------------+
| 把很像的發票名稱放成一群 |
| 先回答:這群名稱在講哪個商品? |
+----------------+-----------------+
|
v
+----------------------------------+
| 找出最可能的幾個商品版本 |
| 通常先挑 2 到 5 個候選 |
+----------------+-----------------+
|
v
+----------------------------------+
| 比對各種證據 |
| 名稱 / 條碼 / 圖片 / 品牌 / 規格 |
| 包裝層級 / 時間 / 通路上下文 |
+----------------+-----------------+
|
+----------+----------+
| |
v v
+-------------+ +----------------------+
| 很明確 | | 不夠明確或互相打架 |
| 自動確認 | | 進人工審核或補證據 |
+------+------+ +----------+-----------+
| |
+------------+-----------+
|
v
+----------------------------------+
| 寫進正式商品主檔 |
| 發票名稱群組 -> SI -> BI |
+----------------+-----------------+
|
v
+----------------------------------+
| 通過發布條件才對外輸出 |
| 給搜尋 / 分析 / Barcode-PN / 下游|
+----------------+-----------------+
|
v
+----------------------------------+
| 已確認結果回饋下次判斷 |
| 讓後面的比對越來越準 |
+----------------------------------+
白話補充 / Plain-language notes:
BI 可以先理解成「這是什麼商品家族」。SI 可以先理解成「消費者實際買到的是哪個版本」。學名 / 俗名 / alias
是叫法,不是身份;叫法不同,不代表是不同商品。白話例子 / Plain-language example [Inference]
品客原味。Pringles Original 110g,通路 B 寫
品客原味洋芋片 110g,有人平常只叫它
黃罐品客。110g
單品版本,最後應收斂到同一個 SI。品客酸奶洋蔥 110g,因口味不同,通常不應和原味併成同一個
BI / SI。[Verified]+---------------------------+ +-----------------------------+ +-----------------------------+ +----------------------------+ +----------------------+
| 多來源資料 Sources |-->| 證據層與候選池 |-->| 審核與決策 |-->| 正式主檔 Gold Master |-->| 發布閘門與輸出 |
| 發票 / 通路 / 群眾 / 分類 | | 不讓單一來源直接定真相 | | auto 或 human final decision | | BI / SI / barcode / image | | serving / Barcode-PN |
+-------------+-------------+ +--------------+--------------+ | crowd 只補證據,不做定案 | +-------------+--------------+ +----------+-----------+
^ ^ +--------------+--------------+ | |
| | | v v
+--------------------------------+---------------------------------+ +----------------------------+ +----------------------+
已確認結果回饋下次判斷 | 下游應用 / 交付 | | 發布條件 |
| 搜尋 / 分析 / 映射輸出 | | tier / status / risk |
+----------------------------+ +----------------------+
老闆版例子 / Executive example [Inference]
白蘭氏雞精 可以視為一個商品家族 BI。白蘭氏雞精 單瓶 和
白蘭氏雞精 6 入,通常是同一個 BI 下的不同
SI。白蘭氏蜆精 單瓶
雖然品牌接近,但屬不同產品線,通常應另開 BI。身份判斷速查表 / Identity Decision Quick Reference
[Verified]
| 情況 | 正確判斷 | 不要做的事 | 例子 |
|---|---|---|---|
| 只是叫法不同,東西沒變 | 保持同一個 SI,把新叫法收進 alias
或證據層 |
不要因俗名不同就新開 BI / SI |
黃罐品客、Pringles Original 110g、品客原味 110g |
| 同一商品家族,只是入數或包裝層級不同 | 同 BI、新 SI |
不要把 6 入 直接併成單瓶 SI |
白蘭氏雞精 單瓶 vs 白蘭氏雞精 6 入 |
| 同品牌但口味或配方不同 | 通常不同 BI |
不要只因品牌相同就合併 | 可口可樂原味 vs 可口可樂 Zero |
| 同品牌但不同產品線 | 不同 BI |
不要把品牌當成身份鍵 | 白蘭氏雞精 vs 白蘭氏蜆精 |
| 證據不足或彼此打架 | 先留在候選 / 補證據 / 人工審核 | 不要急著新開 BI / SI |
發票只寫 完膳 250ml,看不出原味或香草 |
速查表例子欄為示意,用來幫助判讀,不是正式主檔資料
[Inference]
[Verified]+----------------------+ +------------------------+ +---------------------------+
| Source: Invoice | | Source: channel_master | | Source: Crowd / Taxonomy |
| 發票資料 | | 通路候選與證據 | | 群眾 / 品牌分類提示 |
+----------+-----------+ +-----------+------------+ +-------------+-------------+
| | |
v v v
+--------------------------------------------------------------------------------------+
| Bronze / Raw |
| raw_invoice_lines | raw_channel_master | raw_crowd_submissions | raw_*_taxonomy |
+-----------------------------------------------+--------------------------------------+
|
v
+--------------------------------------------------------------------------------------+
| Silver / Working |
| invoice_lines |
| invoice_name_clusters + cluster_members |
| evidence_observations |
| mapping_candidates + mapping_candidate_evidence |
| review_tasks + review_answers |
+----------------------------+----------------------------+----------------------------+
^ ^ ^
| | |
+--------------------+ +----------------------+ +----------------------+
| Rule / ML / AI | | Crowd Tasks | | Human Review |
| 候選與 tier 提議 | | 僅補證據,不做定案 | | 最終確認 / 駁回 / 新建 |
+--------------------+ +----------------------+ +----------------------+
|
v
+--------------------------------------------------------------------------------------+
| Gold / Master |
| base_items (BI) | sellable_items (SI) | item_components | item_aliases |
| item_barcodes | sellable_item_images | mapping_decisions |
+-----------------------------------------------+--------------------------------------+
|
v
+--------------------------------------------------------------------------------------+
| Serving Gate / Publish |
| item_tier + mapping_tier + status + blocking_flags -> serving views / exports |
| vw_confirmed_invoice_mapping | vw_sellable_item_master | vw_base_item_master |
+--------------------------------------------------------------------------------------+
|
v
+--------------------------------------------------------------------------------------+
| Downstream |
| Barcode-PN export | search | analytics | other consumers |
+--------------------------------------------------------------------------------------+
Feedback loop / 回饋迴圈
mapping_decisions + confirmed history ------------------------------> candidate build
sellable_items (existing SI universe) ------------------------------> candidate build
命名層補充 / Naming-layer note [Verified]
BI / SI 是身份層,不等於名稱。sellable_items.sellable_name、base_items.canonical_name
可視為較正式的學名。item_aliases、raw_pn、通路標題、群眾常用叫法屬於俗名
/ alias / 原始名稱層。SI 可以掛多個名稱;名稱不同,不代表要新開
BI / SI。工程版總體例子 / Engineering architecture example
[Inference]
可口可樂 Zero、通路標題
Coca-Cola Zero 330ml、Coke Zero 330ml 24 入箱、圖片與條碼。Zero 330ml 單罐、Zero 330ml 24 入箱、可口可樂原味 330ml 單罐。Zero 的單罐
SI;原味 因配方不同,不應被併進同一個
BI。[Verified]invoice_lines
|
v
invoice_name_clusters
|
v
shortlisted candidates
2 to 5 candidate SI + score + veto + source-risk check
|
+--> score >= 85
| gap >= 12
| no veto
| no high-risk source dominates
| ------------------------------> gold_master_publish
| -> mapping_decisions.auto_confirmed
|
+--> score 60 to 84
| or candidate conflict
| or high-risk source dominates
| ------------------------------> under_review
|
+--> score < 60
| or missing evidence
| ------------------------------> needs_more_evidence
|
+--> no candidate survives
------------------------------> new_item_triage / reject_all review
under_review
new_item_triage / reject_all review
|
v
human final decision
|
+--> confirm_candidate -------> gold_master_publish
| -> mapping_decisions.review_confirmed
|
+--> reject_all --------------> gold_master_publish
| -> mapping_decisions.rejected
|
+--> needs_more_evidence ----> return to evidence_observations / review_tasks
|
+--> create_new_item --------> gold_master_publish
-> create / update BI and SI
-> mapping_decisions.needs_new_item
決策流例子 / Decision-flow example [Inference]
統一麥香奶茶 300ml
若名稱、條碼、圖片都一致,可能直接走自動確認。統一麥香奶茶 300ml 6 入組
頁面,會因包裝污染風險進人工審核。統一麥香紅茶 300ml
不應因同品牌、同容量就直接併到奶茶。統一麥香豆奶燕麥新配方 300ml,而現有候選都不合,才可能走
new_item_triage。[Verified]bronze_invoice_ingest -----------+
|
v
silver_invoice_prepare ---------------------+
|
bronze_channel_master_ingest -----------------------------------------+--> silver_candidate_build --> silver_review_sync --> gold_master_publish
|
bronze_crowd_ingest --------------------------------------------------+
raw_brand_taxonomy / raw_category_taxonomy ---------------------------> silver_invoice_prepare
raw_brand_taxonomy / raw_category_taxonomy ---------------------------> silver_candidate_build
AI / crowd / human answers -------------------------------------------> silver_review_sync
all jobs -------------------------------------------------------------> ops_job_monitor
Job DAG 例子 / Job DAG example [Inference]
bronze_channel_master_ingest 早上可能先收進
桂格完膳原味 250ml 與
桂格完膳香草 250ml。silver_candidate_build 會把 原味 與
香草 分開看待,不因同品牌就直接合併。完膳 250ml,silver_review_sync
會把這種口味不足的案例送進 review queue。[Verified]+----------------------+ +----------------------+ +----------------------+ +----------------------+
| Rule / ML / AI |----->| Silver Candidates |----->| Human Review |----->| Gold Master Publish |
| 可提議 candidate/tier | | proposed state only | | 最終確認 / 駁回 / 新建 | | 寫正式 decision |
| 不可最終定案 | | 不等於 final truth | | 可升降 mapping/item | | 建 / 更新 BI / SI |
+----------+-----------+ +----------+-----------+ +----------+-----------+ +----------+-----------+
^ ^ ^ |
| | | v
+----------+-----------+ +----------+-----------+ +----------+-----------+ +----------------------+
| Crowd Tasks |----->| review_answers / |----->| review_tasks backlog | | Serving Gate |
| 只補證據與拆解任務 | | evidence_observations| | queue ownership | | 發布前再過條件 |
| 不可建正式商品 | | 不可直接定案 | | review by human | | tier / status / risk |
+----------------------+ +----------------------+ +----------------------+ +----------+-----------+
|
v
+----------------------+
| Downstream Consumers |
| read-only outputs |
+----------------------+
角色與權限 / Role and permission summary:
Rule / ML / AI:可提議
mapping_tier、item_tier,不可最終裁決
[Verified]Crowd:只做
candidate_confirm、barcode_confirm、image_confirm、new_item_triage
任務,不可輸入最終商品代碼與 tier [Verified]Human Review:可確認
mapping_tier、item_tier,也可做
confirm_candidate、reject_all、needs_more_evidence、create_new_item
[Verified]Gold Master Publish:負責寫正式
mapping_decisions,必要時建立或更新 BI / SI
[Verified]Serving Gate:只發布符合
mapping_tier、item_tier、status
與風險條件的結果 [Verified]治理例子 / Governance example [Inference]
御茶園日式綠茶 550ml 常被簡寫成
御茶園綠茶,這屬命名層證據。綠茶 550ml 的
SI。御茶園麥萃麥茶 590ml,最後仍要由 human review 定案;crowd
和 AI 都不能直接發布正式 mapping。[Verified]+--------------------------------------------------------------------------------------------------+
| Unity Catalog: item_master |
+--------------------------------+--------------------------------+--------------------------------+
| |
v v
+----------------------------+ +----------------------------+
| item_master.bronze | | item_master.silver |
| raw_invoice_lines | | invoice_lines |
| raw_channel_master | | invoice_name_clusters |
| raw_crowd_submissions | | cluster_members |
| raw_brand_taxonomy | | evidence_observations |
| raw_category_taxonomy | | mapping_candidates |
+-------------+--------------+ | review_tasks / answers |
| +-------------+--------------+
| |
+---------------+------------------+
|
v
+----------------------------+
| item_master.gold |
| base_items |
| sellable_items |
| item_barcodes |
| sellable_item_images |
| mapping_decisions |
+-------------+--------------+
|
v
+----------------------------+
| serving views / exports |
| vw_confirmed_invoice_mapping|
| vw_sellable_item_master |
| vw_base_item_master |
| Barcode-PN export |
+-------------+--------------+
|
v
+----------------------------+
| downstream outputs |
| search / analytics / API |
+----------------------------+
環境與產出邊界 / Environment and output boundary notes:
Bronze / Silver / Gold 邏輯環境與
Unity Catalog 結構,不是 dev / staging / prod
實體環境 [Verified]Barcode-PN export
已被明確定義為重要輸出方向,但具體檔案格式、命名規則與交付介面在目前文件中未定義
[Unknown]gold 基礎表與 gold serving view
必須分離,避免未達發布條件的資料直接外流 [Verified]環境與產出例子 / Environment and output example
[Inference]
舒潔抽取衛生紙 100 抽 x 10 包 若已達發布條件,可出現在
serving view 與 export。舒潔廚房紙巾 60 張 x 6 捲 若仍有風險旗標或 tier
不足,就不應被發布。BI = base_items,商品家族 / product family
[Verified]SI = sellable_items,可售版本 / sellable
version [Verified]Bronze / Silver / Gold = 表層級 / table layer
[Verified]item_tier / mapping_tier = 記錄成熟度 / record maturity
[Verified]Serving Gate / Publish = Gold 到對外 view / export
的發布條件層 [Verified]學名 / 俗名 / alias =
命名層,不是身份層;它們描述叫法,不取代 BI / SI
[Verified]