diff --git a/.opencode/agents/ca-subtask-loop.md b/.opencode/agents/ca-subtask-loop.md index 0c862f3ce..68d347aa7 100644 --- a/.opencode/agents/ca-subtask-loop.md +++ b/.opencode/agents/ca-subtask-loop.md @@ -109,6 +109,38 @@ Loop FOREVER: Pass: working directory, ref summary, subtask description, spec context, issue details, attempt_log (if attempt > 1) + # Step 1.5: Meaningful Change Verification + # Before running expensive quality gates, verify the implementer + # actually produced functional code changes — not just comments, + # whitespace, or empty diffs. + diff_output = run `git diff --stat` in working directory + full_diff = run `git diff` in working directory + + reject_attempt = false + if diff_output is empty: + reject_attempt = true # No changes at all + else: + # Analyze the diff content for meaningful changes + functional_lines = count lines in full_diff that: + - Are additions (start with "+") or deletions (start with "-") + - Are NOT comment-only lines (e.g., lines where the only content + after +/- is a Python comment starting with #) + - Are NOT whitespace-only changes + - Are NOT empty lines + - Are NOT import-only additions with no corresponding usage + if functional_lines < 3: + reject_attempt = true # Trivially small or comment-only change + + if reject_attempt: + Record in attempt_log: + "Attempt rejected: implementer produced no meaningful code + changes (empty diff, comment-only, or fewer than 3 functional + lines). Skipping quality gates and escalating." + # Reset the working directory to avoid polluting the next attempt + run `git checkout -- .` in working directory + # Continue to next attempt (escalation) WITHOUT running quality gates + continue + # Step 2: Write / Review ALL Tests IN PARALLEL # Launch ALL test writers simultaneously — do not serialize. invoke ALL of the following IN PARALLEL: