Harden non-success trajectory truncation
This commit is contained in:
@@ -49,20 +49,22 @@ def test_workflow_calls_boundary_then_scores_only_materialized_prefix() -> None:
|
||||
[
|
||||
{
|
||||
"sample_id": "sample-1",
|
||||
"checks": {
|
||||
"task_coverage": "INCOMPLETE",
|
||||
"final_patch_scope": "POLLUTED",
|
||||
"constraints": "RESPECTED",
|
||||
"claims_vs_observations": "CONTRADICTED",
|
||||
},
|
||||
"decision": "TRUNCATE",
|
||||
"candidate_block_id": "block-001",
|
||||
"truncate_before_turn": 5,
|
||||
"prefix_safe_before_boundary": True,
|
||||
"category": "PERSISTENT_WRONG_IMPLEMENTATION",
|
||||
"severity": "MAJOR",
|
||||
"state_effect": "UNRECOVERED",
|
||||
"evidence": [{"turn_id": 5, "quote": "BAD_SUFFIX_SENTINEL patch"}],
|
||||
"evidence_turns": [5],
|
||||
"reason": "The patch is not repaired.",
|
||||
},
|
||||
{
|
||||
"sample_id": "sample-1",
|
||||
"prefix_valid": True,
|
||||
"unrecovered_major_or_critical": False,
|
||||
"behavior_issues": [],
|
||||
"dimensions": {
|
||||
"planning": 15,
|
||||
@@ -71,7 +73,7 @@ def test_workflow_calls_boundary_then_scores_only_materialized_prefix() -> None:
|
||||
"progress": 12,
|
||||
"clarity_and_efficiency": 10,
|
||||
},
|
||||
"evidence": [],
|
||||
"evidence_turns": [],
|
||||
"reason": "The prefix is useful.",
|
||||
},
|
||||
]
|
||||
@@ -92,14 +94,18 @@ def test_hold_boundary_skips_quality_call() -> None:
|
||||
[
|
||||
{
|
||||
"sample_id": "sample-1",
|
||||
"checks": {
|
||||
"task_coverage": "COMPLETE",
|
||||
"final_patch_scope": "CLEAN",
|
||||
"constraints": "RESPECTED",
|
||||
"claims_vs_observations": "CONSISTENT",
|
||||
},
|
||||
"decision": "HOLD",
|
||||
"candidate_block_id": None,
|
||||
"truncate_before_turn": None,
|
||||
"prefix_safe_before_boundary": False,
|
||||
"category": "NONE",
|
||||
"severity": "NONE",
|
||||
"state_effect": "UNCLEAR",
|
||||
"evidence": [],
|
||||
"evidence_turns": [],
|
||||
"reason": "No clear unrepaired defect.",
|
||||
}
|
||||
]
|
||||
@@ -115,25 +121,28 @@ def test_keep_full_process_trajectory_is_scored() -> None:
|
||||
[
|
||||
{
|
||||
"sample_id": "sample-1",
|
||||
"checks": {
|
||||
"task_coverage": "COMPLETE",
|
||||
"final_patch_scope": "CLEAN",
|
||||
"constraints": "RESPECTED",
|
||||
"claims_vs_observations": "CONSISTENT",
|
||||
},
|
||||
"decision": "KEEP_FULL",
|
||||
"candidate_block_id": None,
|
||||
"truncate_before_turn": None,
|
||||
"prefix_safe_before_boundary": True,
|
||||
"category": "NONE",
|
||||
"severity": "NONE",
|
||||
"state_effect": "NONE",
|
||||
"evidence": [],
|
||||
"evidence_turns": [],
|
||||
"reason": "No unrepaired severe problem is visible.",
|
||||
},
|
||||
{
|
||||
"sample_id": "sample-1",
|
||||
"prefix_valid": True,
|
||||
"unrecovered_major_or_critical": False,
|
||||
"behavior_issues": [
|
||||
{
|
||||
"assistant_turn": 3,
|
||||
"turn_id": 3,
|
||||
"kind": "INEFFICIENCY",
|
||||
"severity": "MINOR",
|
||||
"recovered": True,
|
||||
"reason": "The inspection was somewhat broad.",
|
||||
}
|
||||
],
|
||||
@@ -144,7 +153,7 @@ def test_keep_full_process_trajectory_is_scored() -> None:
|
||||
"progress": 12,
|
||||
"clarity_and_efficiency": 10,
|
||||
},
|
||||
"evidence": [],
|
||||
"evidence_turns": [],
|
||||
"reason": "Useful despite minor inefficiency.",
|
||||
},
|
||||
]
|
||||
@@ -153,4 +162,4 @@ def test_keep_full_process_trajectory_is_scored() -> None:
|
||||
assert len(client.calls) == 2
|
||||
assert result["prefix"]["retained_turn_count"] == 6
|
||||
assert result["quality"]["local_score"]["issue_counts"]["inefficiencies"] == 1
|
||||
assert result["recommended_use"] == "PROCESS_PREFIX_CANDIDATE"
|
||||
assert result["recommended_use"] == "HOLD"
|
||||
|
||||
Reference in New Issue
Block a user