Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(tier3): keep correctly unused negative-case advice off the skill (#671)
Christopher Kevin066d43589cd8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex af9b8c18..355d4839 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -412,6 +412,8 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed- Keep Steps per Eval Case chart labels readable for long case IDs while preserving full IDs in hover tooltips.+- Negative controls with complete, confirmed skill non-use report wrong answers as task outcomes instead of recommending skill edits; truncated or recovered attempt evidence cannot establish complete non-use.+- Repeated negative-case task outcomes share one advice item, retain task-failure wording and avoid describing passing attempts as lost, keeping distinct skill fixes visible.- Failed Tier 3 arms retain scored and errored trial activation diagnostics without restoring aggregate quality or lift, or double-counting token usage.- Budget-limited Tier 3 coverage checks retain admitted attempt ordinals, avoiding false missing/excess errors when a denied slot leaves a gap.- HTML reports retain budget context for fully budget-denied runs withoutdiff --git a/src/skillevaluator/evaluation/tier3_report.py b/src/skillevaluator/evaluation/tier3_report.pyindex 76fa3912..d0456d22 100644--- a/src/skillevaluator/evaluation/tier3_report.py+++ b/src/skillevaluator/evaluation/tier3_report.py@@ -3668,31 +3668,6 @@ def _normalize_trials(return out-def _trusted_observed_activation(reward: dict[str, Any]) -> str:- """Project collector-issued invocation evidence; never inspect trajectory or scores as proof."""- from skillevaluator.tier3.harbor.metrics import (- DEFAULT_METRIC_SET,- LEGACY_METRIC_SET,- metric_is_not_applicable,- metric_set_for_reward,- metric_value,- )-- standard_sets = {DEFAULT_METRIC_SET, LEGACY_METRIC_SET}- declared = reward.get("metric_set") or reward.get("metric_set_version")- metric_set, metrics = metric_set_for_reward(reward)- if (- (declared and str(declared) not in standard_sets)- or metric_set not in standard_sets- or "skill_execution" not in metrics- or (metric_value(reward, "skill_execution") is None and not metric_is_not_applicable(reward, "skill_execution"))- or reward.get("invocation_evidence_source") != "trajectory"- ):- return "unknown"- invoked = reward.get("skill_invoked")- return ("invoked" if invoked else "not_invoked") if type(invoked) is bool else "unknown"--def _trial_activation_validation(group: list[dict[str, Any]], trial: dict[str, Any]) -> dict[str, Any]:"""Keep routing, task quality, workflow and resources at their observed scopes.@@ -3700,9 +3675,11 @@ def _trial_activation_validation(group: list[dict[str, Any]], trial: dict[str, Aevery retained row says non-use, omitted steps may have used the skill.Only a collector-produced single/merged root can certify logical non-use."""+ from skillevaluator.tier3.harbor.metrics import trusted_observed_activation+scopes: list[dict[str, Any]] = []for index, reward in enumerate(group[:_MAX_EVIDENCE_PER_CARD]):- scope: dict[str, Any] = {"reward_row": index, "observed_activation": _trusted_observed_activation(reward)}+ scope: dict[str, Any] = {"reward_row": index, "observed_activation": trusted_observed_activation(reward)}artifacts = reward.get("_activation_artifacts")if isinstance(artifacts, dict):scope["artifacts"] = {@@ -3730,7 +3707,7 @@ def _trial_activation_validation(group: list[dict[str, Any]], trial: dict[str, Alogical_scope = len(group) == 1 and group[0].get("invocation_evidence_scope") == "logical_trial"return {"expected_activation": None,- "observed_activation": _trusted_observed_activation(group[0]) if logical_scope else "unknown",+ "observed_activation": trusted_observed_activation(group[0]) if logical_scope else "unknown","expectation_status": "unknown","observation_scope": "logical_trial" if logical_scope else "reward_rows_only","evidence_scopes": scopes,diff --git a/src/skillevaluator/tier3/case_summary.py b/src/skillevaluator/tier3/case_summary.pyindex cc1bfcde..2262ec3e 100644--- a/src/skillevaluator/tier3/case_summary.py+++ b/src/skillevaluator/tier3/case_summary.py@@ -27,6 +27,7 @@ from skillevaluator.reporting.summary_copy import pass_at_k_summaryfrom skillevaluator.reporting.terminal_styles import AMBERfrom skillevaluator.tier3.attempt_verdict import attempt_verdict, scored_goal_accuracyfrom skillevaluator.tier3.eval_core.checks import resolve_should_trigger+from skillevaluator.tier3.harbor.metrics import trusted_observed_activationfrom skillevaluator.tier3.harbor.progress import redact_progress_detail, secret_values_from_environmentfrom skillevaluator.tier3.harbor.report_data import _harbor_task_directory, _recorded_case_idfrom skillevaluator.utils.redaction import redact_sensitive_text@@ -847,11 +848,14 @@ def render_case_summary(head = Text(f" {i}. ", style=f"bold {AMBER}")head.append(safe(fix["case"]), style="bold")n = fix["attempts_lost"]- lost = (- (f" · {n} attempt(s) missed the goal" if fix["kind"] == "goal not met" else f" · lost {n} attempt(s)")- if n- else ""- )+ lost = ""+ if n:+ if fix["kind"] == "task outcome":+ lost = f" · {n} attempt(s) missed the case requirements"+ elif fix["kind"] == "goal not met":+ lost = f" · {n} attempt(s) missed the goal"+ else:+ lost = f" · lost {n} attempt(s)"head.append(f" [{safe(fix['kind'])}] · {safe(fix['scope'])}{lost}", style="dim")console.print(head)console.print(Text(f" what happened: {safe(fix['what'])}"))@@ -1226,6 +1230,11 @@ def _evidence(run_dir: Path, trial_dir: Path | None, *, run_error: bool) -> str:def _fallback_action(issue: Mapping[str, Any]) -> str:kind = issue["kind"]+ if kind == "task outcome":+ return (+ "Not a skill problem: the skill was correctly unused. Check the agent's answer against the existing "+ "case requirements and re-run this case."+ )if kind == "skill not used":request = f' such as "{_short(issue["prompt"], 120)}"' if issue.get("prompt") else ""return (@@ -1313,7 +1322,7 @@ def _dataset_entries(run_dir: Path) -> dict[str, Mapping[str, Any]]:return {str(e["id"]): e for e in entries or [] if isinstance(e, Mapping) and e.get("id") is not None}-_MERGED_KINDS = ("run error", "skill not used", "eval case", "missing input", "goal not met")+_MERGED_KINDS = ("run error", "skill not used", "eval case", "missing input", "goal not met", "task outcome")def _merge_across_cases(issues: list[dict[str, Any]], n_cases: int) -> list[dict[str, Any]]:@@ -1364,6 +1373,57 @@ def _restates(prompt: str, description: str) -> bool:return SequenceMatcher(None, a, b, autojunk=False).find_longest_match(0, len(a), 0, len(b)).size >= _RESTATED_CHARS+def _correctly_unused_negative(+ run_dir: Path,+ agent_name: str,+ agent: Mapping[str, Any],+ case_id: str,+ entry: Mapping[str, Any],+ *,+ trials_by_agent: dict[str, dict[str, list[Path]]] | None = None,+) -> bool:+ if resolve_should_trigger(dict(entry)) is not False:+ return False+ case = _cases(agent, "with_skill").get(case_id)+ if (+ not isinstance(case, Mapping)+ or case.get("attempts_missing")+ or case.get("attempts_recovered")+ or case.get("attempt_details_truncated")+ ):+ return False+ attempts = case.get("attempts")+ if not isinstance(attempts, list) or not attempts:+ return False+ # A retained sample cannot establish non-use by every logical attempt.+ # Older reports may omit counts; present counts must describe these rows.+ for key in ("attempts_used", "attempt_details_total", "attempt_details_shown"):+ if key in case and (type(case[key]) is not int or case[key] != len(attempts)):+ return False+ trials_by_agent = {} if trials_by_agent is None else trials_by_agent+ if agent_name not in trials_by_agent:+ trials_by_agent[agent_name] = _trials_by_case(run_dir, agent_name)+ case_trials = trials_by_agent[agent_name].get(case_id, [])+ if not case_trials:+ return False+ for attempt in attempts:+ if not isinstance(attempt, Mapping):+ return False+ trials = _trial_dirs(run_dir, agent_name, attempt.get("trial"))+ if not trials or any(trial not in case_trials for trial in trials):+ return False+ for trial in case_trials:+ reward = _load_json(trial / "reward.json", root=run_dir)+ if (+ not isinstance(reward, dict)+ or _evaluation_failed(reward)+ or reward.get("invocation_evidence_scope") != "logical_trial"+ or trusted_observed_activation(reward) != "not_invoked"+ ):+ return False+ return True++def what_to_fix(result: Mapping[str, Any], *, run_dir: Path, skill_path: Path | None = None, use_llm: bool = True) -> list[dict[str, Any]]:@@ -1389,13 +1449,26 @@ def _what_to_fix(trials_by_agent: dict[str, dict[str, list[Path]]] = {}for case_id in _case_ids(agents):for name, agent in agents.items():- for issue in _diagnose_agent_case(- run_dir, name, agent, case_id, entry=dataset.get(case_id, {}), trials_by_agent=trials_by_agent+ entry = dataset.get(case_id, {})+ diagnosed = _diagnose_agent_case(+ run_dir, name, agent, case_id, entry=entry, trials_by_agent=trials_by_agent+ )+ if any(issue["kind"] in ("skill", "skill hurts", "goal not met") for issue in diagnosed) and (+ _correctly_unused_negative(run_dir, name, agent, case_id, entry, trials_by_agent=trials_by_agent)):+ for issue in diagnosed:+ if issue["kind"] in ("skill", "skill hurts", "goal not met"):+ if issue["kind"] == "skill hurts":+ issue["what"] = _short(+ "; ".join(issue["reasons"][:2]) or "the agent's answer missed the case requirements",+ 320,+ )+ issue["kind"] = "task outcome"+ for issue in diagnosed:grouped.setdefault((case_id, issue["kind"], issue.get("cause")), []).append(issue)issues = []for items in grouped.values():- names = [item["agent"] for item in items]+ names = list(dict.fromkeys(item["agent"] for item in items))merged = dict(items[0])merged["asks_for_input"] = all(item.get("asks_for_input") for item in items)merged.update(@@ -1414,7 +1487,7 @@ def _what_to_fix(entry = dataset.get(issue["case"], {})prompt = str(entry.get("question") or entry.get("prompt") or "")issue["prompt"] = prompt- if issue["kind"] != "run error" and _restates(prompt, description):+ if issue["kind"] not in ("run error", "task outcome") and _restates(prompt, description):issue["kind"] = "eval case"issue["what"] = "the test prompt repeats the skill description instead of asking for a concrete task"issues = _merge_across_cases(issues, len(_case_ids(agents)))@@ -1426,7 +1499,7 @@ def _what_to_fix(actionable = [issuefor issue in issues- if issue["kind"] not in ("run error", "eval case", "missing input", "skill not used")+ if issue["kind"] not in ("run error", "eval case", "missing input", "skill not used", "task outcome")and not issue.get("asks_for_input")]case_ids = {*dataset, *_case_ids(agents)}diff --git a/src/skillevaluator/tier3/harbor/metrics.py b/src/skillevaluator/tier3/harbor/metrics.pyindex ace6f0c3..98f7494c 100644--- a/src/skillevaluator/tier3/harbor/metrics.py+++ b/src/skillevaluator/tier3/harbor/metrics.py@@ -461,6 +461,23 @@ def metric_set_for_reward(reward: dict[str, Any]) -> tuple[str, tuple[str, ...]]return DEFAULT_METRIC_SET, DEFAULT_METRICS+def trusted_observed_activation(reward: dict[str, Any]) -> str:+ """Project collector-issued invocation evidence; never inspect trajectory or scores as proof."""+ standard_sets = {DEFAULT_METRIC_SET, LEGACY_METRIC_SET}+ declared = reward.get("metric_set") or reward.get("metric_set_version")+ metric_set, metrics = metric_set_for_reward(reward)+ if (+ (declared and str(declared) not in standard_sets)+ or metric_set not in standard_sets+ or "skill_execution" not in metrics+ or (metric_value(reward, "skill_execution") is None and not metric_is_not_applicable(reward, "skill_execution"))+ or reward.get("invocation_evidence_source") != "trajectory"+ ):+ return "unknown"+ invoked = reward.get("skill_invoked")+ return ("invoked" if invoked else "not_invoked") if type(invoked) is bool else "unknown"++def rewards_have_mixed_metric_contracts(rewards: object) -> bool:"""Return whether physical reward rows declare distinct metric contracts."""if not isinstance(rewards, list):diff --git a/tests/test_tier3_case_summary.py b/tests/test_tier3_case_summary.pyindex 2150c5a7..3c4263d3 100644--- a/tests/test_tier3_case_summary.py+++ b/tests/test_tier3_case_summary.py@@ -1499,6 +1499,283 @@ def test_failed_negative_keeps_task_diagnostics(tmp_path: Path, activation_statuassert "omitted the requested total" in fix["what"][email protected]("routing", [{"expected_skill": None}, {"should_trigger": False}])[email protected]("passed", [False, True])[email protected]("use_llm", [False, True])+def test_correctly_unused_negative_answer_does_not_advise_skill_edits(+ tmp_path: Path, monkeypatch, routing: dict, passed: bool, use_llm: bool+) -> None:+ monkeypatch.setattr(+ "skillevaluator.tier3.case_summary._llm_actions",+ lambda *_args: pytest.fail("Correct non-use must not request a skill-edit action"),+ )+ (tmp_path / "dataset_snapshot.json").write_text(json.dumps({"dataset": [{"id": "negative", **routing}]}))+ reward = _reward(False, "the answer omitted the requested total")+ reward.update(+ entry_id="negative",+ skill_execution=1.0,+ goal_accuracy=0.0,+ skill_invoked=False,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ _trial(tmp_path, "a", "t0", reward)+ agent = _agent({"negative": _case(passed)}, {})++ [fix] = what_to_fix({"agents": {"a": agent}}, run_dir=tmp_path, use_llm=use_llm)++ assert fix["kind"] == "task outcome"+ assert fix["source"] == "deterministic"+ assert "correctly unused" in fix["action"]+ assert "SKILL.md" not in fix["action"]+ assert "requested total" in fix["what"] or "requested total" in " ".join(fix["reasons"])+ assert fix["attempts_lost"] == 1++[email protected]("evidence", ["invoked", "unknown", "missing", "error", "custom", "step", "missing scope"])+def test_negative_answer_requires_complete_trusted_non_use_evidence(tmp_path: Path, evidence: str) -> None:+ (tmp_path / "dataset_snapshot.json").write_text(+ json.dumps({"dataset": [{"id": "negative", "expected_skill": None}]})+ )+ if evidence != "missing":+ reward = _reward(False, "wrong total")+ reward.update(+ entry_id="negative",+ skill_execution=1.0,+ skill_invoked=evidence == "invoked",+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ if evidence == "unknown":+ reward.pop("invocation_evidence_source")+ elif evidence == "error":+ reward["evaluation_status"] = "error"+ elif evidence == "custom":+ reward["metric_set"] = "custom-metrics"+ elif evidence == "step":+ reward["invocation_evidence_scope"] = "step"+ elif evidence == "missing scope":+ reward.pop("invocation_evidence_scope")+ _trial(tmp_path, "a", "t0", reward)+ agent = _agent({"negative": _case(False)}, {})++ fixes = what_to_fix({"agents": {"a": agent}}, run_dir=tmp_path, use_llm=False)++ assert all(fix["kind"] != "task outcome" for fix in fixes)+++ "metadata",+ [+ {"attempt_details_truncated": True},+ {"attempts_recovered": 1},+ {"attempts_missing": 1},+ *(+ {key: value}+ for key in ("attempts_used", "attempt_details_total", "attempt_details_shown")+ for value in (2, -1, True, 1.0, "1", None)+ ),+ ],+)+def test_negative_non_use_requires_complete_attempt_details(tmp_path: Path, metadata: dict) -> None:+ from skillevaluator.tier3.case_summary import _correctly_unused_negative++ reward = _reward(False, "wrong total")+ reward.update(+ entry_id="negative",+ skill_execution=1.0,+ skill_invoked=False,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ _trial(tmp_path, "a", "t0", reward)+ case = {**_case(False), **metadata}+ agent = _agent({"negative": case}, {})++ assert not _correctly_unused_negative(tmp_path, "a", agent, "negative", {"expected_skill": None})+++def test_collector_capped_attempts_do_not_claim_complete_negative_non_use(tmp_path: Path) -> None:+ from skillevaluator.tier3.harbor.collector import PUBLISHED_ATTEMPT_DETAILS_PER_CASE_MAX, _pass_summary++ (tmp_path / "dataset_snapshot.json").write_text(+ json.dumps({"dataset": [{"id": "negative", "expected_skill": None}]})+ )+ rewards = []+ for index in range(PUBLISHED_ATTEMPT_DETAILS_PER_CASE_MAX + 1):+ reward = _reward(False, "wrong total")+ reward.update(+ entry_id="negative",+ _trial_name=f"t{index}",+ skill_execution=1.0,+ skill_invoked=index == PUBLISHED_ATTEMPT_DETAILS_PER_CASE_MAX,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ rewards.append(reward)+ _trial(tmp_path, "a", f"t{index}", reward)+ summary = _pass_summary(+ rewards,+ n_attempts=len(rewards),+ pass_threshold=0.5,+ expected_cases=1,+ expected_case_ids=["negative"],+ scorer=lambda _reward: 0.2,+ )+ case = summary["cases"]["negative"]+ assert case["attempt_details_truncated"]+ assert len(case["attempts"]) == PUBLISHED_ATTEMPT_DETAILS_PER_CASE_MAX+ assert case["attempts_used"] == len(rewards)+ agent = _agent({}, {})+ agent["pass_at_k"]["with_skill"] = summary++ fixes = what_to_fix({"agents": {"a": agent}}, run_dir=tmp_path, use_llm=False)++ assert fixes+ assert all(fix["kind"] != "task outcome" and "correctly unused" not in fix["action"] for fix in fixes)+++def test_negative_task_outcome_scope_deduplicates_agent_and_sums_losses(tmp_path: Path) -> None:+ (tmp_path / "dataset_snapshot.json").write_text(+ json.dumps({"dataset": [{"id": "negative", "expected_skill": None}]})+ )+ for name, attempts in (("A", 2), ("B", 1)):+ for i in range(attempts):+ reward = _reward(False, "wrong total" if name == "A" else "correct total")+ reward.update(+ entry_id="negative",+ skill_execution=1.0,+ goal_accuracy=0.0 if name == "A" else 1.0,+ skill_invoked=False,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ _trial(tmp_path, name, f"t{i}", reward)+ agents = {+ "A": _agent({"negative": _case(False, True)}, {}),+ "B": _agent({"negative": _case(True)}, {}),+ }++ [fix] = what_to_fix({"agents": agents}, run_dir=tmp_path, use_llm=False)++ assert fix["kind"] == "task outcome"+ assert fix["scope"] == "A only"+ assert fix["scope"].count("A") == 1+ assert fix["attempts_lost"] == 2++[email protected]("passed", [False, True])+def test_negative_task_outcome_copy_does_not_blame_skill_or_call_passed_attempts_lost(+ tmp_path: Path, passed: bool+) -> None:+ (tmp_path / "dataset_snapshot.json").write_text(+ json.dumps({"dataset": [{"id": "negative", "expected_skill": None}]})+ )+ reward = _reward(False, "wrong total")+ reward.update(+ entry_id="negative",+ goal_accuracy=0.0,+ skill_execution=1.0,+ skill_invoked=False,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ _trial(tmp_path, "a", "t0", reward)+ result = {"agents": {"a": _agent({"negative": _case(passed)}, {"negative": _case(True)})}}++ fixes = what_to_fix(result, run_dir=tmp_path, use_llm=False)+ [fix] = [item for item in fixes if item["kind"] == "task outcome"]+ assert "without the skill" not in fix["what"]+ assert "wrong total" in fix["what"]+ console = Console(record=True, width=180)+ render_case_summary(result, console=console, fixes=[fix])+ advice = console.export_text().split("How to improve", 1)[1]+ assert "missed the case requirements" in advice+ assert "lost " not in advice+++def test_negative_task_outcomes_merge_without_hiding_a_skill_fix(tmp_path: Path) -> None:+ negative_ids = [f"negative-{index}" for index in range(3)]+ (tmp_path / "dataset_snapshot.json").write_text(+ json.dumps(+ {+ "dataset": [+ *({"id": case, "expected_skill": None} for case in negative_ids),+ {"id": "positive", "should_trigger": True},+ ]+ }+ )+ )+ cases = {}+ for case_id in [*negative_ids, "positive"]:+ negative = case_id in negative_ids+ cases[case_id] = _case(*([False, False] if negative else [False]), prefix=case_id)+ for index in range(2 if negative else 1):+ reward = _reward(not negative, "wrong total" if negative else "missing required feature")+ reward.update(+ entry_id=case_id,+ skill_execution=1.0,+ skill_invoked=not negative,+ invocation_evidence_source="trajectory",+ invocation_evidence_scope="logical_trial",+ )+ _trial(tmp_path, "a", f"{case_id}{index}", reward)++ fixes = what_to_fix({"agents": {"a": _agent(cases, {})}}, run_dir=tmp_path, use_llm=False)++ assert len(fixes) == 2+ [task_outcome] = [fix for fix in fixes if fix["kind"] == "task outcome"]+ assert task_outcome["cases"] == negative_ids+ assert task_outcome["attempts_lost"] == 6+ assert any(fix["case"] == "positive" and fix["kind"] == "skill" for fix in fixes)+++def test_trusted_observed_activation_is_a_public_metrics_helper() -> None:+ from skillevaluator.tier3 import case_summary+ from skillevaluator.tier3.harbor import metrics++ helper = metrics.trusted_observed_activation+ trusted = {"skill_execution": 1.0, "invocation_evidence_source": "trajectory"}+ assert helper({**trusted, "skill_invoked": True}) == "invoked"+ assert helper({**trusted, "skill_invoked": False}) == "not_invoked"+ assert helper({**trusted, "skill_invoked": "no"}) == "unknown"+ assert helper({"skill_execution": 1.0, "skill_invoked": False}) == "unknown"+ assert helper({**trusted, "skill_invoked": False, "metric_set": "custom-metrics"}) == "unknown"+ assert helper({"invocation_evidence_source": "trajectory", "skill_invoked": False}) == "unknown"+ assert case_summary.trusted_observed_activation is helper+++def test_report_activation_validation_uses_the_shared_trusted_helper(monkeypatch) -> None:+ from skillevaluator.evaluation.tier3_report import _trial_activation_validation+ from skillevaluator.tier3.harbor import metrics++ monkeypatch.setattr(metrics, "trusted_observed_activation", lambda _reward: "shared-helper")+ reward = {"invocation_evidence_scope": "logical_trial"}+ trial = {"scores": {}}++ validation = _trial_activation_validation([reward], trial)++ assert validation["observed_activation"] == "shared-helper"+ assert validation["evidence_scopes"][0]["observed_activation"] == "shared-helper"+++def test_case_summary_import_does_not_load_the_report_module() -> None:+ import subprocess+ import sys++ source = Path(__file__).resolve().parents[1] / "src"+ code = (+ "import sys; "+ f"sys.path.insert(0, {str(source)!r}); "+ "import skillevaluator.tier3.case_summary; "+ f"assert skillevaluator.tier3.case_summary.__file__ == {str(source / 'skillevaluator/tier3/case_summary.py')!r}; "+ "sys.exit(1 if 'skillevaluator.evaluation.tier3_report' in sys.modules else 0)"+ )+ completed = subprocess.run([sys.executable, "-I", "-c", code], capture_output=True, text=True, timeout=60)++ assert completed.returncode == 0, completed.stderr++@pytest.mark.parametrize("snapshot", [None, "{broken", '{"dataset": [{"id": "c"}]}'])@pytest.mark.parametrize("activation_status", ["never_activated", "unknown"])def test_unlabeled_snapshot_preserves_legacy_activation_diagnosis(