Prepare bounded casebuilding trial with explicit phase stop

This commit is contained in:
Nico committed 2026-10-14 22:42:27 +02:00
1 parent 02f63702ba
commit 0dcd2ab6df
3 files changed
+102 -3

No files matched your search

+23
View File
@@ -65,6 +65,18 @@ def test_initial_builder_interpretation_and_hypotheses(case_setup):
assert adapter.calls == 2
@pytest.mark.parametrize("phase,dispatches,calls",[("case",1,0),("interpretation",2,1),("interpretation",10,1)])
def test_stop_after_confirmed_phase_and_safe_repeated_command(case_setup,phase,dispatches,calls):
store=case_setup[0]
adapter=PipelineAdapter();g=gateway(adapter)
result=asyncio.run(drive(store,g,*CASE,max_dispatches=dispatches,stop_after=phase))
assert result["status"]=="PHASE_COMPLETE" and adapter.calls==calls
with PackageReader(result["package"]) as reader:
assert not reader.manifest["artifacts"].get("hypotheses")
replay=asyncio.run(drive(store,g,*CASE,max_dispatches=10,stop_after=phase))
assert replay["package"]==result["package"] and adapter.calls==calls
def test_retry_returns_without_sleep_and_blocked_budget_kept(tool_case):
store = tool_case[0]
adapter = LoopAdapter(unavailable=True)
@@ -105,6 +117,17 @@ def test_cli_rejects_ambiguous_identity():
main(["run", "--package", "one.zip", "--case-id", "a", "--package-id", "b"])
def test_cli_interpretation_stop_exits_successfully(case_setup,monkeypatch,capsys):
import viano_bug_analysis.trial as trial
store=case_setup[0];adapter=PipelineAdapter()
monkeypatch.setattr(trial,"preflight",lambda path:gateway(adapter))
command=["run","--workspace",str(store.workspace.root),"--case-id",CASE[0],"--package-id",CASE[1],
"--stop-after","interpretation","--max-dispatches","6"]
assert main(command)==0
assert json.loads(capsys.readouterr().out)["status"]=="PHASE_COMPLETE" and adapter.calls==1
assert main(command)==0 and adapter.calls==1
def test_cli_run_connects_telemetry_and_publishes(tool_case, monkeypatch, capsys):
import viano_bug_analysis.trial as trial
store = tool_case[0]