Make strong incumbent trigger validation phase

This commit is contained in:
2026-04-28 20:54:05 +08:00
parent 68cdaf56a8
commit 38ff4380e5
4 changed files with 53 additions and 8 deletions

View File

@@ -411,11 +411,16 @@ class CoreFlowTests(unittest.TestCase):
guard = context["convergence_guard"]["strong_incumbent"]
self.assertTrue(guard["guard_active"])
self.assertGreaterEqual(guard["incumbent_gain_vs_baseline"], 3.0)
self.assertTrue(
self.assertFalse(
context["convergence_guard"][
"should_stop_if_no_harness_can_justify_a_new_adjacent_probe"
]
)
self.assertEqual(
context["convergence_guard"]["reason"],
"strong_incumbent_requires_validation_probes",
)
self.assertIn("validate", guard["recommended_next_action"])
def test_trace_input_length_filter_keeps_only_matching_rows(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
@@ -2418,6 +2423,21 @@ class CoreFlowTests(unittest.TestCase):
["throughput: higher", "ttft: lower"],
)
def test_proposal_observation_accepts_object(self) -> None:
proposal = Proposal.from_dict(
{
"observation": {
"incumbent_trial": "trial-0002",
"boundary_signal": "tpot cliff",
},
"diagnosis": "validate incumbent",
"config_patch": {"env_patch": {}, "flag_patch": {"max-num-seqs": 160}},
"expected_effects": ["more TPOT headroom"],
}
)
self.assertIn('"incumbent_trial": "trial-0002"', proposal.observation)
self.assertEqual(proposal.diagnosis, "validate incumbent")
def test_proposal_accepts_should_stop(self) -> None:
proposal = Proposal.from_dict(
{