Skip to content

更正 README 過時的 AI_PROVIDER 說法,行號連結重算並加上檢查腳本 - #17

Merged
k66inthesky merged 1 commit into
mainfrom
claude/0g-tech-competition-deploy-lv08or
Sep 10, 2026
Merged

k66inthesky merged 1 commit into
mainfrom
claude/0g-tech-competition-deploy-lv08or

Conversation

@k66inthesky

Copy link
Copy Markdown
Contributor

說法反了

給評審那張表寫著「把 AI_PROVIDER 改成 0g 就能整支切過去」—— 在 #16 之後這是反的,0g 已經是預設。改成說明兩者預設都指向 0G Compute,以及為什麼不能是 OpenAI:對打的 agent 不在 enclave 裡的話,「整場都是同一位」這個主張就不成立。

三個行號連結指到不相干的地方

範圍還在檔案內,所以肉眼看不出來:

原本 改成 原本落在哪
shard.js#L62-L84 #L85-L107 註解中段
agent.js#L173-L256 #L188-L291 evidence 那段把它往後推了
ai.js#L16-L65 #L16-L68 函式尾巴被截掉

另外把 _shared.js 的供應商工廠拆成兩個連結,分別指 providerConfig 與 ogComputeConfig。

加了檢查腳本

這種漂移一天內發生兩次了(上一次「賽道二 indexer 唯讀查詢」點下去落在兩個無關的小工具函式上),所以加 scripts/check-links.mjs:

npm run check:links

它不驗「行號是不是原本想指的東西」—— 那需要人判斷 —— 只驗一件機械可查的事:起始行要是函式或註解區塊的開頭、結束行要是收尾。行號位移之後這兩個條件幾乎必然被破壞,所以抓得到。

15 個行號連結都落在函式起訖上。

🤖 Generated with Claude Code

https://claude.ai/code/session_015NBxaWtzqEX3i8NvoZEeq3


Generated by Claude Code

「把 AI_PROVIDER 改成 0g 就能整支切過去」在 #16 之後是反的 —— 0g 已經是預設。
改成說明兩者預設都指向 0G Compute,以及為什麼不能是 OpenAI(對打的 agent 不在
enclave 裡的話,「整場都是同一位」這個主張就不成立)。

行號連結有三個在 #16 之後指到不相干的地方(範圍還在檔案內,所以肉眼看不出來):
  functions/api/og/shard.js#L62-L84   → #L85-L107   (原本落在註解中段)
  functions/api/agent.js#L173-L256    → #L188-L291  (evidence 那段把它往後推)
  public/js/ai.js#L16-L65             → #L16-L68
另外 _shared.js 的供應商工廠拆成兩個連結,分別指 providerConfig 與 ogComputeConfig。

這種漂移一天內發生兩次了,所以加 scripts/check-links.mjs(npm run check:links)。
它不驗「行號是不是原本想指的東西」—— 那需要人判斷 —— 只驗一件機械可查的事:
起始行要是函式或註解區塊的開頭、結束行要是收尾。位移之後這兩個條件幾乎必然被破壞。
現在 15 個連結全過。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015NBxaWtzqEX3i8NvoZEeq3
@k66inthesky
k66inthesky marked this pull request as ready for review September 10, 2026 08:36
Copilot AI lite review requested due to automatic review settings September 10, 2026 08:36
@k66inthesky
k66inthesky merged commit 03e48d7 into main Sep 10, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

新增的檢查腳本在起始行號無效時可能直接拋錯崩潰,且 README 仍有一列對敵方 agent 預設供應商的描述與實際行為不一致。

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

這個 PR 更新 README 中關於 AI_PROVIDER/0G Compute 預設行為的說明、修正多個行號連結的範圍,並新增一個腳本用來自動檢查 README 的行號連結是否因為程式碼位移而漂移失效。

Changes:

  • 更正 README 對 AI_PROVIDER 與 0G Compute/OpenAI 預設指向的敘述,並重算多個行號連結範圍。
  • 新增 scripts/check-links.mjs,提供 npm run check:links 檢查 README 行號連結是否落在合理的「區塊起訖」位置。
  • 在 package.json 中加入 check:links script。
File summaries
File Description
scripts/check-links.mjs 新增 README 行號連結漂移檢查腳本。
README.md 修正 AI_PROVIDER 說法與行號連結範圍,並補上檢查指令說明。
package.json 新增 check:links npm script。
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/check-links.mjs
Comment on lines +42 to +52
const a = Number(aStr);
const b = Number(bStr);
if (b > lines.length) {
console.log(`❌ ${key} 檔案只有 ${lines.length} 行`);
bad += 1;
continue;
}

const head = lines[a - 1].trim();
const tail = lines[b - 1].trim();
const ok = START_OK.test(head) && END_OK.test(tail);
Comment thread README.md
| **0G Chain**<br>鏈上回驗 | **這是整個專案的重點**:按了按鈕、錢包沒報錯,不代表資料真的在鏈上。所以再用 `eth_getTransactionByHash` 把交易讀回來、反解 calldata、跟本地碎片逐欄比對,四項全對才打勾。 | [`functions/api/og/verify.js#L19-L47`](https://github.com/ConsssLab/web/blob/main/functions/api/og/verify.js#L19-L47) · [`functions/api/og/verify.js#L49-L104`](https://github.com/ConsssLab/web/blob/main/functions/api/og/verify.js#L49-L104) |
| **0G Chain**<br>鏈況與網路切換 | 標題頁即時顯示 Galileo 區塊高度;chainId **從鏈上實際讀回來**校準而不是寫死(0G 換過 chain ID 16601→16602,寫死會讓切鏈整個失敗)。 | [`functions/api/og/status.js#L59-L157`](https://github.com/ConsssLab/web/blob/main/functions/api/og/status.js#L59-L157) · [`public/js/og.js#L167-L220`](https://github.com/ConsssLab/web/blob/main/public/js/og.js#L167-L220) |
| — **敵方 AI agent**<br>(OpenAI,非 0G) | 對戰時每回合都要叫一次,需要低延遲,所以另外走 OpenAI。模型輸出一律當不可信資料重新過濾。 | [`functions/api/agent.js#L173-L256`](https://github.com/ConsssLab/web/blob/main/functions/api/agent.js#L173-L256) · [`public/js/ai.js#L16-L65`](https://github.com/ConsssLab/web/blob/main/public/js/ai.js#L16-L65) |
| — **敵方 AI agent**<br>(OpenAI,非 0G) | 對戰時每回合都要叫一次,需要低延遲,所以另外走 OpenAI。模型輸出一律當不可信資料重新過濾。 | [`functions/api/agent.js#L188-L291`](https://github.com/ConsssLab/web/blob/main/functions/api/agent.js#L188-L291) · [`public/js/ai.js#L16-L68`](https://github.com/ConsssLab/web/blob/main/public/js/ai.js#L16-L68) |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants