feat: AI Self-Loop 專案骨架 — 爬站健檢版

完整實作建構順序 1-8(rule-based):
- Task Queue(SQLite):tasks/attempts/results + claim 防重複
- LLM 後端:OllamaBackend(num_ctx=32768) + LLMRouter
- Prompt Builder(YAML+Jinja2,重試注入 feedback)
- Context Assembler / Output Judge / Feedback Builder
- Loop Controller + Circuit Breaker
- Driver 層(BaseDriver + ApiClientDriver)
- Agent 層(BaseAgent + SiteHealthAgent:爬站/健檢/issue 生成)
- pipeline.py 入口,驗收:pending→done,output/ 落地

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Yellow
2026-06-14 17:35:54 +08:00
commit 27f98712ee
31 changed files with 1480 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# =============================================================================
# 憑證佔位檔(範本)。
#
# 使用方式:
# 1. 複製成 config/credentials.yaml已被 .gitignore 忽略,不會進版控)
# 2. 填入真實值,或留空改用環境變數
#
# 讀取優先序(見 src/config.py
# 環境變數 > credentials.yaml > 這裡的預設
#
# TODO(security): 日後要加密時,這個檔就是掛載解密層的位置——
# 例如改讀 SOPS / age / Vault介面不變。
# =============================================================================
credentials:
# 範例:未來若目標站需要登入或 API key 才能測
target_basic_auth:
username: "${TARGET_USER:-}"
password: "${TARGET_PASS:-}"
# 範例:若改用雲端 LLM
ollama_api_key: "${OLLAMA_API_KEY:-}"