Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Fix #3187: calibrate checks the report folder before the sweep, not after it

Niko122152ecf67ef712
diff --git a/strata_control/calibration.py b/strata_control/calibration.py
index a020f2f76..b158f741b 100644
--- a/strata_control/calibration.py
+++ b/strata_control/calibration.py
@@ -290,8 +290,10 @@ def _measure_locked(ref: str, path: Path, profile: dict | None, revision: str |
_exclusive_preflight(cfg, profile)
if output.exists() or output.is_symlink():
raise ProfileError("calibration report path already exists", 2)
+ if not output.parent.is_dir(): # before the 19 minute sweep, not after it (#3187)
+ raise ProfileError("report output directory does not exist", 5)
identity = _identity(path, cfg, profile, revision)
- cal = _full_folder("tools.calibrate")
+ cal =_full_folder("tools.calibrate")
execute = runner or cal.run
runner_cfg = _runtime_cfg(cfg, profile)
runner_cfg["exe"] = str(_resolved(cfg["exe"], cfg, path))
diff --git a/tests/terminal/test_calibration.py b/tests/terminal/test_calibration.py
index 127463d94..5ebc74ac7 100644
--- a/tests/terminal/test_calibration.py
+++ b/tests/terminal/test_calibration.py
@@ -326,6 +326,13 @@ class CalibrationFlowTests(unittest.TestCase):
["engine.calibrate.rollback", "engine.calibrate.apply",
"engine.calibrate.measure"])
+ def test_missing_report_folder_is_refused_before_the_sweep(self):
+ # #3187: the sweep takes ~19 minutes; the folder check must not wait until after it
+ for output in (self.root / "no-such-dir" / "report.json", self.config / "report.json"):
+ with self.assertRaisesRegex(profiles.ProfileError, "report output directory does not exist"):
+ calibration.measure("local", output, exclusive_ack=True,
+ runner=lambda *_a, **_k: self.fail("the sweep must not start"))
+
def test_calibration_rechecks_reviewed_digests_inside_operation_lock(self):
report_path = self.root / "pinned-calibration.json"
with self.assertRaisesRegex(profiles.ProfileError, "source changed after review"):