Добавить dogfood-манифест stage-loop
This commit is contained in:
@@ -1265,6 +1265,32 @@ def handle_continue(args: argparse.Namespace) -> int:
|
||||
),
|
||||
}
|
||||
)
|
||||
elif next_action == "run_stage_loop_or_ingest_gui_run":
|
||||
if getattr(args, "run_id", None):
|
||||
ingest_summary = ingest_gui_run_review(args)
|
||||
payload.update(
|
||||
{
|
||||
"performed_action": "ingest_gui_run_from_cold_start",
|
||||
"ingest_summary": ingest_summary,
|
||||
"next_action": ingest_summary.get("next_action"),
|
||||
}
|
||||
)
|
||||
else:
|
||||
write_json(stage_dir / "stage_manifest.json", stage_manifest)
|
||||
write_text(stage_dir / "stage_manifest_source.txt", repo_relative(stage_manifest_path) + "\n")
|
||||
command = build_domain_pack_loop_command(args, stage_manifest, stage_dir)
|
||||
write_text(stage_dir / "domain_pack_loop.command.txt", " ".join(command) + "\n")
|
||||
payload.update(
|
||||
{
|
||||
"performed_action": "materialize_stage_run_dry_run",
|
||||
"domain_pack_loop_command": command,
|
||||
"next_action": next_action,
|
||||
"suggested_command": (
|
||||
"python scripts/stage_agent_loop.py run "
|
||||
"--manifest <stage_manifest.json>"
|
||||
),
|
||||
}
|
||||
)
|
||||
else:
|
||||
payload.update(
|
||||
{
|
||||
|
||||
@@ -778,6 +778,45 @@ class StageAgentLoopTests(unittest.TestCase):
|
||||
self.assertEqual(result["performed_action"], "wait_for_rerun_ingest")
|
||||
self.assertEqual(result["next_action"], "rerun_same_stage_or_gui_and_ingest_result")
|
||||
|
||||
def test_handle_continue_materializes_stage_run_from_cold_start(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
manifest_path = root / "stage.json"
|
||||
output_root = root / "stage_runs"
|
||||
stage_dir = output_root / "agent_loop"
|
||||
write_json(
|
||||
manifest_path,
|
||||
{
|
||||
"stage_id": "agent_loop",
|
||||
"module_name": "Agent Loop",
|
||||
"title": "Agent Loop",
|
||||
"pack_manifest": "docs/orchestration/demo_pack.json",
|
||||
},
|
||||
)
|
||||
|
||||
exit_code = stage_loop.handle_continue(
|
||||
stage_args(
|
||||
manifest=str(manifest_path),
|
||||
output_root=str(output_root),
|
||||
handoff=None,
|
||||
iteration_id=None,
|
||||
plan=None,
|
||||
coder_schema=str(root / "coder.schema.json"),
|
||||
execute_repair=False,
|
||||
run_id=None,
|
||||
session_file=None,
|
||||
sessions_dir=str(root / "sessions"),
|
||||
reports_dir=str(root / "reports"),
|
||||
review_output_dir=None,
|
||||
)
|
||||
)
|
||||
result = json.loads((stage_dir / "stage_continue_result.json").read_text(encoding="utf-8"))
|
||||
command_text = (stage_dir / "domain_pack_loop.command.txt").read_text(encoding="utf-8")
|
||||
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertEqual(result["performed_action"], "materialize_stage_run_dry_run")
|
||||
self.assertIn("run-pack-loop", command_text)
|
||||
|
||||
def test_resolve_stage_repair_iteration_auto_prepares_from_handoff(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
|
||||
Reference in New Issue
Block a user