fix(t130 🔴🔴): PORTAL_TEMPLATE_SEEDS 補 triplet——新實例總圖不再永遠空
真兇(總管探針定罪):seeds 只有 portal_user/portal_library,寫三元組回 400 'template not found: triplet' ⇒ 每個新用戶(含封測者)總圖必空。 geek6688 有是舊實例早期流程建過=拿它驗會假綠(已記 mistakes)。 呼叫路徑已驗:daemon/libraries、admin/libraries、init/seed 皆會 ensurePortalTemplates(冪等)。 vitest 24/24 綠(總管親跑)。(實作=子 CC;驗證+commit=總管)
This commit is contained in:
@@ -254,6 +254,21 @@
|
||||
- rag_chat:question ✅;namespace/kbdb_base 未核實(rag_chat workflow yaml 在 arcrun-rag,非本 repo)
|
||||
- takedown:不在 portal-data.ts,在 arcrun-rag 端(dashboard/安裝器),超出本 repo 範圍
|
||||
|
||||
- [x] **t130 新實例缺 triplet template → 總圖永遠空(2026-07-29,任務層小改)**:
|
||||
真因:`PORTAL_TEMPLATE_SEEDS` 只有 `portal_user`+`portal_library`;`rag_ingest_card.post_triplet`
|
||||
打 `POST /records {template:'triplet'}` → 新實例回 400「template not found: triplet」→ 三元組全滅。
|
||||
修:`portal-seeds.ts` 補 `triplet` seed(slots 來源:2026-07-19 kbdb_list_templates 核實 15 槽 + library)。
|
||||
呼叫路徑驗證(`ensurePortalTemplates` 全四掛點):
|
||||
① `POST /init/seed`(acr init 觸發)← 主線,新裝必經
|
||||
② `POST /portal/admin/bootstrap`(首次 admin 設定)
|
||||
③ `POST /portal/daemon/libraries`(daemon 登記資料夾→庫)
|
||||
④ `POST /portal/admin/libraries`(admin 手動新增庫)
|
||||
既有壞實例補救:任一掛點重跑即補建(冪等),e.g. 重跑 acr init 或 bootstrap。
|
||||
執行範圍:`cypher-executor/src/lib/portal-seeds.ts`(新增 triplet seed);
|
||||
`cypher-executor/tests/portal-auth.test.ts`(mockTemplatesExist 補 triplet + t130 3 條新測試);
|
||||
`cypher-executor/tests/portal-admin.test.ts`(mockTemplatesExist 補 triplet)。
|
||||
測試:純資料驗證(seed 含 triplet + 必要 slots)+冪等驗(已存→existing)+自動補建(404→POST→created)。
|
||||
|
||||
- [x] **t129 AI 問答出處重複一整頁——後端按 page_name 去重(2026-07-29,任務層小改)**:
|
||||
診斷:一張卡拆成 3-5 block,每 block 各回一筆 source(同 page_name)→ 前端列一整頁重複。
|
||||
選後端修(/portal/data/chat)理由:出處去重是資料清潔,跟前端渲染無關;改後端不需動 HTML。
|
||||
|
||||
Reference in New Issue
Block a user