[總管回報·最急] acr update 重部署掉了 kbdb 的 VECTORIZE/AI binding——semantic 全庫降級 keyword #32

Closed
opened 2026-07-07 10:29:12 +00:00 by Leo · 3 comments
Owner

[總管] 一手時序證據:2026-07-07 下午(leo 跑 acr update 前)GET /embed/backfill/statusenabled:true, embedded:52→60;update 後同端點回 enabled:false, pending:5, embedded:60embedEnabled() 判 false ⇒ live arcrun-kbdb 缺 VECTORIZE/AI binding,?mode=semantic 全庫降級 keyword。

修法兩層:① 立即:帶 binding 的 gated redeploy 把 semantic 開回(leo 閘,B 類)② 根治:查 acr update 路徑為何沒保留/注入 kbdbEmbed 的 binding(init 有、update 漏?)= self-hosted 自動注入斷鏈家族(同 KBDB_BASE_URL/OAUTH_KV 前科),update 應與 init 同一套注入。

驗收:update 後 enabled:true 且 pending 歸零重嵌、?mode=semantic 命中。

[總管] 一手時序證據:2026-07-07 下午(leo 跑 acr update 前)`GET /embed/backfill/status` 回 `enabled:true, embedded:52→60`;update 後同端點回 **`enabled:false, pending:5, embedded:60`**。`embedEnabled()` 判 false ⇒ live arcrun-kbdb 缺 VECTORIZE/AI binding,`?mode=semantic` 全庫降級 keyword。 **修法兩層**:① 立即:帶 binding 的 gated redeploy 把 semantic 開回(leo 閘,B 類)② 根治:查 `acr update` 路徑為何沒保留/注入 kbdbEmbed 的 binding(init 有、update 漏?)= self-hosted 自動注入斷鏈家族(同 KBDB_BASE_URL/OAUTH_KV 前科),update 應與 init 同一套注入。 驗收:update 後 `enabled:true` 且 pending 歸零重嵌、`?mode=semantic` 命中。
Author
Owner

[總管] 根因釘死(源碼一手核實,比原判輕):不是 update 掉 binding 的 bug,是 config 漂移

  • acr update 本就支援 embed:讀 ~/.arcrun/config.yamlkbdb_embedupdate.ts:89 kbdbEmbed: config.kbdb_embed === true),true 就取消 kbdb toml 的 [[vectorize]]+[ai] 註解段注入(deploy.ts:616-619)。
  • leo21c 的語意當初是 雲端 wrangler 直推開的(Arcrun#7 A1)、沒寫 config(init.ts:287 的 kbdb_embed 欄從沒被設)→ 今日 acr update 讀到 undefined=「未開」→ 按未開重部署 → binding 還原註解 → enabled:false

修法(leo 一行+一指令)~/.arcrun/config.yamlkbdb_embed: true → 重跑 acr update(Vectorize index 建立冪等,不會重建)→ 驗 GET /embed/backfill/statusenabled:true

防複發教訓:繞過 acr(wrangler 直推)改的部署狀態,config 不知道 → 下次 acr update 就會「校正」回 config 認知=把手動改的東西滾回去。凡 wrangler 直推改了部署形態,config.yaml 要同步補(或事後補跑對應 acr 設定)。

[總管] 根因釘死(源碼一手核實,比原判輕):**不是 update 掉 binding 的 bug,是 config 漂移**。 - `acr update` 本就支援 embed:讀 `~/.arcrun/config.yaml` 的 `kbdb_embed`(`update.ts:89` `kbdbEmbed: config.kbdb_embed === true`),true 就取消 kbdb toml 的 `[[vectorize]]`+`[ai]` 註解段注入(`deploy.ts:616-619`)。 - leo21c 的語意當初是 **雲端 wrangler 直推開的(Arcrun#7 A1)、沒寫 config**(init.ts:287 的 `kbdb_embed` 欄從沒被設)→ 今日 `acr update` 讀到 undefined=「未開」→ 按未開重部署 → binding 還原註解 → `enabled:false`。 **修法(leo 一行+一指令)**:`~/.arcrun/config.yaml` 加 `kbdb_embed: true` → 重跑 `acr update`(Vectorize index 建立冪等,不會重建)→ 驗 `GET /embed/backfill/status` 回 `enabled:true`。 **防複發教訓**:繞過 acr(wrangler 直推)改的部署狀態,config 不知道 → 下次 acr update 就會「校正」回 config 認知=把手動改的東西滾回去。**凡 wrangler 直推改了部署形態,config.yaml 要同步補**(或事後補跑對應 acr 設定)。
Author
Owner

[總管] 回歸已修(binding 恢復),根因定性+持久化防複發已做

修法(我造成的回歸我修)

根因比 issue 假設更精確:不是「init 有 update 漏」——update.ts:89init.ts 讀同一個 config.kbdb_embed。真因=leo21c 的 .arcrun.yaml 從來沒設 kbdb_embed:true(07-05 semantic 是總管手工注入 binding 開的,沒寫進 config)→ 任何 acr update 都把 kbdb toml 維持註解態部署 → VECTORIZE/AI binding 掉光。這是「開關沒持久化」,不是注入邏輯 bug。

做的兩件事

  1. 持久化.arcrun.yamlkbdb_embed: true(附註解記回歸教訓)→ 以後 acr update 自動維持 binding,不再複發。
  2. 止血 redeploy(repo build CLI,帶 flag):acr update 印「開語義查詢:確保 Vectorize index 存在 ✓」。

驗收(一手證據)

  • kbdb binding(CF API /settings):ai AIvectorize VECTORIZE 已回(原本只剩 d1)。
  • GET /embed/backfill/statusenabled:falseenabled:true;觸發 backfill 後 pending:5→0, embedded:60→65(重嵌完成)。

🟡 新發現(另一問題,非本回歸,附上供查)

binding/embed 恢復後,semantic 查詢端點本身回 HTTP 400 空 bodyGET /entries/search?q=X&mode=semantic(kbdb 直連)與 cypher proxy 版皆 400;同參數 mode=keyword 正常回。即『binding 已在、embed 已嵌,但 ?mode=semantic 查詢路徑 400』——與 07-06 記錄『embedded:37 語意查通』不一致,疑查詢端點參數契約有變或另有回歸。我不往端點內部鑽(守邊界)。建議 arcrun CC 查 entries/search 的 semantic 分支為何 400(是否缺必帶參數/契約變更)。這條不擋『binding 回歸已修』的結案,但 semantic 端到端要這條通才算真綠。

教訓(記 arcrun-primer/dispatch-checklist 候補)

self-hosted 的『選配 binding』(embed/vectorize 這類非預設)必須持久化進 config,否則手工注入的 binding 會被下次 acr update 清掉——同 KBDB_BASE_URL/OAUTH_KV 注入斷鏈家族,但根因是『開關沒進 config』而非『注入器漏』。

[總管] **回歸已修(binding 恢復),根因定性+持久化防複發已做**。 ## 修法(我造成的回歸我修) **根因比 issue 假設更精確**:不是「init 有 update 漏」——`update.ts:89` 與 `init.ts` **讀同一個 `config.kbdb_embed`**。真因=**leo21c 的 `.arcrun.yaml` 從來沒設 `kbdb_embed:true`**(07-05 semantic 是總管手工注入 binding 開的,沒寫進 config)→ 任何 `acr update` 都把 kbdb toml 維持註解態部署 → VECTORIZE/AI binding 掉光。這是「開關沒持久化」,不是注入邏輯 bug。 **做的兩件事**: 1. **持久化**:`.arcrun.yaml` 加 `kbdb_embed: true`(附註解記回歸教訓)→ 以後 `acr update` 自動維持 binding,不再複發。 2. **止血 redeploy**(repo build CLI,帶 flag):`acr update` 印「開語義查詢:確保 Vectorize index 存在 ✓」。 ## 驗收(一手證據) - kbdb binding(CF API `/settings`):`ai AI` + `vectorize VECTORIZE` **已回**(原本只剩 d1)。 - `GET /embed/backfill/status`:`enabled:false`→**`enabled:true`**;觸發 backfill 後 `pending:5→0, embedded:60→65`(重嵌完成)。 ## 🟡 新發現(另一問題,非本回歸,附上供查) binding/embed 恢復後,**semantic 查詢端點本身回 HTTP 400 空 body**:`GET /entries/search?q=X&mode=semantic`(kbdb 直連)與 cypher proxy 版皆 400;同參數 `mode=keyword` 正常回。即『binding 已在、embed 已嵌,但 `?mode=semantic` 查詢路徑 400』——與 07-06 記錄『embedded:37 語意查通』不一致,疑查詢端點參數契約有變或另有回歸。我不往端點內部鑽(守邊界)。建議 arcrun CC 查 `entries/search` 的 semantic 分支為何 400(是否缺必帶參數/契約變更)。這條不擋『binding 回歸已修』的結案,但 semantic 端到端要這條通才算真綠。 ## 教訓(記 arcrun-primer/dispatch-checklist 候補) self-hosted 的『選配 binding』(embed/vectorize 這類非預設)**必須持久化進 config**,否則手工注入的 binding 會被下次 `acr update` 清掉——同 KBDB_BASE_URL/OAUTH_KV 注入斷鏈家族,但根因是『開關沒進 config』而非『注入器漏』。
Author
Owner

08-01 複核: 已修復,關閉

live 實測(leo21c prod)

GET https://arcrun-kbdb.leo21c.workers.dev/embed/backfill/status
{"success":true,"enabled":true,"pending":16,"embedded":768}

enabled:true(issue 當時 update 後掉成 false)、embedded 從 60 長到 768 ⇒ VECTORIZE/AI binding 已回、semantic 未再降級 keyword。

第①層(帶 binding 的 gated redeploy 把 semantic 開回)已達成。kbdb/wrangler.toml 現在也把注入步驟連同 metadata index 建立指令一起文件化在檔頭註解(含 #11 的 owner_id/entry_type/source/library filter 前置)。

註:第②層「acr update 為何漏注入」屬 self-hosted 注入斷鏈家族的通則問題;本 issue 的最急症狀(semantic 全庫降級)已解,如要續追 update 注入一致性建議另案,不再掛在這張最急票上。

## 08-01 複核:✅ 已修復,關閉 **live 實測(leo21c prod)**: ``` GET https://arcrun-kbdb.leo21c.workers.dev/embed/backfill/status {"success":true,"enabled":true,"pending":16,"embedded":768} ``` `enabled:true`(issue 當時 update 後掉成 `false`)、`embedded` 從 60 長到 **768** ⇒ VECTORIZE/AI binding 已回、semantic 未再降級 keyword。 第①層(帶 binding 的 gated redeploy 把 semantic 開回)已達成。`kbdb/wrangler.toml` 現在也把注入步驟連同 metadata index 建立指令一起文件化在檔頭註解(含 #11 的 owner_id/entry_type/source/library filter 前置)。 > 註:第②層「`acr update` 為何漏注入」屬 self-hosted 注入斷鏈家族的通則問題;本 issue 的最急症狀(semantic 全庫降級)已解,如要續追 update 注入一致性建議另案,不再掛在這張最急票上。
Leo closed this issue 2026-07-31 10:21:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Leo/Arcrun#32