|
|
@@ -5,6 +5,7 @@ import re
|
|
|
from collections.abc import Mapping, Sequence
|
|
|
from datetime import UTC, datetime
|
|
|
from pathlib import Path
|
|
|
+from types import SimpleNamespace
|
|
|
from typing import Any, cast
|
|
|
|
|
|
import pytest
|
|
|
@@ -35,9 +36,9 @@ from script_build_host.application.phase_two_planning import (
|
|
|
)
|
|
|
from script_build_host.domain.artifacts import (
|
|
|
ArtifactKind,
|
|
|
+ DirectionArtifact,
|
|
|
DirectionGoal,
|
|
|
EvidenceRecordV1,
|
|
|
- ScriptDirectionArtifactV1,
|
|
|
)
|
|
|
from script_build_host.domain.errors import PhaseTwoBoundaryNotReady
|
|
|
from script_build_host.domain.phase_two_artifacts import (
|
|
|
@@ -128,6 +129,11 @@ def _contract(
|
|
|
"max_external_queries": 40,
|
|
|
"max_no_improvement": 3,
|
|
|
},
|
|
|
+ "goal_ids": (
|
|
|
+ []
|
|
|
+ if kind in {ScriptTaskKind.DIRECTION, ScriptTaskKind.DECODE_RETRIEVAL}
|
|
|
+ else ["goal-1"]
|
|
|
+ ),
|
|
|
"supersedes_decision_ids": list(supersedes),
|
|
|
"candidate_closure_decision_refs": list(closure),
|
|
|
"adopted_decision_ids": list(adopted),
|
|
|
@@ -235,12 +241,16 @@ class _ScriptedExecutor:
|
|
|
task_id=context["task_id"],
|
|
|
attempt_id=context["attempt_id"],
|
|
|
spec_version=context["spec_version"],
|
|
|
- artifact=ScriptDirectionArtifactV1(
|
|
|
- goals=(DirectionGoal("goal-1", "Use a concrete reversal to reveal the topic"),),
|
|
|
- evidence_refs=(str(evidence_refs[0]["uri"]),),
|
|
|
- legacy_markdown=(
|
|
|
- "# Direction\n\nReveal the topic through one concrete reversal."
|
|
|
+ artifact=DirectionArtifact(
|
|
|
+ goals=(
|
|
|
+ DirectionGoal(
|
|
|
+ "goal-1",
|
|
|
+ "Use a concrete reversal to reveal the topic",
|
|
|
+ "A visible reversal makes the direction observable",
|
|
|
+ success_criteria=("the opening reveals one concrete reversal",),
|
|
|
+ ),
|
|
|
),
|
|
|
+ evidence_refs=(str(evidence_refs[0]["uri"]),),
|
|
|
),
|
|
|
)
|
|
|
elif kind in {ScriptTaskKind.STRUCTURE, ScriptTaskKind.PARAGRAPH}:
|
|
|
@@ -522,6 +532,7 @@ async def test_sql_phase_two_dynamic_replacement_compose_portfolio_and_boundary(
|
|
|
coordinator=coordinator,
|
|
|
bindings=bindings,
|
|
|
contracts=contract_store,
|
|
|
+ artifacts=artifacts,
|
|
|
closure_gate=boundary,
|
|
|
)
|
|
|
coordinator.set_executor(
|
|
|
@@ -1042,6 +1053,7 @@ async def test_same_task_cannot_reserve_parallel_attempts(tmp_path: Path) -> Non
|
|
|
coordinator=coordinator,
|
|
|
bindings=cast(Any, _SingleBinding(root)),
|
|
|
contracts=FileScriptTaskContractStore(tmp_path / "contracts"),
|
|
|
+ artifacts=cast(Any, SimpleNamespace()),
|
|
|
)
|
|
|
task = await planning.plan_script_tasks(
|
|
|
contract_payloads=(_contract(ScriptTaskKind.DIRECTION),),
|