feat(debate): 분산 토론 시스템 — Wiki.js 기반 통신, AG 프로젝트 스캐폴딩, handler 리팩토링

- wiki_client.py: find_page()를 singleByPath 직접 조회로 교체 (O(1))
- debate-agent/: gemini/opus AG 프로젝트 생성 (GEMINI.md + wiki_debate.py + /start)
- debate_handler.py: 로컬 파일 I/O → Wiki.js API 전환, _sync_wiki() 삭제
- response 페이지 매 턴 초기화 (누적 방지)
This commit is contained in:
2026-03-21 20:52:12 +09:00
parent 5fb4179857
commit cbc9db0439
10 changed files with 633 additions and 89 deletions

View File

@@ -110,12 +110,25 @@ class WikiClient:
)
async def find_page(self, path: str) -> Optional[WikiPage]:
"""경로로 페이지 찾기 (없으면 None)."""
pages = await self.list_pages()
for p in pages:
if p.path == path:
return await self.get_page(p.id)
return None
"""경로로 페이지 찾기 (없으면 None). singleByPath 직접 조회."""
query = """
query ($path: String!) {
pages { singleByPath(path: $path, locale: "ko") {
id, path, title, content, updatedAt, description,
tags { tag }
}}
}
"""
data = await self._query(query, {"path": path})
p = data.get("pages", {}).get("singleByPath")
if not p:
return None
tags = [t["tag"] for t in p.get("tags", [])]
return WikiPage(
id=p["id"], path=p["path"], title=p["title"],
content=p.get("content", ""), updated_at=p.get("updatedAt", ""),
description=p.get("description", ""), tags=tags,
)
# ──────────────────────────────────────
# 생성 / 수정 / 삭제