From 9ba202f395cd43e6c5967644191f8f9a3ebef46f Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 15:25:53 +0200 Subject: [PATCH] kin: auto-commit after pipeline --- agents/prompts/reviewer.md | 52 +++++++++++++++++++++++++++++++++++++- agents/runner.py | 6 +++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/agents/prompts/reviewer.md b/agents/prompts/reviewer.md index 46a358a..8838e3c 100644 --- a/agents/prompts/reviewer.md +++ b/agents/prompts/reviewer.md @@ -61,15 +61,65 @@ Return ONLY valid JSON (no markdown, no explanation): } ``` -Valid values for `verdict`: `"approved"`, `"changes_requested"`, `"blocked"`. +Valid values for `verdict`: `"approved"`, `"changes_requested"`, `"revise"`, `"blocked"`. Valid values for `severity`: `"critical"`, `"high"`, `"medium"`, `"low"`. Valid values for `test_coverage`: `"adequate"`, `"insufficient"`, `"missing"`. If verdict is "changes_requested", findings must be non-empty with actionable suggestions. +If verdict is "revise", include `"target_role": "..."` and findings must be non-empty with actionable suggestions. If verdict is "blocked", include `"blocked_reason": "..."` (e.g. unable to read files). +## Verdict definitions + +### verdict: "revise" +Use when: the implementation **is present and reviewable**, but does NOT meet quality standards. +- You can read the code and evaluate it +- Something is wrong: missing edge case, convention violation, security issue, failing test, etc. +- The work needs to be redone by a specific role (e.g. `backend_dev`, `tester`) +- **Always specify `target_role`** — who should fix it + +```json +{ + "verdict": "revise", + "target_role": "backend_dev", + "reason": "Функция не обрабатывает edge case пустого списка, см. тест test_empty_input", + "findings": [ + { + "severity": "high", + "file": "core/models.py", + "line_hint": "get_items()", + "issue": "Не обрабатывается пустой список — IndexError при items[0]", + "suggestion": "Добавить проверку `if not items: return []` перед обращением к элементу" + } + ], + "security_issues": [], + "conventions_violations": [], + "test_coverage": "insufficient", + "summary": "Реализация готова, но не покрывает edge case пустого ввода." +} +``` + +### verdict: "blocked" +Use when: you **cannot evaluate** the implementation because of missing context or data. +- Handoff contains only task description but no actual code changes +- Referenced files do not exist or are inaccessible +- The output is so ambiguous you cannot form a judgment +- **Do NOT use "blocked" when code exists but is wrong** — use "revise" instead + +```json +{ + "verdict": "blocked", + "blocked_reason": "Нет исходного кода для проверки — handoff содержит только описание задачи", + "findings": [], + "security_issues": [], + "conventions_violations": [], + "test_coverage": "missing", + "summary": "Невозможно выполнить ревью: отсутствует реализация." +} +``` + ## Blocked Protocol If you cannot perform the review (no file access, ambiguous requirements, task outside your scope), return this JSON **instead of** the normal output: diff --git a/agents/runner.py b/agents/runner.py index ccc4060..f02a33d 100644 --- a/agents/runner.py +++ b/agents/runner.py @@ -848,6 +848,12 @@ def _save_decomposer_output( ).fetchone() if existing: skipped += 1 + _logger.info( + "task_decomposer: skip duplicate child task '%s' (parent=%s, existing=%s)", + title, + parent_task_id, + existing[0], + ) continue category = (item.get("category") or "").strip().upper() if category not in models.TASK_CATEGORIES: