diff --git a/control_plane/projects/management/commands/self_bootstrap.py b/control_plane/projects/management/commands/self_bootstrap.py index c2de5eb..ddf5891 100644 --- a/control_plane/projects/management/commands/self_bootstrap.py +++ b/control_plane/projects/management/commands/self_bootstrap.py @@ -62,9 +62,9 @@ class Command(BaseCommand): milestone=milestone, task_type="implementation", status=TaskStatus.READY, - goal="Add a V2 self-bootstrap status management command that prints recent self-bootstrap artifacts and tests.", - acceptance_criteria=["management command exists", "tests pass", "accepted commit is recorded"], - max_retries=1, + goal="Add a V2 self-bootstrap status management command that prints recent self-bootstrap artifacts and tests. Tests must be deterministic and must not depend on database insertion order unless the command explicitly orders results.", + acceptance_criteria=["management command exists", "deterministic tests pass", "accepted commit is recorded"], + max_retries=2, ) qwen_resource = Resource.objects.filter(provider="local_inference", is_active=True).first() if qwen_resource is None: diff --git a/runtime_loop/autonomous_task_loop.py b/runtime_loop/autonomous_task_loop.py index f645e5e..bc10133 100644 --- a/runtime_loop/autonomous_task_loop.py +++ b/runtime_loop/autonomous_task_loop.py @@ -67,6 +67,11 @@ class AutonomousTaskLoop: status="RUNNING", ) context = self.context_builder.build_for_task(task, Path(worktree.worktree_path)) + context["previous_attempts"] = list( + task.attempts.exclude(id=attempt.id).order_by("attempt_number").values( + "attempt_number", "status", "coder_result", "review_findings", "judge_findings" + ) + ) attempt.context_snapshot = self._scrub_context(context) attempt.save(update_fields=["context_snapshot", "updated_at"])