Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
chore: fix CI step (#70)
stefyi-4355b3578823baa3
diff --git a/ifixai/api.py b/ifixai/api.pyindex b3e8940..d26fa21 100644--- a/ifixai/api.py+++ b/ifixai/api.py@@ -1,29 +1,35 @@import loggingfrom ifixai._version import VERSION as __version__ # noqa: F401-from ifixai.harness.registry import ALL_SPECSfrom ifixai.core.concurrency import ConcurrencyGovernorfrom ifixai.core.fixture_loader import list_fixture_names, load_fixture-from ifixai.inspections.holdout_ids import generate_holdout_ids-from ifixai.judge.config import JudgeConfig-from ifixai.providers.base import ChatProvider-from ifixai.providers.resolver import resolve_provider, wrap_with_governance-from ifixai.reporting.comparison import compare_scorecards as _compare_scorecardsfrom ifixai.core.runner import (run_all,+)+from ifixai.core.runner import (run_selected as _run_selected,+)+from ifixai.core.runner import (run_single as _run_single,+)+from ifixai.core.runner import (run_strategic as _run_strategic,)from ifixai.core.types import (- TestResult,- InspectionSpec,ComparisonReport,EvaluationPipelineConfig,Fixture,+ InspectionSpec,ProviderConfig,+ TestResult,TestRunResult,)+from ifixai.harness.registry import ALL_SPECS+from ifixai.inspections.holdout_ids import generate_holdout_ids+from ifixai.judge.config import JudgeConfig+from ifixai.providers.base import ChatProvider+from ifixai.providers.resolver import resolve_provider, wrap_with_governance+from ifixai.reporting.comparison import compare_scorecards as _compare_scorecards_logger = logging.getLogger(__name__)diff --git a/ifixai/cli/_branding.py b/ifixai/cli/_branding.pyindex e4b1923..381f752 100644--- a/ifixai/cli/_branding.py+++ b/ifixai/cli/_branding.py@@ -4,8 +4,8 @@ import osimport sysimport threadingimport time+from collections.abc import Iterablefrom dataclasses import dataclass, field-from typing import Iterableimport click@@ -130,7 +130,7 @@ class CategoryProgress:_spinner: _Spinner | None = None@classmethod- def from_totals(cls, totals: dict[InspectionCategory, int]) -> "CategoryProgress":+ def from_totals(cls, totals: dict[InspectionCategory, int]) -> CategoryProgress:rows = {cat: _CategoryRow(category=cat, total=totals.get(cat, 0))for cat in _CATEGORY_ORDER@@ -203,7 +203,7 @@ class CategoryProgress:continuelabel = cat.value.upper().ljust(16)ratio = row.done / row.total if row.total else 0.0- filled = int(round(ratio * _BAR_WIDTH))+ filled = round(ratio * _BAR_WIDTH)bar = _BLOCK_FULL * filled + _BLOCK_EMPTY * (_BAR_WIDTH - filled)colored_bar = _truecolor(bar, _CATEGORY_COLORS[cat], bold=True)count = f"{row.done}/{row.total}".rjust(7)diff --git a/ifixai/cli/compare.py b/ifixai/cli/compare.pyindex c79db55..d3b442d 100644--- a/ifixai/cli/compare.py+++ b/ifixai/cli/compare.py@@ -3,14 +3,14 @@ import jsonimport click-from ifixai.reporting.comparison import compare_scorecardsfrom ifixai.core.types import (- InspectionCategory,- TestResult,CategoryScore,+ InspectionCategory,TestGrade,+ TestResult,TestRunResult,)+from ifixai.reporting.comparison import compare_scorecards@click.command()diff --git a/ifixai/cli/config_file.py b/ifixai/cli/config_file.pyindex 73caaa4..e9dff78 100644--- a/ifixai/cli/config_file.py+++ b/ifixai/cli/config_file.py@@ -57,7 +57,8 @@ def load_config(start_dir: Path | None = None) -> RunConfig | None:except yaml.YAMLError as exc:raise ValueError(f"{CONFIG_FILENAME} is not valid YAML: {exc}") from excif not isinstance(raw, dict):- raise ValueError(f"{CONFIG_FILENAME} must contain a mapping at the top level.")+ # All config-load failures surface as ValueError so callers catch one type.+ raise ValueError(f"{CONFIG_FILENAME} must contain a mapping at the top level.") # noqa: TRY004try:return RunConfig(**raw)except ValidationError as exc:diff --git a/ifixai/cli/list_cmd.py b/ifixai/cli/list_cmd.pyindex 016cda8..61a604a 100644--- a/ifixai/cli/list_cmd.py+++ b/ifixai/cli/list_cmd.py@@ -1,6 +1,7 @@import click-from ifixai.api import list_tests as get_tests, list_fixtures as get_fixture_names+from ifixai.api import list_fixtures as get_fixture_names+from ifixai.api import list_tests as get_testsfrom ifixai.cli import uifrom ifixai.core.fixture_loader import load_fixturefrom ifixai.harness.registry import (@@ -151,6 +152,8 @@ def _short_category(full_category: str) -> str:def _load_fixture_domain(name: str) -> str:try:fixture = load_fixture(name)- return fixture.metadata.domain or fixture.metadata.name- except Exception:+ label = fixture.metadata.domain or fixture.metadata.name+ except Exception: # noqa: BLE001 — best-effort label lookup, any failure falls back to the raw namereturn name+ else:+ return labeldiff --git a/ifixai/cli/main.py b/ifixai/cli/main.pyindex fd26fef..0b94259 100644--- a/ifixai/cli/main.py+++ b/ifixai/cli/main.py@@ -5,13 +5,13 @@ import sysimport clickfrom ifixai._version import VERSION+from ifixai.cli.compare import comparefrom ifixai.cli.init import init, load_dotenv_file+from ifixai.cli.list_cmd import list_groupfrom ifixai.cli.run import runfrom ifixai.cli.scaffold import installfrom ifixai.cli.setup_cmd import setup-from ifixai.cli.list_cmd import list_groupfrom ifixai.cli.validate import validate-from ifixai.cli.compare import compare@click.group()@@ -34,7 +34,7 @@ def _ensure_utf8_stdout() -> None:returnimport io- def _fix(stream): # noqa: E306+ def _fix(stream):enc = ""if hasattr(stream, "encoding") and stream.encoding:enc = stream.encodingdiff --git a/ifixai/cli/orchestrator.py b/ifixai/cli/orchestrator.pyindex a5abe58..10bbfba 100644--- a/ifixai/cli/orchestrator.py+++ b/ifixai/cli/orchestrator.py@@ -6,9 +6,17 @@ import threadingimport clickfrom ifixai.api import run_inspections, run_selected, run_single, run_strategic+from ifixai.cli.schemas import EvalModeResolutionfrom ifixai.core.concurrency import ConcurrencyGovernor-from ifixai.evaluation.errors import JudgeUnavailableErrorfrom ifixai.core.fixture_loader import load_fixture+from ifixai.core.types import (+ EvaluationPipelineConfig,+ InspectionCategory,+ TestResult,+ TestRunResult,+ TestStatus,+)+from ifixai.evaluation.errors import JudgeUnavailableErrorfrom ifixai.harness.registry import ALL_SPECS, SPEC_BY_IDfrom ifixai.judge.config import JudgeConfig, JudgeProviderSpecfrom ifixai.providers.resolver import (@@ -17,14 +25,6 @@ from ifixai.providers.resolver import (select_cross_provider_judge,)from ifixai.scoring.category_weights import STRATEGIC_TEST_IDS-from ifixai.core.types import (- TestResult,- TestRunResult,- EvaluationPipelineConfig,- InspectionCategory,- TestStatus,-)-from ifixai.cli.schemas import EvalModeResolutiondef _enable_windows_vt_processing() -> bool:@@ -84,7 +84,7 @@ def _resolve_standard_eval_mode(sut_name = (sut_provider or "").lower()available = detect_available_credentials(os.environ)if sut_name and sut_name not in available and sut_api_key:- available = [sut_name] + available+ available = [sut_name, *available]distinct = [p for p in available if p != sut_name]if distinct:chosen = select_cross_provider_judge(sut_name, available)@@ -650,8 +650,6 @@ async def execute_tests(auth_method=auth_method,extra_headers=extra_headers,)- inspections_result.self_judged = self_judged- return inspections_resultexcept JudgeUnavailableError as exc:# Fail-fast: the judge went unreachable after its retries. Stop the run@@ -665,10 +663,14 @@ async def execute_tests(click.style(f"\n*** RUN STOPPED *** {exc.detail}", fg="red"), err=True)return None- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — top-level run guard; report any failure to the userclick.echo(click.style(f"Test execution failed: {exc}", fg="red"))return None+ else:+ inspections_result.self_judged = self_judged+ return inspections_result+finally:if display:display.stop()diff --git a/ifixai/cli/reports.py b/ifixai/cli/reports.pyindex cb523dc..a7d8313 100644--- a/ifixai/cli/reports.py+++ b/ifixai/cli/reports.py@@ -3,12 +3,12 @@ from pathlib import Pathimport click+from ifixai.core.types import TestRunResultfrom ifixai.reporting.scorecard import (generate_json_report,generate_markdown_report,generate_summary_report,)-from ifixai.core.types import TestRunResultdef _slugify(value: str) -> str:diff --git a/ifixai/cli/run.py b/ifixai/cli/run.pyindex d49fd4b..b8f890c 100644--- a/ifixai/cli/run.py+++ b/ifixai/cli/run.py@@ -22,8 +22,8 @@ from ifixai.cli import uifrom ifixai.cli._branding import (print_startup_banner,)-from ifixai.cli.config_file import CONFIG_FILENAME, load_configfrom ifixai.cli._imecore_prompt import print_imecore_conclusion+from ifixai.cli.config_file import CONFIG_FILENAME, load_configfrom ifixai.cli.orchestrator import (_build_judge_config,_eval_mode_declaration,@@ -34,18 +34,12 @@ from ifixai.cli.orchestrator import (_resolve_standard_eval_mode,execute_tests,)-from ifixai.cli.schemas import InteractiveConfigfrom ifixai.cli.reports import save_reports-from ifixai.reporting.artifact import render_artifact-from ifixai.reporting.health import (- judge_health_note,- measurement_failure_banner,- run_health,-)+from ifixai.cli.schemas import InteractiveConfigfrom ifixai.core.concurrency import (- ConcurrencyGovernor,JUDGE_CALL_CAP,MAX_CONCURRENCY_LIMIT,+ ConcurrencyGovernor,)from ifixai.core.connection import test_connection as _test_connfrom ifixai.core.context import collect_context@@ -54,25 +48,29 @@ from ifixai.core.discovery import (discover_system,display_discovery_summary,)+from ifixai.core.fixture_loader import load_fixture, resolve_fixture_path+from ifixai.core.grounding import GroundingMode, compose_system_prompt+from ifixai.core.types import (+ EvaluationMode,+ EvaluationPipelineConfig,+ ProviderConfig,+ RunMode,+)from ifixai.evaluation.manifest import (build_manifest,generate_run_nonce,is_valid_run_nonce,write_manifest,)-from ifixai.inspections.holdout_ids import generate_holdout_idsfrom ifixai.evaluation.normalizer import NORMALIZER_VERSIONfrom ifixai.evaluation.types import ModelDescriptor-from ifixai.core.fixture_loader import load_fixture, resolve_fixture_pathfrom ifixai.harness.registry import (CATEGORY_NAMES,SPEC_BY_ID,resolve_category_test_ids,)from ifixai.harness.suites import SUITE_NAMES, resolve_suite-from ifixai.utils.fixture_digest import compute_fixture_digest-from ifixai.utils.rubric_digest import compute_rubric_digests_for_tests_layout-from ifixai.core.grounding import GroundingMode, compose_system_prompt+from ifixai.inspections.holdout_ids import generate_holdout_idsfrom ifixai.providers.base import ChatProviderfrom ifixai.providers.governance_fixture import GovernanceFixturefrom ifixai.providers.resolver import (@@ -85,14 +83,18 @@ from ifixai.quick_build import (fixture_to_yaml,generate_fixture_from_context,generate_fixture_from_profile,+)+from ifixai.quick_build import (save_fixture as qb_save,)-from ifixai.core.types import (- EvaluationMode,- EvaluationPipelineConfig,- ProviderConfig,- RunMode,+from ifixai.reporting.artifact import render_artifact+from ifixai.reporting.health import (+ judge_health_note,+ measurement_failure_banner,+ run_health,)+from ifixai.utils.fixture_digest import compute_fixture_digest+from ifixai.utils.rubric_digest import compute_rubric_digests_for_tests_layoutfrom ifixai.wizard import generate_fixture_from_wizard, run_wizardDEFAULT_CONCURRENCY = 5@@ -234,7 +236,7 @@ def _format_elapsed(seconds: float) -> str:"""if seconds < 1.0:return f"{int(seconds * 1000)}ms"- total = int(round(seconds))+ total = round(seconds)hours, remainder = divmod(total, 3600)minutes, secs = divmod(remainder, 60)if hours:@@ -884,8 +886,8 @@ def run(err=True,)sys.exit(2)- judge_provider = judge_provider + (eval_mode_auto_selected_judge,)- judge_api_key = judge_api_key + (auto_judge_api_key,)+ judge_provider = (*judge_provider, eval_mode_auto_selected_judge)+ judge_api_key = (*judge_api_key, auto_judge_api_key)click.echo(click.style(f"Standard mode: auto-paired judge provider "diff --git a/ifixai/cli/setup_cmd.py b/ifixai/cli/setup_cmd.pyindex 6fc8471..9682979 100644--- a/ifixai/cli/setup_cmd.py+++ b/ifixai/cli/setup_cmd.py@@ -135,7 +135,7 @@ def setup(ctx: click.Context) -> None:# Surface the real-agent (http) path first: it's the highest-fidelity SUT.# Then providers whose key is already present, then the rest.rest = [p for p in _ALL_PROVIDERS if p != "http" and p not in available_names]- provider_choices = ["http"] + available_names + rest+ provider_choices = ["http", *available_names, *rest]provider_desc = {p: _PROVIDER_DESCRIPTIONS.get(p, "")+ (" — key detected" if p in available_names else "")@@ -281,7 +281,7 @@ def setup(ctx: click.Context) -> None:try:fx = load_fixture(name)fixture_desc[name] = fx.metadata.domain or fx.metadata.name or name- except Exception:+ except Exception: # noqa: BLE001 — best-effort environment probe; any failure falls back to the defaultfixture_desc[name] = namefixture = ui.select("Fixture (the deployment profile to test against):",diff --git a/ifixai/cli/ui.py b/ifixai/cli/ui.pyindex 3e60f2f..b4ad310 100644--- a/ifixai/cli/ui.py+++ b/ifixai/cli/ui.py@@ -9,8 +9,8 @@ callers keep their plain-text path.from __future__ import annotationsimport sys+from collections.abc import Sequencefrom functools import lru_cache-from typing import Sequencefrom ifixai.cli._branding import supports_color@@ -22,20 +22,20 @@ _DIM = "grey62"def _rich_available() -> bool:try:import rich # noqa: F401-- return True- except Exception:+ except Exception: # noqa: BLE001 — probing optional dependency availabilityreturn False+ else:+ return True@lru_cache(maxsize=1)def _questionary_available() -> bool:try:import questionary # noqa: F401-- return True- except Exception:+ except Exception: # noqa: BLE001 — probing optional dependency availabilityreturn False+ else:+ return Truedef use_rich() -> bool:diff --git a/ifixai/core/connection.py b/ifixai/core/connection.pyindex b6f6cfe..b9e1152 100644--- a/ifixai/core/connection.py+++ b/ifixai/core/connection.py@@ -4,6 +4,7 @@ import asyncioimport timefrom dataclasses import dataclass+from ifixai.core.types import ChatMessage, ProviderCapabilities, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderAuthError,@@ -11,7 +12,6 @@ from ifixai.providers.base import (ProviderTimeoutError,detect_capabilities,)-from ifixai.core.types import ChatMessage, ProviderCapabilities, ProviderConfigCONNECTION_TEST_TIMEOUT = 30.0@@ -43,7 +43,7 @@ async def test_connection(try:capabilities = await detect_capabilities(provider, config)- except Exception:+ except Exception: # noqa: BLE001 — connection health probe; any failure is treated as unavailablecapabilities = Nonereturn ConnectionTestResult(@@ -74,7 +74,7 @@ async def test_connection(success=False,error_message=f"Connection timed out after {CONNECTION_TEST_TIMEOUT}s — endpoint may be down.",)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — connection health probe; any failure is treated as unavailablereturn ConnectionTestResult(success=False,error_message=f"Connection failed: {type(exc).__name__}: {exc}",diff --git a/ifixai/core/discovery.py b/ifixai/core/discovery.pyindex c316594..865a55d 100644--- a/ifixai/core/discovery.py+++ b/ifixai/core/discovery.py@@ -6,7 +6,6 @@ from dataclasses import dataclass, fieldimport click-from ifixai.providers.base import ChatProvider, detect_capabilitiesfrom ifixai.core.types import (ContextProfile,DataSource,@@ -19,6 +18,7 @@ from ifixai.core.types import (TestCase,Tool,)+from ifixai.providers.base import ChatProvider, detect_capabilitieslogger = logging.getLogger(__name__)diff --git a/ifixai/core/runner.py b/ifixai/core/runner.pyindex 8636379..7a9abf6 100644--- a/ifixai/core/runner.py+++ b/ifixai/core/runner.py@@ -1,14 +1,30 @@import asyncioimport logging+from collections.abc import Callablefrom datetime import datetime, timezone-from typing import Callable, Optional+from typing import Optionalfrom ifixai.core.concurrency import ConcurrencyGovernor+from ifixai.core.types import (+ EvaluationPipelineConfig,+ Fixture,+ InspectionCategory,+ InspectionSpec,+ ProviderCapabilities,+ ProviderConfig,+ TestResult,+ TestRunResult,+ TestStatus,+)from ifixai.evaluation.analytic_judge import (AnalyticRubricJudge,EnsembleAnalyticRubricJudge,)from ifixai.evaluation.pipeline import EvaluationPipeline+from ifixai.harness.consistency import CrossHookValidator+from ifixai.harness.registry import ALL_SPECS, INSPECTION_REGISTRY+from ifixai.judge.config import JudgeConfig+from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluatorfrom ifixai.providers.base import ChatProvider, detect_capabilitiesfrom ifixai.reporting.gap_analysis import identify_gapsfrom ifixai.reporting.grading import score_to_grade@@ -32,7 +48,6 @@ from ifixai.scoring.engine import (compute_overall_score,compute_strategic_score,)-from ifixai.harness.registry import ALL_SPECS, INSPECTION_REGISTRYfrom ifixai.scoring.mandatory_minimums import (PASS_THRESHOLD,SCORE_CAP_ON_FAILURE,@@ -40,20 +55,6 @@ from ifixai.scoring.mandatory_minimums import (cap_score_if_minimums_failed,check_mandatory_minimums,)-from ifixai.harness.consistency import CrossHookValidator-from ifixai.judge.config import JudgeConfig-from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluator-from ifixai.core.types import (- InspectionCategory,- TestResult,- TestStatus,- InspectionSpec,- EvaluationPipelineConfig,- Fixture,- ProviderCapabilities,- ProviderConfig,- TestRunResult,-)ProgressCallback = Callable[[str, int, int, "TestResult"], None]diff --git a/ifixai/core/types.py b/ifixai/core/types.pyindex 8ff04d3..8d2a3aa 100644--- a/ifixai/core/types.py+++ b/ifixai/core/types.py@@ -3,9 +3,8 @@ from datetime import datetimefrom enum import Enumfrom typing import TYPE_CHECKING, Any, Literal, Optional-from typing_extensions import TypedDict-from pydantic import BaseModel, Field, model_validator+from typing_extensions import TypedDictif TYPE_CHECKING:from ifixai.providers.base import ChatProviderdiff --git a/ifixai/evaluation/analytic_judge.py b/ifixai/evaluation/analytic_judge.pyindex 6bd11a0..cd52861 100644--- a/ifixai/evaluation/analytic_judge.py+++ b/ifixai/evaluation/analytic_judge.py@@ -12,9 +12,7 @@ from typing import Final, Optionalimport yamlfrom json_repair import repair_json-from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluatorfrom ifixai.core.refusal import is_platform_refusal-from ifixai.providers.base import is_fatal_provider_errorfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -23,6 +21,8 @@ from ifixai.core.types import (ReferenceSet,RubricVerdict,)+from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluator+from ifixai.providers.base import is_fatal_provider_errorclass JudgeErrorKind(str, Enum):@@ -881,10 +881,9 @@ class AnalyticRubricJudge:except Exception as exc:last_exc = excif is_fatal_provider_error(exc):- logger.error(- "Judge call for %s aborted (non-retryable): %s",+ logger.exception(+ "Judge call for %s aborted (non-retryable)",rubric.test_id,- exc,)raise JudgeCommunicationError(f"Judge provider rejected the request (non-retryable): "@@ -900,11 +899,10 @@ class AnalyticRubricJudge:exc,)continue- logger.error(- "Judge communication failed for %s — all %d attempts failed: %s",+ logger.exception(+ "Judge communication failed for %s — all %d attempts failed",rubric.test_id,self._EXTRACTION_RETRIES,- exc,)raise JudgeCommunicationError(f"Judge provider send failed after {self._EXTRACTION_RETRIES} attempts: "@@ -937,11 +935,10 @@ class AnalyticRubricJudge:exc,)else:- logger.error(- "Error extracting judge data for %s — all %d attempts failed: %s",+ logger.exception(+ "Error extracting judge data for %s — all %d attempts failed",rubric.test_id,self._EXTRACTION_RETRIES,- exc,)raise JudgeExtractionError(diff --git a/ifixai/evaluation/atomic_claims.py b/ifixai/evaluation/atomic_claims.pyindex ec6b34e..9c7f706 100644--- a/ifixai/evaluation/atomic_claims.py+++ b/ifixai/evaluation/atomic_claims.py@@ -9,8 +9,8 @@ import yamlfrom json_repair import repair_jsonfrom pydantic import BaseModel, Field-from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluatorfrom ifixai.core.types import ChatMessage+from ifixai.judge.evaluator import EnsembleJudgeEvaluator, JudgeEvaluatorif TYPE_CHECKING:from ifixai.core.types import ExpectedClaim@@ -122,7 +122,7 @@ def _build_few_shot_block(test_id: str) -> str:try:raw = yaml.safe_load(ref_path.read_text(encoding="utf-8"))_ = raw # references.yaml loaded successfully; use hardcoded examples below- except Exception:+ except Exception: # noqa: BLE001 — best-effort few-shot cache load; any failure falls back to no examples_FEW_SHOT_CACHE[test_id] = ""return ""@@ -295,7 +295,7 @@ async def _score_with_single_evaluator(_ATOMIC_MAX_ATTEMPTS,)continue- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — best-effort scoring boundary; any failure degrades to an empty resultlast_error = f"judge call failed: {exc}"logger.warning("Atomic judge attempt %d/%d failed: %s",@@ -568,7 +568,7 @@ async def score_atomic_claims_with_ground_truth(_ATOMIC_MAX_ATTEMPTS,)continue- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — best-effort scoring boundary; any failure degrades to an empty resultlast_error = f"judge call failed: {exc}"logger.warning("Ground-truth judge attempt %d/%d failed: %s",diff --git a/ifixai/evaluation/checkpoint.py b/ifixai/evaluation/checkpoint.pyindex f20df10..58023dc 100644--- a/ifixai/evaluation/checkpoint.py+++ b/ifixai/evaluation/checkpoint.py@@ -20,8 +20,8 @@ import loggingfrom pathlib import Pathfrom typing import Optional-from ifixai.evaluation.manifest import RunManifestfrom ifixai.core.types import TestResult+from ifixai.evaluation.manifest import RunManifestfrom ifixai.evaluation.schemas import ResumeState_logger = logging.getLogger(__name__)@@ -44,7 +44,7 @@ def load_checkpoint(runs_root: Path, run_id: str) -> dict[str, TestResult]:for test_id, payload in raw.items():try:result = TestResult.model_validate(payload)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — best-effort checkpoint read; any failure is treated as no checkpoint_logger.warning("checkpoint entry for %s rejected (%s) — will re-run",test_id, exc,diff --git a/ifixai/evaluation/manifest.py b/ifixai/evaluation/manifest.pyindex 1beec49..67a4e6b 100644--- a/ifixai/evaluation/manifest.py+++ b/ifixai/evaluation/manifest.py@@ -12,8 +12,8 @@ from typing import Anyfrom pydantic import BaseModel, Field, field_validator-from ifixai.evaluation.types import ModelDescriptorfrom ifixai.core.types import RunMode+from ifixai.evaluation.types import ModelDescriptor_SHA256_HEX_RE = re.compile(r"^[0-9a-f]{64}$")_ZERO_SHA256 = "0" * 64diff --git a/ifixai/evaluation/pipeline.py b/ifixai/evaluation/pipeline.pyindex 2b775cf..68e77f3 100644--- a/ifixai/evaluation/pipeline.py+++ b/ifixai/evaluation/pipeline.py@@ -2,23 +2,6 @@ import loggingimport refrom typing import TYPE_CHECKING-from ifixai.evaluation.analytic_judge import (- JudgeCommunicationError,- JudgeContractError,- JudgeExtractionError,-)-from ifixai.evaluation.errors import (- JudgePipelineRequiredError,- JudgeUnavailableError,- judge_fail_fast_enabled,-)-from ifixai.evaluation.atomic_claims import (- AtomicMode,- AtomicScore,- score_atomic_claims,- score_atomic_claims_with_ground_truth,-)-from ifixai.evaluation.response_classifier import ResponseClass, classify_responsefrom ifixai.core.refusal import is_platform_refusalfrom ifixai.core.types import (AnalyticRubric,@@ -33,6 +16,23 @@ from ifixai.core.types import (ReferenceResponse,RubricVerdict,)+from ifixai.evaluation.analytic_judge import (+ JudgeCommunicationError,+ JudgeContractError,+ JudgeExtractionError,+)+from ifixai.evaluation.atomic_claims import (+ AtomicMode,+ AtomicScore,+ score_atomic_claims,+ score_atomic_claims_with_ground_truth,+)+from ifixai.evaluation.errors import (+ JudgePipelineRequiredError,+ JudgeUnavailableError,+ judge_fail_fast_enabled,+)+from ifixai.evaluation.response_classifier import ResponseClass, classify_responseif TYPE_CHECKING:from ifixai.evaluation.analytic_judge import (@@ -242,7 +242,7 @@ class EvaluationPipeline:extraction_error=JudgeErrorKind.COMMUNICATION,)except JudgeExtractionError as exc:- _logger.error("Judge extraction error: %s", exc)+ _logger.exception("Judge extraction error")self._judge_calls_used += 1return PipelineResult(passed=False,@@ -251,7 +251,7 @@ class EvaluationPipeline:extraction_error=JudgeErrorKind.EXTRACTION,)except JudgeContractError as exc:- _logger.error("Judge contract error: %s", exc)+ _logger.exception("Judge contract error")self._judge_calls_used += 1return PipelineResult(passed=False,@@ -296,10 +296,8 @@ class EvaluationPipeline:judge_provider=provider,judge_config=config,)- except JudgeContractError as exc:- _logger.error(- "Classifier contract violation (non-conforming output): %s", exc- )+ except JudgeContractError:+ _logger.exception("Classifier contract violation (non-conforming output)")return Noneasync def evaluate_atomic(diff --git a/ifixai/evaluation/response_classifier.py b/ifixai/evaluation/response_classifier.pyindex 71fae3d..e454891 100644--- a/ifixai/evaluation/response_classifier.py+++ b/ifixai/evaluation/response_classifier.py@@ -2,9 +2,9 @@ import jsonimport refrom enum import Enum+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.evaluation.analytic_judge import JudgeContractErrorfrom ifixai.providers.base import ChatProvider-from ifixai.core.types import ChatMessage, ProviderConfigclass ResponseClass(str, Enum):diff --git a/ifixai/examples/ci_check.py b/ifixai/examples/ci_check.pyindex 95e10e5..25cea79 100644--- a/ifixai/examples/ci_check.py+++ b/ifixai/examples/ci_check.py@@ -5,6 +5,7 @@ import sysfrom ifixai.api import run_inspectionsfrom ifixai.reporting.scorecard import generate_json_report+def read_env_config() -> dict[str, str]:return {"provider": os.environ.get("IFIXAI_PROVIDER", "openai"),diff --git a/ifixai/examples/custom_fixture.py b/ifixai/examples/custom_fixture.pyindex b19e9a1..2537504 100644--- a/ifixai/examples/custom_fixture.py+++ b/ifixai/examples/custom_fixture.py@@ -3,7 +3,11 @@ import osfrom pathlib import Pathfrom ifixai.api import run_inspections-from ifixai.core.fixture_loader import list_test_coverage, load_fixture, validate_fixture+from ifixai.core.fixture_loader import (+ list_test_coverage,+ load_fixture,+ validate_fixture,+)CUSTOM_FIXTURE_PATH = Path("my_domain/fixture.yaml")diff --git a/ifixai/examples/run_all.py b/ifixai/examples/run_all.pyindex a2b94f0..290ddc3 100644--- a/ifixai/examples/run_all.py+++ b/ifixai/examples/run_all.py@@ -1,8 +1,10 @@import asyncioimport os+from ifixai.api import run_inspectionsfrom ifixai.reporting.scorecard import generate_json_report, generate_markdown_report+async def main() -> None:result = await run_inspections(provider="openai",diff --git a/ifixai/examples/run_single.py b/ifixai/examples/run_single.pyindex d1da2cf..63c2516 100644--- a/ifixai/examples/run_single.py+++ b/ifixai/examples/run_single.py@@ -1,5 +1,6 @@import asyncioimport os+from ifixai.api import run_singlediff --git a/ifixai/harness/base.py b/ifixai/harness/base.pyindex 00c24c0..ff5be05 100644--- a/ifixai/harness/base.py+++ b/ifixai/harness/base.py@@ -1,37 +1,35 @@+import loggingimport randomimport timefrom abc import ABC, abstractmethodfrom collections.abc import Callable, Sequencefrom typing import TYPE_CHECKING, Optional, TypeVar-import logging-from ifixai.evaluation.analytic_judge import load_analytic_rubricfrom ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.providers.base import ProviderEmptyContentError, ProviderError-from ifixai.providers.base import ChatProvider-from ifixai.utils.template_renderer import render+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError, ProviderErrorfrom ifixai.rules.loader import load_inspection_definitionfrom ifixai.scoring.engine import compute_test_ci+from ifixai.utils.template_renderer import renderif TYPE_CHECKING:from ifixai.evaluation.pipeline import EvaluationPipelinefrom ifixai.core.types import (AnalyticRubric,- ScoreBreakdown,- TestResult,- TestStatus,- InspectionSpec,ChatMessage,ConversationPlan,EvaluationMode,EvaluationPipelineConfig,EvidenceItem,Fixture,+ InspectionSpec,JudgeErrorKind,ProviderCapabilities,ProviderConfig,+ ScoreBreakdown,+ TestResult,+ TestStatus,)_logger = logging.getLogger(__name__)@@ -64,7 +62,7 @@ class BaseTest(ABC):self.spec = specself.capabilities = ProviderCapabilities()self.pipeline_config: EvaluationPipelineConfig | None = None- self._pipeline: "EvaluationPipeline | None" = None+ self._pipeline: EvaluationPipeline | None = Noneself._fixture: Fixture | None = None@abstractmethod@@ -173,7 +171,7 @@ class BaseTest(ABC):error_message=str(exc),insufficient_evidence=True,)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — top-level inspection guard: any failure becomes a failed TestResult, never aborts the runduration = time.monotonic() - startreturn TestResult(test_id=self.spec.test_id,@@ -195,19 +193,20 @@ class BaseTest(ABC):def load_inspection_data(self) -> ConversationPlan | None:try:plan = load_inspection_definition(self.spec.test_id)- if plan is None:- _logger.debug(- "%s: no YAML inspection definition, using hardcoded logic",- self.spec.test_id,- )- return plan- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — YAML load is best-effort; fall back to hardcoded logic_logger.warning("%s: failed to load YAML inspection: %s — using hardcoded logic",self.spec.test_id,exc,)return None+ else:+ if plan is None:+ _logger.debug(+ "%s: no YAML inspection definition, using hardcoded logic",+ self.spec.test_id,+ )+ return plandef compute_score(self, evidence: list[EvidenceItem]) -> float:if self.spec.count_extraction_errors_as_fail:@@ -367,7 +366,7 @@ class BaseTest(ABC):))else:- raise JudgePipelineRequiredError(+ raise JudgePipelineRequiredError( # noqa: TRY301 — inner functions are disallowed by project styleplan.test_id,"execute_conversation requires an analytic judge pipeline",)@@ -401,7 +400,7 @@ class BaseTest(ABC):details={"error": str(exc), "comm_failure": True},))- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — top-level inspection guard: any failure becomes a failed TestResult, never aborts the runevidence.append(EvidenceItem(test_case_id=f"{plan.test_id}_step{step.step_id}_{case_label}",diff --git a/ifixai/harness/registry.py b/ifixai/harness/registry.pyindex ae10ad7..bfe458e 100644--- a/ifixai/harness/registry.py+++ b/ifixai/harness/registry.py@@ -3,180 +3,267 @@ import warningsfrom collections.abc import Iterablefrom typing import TypedDict+from ifixai.core.types import InspectionCategory+from ifixai.harness.base import BaseTestfrom ifixai.inspections.b01_tool_governance.runner import (SPEC as B01_SPEC,+)+from ifixai.inspections.b01_tool_governance.runner import (B01ToolGovernance,)-from ifixai.inspections.b02_non_llm_layer.runner import SPEC as B02_SPEC, B02NonLlmLayer-from ifixai.inspections.b03_auditability.runner import SPEC as B03_SPEC, B03Auditability+from ifixai.inspections.b02_non_llm_layer.runner import SPEC as B02_SPEC+from ifixai.inspections.b02_non_llm_layer.runner import B02NonLlmLayer+from ifixai.inspections.b03_auditability.runner import SPEC as B03_SPEC+from ifixai.inspections.b03_auditability.runner import B03Auditabilityfrom ifixai.inspections.b04_deterministic_override.runner import (SPEC as B04_SPEC,+)+from ifixai.inspections.b04_deterministic_override.runner import (B04DeterministicOverride,)from ifixai.inspections.b05_source_provenance.runner import (SPEC as B05_SPEC,+)+from ifixai.inspections.b05_source_provenance.runner import (B05SourceProvenance,)from ifixai.inspections.b06_uncertainty_signalling.runner import (SPEC as B06_SPEC,+)+from ifixai.inspections.b06_uncertainty_signalling.runner import (B06UncertaintySignalling,)from ifixai.inspections.b07_hallucination_rate.runner import (SPEC as B07_SPEC,+)+from ifixai.inspections.b07_hallucination_rate.runner import (B07HallucinationRate,)from ifixai.inspections.b08_privilege_escalation.runner import (SPEC as B08_SPEC,+)+from ifixai.inspections.b08_privilege_escalation.runner import (B08PrivilegeEscalation,)from ifixai.inspections.b09_policy_violation.runner import (SPEC as B09_SPEC,+)+from ifixai.inspections.b09_policy_violation.runner import (B09PolicyViolation,)from ifixai.inspections.b10_evaluation_drift.runner import (SPEC as B10_SPEC,+)+from ifixai.inspections.b10_evaluation_drift.runner import (B10EvaluationDrift,)from ifixai.inspections.b11_system_controllability.runner import (SPEC as B11_SPEC,+)+from ifixai.inspections.b11_system_controllability.runner import (B11SystemControllability,)from ifixai.inspections.b12_prompt_injection.runner import (SPEC as B12_SPEC,+)+from ifixai.inspections.b12_prompt_injection.runner import (B12PromptInjection,)from ifixai.inspections.b13_plan_traceability.runner import (SPEC as B13_SPEC,+)+from ifixai.inspections.b13_plan_traceability.runner import (B13PlanTraceability,)from ifixai.inspections.b14_covert_side_task.runner import (SPEC as B14_SPEC,+)+from ifixai.inspections.b14_covert_side_task.runner import (B14CovertSideTask,)from ifixai.inspections.b15_long_horizon_drift.runner import (SPEC as B15_SPEC,+)+from ifixai.inspections.b15_long_horizon_drift.runner import (B15LongHorizonDrift,)from ifixai.inspections.b16_silent_failure.runner import (SPEC as B16_SPEC,+)+from ifixai.inspections.b16_silent_failure.runner import (B16SilentFailure,)from ifixai.inspections.b17_fact_consistency.runner import (SPEC as B17_SPEC,+)+from ifixai.inspections.b17_fact_consistency.runner import (B17FactConsistency,)from ifixai.inspections.b18_goal_stability.runner import (SPEC as B18_SPEC,+)+from ifixai.inspections.b18_goal_stability.runner import (B18GoalStability,)from ifixai.inspections.b19_context_accuracy.runner import (SPEC as B19_SPEC,+)+from ifixai.inspections.b19_context_accuracy.runner import (B19ContextAccuracy,)from ifixai.inspections.b20_instruction_adherence.runner import (SPEC as B20_SPEC,+)+from ifixai.inspections.b20_instruction_adherence.runner import (B20InstructionAdherence,)from ifixai.inspections.b21_cross_turn_objective.runner import (SPEC as B21_SPEC,+)+from ifixai.inspections.b21_cross_turn_objective.runner import (B21CrossTurnObjective,)from ifixai.inspections.b22_decision_reproducibility.runner import (SPEC as B22_SPEC,+)+from ifixai.inspections.b22_decision_reproducibility.runner import (B22DecisionReproducibility,)from ifixai.inspections.b23_policy_version_trace.runner import (SPEC as B23_SPEC,+)+from ifixai.inspections.b23_policy_version_trace.runner import (B23PolicyVersionTrace,)-from ifixai.inspections.b24_risk_scoring.runner import SPEC as B24_SPEC, B24RiskScoring+from ifixai.inspections.b24_risk_scoring.runner import SPEC as B24_SPEC+from ifixai.inspections.b24_risk_scoring.runner import B24RiskScoringfrom ifixai.inspections.b25_regulatory_readiness.runner import (SPEC as B25_SPEC,+)+from ifixai.inspections.b25_regulatory_readiness.runner import (B25RegulatoryReadiness,)from ifixai.inspections.b26_rate_limiting.runner import (SPEC as B26_SPEC,+)+from ifixai.inspections.b26_rate_limiting.runner import (B26RateLimiting,)from ifixai.inspections.b27_session_integrity.runner import (SPEC as B27_SPEC,+)+from ifixai.inspections.b27_session_integrity.runner import (B27SessionIntegrity,)from ifixai.inspections.b28_rag_context_integrity.runner import (SPEC as B28_SPEC,+)+from ifixai.inspections.b28_rag_context_integrity.runner import (B28RAGContextIntegrity,)from ifixai.inspections.b29_prompt_sensitivity.runner import (SPEC as B29_SPEC,+)+from ifixai.inspections.b29_prompt_sensitivity.runner import (B29PromptSensitivity,)from ifixai.inspections.b30_malicious_deployer_rules.runner import (SPEC as B30_SPEC,+)+from ifixai.inspections.b30_malicious_deployer_rules.runner import (B30MaliciousDeployerRules,)from ifixai.inspections.b31_escalation_correctness.runner import (SPEC as B31_SPEC,+)+from ifixai.inspections.b31_escalation_correctness.runner import (B31EscalationCorrectness,)from ifixai.inspections.b32_off_topic_detection.runner import (SPEC as B32_SPEC,+)+from ifixai.inspections.b32_off_topic_detection.runner import (B32OffTopicDetection,)+from ifixai.inspections.c02_low_confidence_abstention.runner import (+ SPEC as C02_SPEC,+)+from ifixai.inspections.c02_low_confidence_abstention.runner import (+ C02LowConfidenceAbstention,+)+from ifixai.inspections.c05_human_fallback_routing.runner import (+ SPEC as C05_SPEC,+)+from ifixai.inspections.c05_human_fallback_routing.runner import (+ C05HumanFallbackRouting,+)+from ifixai.inspections.c11_operational_outcome_conformance.runner import (+ SPEC as C11_SPEC,+)+from ifixai.inspections.c11_operational_outcome_conformance.runner import (+ C11OperationalOutcomeConformance,+)from ifixai.inspections.p01_destruction_resistance.runner import (SPEC as P01_SPEC,+)+from ifixai.inspections.p01_destruction_resistance.runner import (P01DestructionResistance,)from ifixai.inspections.p08_self_audit_trail_integrity.runner import (SPEC as P08_SPEC,+)+from ifixai.inspections.p08_self_audit_trail_integrity.runner import (P08SelfAuditTrailIntegrity,)from ifixai.inspections.p13_hidden_side_objective_persistence.runner import (SPEC as P13_SPEC,+)+from ifixai.inspections.p13_hidden_side_objective_persistence.runner import (P13HiddenSideObjectivePersistence,)from ifixai.inspections.p19_honeypot_tool_restraint.runner import (SPEC as P19_SPEC,+)+from ifixai.inspections.p19_honeypot_tool_restraint.runner import (P19HoneypotToolRestraint,)from ifixai.inspections.p22_goal_edit_acceptance.runner import (SPEC as P22_SPEC,+)+from ifixai.inspections.p22_goal_edit_acceptance.runner import (P22GoalEditAcceptance,)from ifixai.inspections.p27_privilege_creep.runner import (SPEC as P27_SPEC,+)+from ifixai.inspections.p27_privilege_creep.runner import (P27PrivilegeCreep,)from ifixai.inspections.p32_emergent_systemic_harm.runner import (SPEC as P32_SPEC,- P32EmergentSystemicHarm,-)-from ifixai.inspections.c02_low_confidence_abstention.runner import (- SPEC as C02_SPEC,- C02LowConfidenceAbstention,-)-from ifixai.inspections.c05_human_fallback_routing.runner import (- SPEC as C05_SPEC,- C05HumanFallbackRouting,)-from ifixai.inspections.c11_operational_outcome_conformance.runner import (- SPEC as C11_SPEC,- C11OperationalOutcomeConformance,+from ifixai.inspections.p32_emergent_systemic_harm.runner import (+ P32EmergentSystemicHarm,)from ifixai.inspections.s02_configurer_stakeholder_conflict.runner import (SPEC as S02_SPEC,+)+from ifixai.inspections.s02_configurer_stakeholder_conflict.runner import (S02ConfigurerStakeholderConflict,)from ifixai.inspections.x04_detection_performance_gate.runner import (SPEC as X04_SPEC,+)+from ifixai.inspections.x04_detection_performance_gate.runner import (X04DetectionPerformanceGate,)from ifixai.inspections.x11_pre_action_confirmation_gate.runner import (SPEC as X11_SPEC,+)+from ifixai.inspections.x11_pre_action_confirmation_gate.runner import (X11PreActionConfirmationGate,)-from ifixai.harness.base import BaseTestfrom ifixai.scoring.category_weights import STRATEGIC_TEST_IDS-from ifixai.core.types import InspectionCategoryALL_SPECS = [B01_SPEC,diff --git a/ifixai/harness/suites.py b/ifixai/harness/suites.pyindex b778f7b..a25c7f5 100644--- a/ifixai/harness/suites.py+++ b/ifixai/harness/suites.py@@ -50,7 +50,7 @@ def _smoke_ids() -> list[str]:return _strategic_ids()[:3]-_TIER_RESOLVERS: dict[str, "callable[[], list[str]]"] = {+_TIER_RESOLVERS: dict[str, callable[[], list[str]]] = {"smoke": _smoke_ids,"strategic": _strategic_ids,"core": _core_ids,diff --git a/ifixai/harness/version_enforcement.py b/ifixai/harness/version_enforcement.pyindex 0a1321d..e30c529 100644--- a/ifixai/harness/version_enforcement.py+++ b/ifixai/harness/version_enforcement.py@@ -1,7 +1,7 @@import hashlibimport json+from collections.abc import Iterablefrom pathlib import Path-from typing import Iterablefrom pydantic import BaseModeldiff --git a/ifixai/inspections/b01_tool_governance/runner.py b/ifixai/inspections/b01_tool_governance/runner.pyindex a8c4fa5..01feffb 100644--- a/ifixai/inspections/b01_tool_governance/runner.py+++ b/ifixai/inspections/b01_tool_governance/runner.py@@ -1,10 +1,6 @@import loggingfrom typing import TypedDict-from ifixai.harness.base import BaseTest-from ifixai.inspections.holdout_ids import generate_holdout_ids-from ifixai.inspections.policy_grounding import is_policy_grounded-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -15,6 +11,10 @@ from ifixai.core.types import (ProviderConfig,ToolInvocationResult,)+from ifixai.harness.base import BaseTest+from ifixai.inspections.holdout_ids import generate_holdout_ids+from ifixai.inspections.policy_grounding import is_policy_grounded+from ifixai.providers.base import ChatProviderclass HoldoutCase(TypedDict):diff --git a/ifixai/inspections/b02_non_llm_layer/runner.py b/ifixai/inspections/b02_non_llm_layer/runner.pyindex 8f10880..fd972a0 100644--- a/ifixai/inspections/b02_non_llm_layer/runner.py+++ b/ifixai/inspections/b02_non_llm_layer/runner.py@@ -1,8 +1,5 @@import logging-from ifixai.harness.base import BaseTest-from ifixai.inspections.policy_grounding import is_policy_grounded-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -12,6 +9,9 @@ from ifixai.core.types import (InspectionSpec,ProviderConfig,)+from ifixai.harness.base import BaseTest+from ifixai.inspections.policy_grounding import is_policy_grounded+from ifixai.providers.base import ChatProvider_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b03_auditability/runner.py b/ifixai/inspections/b03_auditability/runner.pyindex f4674e8..21a2c53 100644--- a/ifixai/inspections/b03_auditability/runner.py+++ b/ifixai/inspections/b03_auditability/runner.py@@ -1,23 +1,23 @@import loggingfrom typing import Any, Optional-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (AuditRecord,ConversationPlan,- InspectionCategory,- InspectionSpec,+ EvaluationMethod,EvidenceItem,Fixture,+ InspectionCategory,InspectionMethod,- EvaluationMethod,+ InspectionSpec,ProviderConfig,ScoreBreakdown,Tool,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadError_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b04_deterministic_override/runner.py b/ifixai/inspections/b04_deterministic_override/runner.pyindex af7016d..a2fa365 100644--- a/ifixai/inspections/b04_deterministic_override/runner.py+++ b/ifixai/inspections/b04_deterministic_override/runner.py@@ -1,7 +1,5 @@from typing import Final-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (ConfigError,EvaluationMethod,@@ -12,6 +10,8 @@ from ifixai.core.types import (InspectionSpec,ProviderConfig,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider_WEIGHTS: Final[dict[str, float]] = {"reproducibility": 0.3,diff --git a/ifixai/inspections/b05_source_provenance/runner.py b/ifixai/inspections/b05_source_provenance/runner.pyindex fea66d5..6cb93b9 100644--- a/ifixai/inspections/b05_source_provenance/runner.py+++ b/ifixai/inspections/b05_source_provenance/runner.py@@ -2,23 +2,23 @@ import asynciofrom typing import TYPE_CHECKINGfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, send_single_turn-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (AnalyticRubric,+ DataSource,EvaluationCriteria,+ EvaluationMethod,+ EvidenceItem,ExpectedClaim,+ Fixture,InspectionCategory,InspectionMethod,InspectionSpec,- EvaluationMethod,- EvidenceItem,- Fixture,ProviderConfig,- DataSource,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, send_single_turn+from ifixai.providers.base import ChatProviderif TYPE_CHECKING:# User is only needed for type annotations in _bounded/_atomic_inspection.diff --git a/ifixai/inspections/b06_uncertainty_signalling/runner.py b/ifixai/inspections/b06_uncertainty_signalling/runner.pyindex 46f1561..c6141d5 100644--- a/ifixai/inspections/b06_uncertainty_signalling/runner.py+++ b/ifixai/inspections/b06_uncertainty_signalling/runner.py@@ -27,11 +27,9 @@ draws rather than near-synonyms."""import logging-from typing import Callable, Optional+from collections.abc import Callable+from typing import Optional-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (ConversationPlan,EvidenceItem,@@ -41,6 +39,9 @@ from ifixai.core.types import (ProviderConfig,ScoreBreakdown,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadError_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b07_hallucination_rate/runner.py b/ifixai/inspections/b07_hallucination_rate/runner.pyindex d5fe56b..182060a 100644--- a/ifixai/inspections/b07_hallucination_rate/runner.py+++ b/ifixai/inspections/b07_hallucination_rate/runner.py@@ -1,21 +1,21 @@import asynciofrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, send_single_turn-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (- ExpectedClaim,- InspectionCategory,- InspectionSpec,EvaluationMethod,EvidenceItem,+ ExpectedClaim,Fixture,+ InspectionCategory,InspectionMethod,+ InspectionSpec,JudgeErrorKind,ProviderConfig,User,)+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, send_single_turn+from ifixai.providers.base import ChatProviderSPEC = InspectionSpec(test_id="B07",@@ -70,7 +70,7 @@ class B07HallucinationRate(BaseTest):for user in fixture.users:try:report = await provider.get_grounding_report(config)- except Exception:+ except Exception: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreport = Noneif report is None:continuediff --git a/ifixai/inspections/b08_privilege_escalation/runner.py b/ifixai/inspections/b08_privilege_escalation/runner.pyindex 0f38496..35c4407 100644--- a/ifixai/inspections/b08_privilege_escalation/runner.py+++ b/ifixai/inspections/b08_privilege_escalation/runner.py@@ -1,21 +1,21 @@import asynciofrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (ConversationPlan,- InspectionCategory,- InspectionSpec,+ EvaluationMethod,EvidenceItem,Fixture,+ InspectionCategory,InspectionMethod,- EvaluationMethod,+ InspectionSpec,ProviderConfig,Tool,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader_HOLDOUT_TOOL_ID = "ifixai_holdout_unknown_tool_xyzzy"_HOLDOUT_ROLE = "ifixai_holdout_unknown_role_xyzzy"diff --git a/ifixai/inspections/b09_policy_violation/runner.py b/ifixai/inspections/b09_policy_violation/runner.pyindex 2e85df1..2730989 100644--- a/ifixai/inspections/b09_policy_violation/runner.py+++ b/ifixai/inspections/b09_policy_violation/runner.py@@ -1,24 +1,24 @@import asynciofrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import (- load_analytic_rubric,- render_judge_prompt_template,-)-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (AnalyticRubric,ConversationPlan,- InspectionCategory,- InspectionSpec,EvidenceItem,Fixture,+ InspectionCategory,+ InspectionSpec,Policy,ProviderConfig,User,)+from ifixai.evaluation.analytic_judge import (+ load_analytic_rubric,+ render_judge_prompt_template,+)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoaderSPEC = InspectionSpec(test_id="B09",diff --git a/ifixai/inspections/b10_evaluation_drift/runner.py b/ifixai/inspections/b10_evaluation_drift/runner.pyindex c3ec6c9..178c8db 100644--- a/ifixai/inspections/b10_evaluation_drift/runner.py+++ b/ifixai/inspections/b10_evaluation_drift/runner.py@@ -3,23 +3,23 @@ import hashlibimport loggingfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.harness.base import BaseTest, send_single_turn-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ConversationPlan,- InspectionCategory,- InspectionSpec,EvidenceItem,Fixture,+ InspectionCategory,+ InspectionSpec,InspectionStep,ProviderConfig,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, send_single_turn+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadError+from ifixai.utils.template_renderer import render_logger = logging.getLogger(__name__)@@ -368,5 +368,5 @@ def _stable_triple_seed(user_id: str, action: str) -> int:so different cases do not share sampled state. SHA-256 truncated to31 bits gives both properties without per-run drift."""- digest = hashlib.sha256(f"{user_id}|{action}".encode("utf-8")).digest()+ digest = hashlib.sha256(f"{user_id}|{action}".encode()).digest()return int.from_bytes(digest[:4], "big") % _SEED_CEILINGdiff --git a/ifixai/inspections/b11_system_controllability/runner.py b/ifixai/inspections/b11_system_controllability/runner.pyindex b12c5cc..65d297b 100644--- a/ifixai/inspections/b11_system_controllability/runner.py+++ b/ifixai/inspections/b11_system_controllability/runner.py@@ -1,7 +1,5 @@import logging-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTestfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -11,7 +9,9 @@ from ifixai.core.types import (InspectionSpec,ProviderConfig,)+from ifixai.harness.base import BaseTestfrom ifixai.inspections.b11_system_controllability.schemas import PolicyTestIds+from ifixai.providers.base import ChatProvider_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b12_prompt_injection/runner.py b/ifixai/inspections/b12_prompt_injection/runner.pyindex 04e224f..8ced2d3 100644--- a/ifixai/inspections/b12_prompt_injection/runner.py+++ b/ifixai/inspections/b12_prompt_injection/runner.py@@ -2,24 +2,24 @@ import asyncioimport secretsfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.harness.base import BaseTest, send_single_turn+from ifixai.core.types import (+ AnalyticRubric,+ EvaluationCriteria,+ EvidenceItem,+ Fixture,+ InspectionCategory,+ InspectionSpec,+ ProviderConfig,+)from ifixai.evaluation.analytic_judge import load_analytic_rubricfrom ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, send_single_turnfrom ifixai.harness.injection_corpus import (InjectionPayload,load_injection_corpus,sample_corpus,)from ifixai.providers.base import ChatProvider-from ifixai.core.types import (- AnalyticRubric,- InspectionCategory,- InspectionSpec,- EvaluationCriteria,- EvidenceItem,- Fixture,- ProviderConfig,-)_MAX_CONCURRENT_PAYLOADS = DEFAULT_INSPECTION_CONCURRENCY["b12"]diff --git a/ifixai/inspections/b13_plan_traceability/runner.py b/ifixai/inspections/b13_plan_traceability/runner.pyindex 4c4e3a9..437eaa5 100644--- a/ifixai/inspections/b13_plan_traceability/runner.py+++ b/ifixai/inspections/b13_plan_traceability/runner.py@@ -2,16 +2,16 @@ import loggingfrom dateutil.parser import parse as parse_datetime-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (- InspectionCategory,- InspectionSpec,EvidenceItem,Fixture,+ InspectionCategory,+ InspectionSpec,ProviderConfig,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b14_covert_side_task/runner.py b/ifixai/inspections/b14_covert_side_task/runner.pyindex 98f50fb..e2043ac 100644--- a/ifixai/inspections/b14_covert_side_task/runner.py+++ b/ifixai/inspections/b14_covert_side_task/runner.py@@ -2,30 +2,29 @@ import asyncioimport loggingimport secretsfrom pathlib import Path--from ifixai.harness.adversarial_mutator import (- MutatedVariant,- SeedEntry,- expand_seeds,- load_seeds,-)-from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader-from ifixai.harness.base import BaseTestfrom typing import Optional+from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCYfrom ifixai.core.types import (+ EvaluationMethod,EvidenceItem,Fixture,InspectionCategory,InspectionMethod,- EvaluationMethod,InspectionSpec,ProviderConfig,ScoreBreakdown,User,)+from ifixai.harness.adversarial_mutator import (+ MutatedVariant,+ SeedEntry,+ expand_seeds,+ load_seeds,+)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoaderSPEC = InspectionSpec(test_id="B14",diff --git a/ifixai/inspections/b15_long_horizon_drift/runner.py b/ifixai/inspections/b15_long_horizon_drift/runner.pyindex d6c37ee..577b46c 100644--- a/ifixai/inspections/b15_long_horizon_drift/runner.py+++ b/ifixai/inspections/b15_long_horizon_drift/runner.py@@ -1,12 +1,6 @@import warningsfrom typing import Optional, TypedDict-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (ChatMessage,ConversationPlan,@@ -23,6 +17,12 @@ from ifixai.core.types import (ScoreBreakdown,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader+from ifixai.utils.template_renderer import renderclass DriftSignalEntry(TypedDict):diff --git a/ifixai/inspections/b16_silent_failure/runner.py b/ifixai/inspections/b16_silent_failure/runner.pyindex d9a5748..ed367cc 100644--- a/ifixai/inspections/b16_silent_failure/runner.py+++ b/ifixai/inspections/b16_silent_failure/runner.py@@ -1,19 +1,19 @@from pathlib import Pathfrom typing import Optional-from ifixai.harness.base import BaseTest-from ifixai.harness.prompt_pool import load_prompt_pool, sample_prompt_pool-from ifixai.inspections.holdout_ids import generate_holdout_ids-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (- InspectionCategory,- InspectionSpec,EvidenceItem,Fixture,+ InspectionCategory,+ InspectionSpec,ProviderConfig,ScoreBreakdown,)+from ifixai.harness.base import BaseTest+from ifixai.harness.prompt_pool import load_prompt_pool, sample_prompt_pool+from ifixai.inspections.holdout_ids import generate_holdout_ids+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader# Threshold rationale: B16 score is binary "% of failing requests reported".# 0.95 allows 1-in-20 silent failure tolerance, parity with sibling deceptiondiff --git a/ifixai/inspections/b17_fact_consistency/runner.py b/ifixai/inspections/b17_fact_consistency/runner.pyindex 18b1593..cbb7d7f 100644--- a/ifixai/inspections/b17_fact_consistency/runner.py+++ b/ifixai/inspections/b17_fact_consistency/runner.py@@ -3,16 +3,6 @@ import loggingfrom typing import Optionalfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import (- generate_envelope_nonce,- load_analytic_rubric,- sanitize_response_payload,-)-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message, sample_capped-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (ChatMessage,ConversationPlan,@@ -27,6 +17,16 @@ from ifixai.core.types import (Tool,User,)+from ifixai.evaluation.analytic_judge import (+ generate_envelope_nonce,+ load_analytic_rubric,+ sanitize_response_payload,+)+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message, sample_capped+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader+from ifixai.utils.template_renderer import render_logger = logging.getLogger(__name__)@@ -335,7 +335,7 @@ class B17FactConsistency(BaseTest):response = await provider.send_message(history, config)except (ProviderEmptyContentError, JudgePipelineRequiredError):raise- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn EvidenceItem(test_case_id=(f"B17_{user.user_id}_{tool.tool_id}_p{phrasing_index}"diff --git a/ifixai/inspections/b18_goal_stability/runner.py b/ifixai/inspections/b18_goal_stability/runner.pyindex 6f60ca1..84cbcc1 100644--- a/ifixai/inspections/b18_goal_stability/runner.py+++ b/ifixai/inspections/b18_goal_stability/runner.py@@ -4,10 +4,6 @@ from typing import Optionalimport yaml-from ifixai.evaluation.pipeline import EvaluationPipeline-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (AnalyticRubric,ConversationPlan,@@ -23,6 +19,10 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.pipeline import EvaluationPipeline+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoaderSPEC = InspectionSpec(test_id="B18",diff --git a/ifixai/inspections/b19_context_accuracy/runner.py b/ifixai/inspections/b19_context_accuracy/runner.pyindex 6301a4b..2805661 100644--- a/ifixai/inspections/b19_context_accuracy/runner.py+++ b/ifixai/inspections/b19_context_accuracy/runner.py@@ -6,11 +6,6 @@ from dataclasses import dataclassfrom typing import Final, Literalfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.evaluation.pipeline import EvaluationPipeline-from ifixai.providers.base import ChatProvider, ProviderError-from ifixai.harness.base import BaseTest, build_system_message, sample_cappedfrom ifixai.core.types import (ChatMessage,EvaluationCriteria,@@ -25,6 +20,11 @@ from ifixai.core.types import (TestResult,TestStatus,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.evaluation.pipeline import EvaluationPipeline+from ifixai.harness.base import BaseTest, build_system_message, sample_capped+from ifixai.providers.base import ChatProvider, ProviderErrorSPEC = InspectionSpec(test_id="B19",@@ -193,13 +193,13 @@ class B19ContextAccuracy(BaseTest):try:context_ack = await provider.send_message(history, config)history.append(ChatMessage(role="assistant", content=context_ack))- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _setup_error_evidence(user_id, probe, exc)history.append(ChatMessage(role="user", content=probe.query_turn))try:recall_response = await provider.send_message(history, config)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _query_error_evidence(user_id, probe, exc)return await self._score_recall(diff --git a/ifixai/inspections/b20_instruction_adherence/runner.py b/ifixai/inspections/b20_instruction_adherence/runner.pyindex 77e6e71..4017ebb 100644--- a/ifixai/inspections/b20_instruction_adherence/runner.py+++ b/ifixai/inspections/b20_instruction_adherence/runner.py@@ -6,11 +6,6 @@ from dataclasses import dataclassfrom typing import Finalfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.evaluation.pipeline import EvaluationPipeline-from ifixai.harness.base import BaseTest, build_system_message, sample_capped-from ifixai.providers.base import ChatProvider, ProviderErrorfrom ifixai.core.types import (ChatMessage,EvaluationCriteria,@@ -25,6 +20,11 @@ from ifixai.core.types import (TestResult,TestStatus,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.evaluation.pipeline import EvaluationPipeline+from ifixai.harness.base import BaseTest, build_system_message, sample_capped+from ifixai.providers.base import ChatProvider, ProviderErrorSPEC = InspectionSpec(test_id="B20",@@ -232,7 +232,7 @@ class B20InstructionAdherence(BaseTest):response = await self._send_probe(semaphore, provider, config, probe, role)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn EvidenceItem(test_case_id=test_case_id,description=description,diff --git a/ifixai/inspections/b21_cross_turn_objective/runner.py b/ifixai/inspections/b21_cross_turn_objective/runner.pyindex 22fe5ad..e5fb212 100644--- a/ifixai/inspections/b21_cross_turn_objective/runner.py+++ b/ifixai/inspections/b21_cross_turn_objective/runner.py@@ -4,10 +4,6 @@ from typing import Optionalimport yaml-from ifixai.evaluation.pipeline import EvaluationPipeline-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (AnalyticRubric,EvidenceItem,@@ -21,6 +17,10 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.pipeline import EvaluationPipeline+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoaderSPEC = InspectionSpec(test_id="B21",diff --git a/ifixai/inspections/b22_decision_reproducibility/runner.py b/ifixai/inspections/b22_decision_reproducibility/runner.pyindex 9d364fa..95c08b8 100644--- a/ifixai/inspections/b22_decision_reproducibility/runner.py+++ b/ifixai/inspections/b22_decision_reproducibility/runner.py@@ -4,14 +4,7 @@ import randomimport refrom collections import Counter-from ifixai.evaluation.analytic_judge import (- generate_envelope_nonce,- load_analytic_rubric,- sanitize_response_payload,-)from ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.providers.base import ChatProvider, ProviderError-from ifixai.harness.base import BaseTest, build_system_message, sample_cappedfrom ifixai.core.types import (ChatMessage,EvaluationCriteria,@@ -25,10 +18,17 @@ from ifixai.core.types import (Tool,User,)+from ifixai.evaluation.analytic_judge import (+ generate_envelope_nonce,+ load_analytic_rubric,+ sanitize_response_payload,+)+from ifixai.harness.base import BaseTest, build_system_message, sample_cappedfrom ifixai.inspections.b22_decision_reproducibility.schemas import (ArmDecisions,StabilityResult,)+from ifixai.providers.base import ChatProvider, ProviderErrorREPETITIONS: int = 5PARAPHRASES: int = 4@@ -564,5 +564,5 @@ async def send_single_prompt(history.append(ChatMessage(role="user", content=prompt))try:return await provider.send_message(history, config)- except Exception:+ except Exception: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn Nonediff --git a/ifixai/inspections/b23_policy_version_trace/runner.py b/ifixai/inspections/b23_policy_version_trace/runner.pyindex 6026bae..6fd329a 100644--- a/ifixai/inspections/b23_policy_version_trace/runner.py+++ b/ifixai/inspections/b23_policy_version_trace/runner.py@@ -1,8 +1,6 @@import loggingimport re-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTestfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -12,6 +10,8 @@ from ifixai.core.types import (InspectionSpec,ProviderConfig,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b24_risk_scoring/runner.py b/ifixai/inspections/b24_risk_scoring/runner.pyindex 1facdc8..6762a76 100644--- a/ifixai/inspections/b24_risk_scoring/runner.py+++ b/ifixai/inspections/b24_risk_scoring/runner.py@@ -1,9 +1,6 @@import loggingfrom typing import Any, Optional-from ifixai.harness.base import BaseTest, sample_capped-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom ifixai.core.types import (ConversationPlan,DataSource,@@ -16,6 +13,9 @@ from ifixai.core.types import (ScoreBreakdown,User,)+from ifixai.harness.base import BaseTest, sample_capped+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b25_regulatory_readiness/classifier.py b/ifixai/inspections/b25_regulatory_readiness/classifier.pyindex 7802211..a6dd8fe 100644--- a/ifixai/inspections/b25_regulatory_readiness/classifier.py+++ b/ifixai/inspections/b25_regulatory_readiness/classifier.py@@ -135,7 +135,7 @@ def apply_classifier_override(is_mandatory=is_mandatory,)if not any(ds.dimension_name == DIM_NAME for ds in verdict.dimension_scores):- new_scores = list(verdict.dimension_scores) + [classifier_score]+ new_scores = [*verdict.dimension_scores, classifier_score]else:new_scores = _replace_dimension_score(list(verdict.dimension_scores), classifier_scorediff --git a/ifixai/inspections/b25_regulatory_readiness/runner.py b/ifixai/inspections/b25_regulatory_readiness/runner.pyindex 70ac5df..27be90c 100644--- a/ifixai/inspections/b25_regulatory_readiness/runner.py+++ b/ifixai/inspections/b25_regulatory_readiness/runner.py@@ -1,25 +1,24 @@import logging--from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest-from ifixai.inspections.b25_regulatory_readiness.classifier import (- apply_classifier_override,-)-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoaderfrom typing import Optionalfrom ifixai.core.types import (AnalyticRubric,ConversationPlan,- InspectionCategory,- InspectionSpec,EvidenceItem,Fixture,+ InspectionCategory,+ InspectionSpec,ProviderConfig,ScoreBreakdown,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest+from ifixai.inspections.b25_regulatory_readiness.classifier import (+ apply_classifier_override,+)+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b26_rate_limiting/runner.py b/ifixai/inspections/b26_rate_limiting/runner.pyindex e49f701..46cdcf4 100644--- a/ifixai/inspections/b26_rate_limiting/runner.py+++ b/ifixai/inspections/b26_rate_limiting/runner.py@@ -3,15 +3,6 @@ import loggingimport timefrom typing import Optional, TypedDict-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.providers.base import (- ChatProvider,- ProviderConnectionError,- ProviderRateLimitError,- ProviderTimeoutError,-)-from ifixai.harness.base import BaseTest-from ifixai.rules.loader import RuleLoadErrorfrom ifixai.core.types import (ChatMessage,ConversationPlan,@@ -24,6 +15,15 @@ from ifixai.core.types import (ProviderConfig,ScoreBreakdown,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.harness.base import BaseTest+from ifixai.providers.base import (+ ChatProvider,+ ProviderConnectionError,+ ProviderRateLimitError,+ ProviderTimeoutError,+)+from ifixai.rules.loader import RuleLoadError_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/b27_session_integrity/runner.py b/ifixai/inspections/b27_session_integrity/runner.pyindex 1599f34..f7d2591 100644--- a/ifixai/inspections/b27_session_integrity/runner.py+++ b/ifixai/inspections/b27_session_integrity/runner.py@@ -4,12 +4,6 @@ from typing import Literalfrom typing_extensions import NotRequired, TypedDict-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.rules.loader import RuleLoader-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (ChatMessage,EvaluationCriteria,@@ -21,6 +15,12 @@ from ifixai.core.types import (JudgeErrorKind,ProviderConfig,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader+from ifixai.utils.template_renderer import renderLeakMatchKind = Literal["full", "prefix_user_scoped", "hash_fragment", "none"]@@ -207,7 +207,7 @@ class B27SessionIntegrity(BaseTest):try:setup_response = await provider.send_message(history, config)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepevidence.append(EvidenceItem(test_case_id=f"B27_{user_a.user_id}_vs_{user_b.user_id}",@@ -231,7 +231,7 @@ class B27SessionIntegrity(BaseTest):try:probe_response = await provider.send_message(history, config)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepevidence.append(EvidenceItem(test_case_id=f"B27_{user_a.user_id}_vs_{user_b.user_id}",diff --git a/ifixai/inspections/b28_rag_context_integrity/runner.py b/ifixai/inspections/b28_rag_context_integrity/runner.pyindex 6ac45a3..164394d 100644--- a/ifixai/inspections/b28_rag_context_integrity/runner.py+++ b/ifixai/inspections/b28_rag_context_integrity/runner.py@@ -5,14 +5,6 @@ import secretsfrom pathlib import Pathfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.adversarial_mutator import (- expand_seeds,- load_seeds,-)-from ifixai.harness.base import BaseTest, send_single_turn-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (EvaluationCriteria,EvidenceItem,@@ -21,6 +13,14 @@ from ifixai.core.types import (InspectionSpec,ProviderConfig,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.adversarial_mutator import (+ expand_seeds,+ load_seeds,+)+from ifixai.harness.base import BaseTest, send_single_turn+from ifixai.providers.base import ChatProviderSPEC = InspectionSpec(test_id="B28",diff --git a/ifixai/inspections/b29_prompt_sensitivity/runner.py b/ifixai/inspections/b29_prompt_sensitivity/runner.pyindex e324369..e7ebbe5 100644--- a/ifixai/inspections/b29_prompt_sensitivity/runner.py+++ b/ifixai/inspections/b29_prompt_sensitivity/runner.py@@ -2,23 +2,10 @@ import asyncioimport loggingfrom collections.abc import Callablefrom pathlib import Path+from typing_extensions import NotRequired, TypedDict-from ifixai.evaluation.analytic_judge import (- generate_envelope_nonce,- load_analytic_rubric,- sanitize_response_payload,-)-from ifixai.evaluation.errors import JudgePipelineRequiredErrorfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.harness.prompt_pool import (- derive_secondary_seed,- load_phrasing_pool,- sample_phrasing_pool,-)-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -32,6 +19,20 @@ from ifixai.core.types import (JudgeErrorKind,ProviderConfig,)+from ifixai.evaluation.analytic_judge import (+ generate_envelope_nonce,+ load_analytic_rubric,+ sanitize_response_payload,+)+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.harness.prompt_pool import (+ derive_secondary_seed,+ load_phrasing_pool,+ sample_phrasing_pool,+)+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorclass PhrasingResult(TypedDict):@@ -185,14 +186,15 @@ class B29PromptSensitivity(BaseTest):history.append(ChatMessage(role="user", content=phrasing))try:response = await provider.send_message(history, config)- return {"ok": True, "text": response}- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-phrasing probe records any failure as a communication errorreturn {"ok": False,"text": "","error_kind": "communication","error_message": str(exc),}+ else:+ return {"ok": True, "text": response}async def _score_group(self,diff --git a/ifixai/inspections/b30_malicious_deployer_rules/runner.py b/ifixai/inspections/b30_malicious_deployer_rules/runner.pyindex d6696d2..2962607 100644--- a/ifixai/inspections/b30_malicious_deployer_rules/runner.py+++ b/ifixai/inspections/b30_malicious_deployer_rules/runner.py@@ -3,14 +3,6 @@ import secretsfrom pathlib import Pathfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.evaluation.response_classifier import ResponseClass-from ifixai.harness.adversarial_mutator import (- expand_seeds,- load_seeds,-)-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTestfrom ifixai.core.types import (ChatMessage,EvaluationMethod,@@ -21,6 +13,14 @@ from ifixai.core.types import (JudgeErrorKind,ProviderConfig,)+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.evaluation.response_classifier import ResponseClass+from ifixai.harness.adversarial_mutator import (+ expand_seeds,+ load_seeds,+)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProviderSPEC = InspectionSpec(test_id="B30",diff --git a/ifixai/inspections/b31_escalation_correctness/runner.py b/ifixai/inspections/b31_escalation_correctness/runner.pyindex c25274a..8920ee2 100644--- a/ifixai/inspections/b31_escalation_correctness/runner.py+++ b/ifixai/inspections/b31_escalation_correctness/runner.py@@ -4,11 +4,6 @@ import refrom collections.abc import Callablefrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTest, sample_capped-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -23,6 +18,11 @@ from ifixai.core.types import (ProviderConfig,RubricVerdict,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, sample_capped+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorSPEC = InspectionSpec(test_id="B31",diff --git a/ifixai/inspections/b32_off_topic_detection/runner.py b/ifixai/inspections/b32_off_topic_detection/runner.pyindex b3b9b27..fe27e6c 100644--- a/ifixai/inspections/b32_off_topic_detection/runner.py+++ b/ifixai/inspections/b32_off_topic_detection/runner.py@@ -5,13 +5,7 @@ from typing import Optionalimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredErrorfrom ifixai.core.concurrency import DEFAULT_INSPECTION_CONCURRENCY-from ifixai.providers.base import ChatProvider-from ifixai.harness.base import BaseTest-from ifixai.harness.prompt_pool import load_prompt_pool, sample_prompt_pool-from ifixai.rules.loader import RuleLoadErrorfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -25,6 +19,12 @@ from ifixai.core.types import (ProviderConfig,ScoreBreakdown,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest+from ifixai.harness.prompt_pool import load_prompt_pool, sample_prompt_pool+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoadError_logger = logging.getLogger(__name__)@@ -334,7 +334,7 @@ class B32OffTopicDetection(BaseTest):[ChatMessage(role="user", content=prompt)],config,)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweep# Per-probe COMMUNICATION isolation: one transient provider# error must not cancel sibling gather tasks. Narrow catch to# Exception so KeyboardInterrupt / asyncio.CancelledError still@@ -379,7 +379,7 @@ class B32OffTopicDetection(BaseTest):[ChatMessage(role="user", content=prompt)],config,)- except Exception as exc:+ except Exception as exc: # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweep_logger.warning("B32 on-topic probe %d communication error: %r", idx, exc)diff --git a/ifixai/inspections/c02_low_confidence_abstention/runner.py b/ifixai/inspections/c02_low_confidence_abstention/runner.pyindex 0bf52cb..a20e58a 100644--- a/ifixai/inspections/c02_low_confidence_abstention/runner.py+++ b/ifixai/inspections/c02_low_confidence_abstention/runner.py@@ -25,12 +25,10 @@ import asyncioimport loggingimport randomimport secrets+from collections.abc import Callablefrom dataclasses import dataclass-from typing import Callable, Optional, TypedDict+from typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (ConfidenceReport,EvaluationMethod,@@ -47,6 +45,9 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_itemlogger = logging.getLogger(__name__)@@ -474,7 +475,7 @@ async def _score_probe(async with semaphore:try:report = await provider.get_confidence(query, config)- except Exception as exc: # pragma: no cover - defensive+ except Exception as exc: # pragma: no cover - defensive # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _provider_error_item(item, query, exc)if report is None:return _provider_error_item(item, query, None)diff --git a/ifixai/inspections/c05_human_fallback_routing/runner.py b/ifixai/inspections/c05_human_fallback_routing/runner.pyindex e378959..a890c9b 100644--- a/ifixai/inspections/c05_human_fallback_routing/runner.py+++ b/ifixai/inspections/c05_human_fallback_routing/runner.py@@ -29,12 +29,10 @@ import asyncioimport loggingimport randomimport secrets+from collections.abc import Callablefrom dataclasses import dataclass-from typing import Callable, Optional, TypedDict+from typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -51,6 +49,9 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_itemlogger = logging.getLogger(__name__)@@ -526,7 +527,7 @@ async def _score_probe(async with semaphore:try:report = await provider.route_to_human(observation, injected, config)- except Exception as exc: # pragma: no cover - defensive+ except Exception as exc: # pragma: no cover - defensive # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _provider_error_item(item, observation, injected, exc)if report is None:return _provider_error_item(item, observation, injected, None)diff --git a/ifixai/inspections/c11_operational_outcome_conformance/runner.py b/ifixai/inspections/c11_operational_outcome_conformance/runner.pyindex 9efdca0..0edd7d4 100644--- a/ifixai/inspections/c11_operational_outcome_conformance/runner.py+++ b/ifixai/inspections/c11_operational_outcome_conformance/runner.py@@ -41,12 +41,10 @@ import asyncioimport loggingimport randomimport secrets+from collections.abc import Callablefrom dataclasses import dataclass, field-from typing import Callable, Optional, TypedDict+from typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -64,6 +62,9 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_itemlogger = logging.getLogger(__name__)@@ -614,7 +615,7 @@ async def _score_probe(async with semaphore:try:report = await provider.reconcile_outcome(feed, config)- except Exception as exc: # pragma: no cover - defensive+ except Exception as exc: # pragma: no cover - defensive # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _provider_error_item(item, feed, exc)if report is None:return _provider_error_item(item, feed, None)diff --git a/ifixai/inspections/p01_destruction_resistance/runner.py b/ifixai/inspections/p01_destruction_resistance/runner.pyindex 757e628..cee63d8 100644--- a/ifixai/inspections/p01_destruction_resistance/runner.py+++ b/ifixai/inspections/p01_destruction_resistance/runner.py@@ -14,8 +14,6 @@ gate. No LLM judge; no rubric.yaml / references.yaml (structural-only).from dataclasses import dataclassfrom typing import TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (EvaluationMethod,EvidenceItem,@@ -27,6 +25,8 @@ from ifixai.core.types import (Tool,ToolInvocationResult,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider# A tool is destructive when any of its descriptive fields contains one of these# verbs. Detection over fields that already exist on the diagnostic Tool model —diff --git a/ifixai/inspections/p08_self_audit_trail_integrity/runner.py b/ifixai/inspections/p08_self_audit_trail_integrity/runner.pyindex 92a7a12..b988d4c 100644--- a/ifixai/inspections/p08_self_audit_trail_integrity/runner.py+++ b/ifixai/inspections/p08_self_audit_trail_integrity/runner.py@@ -19,8 +19,6 @@ from dataclasses import dataclassfrom datetime import datetimefrom typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProviderfrom ifixai.core.types import (AuditRecord,EvaluationMethod,@@ -32,6 +30,8 @@ from ifixai.core.types import (ProviderConfig,Tool,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider_logger = logging.getLogger(__name__)diff --git a/ifixai/inspections/p13_hidden_side_objective_persistence/runner.py b/ifixai/inspections/p13_hidden_side_objective_persistence/runner.pyindex 31be713..616c25d 100644--- a/ifixai/inspections/p13_hidden_side_objective_persistence/runner.py+++ b/ifixai/inspections/p13_hidden_side_objective_persistence/runner.py@@ -23,12 +23,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -49,7 +43,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoaderfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)diff --git a/ifixai/inspections/p19_honeypot_tool_restraint/runner.py b/ifixai/inspections/p19_honeypot_tool_restraint/runner.pyindex 1ad0368..baa7696 100644--- a/ifixai/inspections/p19_honeypot_tool_restraint/runner.py+++ b/ifixai/inspections/p19_honeypot_tool_restraint/runner.py@@ -37,12 +37,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, send_single_turn, sample_capped-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,DimensionScore,@@ -62,7 +56,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, sample_capped, send_single_turn+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)@@ -700,7 +700,7 @@ def _stable_probe_seed(scenario_id: str, user_id: str) -> int:seeds so cases do not share sampled state. SHA-256 truncated to 31 bits givesboth properties without per-run drift. Mirrors B10._stable_triple_seed."""- digest = hashlib.sha256(f"{scenario_id}|{user_id}".encode("utf-8")).digest()+ digest = hashlib.sha256(f"{scenario_id}|{user_id}".encode()).digest()return int.from_bytes(digest[:4], "big") % _SEED_CEILINGdiff --git a/ifixai/inspections/p22_goal_edit_acceptance/runner.py b/ifixai/inspections/p22_goal_edit_acceptance/runner.pyindex ec2e08d..e6f494b 100644--- a/ifixai/inspections/p22_goal_edit_acceptance/runner.py+++ b/ifixai/inspections/p22_goal_edit_acceptance/runner.py@@ -26,12 +26,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -52,7 +46,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)diff --git a/ifixai/inspections/p27_privilege_creep/runner.py b/ifixai/inspections/p27_privilege_creep/runner.pyindex 5a57e91..f541781 100644--- a/ifixai/inspections/p27_privilege_creep/runner.py+++ b/ifixai/inspections/p27_privilege_creep/runner.py@@ -26,12 +26,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -52,7 +46,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)diff --git a/ifixai/inspections/p32_emergent_systemic_harm/runner.py b/ifixai/inspections/p32_emergent_systemic_harm/runner.pyindex 90643d9..e1f237b 100644--- a/ifixai/inspections/p32_emergent_systemic_harm/runner.py+++ b/ifixai/inspections/p32_emergent_systemic_harm/runner.py@@ -30,12 +30,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -56,7 +50,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)diff --git a/ifixai/inspections/s02_configurer_stakeholder_conflict/runner.py b/ifixai/inspections/s02_configurer_stakeholder_conflict/runner.pyindex dc38ae8..4763122 100644--- a/ifixai/inspections/s02_configurer_stakeholder_conflict/runner.py+++ b/ifixai/inspections/s02_configurer_stakeholder_conflict/runner.py@@ -30,12 +30,6 @@ from typing import Optional, TypedDictimport yaml-from ifixai.evaluation.analytic_judge import load_analytic_rubric-from ifixai.evaluation.errors import JudgePipelineRequiredError-from ifixai.harness.base import BaseTest, build_system_message, sample_capped-from ifixai.providers.base import ChatProvider, ProviderEmptyContentError-from ifixai.rules.loader import RuleLoader, RuleLoadError-from ifixai.utils.template_renderer import renderfrom ifixai.core.types import (AnalyticRubric,ChatMessage,@@ -56,7 +50,13 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.evaluation.analytic_judge import load_analytic_rubric+from ifixai.evaluation.errors import JudgePipelineRequiredError+from ifixai.harness.base import BaseTest, build_system_message, sample_capped+from ifixai.providers.base import ChatProvider, ProviderEmptyContentError+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_item+from ifixai.utils.template_renderer import renderlogger = logging.getLogger(__name__)diff --git a/ifixai/inspections/x04_detection_performance_gate/runner.py b/ifixai/inspections/x04_detection_performance_gate/runner.pyindex 2ab8be1..ab2ecb9 100644--- a/ifixai/inspections/x04_detection_performance_gate/runner.py+++ b/ifixai/inspections/x04_detection_performance_gate/runner.py@@ -44,12 +44,10 @@ import asyncioimport loggingimport randomimport secrets+from collections.abc import Callablefrom dataclasses import dataclass-from typing import Callable, Optional, TypedDict+from typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (DeploymentGateReport,DetectionAuditWindow,@@ -67,6 +65,9 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_itemlogger = logging.getLogger(__name__)@@ -631,7 +632,7 @@ async def _score_probe(async with semaphore:try:report = await provider.evaluate_deployment_gate(window, config)- except Exception as exc: # pragma: no cover - defensive+ except Exception as exc: # pragma: no cover - defensive # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _provider_error_item(item, window, exc)if report is None:return _provider_error_item(item, window, None)diff --git a/ifixai/inspections/x11_pre_action_confirmation_gate/runner.py b/ifixai/inspections/x11_pre_action_confirmation_gate/runner.pyindex a217f8b..1fd1e09 100644--- a/ifixai/inspections/x11_pre_action_confirmation_gate/runner.py+++ b/ifixai/inspections/x11_pre_action_confirmation_gate/runner.py@@ -45,12 +45,10 @@ import asyncioimport loggingimport randomimport secrets+from collections.abc import Callablefrom dataclasses import dataclass-from typing import Callable, Optional, TypedDict+from typing import Optional, TypedDict-from ifixai.harness.base import BaseTest-from ifixai.providers.base import ChatProvider-from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.core.types import (ActionConfirmationRequest,ConfirmationGateReport,@@ -68,6 +66,9 @@ from ifixai.core.types import (TestStatus,User,)+from ifixai.harness.base import BaseTest+from ifixai.providers.base import ChatProvider+from ifixai.rules.loader import RuleLoader, RuleLoadErrorfrom ifixai.shared.evidence import build_unscorable_itemlogger = logging.getLogger(__name__)@@ -620,7 +621,7 @@ async def _score_probe(async with semaphore:try:report = await provider.evaluate_confirmation_gate(request, config)- except Exception as exc: # pragma: no cover - defensive+ except Exception as exc: # pragma: no cover - defensive # noqa: BLE001 — per-probe isolation: a single probe failure is recorded as error evidence, never aborts the sweepreturn _provider_error_item(item, request, exc)if report is None:return _provider_error_item(item, request, None)diff --git a/ifixai/judge/config.py b/ifixai/judge/config.pyindex f4fd16b..8f2d0e6 100644--- a/ifixai/judge/config.py+++ b/ifixai/judge/config.py@@ -4,6 +4,7 @@ from typing import Optionalfrom pydantic import BaseModel, model_validator+class JudgeProviderSpec(BaseModel):provider: strdiff --git a/ifixai/judge/evaluator.py b/ifixai/judge/evaluator.pyindex 1afba83..8c6e2ce 100644--- a/ifixai/judge/evaluator.py+++ b/ifixai/judge/evaluator.py@@ -1,6 +1,6 @@+from ifixai.core.types import ClassifierPair, ProviderConfigfrom ifixai.judge.config import JudgeConfig, JudgeProviderSpecfrom ifixai.providers.resolver import resolve_provider-from ifixai.core.types import ClassifierPair, ProviderConfigclass JudgeEvaluator:diff --git a/ifixai/observability/logging.py b/ifixai/observability/logging.pyindex f3ce220..443710d 100644--- a/ifixai/observability/logging.py+++ b/ifixai/observability/logging.py@@ -83,7 +83,7 @@ class _StdlibAdapter:self._bound = boundself._logger = logging.getLogger("ifixai")- def bind(self, **kwargs: Any) -> "_StdlibAdapter":+ def bind(self, **kwargs: Any) -> _StdlibAdapter:return _StdlibAdapter({**self._bound, **kwargs})def _emit(self, level: int, event: str, **kwargs: Any) -> None:diff --git a/ifixai/providers/anthropic.py b/ifixai/providers/anthropic.pyindex 2498ffa..5c87f3b 100644--- a/ifixai/providers/anthropic.py+++ b/ifixai/providers/anthropic.py@@ -2,6 +2,7 @@ import asyncioimport anthropic+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderAuthError,@@ -11,7 +12,6 @@ from ifixai.providers.base import (ProviderResponseError,ProviderTimeoutError,)-from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.schemas import MessageSplitDEFAULT_MODEL = "claude-sonnet-4-6"diff --git a/ifixai/providers/azure.py b/ifixai/providers/azure.pyindex 7a7281a..6a653dc 100644--- a/ifixai/providers/azure.py+++ b/ifixai/providers/azure.py@@ -2,17 +2,17 @@ import asyncioimport openai+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,- create_chat_completion_json_fallback,ProviderAuthError,ProviderConnectionError,ProviderEmptyContentError,ProviderRateLimitError,ProviderResponseError,ProviderTimeoutError,+ create_chat_completion_json_fallback,)-from ifixai.core.types import ChatMessage, ProviderConfigDEFAULT_API_VERSION = "2024-10-21"@@ -138,8 +138,6 @@ class AzureOpenAIProvider(ChatProvider):endpoint=config.endpoint,details=f"Empty content in response (finish_reason={finish_reason})",)- return content-except openai.AuthenticationError as exc:raise ProviderAuthError(provider="azure",@@ -170,3 +168,5 @@ class AzureOpenAIProvider(ChatProvider):endpoint=config.endpoint,details=str(exc),) from exc+ else:+ return contentdiff --git a/ifixai/providers/bedrock.py b/ifixai/providers/bedrock.pyindex 9fe8646..6c89724 100644--- a/ifixai/providers/bedrock.py+++ b/ifixai/providers/bedrock.py@@ -3,6 +3,7 @@ import asyncioimport boto3import botocore.exceptions+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderAuthError,@@ -12,7 +13,6 @@ from ifixai.providers.base import (ProviderResponseError,ProviderTimeoutError,)-from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.schemas import ConversePayloadINITIAL_BACKOFF_SECONDS = 1.0@@ -87,8 +87,6 @@ class BedrockProvider(ChatProvider):),timeout=float(config.timeout),)- return response-except asyncio.TimeoutError as exc:raise ProviderTimeoutError(provider="bedrock",@@ -146,6 +144,8 @@ class BedrockProvider(ChatProvider):endpoint=endpoint,details=str(exc),) from exc+ else:+ return responseraise ProviderRateLimitError(provider="bedrock",diff --git a/ifixai/providers/gemini.py b/ifixai/providers/gemini.pyindex 3449176..034f69d 100644--- a/ifixai/providers/gemini.py+++ b/ifixai/providers/gemini.py@@ -3,6 +3,7 @@ import asyncioimport google.generativeai as genaifrom google.api_core import exceptions as google_exceptions+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderAuthError,@@ -12,7 +13,6 @@ from ifixai.providers.base import (ProviderResponseError,ProviderTimeoutError,)-from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.schemas import GeminiMessagesDEFAULT_MODEL = "gemini-2.0-flash"diff --git a/ifixai/providers/governance_fixture.py b/ifixai/providers/governance_fixture.pyindex 4a81058..6c75a4e 100644--- a/ifixai/providers/governance_fixture.py+++ b/ifixai/providers/governance_fixture.py@@ -222,7 +222,7 @@ class GovernanceFixture(BaseModel):default_response: Optional[str] = None@model_validator(mode="after")- def _ensure_b04_probe_defaults(self) -> "GovernanceFixture":+ def _ensure_b04_probe_defaults(self) -> GovernanceFixture:# Inject B04 probe per_test entries only when both are absent. If the# fixture declares either one explicitly, respect the author's intent# and leave per_test alone.@@ -264,7 +264,7 @@ class GovernanceFixture(BaseModel):return PoliciesBlock.model_validate(merged)@classmethod- def load(cls, path: str) -> "GovernanceFixture":+ def load(cls, path: str) -> GovernanceFixture:import yamlwith open(path, encoding="utf-8") as fh:diff --git a/ifixai/providers/governance_mixin.py b/ifixai/providers/governance_mixin.pyindex 3b450f8..39f4c19 100644--- a/ifixai/providers/governance_mixin.py+++ b/ifixai/providers/governance_mixin.py@@ -16,8 +16,6 @@ import jsonfrom datetime import datetime, timezonefrom typing import Any, Optional-from ifixai.providers.base import ChatProvider-from ifixai.providers.governance_fixture import GovernanceFixture, PoliciesBlockfrom ifixai.core.types import (ActionConfirmationRequest,AuditRecord,@@ -40,6 +38,8 @@ from ifixai.core.types import (classify_detection_window,classify_outcome_feed,)+from ifixai.providers.base import ChatProvider+from ifixai.providers.governance_fixture import GovernanceFixture, PoliciesBlockdef _test_id(config: ProviderConfig) -> Optional[str]:@@ -276,7 +276,7 @@ class GovernanceMixin(ChatProvider):# overrides, if any) → same digest across runs.canonical = json.dumps(policies.model_dump(), sort_keys=True, default=str)digest = hashlib.sha256(- f"{self._governance.version}|{canonical}".encode("utf-8")+ f"{self._governance.version}|{canonical}".encode()).hexdigest()[:16]return ConfigurationVersion(version=self._governance.version,diff --git a/ifixai/providers/http.py b/ifixai/providers/http.pyindex 6c33e67..87068be 100644--- a/ifixai/providers/http.py+++ b/ifixai/providers/http.py@@ -6,16 +6,16 @@ from typing import Anyimport aiohttp+from ifixai.core.types import ChatMessage, ProviderConfig, RetrievedSourcefrom ifixai.providers.base import (ChatProvider,- ProviderConnectionError,ProviderAuthError,+ ProviderConnectionError,ProviderRateLimitError,ProviderResponseError,ProviderTimeoutError,)from ifixai.providers.secrets import scrub_secrets-from ifixai.core.types import ChatMessage, ProviderConfig, RetrievedSourceDEFAULT_ENDPOINT = os.environ.get("IFIXAI_HTTP_ENDPOINT", "http://localhost:8000/v1")EXTRA_HEADERS_ENV_VAR = "IFIXAI_EXTRA_HEADERS"@@ -217,13 +217,14 @@ class HttpProvider(ChatProvider):endpoint=endpoint,details="Empty content in response",)- return contentexcept (KeyError, IndexError, TypeError) as exc:raise ProviderResponseError(provider="http",endpoint=endpoint,details=f"Unexpected response format: {exc}",) from exc+ else:+ return contentdef _capture_sources(self, endpoint: str, data: dict[str, Any]) -> None:raw_sources = data.get("sources")diff --git a/ifixai/providers/huggingface.py b/ifixai/providers/huggingface.pyindex d91ea56..6d75264 100644--- a/ifixai/providers/huggingface.py+++ b/ifixai/providers/huggingface.py@@ -4,6 +4,7 @@ from typing import TYPE_CHECKINGif TYPE_CHECKING:from huggingface_hub import InferenceClient+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderAuthError,@@ -13,7 +14,6 @@ from ifixai.providers.base import (ProviderResponseError,ProviderTimeoutError,)-from ifixai.core.types import ChatMessage, ProviderConfigtry:from huggingface_hub import InferenceClient@@ -68,8 +68,6 @@ class HuggingFaceProvider(ChatProvider):),timeout=float(config.timeout),)- return response-except asyncio.TimeoutError as exc:raise ProviderTimeoutError(provider="huggingface",@@ -115,6 +113,8 @@ class HuggingFaceProvider(ChatProvider):endpoint=endpoint,details=str(exc),) from exc+ else:+ return responseraise ProviderRateLimitError(provider="huggingface",diff --git a/ifixai/providers/langchain.py b/ifixai/providers/langchain.pyindex d3366bd..0c60bcc 100644--- a/ifixai/providers/langchain.py+++ b/ifixai/providers/langchain.py@@ -1,11 +1,11 @@import aiohttp+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderConnectionError,ProviderTimeoutError,)-from ifixai.core.types import ChatMessage, ProviderConfigDEFAULT_ENDPOINT = "http://localhost:8000"diff --git a/ifixai/providers/litellm.py b/ifixai/providers/litellm.pyindex 2b5a7d9..f6119bf 100644--- a/ifixai/providers/litellm.py+++ b/ifixai/providers/litellm.py@@ -59,7 +59,7 @@ class LiteLLMProvider(ChatProvider):choices = response.choicesif not choices:- raise ProviderResponseError(+ raise ProviderResponseError( # noqa: TRY301 — inner functions are disallowed by project styleprovider="litellm",endpoint=config.endpoint or "default",details=f"No choices in response (id={response.id})",@@ -67,19 +67,18 @@ class LiteLLMProvider(ChatProvider):choice = choices[0]finish_reason = choice.finish_reason or "unknown"if choice.message is None:- raise ProviderResponseError(+ raise ProviderResponseError( # noqa: TRY301 — inner functions are disallowed by project styleprovider="litellm",endpoint=config.endpoint or "default",details=f"Missing message in choice (finish_reason={finish_reason})",)content = choice.message.contentif not content:- raise ProviderEmptyContentError(+ raise ProviderEmptyContentError( # noqa: TRY301 — inner functions are disallowed by project styleprovider="litellm",endpoint=config.endpoint or "default",details=f"Empty content in response (finish_reason={finish_reason})",)- return contentexcept ProviderResponseError:raise@@ -101,3 +100,5 @@ class LiteLLMProvider(ChatProvider):endpoint=config.endpoint or "default",details=str(exc),) from exc+ else:+ return contentdiff --git a/ifixai/providers/mock_governance.py b/ifixai/providers/mock_governance.pyindex 01fe18b..2790c18 100644--- a/ifixai/providers/mock_governance.py+++ b/ifixai/providers/mock_governance.py@@ -19,6 +19,7 @@ import timefrom collections import dequefrom typing import Optional+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,ProviderCapability,@@ -26,7 +27,6 @@ from ifixai.providers.base import ()from ifixai.providers.governance_fixture import GovernanceFixturefrom ifixai.providers.governance_mixin import GovernanceMixin-from ifixai.core.types import ChatMessage, ProviderConfig_DIM_NAME_RE = re.compile(r"^\s*-\s+(\S+?)(?:\s+\[MANDATORY\])?:", re.MULTILINE)_GROUND_TRUTH_CLAIM_RE = re.compile(diff --git a/ifixai/providers/openai.py b/ifixai/providers/openai.pyindex e6f6a69..0b9933d 100644--- a/ifixai/providers/openai.py+++ b/ifixai/providers/openai.py@@ -2,17 +2,17 @@ import asyncioimport openai+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,- create_chat_completion_json_fallback,ProviderAuthError,ProviderConnectionError,ProviderEmptyContentError,ProviderRateLimitError,ProviderResponseError,ProviderTimeoutError,+ create_chat_completion_json_fallback,)-from ifixai.core.types import ChatMessage, ProviderConfigDEFAULT_MODEL = "gpt-4o"@@ -108,8 +108,6 @@ class OpenAIProvider(ChatProvider):endpoint=endpoint,details=f"Empty content in response (finish_reason={finish_reason})",)- return content-except openai.AuthenticationError as exc:raise ProviderAuthError(provider="openai",@@ -140,3 +138,5 @@ class OpenAIProvider(ChatProvider):endpoint=endpoint,details=str(exc),) from exc+ else:+ return contentdiff --git a/ifixai/providers/openrouter.py b/ifixai/providers/openrouter.pyindex 8ee0311..ccd4579 100644--- a/ifixai/providers/openrouter.py+++ b/ifixai/providers/openrouter.py@@ -2,17 +2,17 @@ import asyncioimport openai+from ifixai.core.types import ChatMessage, ProviderConfigfrom ifixai.providers.base import (ChatProvider,- create_chat_completion_json_fallback,ProviderAuthError,ProviderConnectionError,ProviderEmptyContentError,ProviderRateLimitError,ProviderResponseError,ProviderTimeoutError,+ create_chat_completion_json_fallback,)-from ifixai.core.types import ChatMessage, ProviderConfigDEFAULT_MODEL = "openai/gpt-4o"DEFAULT_BASE_URL = "https://openrouter.ai/api/v1"@@ -119,7 +119,6 @@ class OpenRouterProvider(ChatProvider):endpoint=base_url,details=f"Empty content in response (finish_reason={finish_reason})",)- return contentexcept openai.AuthenticationError as exc:raise ProviderAuthError(provider="openrouter", endpoint=base_url, details=str(exc)@@ -140,3 +139,5 @@ class OpenRouterProvider(ChatProvider):raise ProviderResponseError(provider="openrouter", endpoint=base_url, details=str(exc)) from exc+ else:+ return contentdiff --git a/ifixai/providers/resolver.py b/ifixai/providers/resolver.pyindex 7f69e66..05d89f2 100644--- a/ifixai/providers/resolver.py+++ b/ifixai/providers/resolver.py@@ -1,13 +1,13 @@+from collections.abc import Mappingfrom pathlib import Path-from typing import Mapping, Union-from ifixai.providers.http import HttpProvider-from ifixai.providers.langchain import LangChainProvider+from ifixai.providers.bridge import BridgeJudgeProviderfrom ifixai.providers.governance_fixture import GovernanceFixturefrom ifixai.providers.governance_mixin import GovernanceMixin+from ifixai.providers.http import HttpProvider+from ifixai.providers.langchain import LangChainProviderfrom ifixai.providers.mock_governance import MockGovernanceProvider-from ifixai.providers.bridge import BridgeJudgeProvidertry:from ifixai.providers.anthropic import AnthropicProvider@@ -119,7 +119,7 @@ def wrap_with_governance(return provider-def resolve_provider(provider: Union[str, object]) -> object:+def resolve_provider(provider: str | object) -> object:if not isinstance(provider, str):return providerdiff --git a/ifixai/reporting/artifact.py b/ifixai/reporting/artifact.pyindex f5f3abc..4d77923 100644--- a/ifixai/reporting/artifact.py+++ b/ifixai/reporting/artifact.py@@ -24,6 +24,8 @@ from ifixai.core.types import TestRunResult, TestStatusfrom ifixai.providers.secrets import scrub_secretsfrom ifixai.reporting.grading import (GRADE_BOUNDARIES as _GRADE_BOUNDARIES,+)+from ifixai.reporting.grading import (GRADE_CLASS as _GRADE_CLASS,)from ifixai.reporting.regulatory import build_regulatory_summarydiff --git a/ifixai/reporting/comparison.py b/ifixai/reporting/comparison.pyindex e08396a..db120fd 100644--- a/ifixai/reporting/comparison.py+++ b/ifixai/reporting/comparison.py@@ -1,8 +1,8 @@from ifixai.core.types import (- TestDelta,ComparisonReport,+ TestDelta,TestRunResult,)diff --git a/ifixai/reporting/gap_analysis.py b/ifixai/reporting/gap_analysis.pyindex 8a24013..b028278 100644--- a/ifixai/reporting/gap_analysis.py+++ b/ifixai/reporting/gap_analysis.py@@ -1,11 +1,11 @@-from ifixai.mappings.loader import get_mappings_for_test, load_all_mappingsfrom ifixai.core.types import (GovernanceGap,RegulatoryFramework,TestResult,TestStatus,)+from ifixai.mappings.loader import get_mappings_for_test, load_all_mappingsTEST_CAPABILITY_MAP: dict[str, str] = {"B01": "Tool Authorization Control",diff --git a/ifixai/reporting/regulatory.py b/ifixai/reporting/regulatory.pyindex 8834b1a..bb76969 100644--- a/ifixai/reporting/regulatory.py+++ b/ifixai/reporting/regulatory.py@@ -1,7 +1,8 @@-from ifixai.mappings.loader import get_mappings_for_test, load_all_mappingsfrom ifixai.core.types import RegulatoryFramework, TestRunResult+from ifixai.mappings.loader import get_mappings_for_test, load_all_mappings+def build_regulatory_summary(result: TestRunResult,diff --git a/ifixai/reporting/scorecard.py b/ifixai/reporting/scorecard.pyindex c45e8d3..2680e6f 100644--- a/ifixai/reporting/scorecard.py+++ b/ifixai/reporting/scorecard.py@@ -1,6 +1,7 @@import jsonfrom typing import Final+from ifixai.core.types import RegulatoryFramework, TestResult, TestRunResult, TestStatusfrom ifixai.judge.config import JudgeConfigfrom ifixai.mappings.loader import load_all_mappingsfrom ifixai.reporting.regulatory import (@@ -8,7 +9,6 @@ from ifixai.reporting.regulatory import (build_regulatory_summary,get_test_regulatory_mappings,)-from ifixai.core.types import TestResult, TestStatus, RegulatoryFramework, TestRunResultSELF_JUDGE_BIAS_ADVISORY: Final[str] = ("self-judge bias: Standard-mode score not comparable to Full-mode "diff --git a/ifixai/rules/loader.py b/ifixai/rules/loader.pyindex 73a5587..75ea43c 100644--- a/ifixai/rules/loader.py+++ b/ifixai/rules/loader.py@@ -58,9 +58,10 @@ class RuleLoader:data = yaml.safe_load(fh)if not isinstance(data, dict):raise RuleLoadError(f"Rule file {path} must be a mapping")- return dataexcept yaml.YAMLError as exc:raise RuleLoadError(f"Invalid YAML in {path}: {exc}") from exc+ else:+ return datadef _parse_plan(self,diff --git a/ifixai/scoring/engine.py b/ifixai/scoring/engine.pyindex d920555..a14355c 100644--- a/ifixai/scoring/engine.py+++ b/ifixai/scoring/engine.py@@ -1,15 +1,15 @@import loggingfrom typing import Optional-from ifixai.evaluation.proportion_ci import ProportionCIfrom ifixai.core.types import (- InspectionCategory,- TestResult,- TestStatus,CategoryScore,ConfidenceInterval,EvidenceItem,+ InspectionCategory,+ TestResult,+ TestStatus,)+from ifixai.evaluation.proportion_ci import ProportionCI_logger = logging.getLogger(__name__)diff --git a/ifixai/telemetry.py b/ifixai/telemetry.pyindex 9555810..8dc9683 100644--- a/ifixai/telemetry.py+++ b/ifixai/telemetry.py@@ -63,7 +63,7 @@ _DISCLOSURE_TEXT = (_started_emitted = False_completed_emitted = False_force_disabled = False-_sender: "_Sender | None" = None+_sender: _Sender | None = None_sender_lock = threading.Lock()@@ -139,9 +139,10 @@ def is_enabled() -> bool:def _read_id() -> str | None:try:value = _id_path().read_text(encoding="utf-8").strip()- return value or Noneexcept OSError:return None+ else:+ return value or Nonedef install_id() -> str | None:@@ -241,7 +242,7 @@ def _enqueue(event: str, surface: str) -> None:if install is None:return_get_sender().submit(_build_payload(event, install, surface))- except Exception:+ except Exception: # noqa: BLE001 — telemetry must never break a runpass # telemetry must never break a run@@ -250,7 +251,7 @@ def _enqueue(event: str, surface: str) -> None:# --------------------------------------------------------------------------- #class _Sender:def __init__(self) -> None:- self._queue: "queue.Queue[bytes | None]" = queue.Queue()+ self._queue: queue.Queue[bytes | None] = queue.Queue()self._opener = urllib.request.build_opener(urllib.request.ProxyHandler({}), # bypass ambient http(s)_proxyurllib.request.HTTPSHandler(context=ssl.create_default_context()),@@ -279,11 +280,11 @@ class _Sender:)with self._opener.open(req, timeout=_REQUEST_TIMEOUT) as resp:resp.read()- except Exception:+ except Exception: # noqa: BLE001 — telemetry must never break a runpass # dead/blocked endpoint must never raise-def _get_sender() -> "_Sender":+def _get_sender() -> _Sender:global _senderwith _sender_lock:if _sender is None:@@ -296,7 +297,7 @@ def _flush() -> None:if _sender is not None:try:_sender.flush(_FLUSH_BUDGET)- except Exception:+ except Exception: # noqa: BLE001 — telemetry must never break a runpassdiff --git a/ifixai/utils/template_renderer.py b/ifixai/utils/template_renderer.pyindex e833c8e..34e8d9a 100644--- a/ifixai/utils/template_renderer.py+++ b/ifixai/utils/template_renderer.py@@ -1,7 +1,7 @@from __future__ import annotationsimport re-from typing import Mapping+from collections.abc import Mapping_PLACEHOLDER_RE = re.compile(r"\{([a-zA-Z_][a-zA-Z0-9_]*)\}")diff --git a/pyproject.toml b/pyproject.tomlindex bb6ceba..dd07592 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -89,6 +89,16 @@ include = ["ifixai*"][tool.setuptools.package-data]ifixai = ["py.typed", "fixtures/**/*.yaml", "fixtures/**/*.json", "fixtures/schema.json", "inspections/[bpcsx]*/*.yaml", "schemas/*.json", "harness/synonyms.yaml", "mappings/*.yaml", "scaffold/*.md"]+[tool.ruff.lint]+select = ["E4", "E7", "E9", "F", "I", "UP", "RUF", "TRY", "BLE"]+ignore = [+ "TRY003", # long messages outside the exception class; pervasive and low-value here+ "RUF001", # ambiguous unicode in strings (intentional in fixture/report copy)+ "RUF002", # ambiguous unicode in docstrings+ "RUF003", # ambiguous unicode in comments+ "UP045", # Optional[x] -> x | None; large mechanical churn, deferred+]+[tool.ruff.lint.per-file-ignores]# ChatProvider base-class methods accept the full provider-call signature as an# interface contract; concrete subclasses use the args, the no-op defaults do not.