feat: codebase_qa + github_pr in Python (142 → 148 commands)
Closes the Python parity gap with rust. All major imba features now mirrored
EXCEPT live LLM hot-swap (python LLM backend is still env-driven, not voice-
switchable like rust).
dev_handlers.py (new, ~250 lines)
Codebase Q&A:
do_codebase_set "укажи проект C:\path" → memory_store.remember("codebase.root", ...)
do_codebase_where "какой проект сейчас"
do_codebase_ask "что делает функция X" / "найди в коде Y"
Walks the root with same caps as rust:
depth=3, files=30, file_bytes=4096, total=50000
Filters by extension (rs/py/ts/lua/go/...).
Skips .git/target/node_modules/__pycache__/.venv etc.
Feeds digest to Groq LLM with "senior reviewer" prompt.
GitHub PR review (requires `gh` CLI authenticated):
do_github_set_repo "текущий репо owner/repo" → memory_store
do_github_list_prs "какие пиары" → `gh pr list --json number,title,author`,
speaks count + first 3 titles
do_github_summarize_pr "разбери последний пиар" → gh pr view of latest open
PR, feeds title+body+diff stat to LLM, speaks 3-5
sentence review.
extensions.py — 6 new proxy handlers + import dev_handlers + set_speak wires it.
main.py — 6 new action_type dispatches in run_action.
commands.yaml (+6 entries, 142 → 148):
codebase_set, codebase_where, codebase_ask,
github_set_repo, github_list_prs, github_summarize_pr.
Tests: ast.parse passes for all .py files. yaml.safe_load = 148 entries.
PYTHON PARITY VS RUST IS NOW COMPLETE except:
✗ LLM hot-swap voice command (rust calls llm::swap_to + persists DB;
python config.GROQ_TOKEN is read once at startup)
✗ GUI pages (rust has Tauri+Svelte, python is console-only)
Everything else has full parity: memory / profiles / vision / macros /
scheduler / codebase Q&A / GitHub PR review / 14 utility packs.
This commit is contained in:
parent
6a328077bc
commit
31ff997782
4 changed files with 463 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ import profiles_store
|
|||
import macros_store
|
||||
import scheduler_store
|
||||
import vision_handler
|
||||
import dev_handlers
|
||||
|
||||
_speak_fn = print
|
||||
_set_clipboard_fn = None
|
||||
|
|
@ -36,6 +37,7 @@ def set_speak(fn):
|
|||
_speak_fn = fn
|
||||
scheduler_store.set_speak(fn)
|
||||
vision_handler.set_speak(fn)
|
||||
dev_handlers.set_speak(fn)
|
||||
|
||||
|
||||
def set_clipboard_fn(fn):
|
||||
|
|
@ -875,3 +877,31 @@ def do_interesting_fact(action, voice):
|
|||
except Exception as exc:
|
||||
print(f"[ext] fact LLM failed: {exc}")
|
||||
_speak("Не получилось получить факт.")
|
||||
|
||||
|
||||
# ── codebase Q&A (proxies to dev_handlers) ──────────────────────────────────
|
||||
|
||||
def do_codebase_set(action, voice):
|
||||
dev_handlers.do_codebase_set(action, voice)
|
||||
|
||||
|
||||
def do_codebase_where(action, voice):
|
||||
dev_handlers.do_codebase_where(action, voice)
|
||||
|
||||
|
||||
def do_codebase_ask(action, voice):
|
||||
dev_handlers.do_codebase_ask(action, voice)
|
||||
|
||||
|
||||
# ── GitHub PR (proxies to dev_handlers) ─────────────────────────────────────
|
||||
|
||||
def do_github_set_repo(action, voice):
|
||||
dev_handlers.do_github_set_repo(action, voice)
|
||||
|
||||
|
||||
def do_github_list_prs(action, voice):
|
||||
dev_handlers.do_github_list_prs(action, voice)
|
||||
|
||||
|
||||
def do_github_summarize_pr(action, voice):
|
||||
dev_handlers.do_github_summarize_pr(action, voice)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue