|
@@ -77,21 +77,14 @@ def _contract(
|
|
|
*,
|
|
*,
|
|
|
scope: str,
|
|
scope: str,
|
|
|
) -> dict[str, object]:
|
|
) -> dict[str, object]:
|
|
|
- output_schema = {
|
|
|
|
|
- "direction": "script-direction/v1",
|
|
|
|
|
- "decode-retrieval": "evidence-record/v1",
|
|
|
|
|
- }[kind]
|
|
|
|
|
return {
|
|
return {
|
|
|
- "schema_version": "script-task-contract/v1",
|
|
|
|
|
"task_kind": kind,
|
|
"task_kind": kind,
|
|
|
"scope_ref": scope,
|
|
"scope_ref": scope,
|
|
|
"intent_class": "explore",
|
|
"intent_class": "explore",
|
|
|
"objective": objective,
|
|
"objective": objective,
|
|
|
- "input_decision_refs": [],
|
|
|
|
|
- "base_artifact_ref": None,
|
|
|
|
|
- "write_scope": [scope],
|
|
|
|
|
|
|
+ "input_decision_ids": [],
|
|
|
|
|
+ "base_decision_id": None,
|
|
|
"gap_ref": None,
|
|
"gap_ref": None,
|
|
|
- "output_schema": output_schema,
|
|
|
|
|
"criteria": [
|
|
"criteria": [
|
|
|
{
|
|
{
|
|
|
"criterion_id": criterion_id,
|
|
"criterion_id": criterion_id,
|
|
@@ -99,20 +92,9 @@ def _contract(
|
|
|
"hard": True,
|
|
"hard": True,
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- "budget": {
|
|
|
|
|
- "max_attempts": 4,
|
|
|
|
|
- "max_tokens": 32000,
|
|
|
|
|
- "max_seconds": 900,
|
|
|
|
|
- "max_external_queries": 40,
|
|
|
|
|
- "max_no_improvement": 3,
|
|
|
|
|
- },
|
|
|
|
|
"goal_ids": [],
|
|
"goal_ids": [],
|
|
|
"supersedes_decision_ids": [],
|
|
"supersedes_decision_ids": [],
|
|
|
- "candidate_closure_decision_refs": [],
|
|
|
|
|
- "adopted_decision_ids": [],
|
|
|
|
|
- "held_or_rejected_decision_ids": [],
|
|
|
|
|
- "compose_order": [],
|
|
|
|
|
- "comparison_decision_refs": [],
|
|
|
|
|
|
|
+ "comparison_decision_ids": [],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -306,7 +288,7 @@ class _ScriptedLLM:
|
|
|
{
|
|
{
|
|
|
"goals": [
|
|
"goals": [
|
|
|
{
|
|
{
|
|
|
- "goal_id": "g1",
|
|
|
|
|
|
|
+ "client_key": "grounded-direction",
|
|
|
"statement": "make one grounded direction",
|
|
"statement": "make one grounded direction",
|
|
|
"rationale": "accepted evidence",
|
|
"rationale": "accepted evidence",
|
|
|
"success_criteria": ["the direction remains grounded"],
|
|
"success_criteria": ["the direction remains grounded"],
|
|
@@ -348,6 +330,9 @@ class _ScriptedLLM:
|
|
|
self.validated_artifact_kinds.append(kind)
|
|
self.validated_artifact_kinds.append(kind)
|
|
|
failed = spec["objective"] == "decode evidence" and spec["version"] == 1
|
|
failed = spec["objective"] == "decode evidence" and spec["version"] == 1
|
|
|
verdict = "failed" if failed else "passed"
|
|
verdict = "failed" if failed else "passed"
|
|
|
|
|
+ snapshot = prompt["artifact_snapshot"]
|
|
|
|
|
+ refs = [*snapshot["artifact_refs"], *snapshot["evidence_refs"]]
|
|
|
|
|
+ artifact_ref = refs[0]
|
|
|
return self.call(
|
|
return self.call(
|
|
|
"submit_validation",
|
|
"submit_validation",
|
|
|
{
|
|
{
|
|
@@ -357,6 +342,7 @@ class _ScriptedLLM:
|
|
|
"criterion_id": item["criterion_id"],
|
|
"criterion_id": item["criterion_id"],
|
|
|
"verdict": verdict,
|
|
"verdict": verdict,
|
|
|
"reason": "checked frozen snapshot",
|
|
"reason": "checked frozen snapshot",
|
|
|
|
|
+ "evidence_refs": [] if failed else [artifact_ref],
|
|
|
}
|
|
}
|
|
|
for item in spec["acceptance_criteria"]
|
|
for item in spec["acceptance_criteria"]
|
|
|
],
|
|
],
|
|
@@ -585,7 +571,8 @@ async def test_real_runner_phase_one_fail_revise_pass_direction_accept_then_root
|
|
|
assert llm.validated_artifact_kinds == ["evidence", "evidence", "direction"]
|
|
assert llm.validated_artifact_kinds == ["evidence", "evidence", "direction"]
|
|
|
assert legacy.status == BuildStatus.PARTIAL
|
|
assert legacy.status == BuildStatus.PARTIAL
|
|
|
assert legacy.direction.startswith("# Direction\n\n## Goals")
|
|
assert legacy.direction.startswith("# Direction\n\n## Goals")
|
|
|
- assert "### g1: make one grounded direction" in legacy.direction
|
|
|
|
|
|
|
+ assert "### goal-" in legacy.direction
|
|
|
|
|
+ assert ": make one grounded direction" in legacy.direction
|
|
|
assert "## Constraints" in legacy.direction
|
|
assert "## Constraints" in legacy.direction
|
|
|
assert publications.state == PublicationState.PUBLISHED
|
|
assert publications.state == PublicationState.PUBLISHED
|
|
|
assert bindings.active is not None
|
|
assert bindings.active is not None
|