From 507c8faa908620fcfec20d4fc3237f7954586b59 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Fri, 3 Apr 2026 18:48:53 +0000 Subject: [PATCH] =?UTF-8?q?chore(agents):=20improve=20ca-subtask-loop=20?= =?UTF-8?q?=E2=80=94=20add=20meaningful-change=20verification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Approved proposal: #2443 Pattern: workflow_fix Evidence: PR #1513 contained only a single comment line as its entire diff, yet passed all quality gates (lint, typecheck, tests, coverage) and was submitted for review, consuming 8 independent reviewer slots. All quality gates verify code quality, not code existence — a change that adds only comments passes every gate. Fix: Add Step 1.5 (Meaningful Change Verification) between the implementer invocation and test-writing step. This checks git diff output for functional code changes and rejects attempts that produce empty, comment-only, or trivially small diffs (< 3 functional lines), immediately escalating to the next tier without wasting quality gate and reviewer capacity. ISSUES CLOSED: #2443 --- .opencode/agents/ca-subtask-loop.md | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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: