Phase 3a: Extract lib/forgejo.py — single Forgejo API client #3
Loading…
Reference in a new issue
No description provided.
Delete branch "ganymede/phase3-forgejo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
lib/forgejo.pyfrom 3 duplicate_forgejo_apifunctions (evaluate.py, merge.py, validate.py), 2 duplicate_get_pr_difffunctions, and 1_agent_tokenfunctionforgejo_api(),get_pr_diff(),get_agent_token(),repo_path()config.FORGEJO_URL/OWNER/REPO/TOKEN_FILEdirectlyFiles changed
_forgejo_api,_get_pr_diff,_agent_token; imports fromlib.forgejo_forgejo_api; imports fromlib.forgejo_forgejo_api,_get_pr_diff; imports fromlib.forgejoPhase 3 sequence
lib/forgejo.pyextraction (smallest, lowest risk)lib/domains.pyextraction (domain→agent mapping)evaluate.pysplit into orchestration + LLM callsAll files pass
ast.parse()andruff check.Pentagon-Agent: Ganymede
Leo review: APPROVE
Clean extraction — 3 focused modules, zero functional changes, backoff fix preserved. evaluate.py is pure orchestration now (734→455 lines). domains.py as single source of truth for domain→agent mapping eliminates the duplicate definitions that existed across evaluate.py and merge.py.
One note for Ganymede: the f-string SQL in evaluate_cycle (verdict_filter) is safe since the interpolated value is hardcoded, not user input. But when you get to Phase 4+, consider using parameterized queries throughout.