ci: 新增 Gitea Actions workflow 讓 Claude 回應 issue/PR 事件 #8

Merged
yellowadmin merged 1 commits from feat/convert-verify-reconcile into main 2026-07-25 06:19:16 +00:00
Owner

摘要

新增 .gitea/workflows/claude.yml,以 markwylde/claude-code-gitea-action@v1.0.20 掛在 issue/PR 事件上,讓 Claude 能回應留言與審查。

單一檔案、26 行、無既有檔案異動。

內容

  • 觸發事件:issue_comment(created)、pull_request_review_comment(created)、issues(opened/assigned/labeled)、pull_request_review(submitted)
  • runner label:yellow-zeabur-runner
  • GITEA_SERVER_URL 覆寫為 https://yellow-git.zeabur.app,避免容器內部連結 http://gitea:3000 在外部無法存取

前提

合併後要生效,需 repo 已設定 secrets ANTHROPIC_API_KEYUSER_TOKEN,且 runner label yellow-zeabur-runner 已註冊。

審核注意

  • 不含任何 raw/wiki/ 內容或 manifest 帳本變更(AGENTS.md §1.4/§14 不受影響)。
  • 本分支原本還帶著 4 個 commit,但那些內容已由 PR #1#5 squash 合併進 main;分支已重設到 main 之上,只保留這一支 commit。
## 摘要 新增 `.gitea/workflows/claude.yml`,以 `markwylde/claude-code-gitea-action@v1.0.20` 掛在 issue/PR 事件上,讓 Claude 能回應留言與審查。 單一檔案、26 行、無既有檔案異動。 ## 內容 - 觸發事件:`issue_comment`(created)、`pull_request_review_comment`(created)、`issues`(opened/assigned/labeled)、`pull_request_review`(submitted) - runner label:`yellow-zeabur-runner` - `GITEA_SERVER_URL` 覆寫為 `https://yellow-git.zeabur.app`,避免容器內部連結 `http://gitea:3000` 在外部無法存取 ## 前提 合併後要生效,需 repo 已設定 secrets `ANTHROPIC_API_KEY` 與 `USER_TOKEN`,且 runner label `yellow-zeabur-runner` 已註冊。 ## 審核注意 - 不含任何 `raw/`、`wiki/` 內容或 manifest 帳本變更(AGENTS.md §1.4/§14 不受影響)。 - 本分支原本還帶著 4 個 commit,但那些內容已由 PR #1 與 #5 squash 合併進 main;分支已重設到 main 之上,只保留這一支 commit。
yellowadmin added 5 commits 2026-07-25 05:53:38 +00:00
- convert.py --verify:純唯讀 re-hash 全部登記檔並掃未登記檔,
  報 missing/mismatch/unregistered,不一致退出碼 1(供刪除/竄改後稽核)
- 修 write_text 在 Windows 轉 \n→\r\n 使磁碟 bytes 與登記 SHA-256 不符
  (converted md 與 web 快照原始檔),改 write_bytes 寫入所登記的那份 bytes
- selfcheck 補 clean/missing/mismatch/unregistered 四情境(全程唯讀斷言)
- AGENTS.md §14 raw 完整性與修復流程 + §1.4 hash==磁碟 bytes 不變式

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
core.autocrlf=true 下,已 commit 的 raw/converted/*.md 於 Windows checkout
會被 git 轉成 CRLF,使磁碟 bytes 與 manifest 登記的 LF-hash 不符、--verify
誤報 mismatch——在 git 層抵銷了轉換器的 write_bytes 修復。以 `raw/** -text`
把「登記 hash == 磁碟 bytes」的不變式延伸到 git 的 checkin/checkout。
AGENTS.md §1.4 補記此機制。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lint 的「source_ref 不在 manifest」只報對不上、不辨成因。diag_refs 把每個
對不上的 source_ref 分成五類(hash 不符/路徑字串岔開/檔名 hash 後綴岔開/
檔在磁碟未登記/完全無對應),各附修法,讓「補帳本(§14.3)」與「修規則
(§12)」的相反處置不再混為一談。純唯讀、結束碼 0/1,可當搬機或改 manifest
後的閘門。附 selfcheck 驗五型別分類、結束碼與零寫檔。README §3.3/§6/§7/§8 同步。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
issue #2:--all-pending 長時間本地 Ollama 攝入全程靜默,使用者不確定有沒有在
跑、又不敢中斷。三處補強:

- 進度可見:每份來源印 [i/N] 起始行、長文件逐分段印「分段 k/n」、每個
  knowledge-item 印「↳ 新增/更新」、完成印「✓」,全部 flush=True 即時顯示。
  最會靜默的分段迴圈正是重點回報處。
- Ctrl-C 安全:KeyboardInterrupt 不是 Exception 子類,原本會略過善後、把使用者
  留在 ingest 分支且無指引。改為獨立攔截——commit 在迴圈之後,故 main 必然未受
  影響——印出可照做的回復指令(git checkout main && git stash -u &&
  git branch -D <branch>),以結束碼 130 收場。

selfcheck_ingest 新增:驗進度標記出現;驗中斷後 main HEAD 未動、停在 ingest
分支、且照文件回復指令實測能回到乾淨 main(驗結果可用,非字串存在,§13.4)。
README §7 補一列。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
以 markwylde/claude-code-gitea-action 掛在 issue_comment、
pull_request_review_comment、issues、pull_request_review 事件上。
GITEA_SERVER_URL 覆寫為外部網址,避免容器內部 http://gitea:3000 連結外部無法存取。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
yellowadmin force-pushed feat/convert-verify-reconcile from f2c6d41d70 to e8fc19bd54 2026-07-25 06:17:13 +00:00 Compare
yellowadmin changed title from feat: raw 完整性對帳(convert --verify)+ diag_refs + ingest 進度可見性 to ci: 新增 Gitea Actions workflow 讓 Claude 回應 issue/PR 事件 2026-07-25 06:17:29 +00:00
yellowadmin merged commit 45fd1d5874 into main 2026-07-25 06:19:16 +00:00
yellowadmin deleted branch feat/convert-verify-reconcile 2026-07-25 06:19:16 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yellowadmin/pp-qa-km#8