Repository navigation
feat(greenfield): route implementation defects in the test feedback loop to their owner - #109
Merged
Merged
Conversation
…not just the first item
A single assert over many items (for example a list of response-time samples
compared with []) failed with 84 violations, and the fixer only ever saw the
first one: pytest's quiet mode elided the comparison diff ("Use -v to get more
diff") and truncated the assertion message. One fix-and-reverify cycle (about
1.5 hours on a sample web project) uncovered one violation at a time.
- Test runs that collect failure evidence (the implement-stage test feedback
probe, verify's per-file runtime checks and the test command) render
assertions fully (`verbosity_assertions=2`, set through the Python language
profile / adapter; test selection is unchanged).
- The full failure text is stored under CoDD's state directory (the feedback
stage's own directory; `.codd/verify` for verify) and the prompt excerpt
collapses lines that differ only in volatile tokens (numbers, hex ids) into
the first line plus a count, then applies the existing head/tail window and
names the stored file.
- Verify's per-file runtime output now gets the same window (it had none).
- The impl-blind test re-derivation prompt is unchanged (no verify output).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
…feedback loop Review follow-up for the first version of this PR. - Verify's runtime checks, test command and the Python verify profile are back to main's behaviour: CoDD no longer rewrites PYTEST_ADDOPTS, so a project's own default (for example a wrapper that sets it only when unset) keeps selecting the same tests, and flaky-restart classification is unchanged. - The feedback probe raises assertion verbosity inside the pytest process it is already injected into; selection, counts and verdicts are unchanged. - Grouping masks only long numbers (5+ digits), long hex runs, UUIDs and addresses, so short codes such as HTTP 401 vs 403 stay distinct. - The window is applied after joining the excerpts returned to one owner (unstable-test outputs no longer pile up past it). - A suite timeout's partial output and a pre-collection error (for example a broken root conftest) are stored in full as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
… route implementation defects to their owner The implement-stage test feedback loop gave each failing test's owner its own round trip: AI fix, a full candidate suite, verdict. On a sample web project that was 10 full suites (155 of the stage's 213 minutes). Failures caused by the implementation were returned to the test's author, who cannot write the implementation, and were rejected round after round. Per round now: - Every owner with returned failures fixes first; one candidate suite then judges all of them. Gates are unchanged and judged per owner from that suite and per-case isolation (counts are limited to the cases returned to the owner and new failures in files that owner changed). - A regression is attributed by removing one owner's candidate at a time and re-running the regressed case in isolation; if that is ambiguous, candidates are re-applied one by one; suite-only signals fall back to per-owner suites. After removing a culprit, the kept tree gets one confirmation suite, which is reused as the next round's start suite when tree and environment match. - An owner can name a cause outside its outputs through a claim file in the loop's state directory; the failure then goes, in the same round, to the task the test depends on that declares that file. A failure whose innermost frame is in such an implementation file goes there from the first round; a failure whose fingerprint did not move after the test owner's attempt goes there in the next round. An implementation owner fixing another task's test may not write any test file; its change is kept when the returned case passes or its failure fingerprint moves with test files byte-unchanged. - Completed but unjudged candidates are saved as pending, so an interrupted round resumes without re-asking finished owners. - The failure text after a rejected or removed candidate is passed to that owner's next request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
…ures for evidence Second review follow-up. - Runs that decide verdicts (the round suite, candidate suites and isolation runs) use pytest's default assertion rendering again: a more verbose AssertionError text could change a test that matches on it. - When a returned failure shows pytest's elision markers (kept as data in the pytest feedback adapter), that one case is re-run once with full assertion rendering, inside the existing isolation time budget. Its text is used only as evidence, and only when it failed at the same place and phase. - Masked tokens use placeholders that do not occur in ordinary output, so a literal "#" can no longer collide with a masked number. - Fixed instructions to the owner stay outside the window; only the evidence is windowed. - The loop's state directory is never treated as a declared output (a `**/*.txt` glob no longer makes stored evidence writable or part of the existing-output context). - An aborted start after earlier commands reported cases still stores the full output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
…fix/c-stage-batch # Conflicts: # codd/greenfield/implement_test_feedback.py
Third review follow-up. - Evidence re-runs (full assertion rendering for an elided failure) run only after the round's verdict isolation runs are done and only within the time that is left, so they never push a verdict run out of the budget. While other owners are still unprocessed in the round, the original text is returned. - When the re-run text is used, the original (verdict) text comes first and the re-run text follows, labelled as a re-run whose different rendering can show a different reason. - Elision markers are matched after trimming surrounding whitespace (`--tb=native` indents them). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
… one by one Review follow-up (10 blocking findings on judging every owner from one combined suite: another owner's change could hide a failure, make a useless change look like progress, or swap a correct fix for the culprit). - After every returned owner has made its fix, one combined suite screens them: an owner whose returned cases neither passed nor (for an implementation owner) moved is rejected and restored without a suite of its own. The rest are accepted or rejected one at a time exactly as on main (each candidate on top of the accepted tree, gates 1-9 unchanged). - Routing to the implementation owner uses the dependencies of the task that declares the failing test file; a claim names the case ids it covers and applies only to them; CoDD's own appends (usage log) no longer turn a claim into "could not evaluate". - The failure fingerprint is the whole masked failure text; the failure after a rejected change is kept per owner and case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
…fix/c-stage-batch # Conflicts: # codd/ai_invoke.py
CoDD Audit❌ Audit failed to run. Check workflow logs. |
Coverage Matrix ReportProject: /home/runner/work/codd-dev/codd-dev
Totals: 369 axes, 176 covered signals (47.70%), 193 unknown. |
…g suite Second review follow-up. Running a combined screening suite changed shared state outside the tree (fixtures), the test environment and unstable-test observations before the individual verdicts, so later verdicts could differ from main's. The loop's acceptance flow is back to main's: each owner fixes, its own candidate suite runs, gates 1-9 decide. Kept: routing a failure to the implementation owner (innermost frame in an implementation file, a case-id claim file, or a fingerprint that did not move; only when exactly one target exists), that owner's test-tree fence and its fixed-or-moved acceptance, the failure after a rejected change per owner and case, and reuse of the round-start suite on the same tree and environment. Claims are read only from the state-directory JSON; the stdout observer is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
# Conflicts: # codd/greenfield/implement_test_feedback.py
… expectation Final review follow-up. - The round-start suite runs every round again (reusing it missed a changed symlink target inside the test environment). - An implementation owner fixing another task's test may not change files that test-tree symlinks point to. - A stored claim's destination is re-validated against the current task list and dependencies every time it is used. - An implementation owner's change counts as progress when the set of failure fingerprints of the returned case changed (one of a call and a teardown failure going away is progress). - No expectation of an existing test on main changed; the added scenarios live in tests/greenfield/test_implement_test_feedback_batch.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
yohey-w
marked this pull request as ready for review
December 1, 2026 10:54
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
In the implement-stage test feedback loop, every failing test's owner got its own round trip (AI fix, a full candidate suite, verdict), and the round only accepted a change that lowered that owner's failure count. On a sample web project the loop ran 10 full suites (155 of its 213 minutes); 5 of 8 attempts were rejected as "did not decrease". One test failed first on an implementation defect (
web.py), was returned to the test's author (who cannot write the implementation) twice, and reached verify unfixed.Builds on #107 (full failure evidence), now on
main.Change
The loop's acceptance flow is exactly
main's (each owner fixes, its own candidate suite runs, the nine gates decide). Added:Earlier versions also screened all owners with one combined suite and reused the round-start suite; review showed running a combined suite changes shared state, the environment and unstable-test records before the individual verdicts, and that environment fingerprints can miss a changed symlink target, so both were dropped. Judging candidates in separate copies is left for a later design.
Guarantees kept
Write fences (test owners cannot write the implementation; an implementation owner fixing another task's test cannot write tests), the rule against fitting expectations to observed behavior, all nine acceptance gates, unstable-test handling, the impl-blind test re-derivation and the verify stage are unchanged.
Measured
On a copy of the failed sample run reset to "implement tasks done, feedback loop and verify not started", an earlier version of this branch plus #107's first version: the loop returned the response-time test with both preparation errors visible, its author fixed both in one attempt (round 1: 1 -> 0), and verify passed first time:
Greenfield autopilot: SUCCESS,exit=0. Feedback loop + verify took 75 minutes (the original run spent 419 minutes in those two stages and failed). The project's own suite afterwards: 956 passed, 0 failed, 0 skipped.Tests
tests/greenfield/test_implement_test_feedback_batch.py(suite count and order identical tomain, routing to the implementation owner, claims and their re-validation, the test-tree and symlink fence, fingerprint-set progress, history per owner and case, unstable observations first seen in a candidate suite).tests/greenfield tests/repair tests/languages: 1670 passed, 3 skipped (local dogfood replay artifacts absent; same onmain).🤖 Generated with Claude Code
https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb