You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[M7] Local LLM provider, generated patches, and benchmark - #7
Add a synchronous OpenAI-compatible provider restricted to loopback HTTP. It disables proxy use and redirects, bounds response size, sanitizes transport errors, and validates tool-call names and the supported JSON Schema subset.
Configure the same local provider for document and code RAG; keep fake providers as the default when no endpoint is configured.
Add model-generated unified diffs to the existing coding loop. Validate patch structure and paths before git apply; reject tool calls, binary/mode changes, path traversal, .git and symlink targets. Invalid patches consume a bounded repair attempt and are fed back as diagnostics.
Require RAG citations to match the worktree base commit. The Base benchmark uses a bounded snapshot from the exact Git tree; RAG uses grounded citations; RAG + test loop allows up to two repairs.
Add a strict benchmark dataset that contains only task IDs and instructions; the runner never loads prepared patch files.
Update runbook, architecture, security, evaluation and milestone docs.
Validation
Ruff check and format check passed.
Python 3.11: 78 passed, 22 skipped.
Python 3.13: 78 passed, 22 skipped.
Fake HTTP server tests make no external AI calls.
The 22 local skips require PostgreSQL/Docker; the PR CI should run those integration/security gates.
Limits
No real inference server, GGUF/model, GPU, offline environment, latency or quality benchmark was run here. Embeddings remain fake. The coding benchmark is a small synthetic baseline, not evidence of production quality or hardware performance.
Commit: 478d625. CI действительно зелёный: 100 passed на Python 3.11 и 3.13. Перед merge нужно исправить два сценария.
1. Major — patch_applied относится к любой попытке, а остальной результат — к последней
src/local_coding_copilot/coding/orchestrator.py:74-87 устанавливает patch_applied=True, но не сбрасывает флаг при reset() в начале следующей попытки. При этом build, test, diff и changed_files описывают последнюю попытку. Флаг затем используется в coding_evaluation.py:159,269,292 для patch_apply_rate.
Я воспроизвёл на временном checkout PR: первая попытка применяет valid patch и падает на тесте, repair возвращает invalid patch. Результат:
То есть JSON и audit утверждают, что patch применён, хотя итоговый worktree пуст; метрика смешивает «применён хотя бы раз» с результатами последней попытки. Нужно явно разделить семантику: сбрасывать patch_applied для текущего/итогового diff и, если нужна метрика ever-applied, хранить её отдельно. Добавьте regression test на valid → failed test → invalid repair.
2. Medium — ошибка Git cleanup прерывает весь benchmark
GitWorktreeManager.remove() (coding/worktree.py:75-87) использует subprocess.run(..., check=True), поэтому при неудаче выбрасывает subprocess.CalledProcessError. Но coding_evaluation.py:150-154 перехватывает только OSError и ValueError.
В результате одна ошибка git worktree remove не попадает в предусмотренное поле worktree_cleanup_error, а аварийно завершает весь runner; остальные задачи и итоговый отчёт теряются. Перехватите CalledProcessError на границе benchmark или преобразуйте его в ожидаемую ошибку менеджера и добавьте тест, что выполнение продолжается, а тип ошибки сохраняется в результате задачи.
Других блокеров в provider/path validation я не нашёл. Ограничение endpoint до loopback, запрет redirects/proxy, проверки diff и отсутствие утверждений о проверенном GPU/offline выглядят согласованно. Реальная модель и качество по-прежнему требуют отдельной проверки на ПК.
Формальный Request changes недоступен, потому что GitHub не разрешает запрашивать изменения на PR того же аккаунта; это ревью опубликовано комментарием.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git apply; reject tool calls, binary/mode changes, path traversal,.gitand symlink targets. Invalid patches consume a bounded repair attempt and are fed back as diagnostics.Validation
Limits
No real inference server, GGUF/model, GPU, offline environment, latency or quality benchmark was run here. Embeddings remain fake. The coding benchmark is a small synthetic baseline, not evidence of production quality or hardware performance.