chore(agents): improve ca-subtask-loop — add meaningful-change verification #2533

Merged
freemo merged 1 commits from improvement/agent-ca-subtask-loop-meaningful-change-check into master 2026-04-05 21:23:59 +00:00
+32
View File
@@ -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 <N> 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: