caelum0x b5da90b795 feat: discovery Pareto frontier + regime/uncertainty stages + benchmark execution engine
Discovery (§8/§16): add Pareto-frontier construction over the multi-objective
candidate score vector (DiscoveryResult.frontier + pareto_frontier()), opt-in
regime segmentation (result.regimes), and bootstrap uncertainty attachment;
CLI --pareto/--regimes flags. Benchmarks: a real generate->run->score->classify
execution engine driving the compiled CLI (9 supported cases end-to-end, 21
honest capability boundaries).

Rust workspace 329->342 tests; benchmarks +8 tests. clippy -D warnings clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 17:00:40 +03:00

47 lines
1.3 KiB
Python

"""Shared pytest fixtures for the benchmark runner tests.
The tests exercise the *real* runner against the *real* compiled CLI. If the
binary is not present, the fixture builds it once (offline); if that build is
impossible in the environment it skips with an explicit message rather than
silently passing.
"""
from __future__ import annotations
import sys
from pathlib import Path
import pytest
BENCHMARKS = Path(__file__).resolve().parents[1]
ROOT = BENCHMARKS.parent
SDK_SRC = ROOT / "python" / "lawsynth" / "src"
for candidate in (BENCHMARKS, SDK_SRC):
if str(candidate) not in sys.path:
sys.path.insert(0, str(candidate))
from _engine import EngineUnavailable, ensure_binary # noqa: E402
@pytest.fixture(scope="session")
def benchmarks_dir() -> Path:
return BENCHMARKS
@pytest.fixture(scope="session")
def repo_root() -> Path:
return ROOT
@pytest.fixture(scope="session")
def cli_binary() -> Path:
"""Return the compiled CLI binary, building it once or skipping cleanly."""
try:
return ensure_binary(ROOT, allow_build=True)
except EngineUnavailable as error:
pytest.skip(
"lawsynth CLI binary unavailable and offline build failed; "
f"run `cargo build -p lawsynth-cli` first ({error})"
)