Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 0 additions & 179 deletions scripts/research/local_quant_research/decision.py

This file was deleted.

14 changes: 7 additions & 7 deletions scripts/research/local_quant_research/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ def validate_complete_run(
raise EvidenceError("completed output digest mismatch")

status = _load_json(Path(run_dir) / "project-status.json")
expected_status = {"schema_version": 1, "status": "complete", "reason_codes": []}
accepted_statuses = [
expected_status,
{**expected_status, "next_action": "human_confirmation_required"},
{**expected_status, "next_action": "return_to_caller"},
]
if status not in accepted_statuses:
expected_status = {
"schema_version": 1,
"status": "complete",
"reason_codes": [],
"next_action": "return_to_caller",
}
if status != expected_status:
raise EvidenceError("completed project status is invalid")
expected_files = {"run-manifest.json", "project-status.json"}
for item in outputs:
Expand Down
18 changes: 4 additions & 14 deletions scripts/research/local_quant_research/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,21 +683,12 @@ def _project_status(staging: Path) -> tuple[str, tuple[str, ...]]:
if status == "complete" and reasons:
raise EvidenceError("complete project status must not contain reasons")
next_action = document.get("next_action")
if next_action is not None and (
status != "complete"
or next_action
not in {"human_confirmation_required", "return_to_caller"}
):
expected_next_action = "return_to_caller" if status == "complete" else None
if next_action != expected_next_action:
raise EvidenceError("project status next_action is invalid")
return status, tuple(reasons)


def _project_next_action(staging: Path) -> str | None:
document = json.loads((Path(staging) / "project-status.json").read_text(encoding="utf-8"))
value = document.get("next_action")
return value if isinstance(value, str) else None


def _actual_staging_files(staging: Path) -> set[str]:
files: set[str] = set()
for path in staging.rglob("*"):
Expand Down Expand Up @@ -842,7 +833,7 @@ def run_project(config_path: Path, *, repo_root: Path) -> RunResult:
reused=True,
reasons=(),
stages=complete_stages,
next_action=_project_next_action(run_dir),
next_action="return_to_caller",
)

project_root.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -1013,7 +1004,6 @@ def run_project(config_path: Path, *, repo_root: Path) -> RunResult:

try:
project_status, reason_codes = _project_status(staging)
next_action = _project_next_action(staging)
except EvidenceError:
return _attempt_result(
repo_root=repo_root,
Expand Down Expand Up @@ -1148,5 +1138,5 @@ def run_project(config_path: Path, *, repo_root: Path) -> RunResult:
reused=False,
reasons=(),
stages=tuple(StageRecord(name, "complete") for name in _COMPLETE_STAGE_NAMES),
next_action=next_action,
next_action="return_to_caller",
)
98 changes: 0 additions & 98 deletions tests/local_quant_research/test_human_decision.py

This file was deleted.

Loading
Loading