Fix plan-review worktree document tracking
This commit is contained in:
@@ -465,6 +465,9 @@ class TestExpandedClaimMarkers(unittest.TestCase):
|
||||
def test_changes_are_complete(self) -> None:
|
||||
self.assertTrue(_claims_file_changes("All changes are complete"))
|
||||
|
||||
def test_korean_change_summary_triggers(self) -> None:
|
||||
self.assertTrue(_claims_file_changes("모든 수정이 완료되었습니다. 아래는 변경 요약입니다."))
|
||||
|
||||
|
||||
class TestExpandedNoChangeMarkers(unittest.TestCase):
|
||||
"""New no-change markers prevent false positives."""
|
||||
@@ -484,6 +487,9 @@ class TestExpandedNoChangeMarkers(unittest.TestCase):
|
||||
def test_no_action_required(self) -> None:
|
||||
self.assertFalse(_claims_file_changes("No action required"))
|
||||
|
||||
def test_korean_no_change_marker(self) -> None:
|
||||
self.assertFalse(_claims_file_changes("변경할 필요 없음"))
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 6. Cross-iteration evidence propagation
|
||||
|
||||
@@ -16,6 +16,7 @@ from cross_eval.agent import (
|
||||
)
|
||||
from cross_eval.models import AgentConfig, AgentResult, ExecutionConfig, PipelineConfig, StepConfig
|
||||
from cross_eval.pipeline import (
|
||||
_copy_inputs_to_worktree,
|
||||
_commit_iteration,
|
||||
_execute_parallel_batch,
|
||||
_execute_step,
|
||||
@@ -118,6 +119,42 @@ class TestInvokeAgentRuntime(unittest.TestCase):
|
||||
self.assertEqual(ctx.exception.failure_type, "API_ERROR")
|
||||
self.assertIn("backend down", ctx.exception.raw_error)
|
||||
|
||||
|
||||
class TestWorktreeInputMapping(unittest.TestCase):
|
||||
def test_repo_local_plan_input_maps_to_tracked_worktree_path(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
repo = Path(tmpdir) / "repo"
|
||||
repo.mkdir()
|
||||
_init_git_repo(repo)
|
||||
(repo / "plan.md").write_text("plan v1\n", encoding="utf-8")
|
||||
subprocess.run(["git", "add", "plan.md"], cwd=repo, capture_output=True, check=True)
|
||||
subprocess.run(
|
||||
["git", "commit", "-m", "add plan"],
|
||||
cwd=repo,
|
||||
capture_output=True,
|
||||
check=True,
|
||||
)
|
||||
|
||||
worktree_dir = Path(tmpdir) / "wt"
|
||||
branch = "cross-eval/test-plan-review"
|
||||
worktree_path, _ = create_worktree(repo, worktree_dir, branch)
|
||||
try:
|
||||
config = PipelineConfig(
|
||||
inputs={"plan": repo / "plan.md"},
|
||||
preset_name="plan-review",
|
||||
)
|
||||
|
||||
_copy_inputs_to_worktree(config, worktree_path, base_cwd=repo)
|
||||
|
||||
self.assertEqual(config.inputs["plan"], worktree_path / "plan.md")
|
||||
finally:
|
||||
remove_worktree(base_cwd=repo, work_dir=worktree_path)
|
||||
subprocess.run(
|
||||
["git", "branch", "-D", branch],
|
||||
cwd=repo,
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
def test_classify_unknown_failure(self) -> None:
|
||||
failure_type, suggested_action = _classify_agent_failure("weird crash")
|
||||
self.assertEqual(failure_type, "UNKNOWN")
|
||||
|
||||
Reference in New Issue
Block a user