fix: use incremental diff per iteration instead of cumulative base diff
After each iteration's _commit_iteration, record the new HEAD SHA and use it as the diff anchor for the next iteration. Previously capture_diff always diffed against the initial base commit, causing every iteration to return the same full cumulative diff — reviewers couldn't see what changed between iterations, leading to repeated feedback and stuck FAIL loops. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -413,11 +413,13 @@ class TestInvokeAgenticRuntime(unittest.TestCase):
|
||||
|
||||
|
||||
class TestPipelineHelpers(unittest.TestCase):
|
||||
@patch("cross_eval.worktree.get_current_head", return_value="a" * 40)
|
||||
@patch("cross_eval.worktree.commit_worktree", return_value=True)
|
||||
def test_commit_iteration_logs_only_when_committed(self, mock_commit: MagicMock) -> None:
|
||||
def test_commit_iteration_logs_only_when_committed(self, mock_commit: MagicMock, mock_head: MagicMock) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
_commit_iteration(Path(tmpdir), "review-fix", 2, "PASS")
|
||||
new_head = _commit_iteration(Path(tmpdir), "review-fix", 2, "PASS")
|
||||
mock_commit.assert_called_once()
|
||||
self.assertEqual(new_head, "a" * 40)
|
||||
|
||||
def test_snapshot_repo_state_includes_untracked_digest(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
|
||||
Reference in New Issue
Block a user