Compare commits

..

4 Commits

Author SHA1 Message Date
LittleYellow
4add7fa9d9 feat: ingest 進度可見性 + Ctrl-C 安全回復 (Closes #2)
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>
2026-07-23 23:45:59 +08:00
LittleYellow
04f4fd5ead feat: 新增 diag_refs — source_ref↔manifest 對帳診斷
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>
2026-07-23 23:45:23 +08:00
LittleYellow
d41cb49a45 fix: 加 .gitattributes 對 raw/** 關閉換行正規化
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>
2026-07-23 08:23:04 +08:00
LittleYellow
f9a0cd2369 feat: convert 新增 --verify 對帳模式 + 修復 Windows CRLF 使 hash 失準
- 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>
2026-07-23 08:21:39 +08:00

View File

@@ -1,27 +0,0 @@
name: Claude Assistant
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned, labeled]
pull_request_review:
types: [submitted]
jobs:
claude-response:
runs-on: yellow-zeabur-runner
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: markwylde/claude-code-gitea-action@v1.0.20
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
gitea_token: ${{ secrets.USER_TOKEN }}
claude_git_name: Claude
claude_git_email: claude@anthropic.com
path_to_claude_code_executable: /usr/local/bin/claude
env:
GITEA_SERVER_URL: https://yellow-git.zeabur.app