evalrx 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- evalrx/__init__.py +139 -0
- evalrx/agent_assets/__init__.py +2 -0
- evalrx/agent_assets/skills/README.md +28 -0
- evalrx/agent_assets/skills/eval-chart-style/SKILL.md +172 -0
- evalrx/agent_assets/skills/evalrx-report-ui/SKILL.md +116 -0
- evalrx/agent_assets/skills/nature-figure/LICENSE +201 -0
- evalrx/agent_assets/skills/nature-figure/README.md +412 -0
- evalrx/agent_assets/skills/nature-figure/SKILL.md +60 -0
- evalrx/agent_assets/skills/nature-figure/manifest.yaml +59 -0
- evalrx/agent_assets/skills/nature-figure/references/api.md +436 -0
- evalrx/agent_assets/skills/nature-figure/references/backend-selection.md +100 -0
- evalrx/agent_assets/skills/nature-figure/references/chart-types.md +281 -0
- evalrx/agent_assets/skills/nature-figure/references/common-patterns.md +350 -0
- evalrx/agent_assets/skills/nature-figure/references/demos.md +65 -0
- evalrx/agent_assets/skills/nature-figure/references/design-theory.md +439 -0
- evalrx/agent_assets/skills/nature-figure/references/figure-contract.md +93 -0
- evalrx/agent_assets/skills/nature-figure/references/figure-legend-conventions.md +71 -0
- evalrx/agent_assets/skills/nature-figure/references/nature-2026-observations.md +112 -0
- evalrx/agent_assets/skills/nature-figure/references/qa-contract.md +119 -0
- evalrx/agent_assets/skills/nature-figure/references/r-template-index.md +66 -0
- evalrx/agent_assets/skills/nature-figure/references/r-workflow.md +161 -0
- evalrx/agent_assets/skills/nature-figure/references/tutorials.md +251 -0
- evalrx/agent_assets/skills/nature-figure/static/core/contract.md +29 -0
- evalrx/agent_assets/skills/nature-figure/static/core/stance.md +37 -0
- evalrx/agent_assets/skills/nature-figure/static/fragments/backend/python.md +37 -0
- evalrx/agent_assets/skills/nature-figure/static/fragments/backend/r.md +44 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/SKILL.md +213 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/assets/analysis_report_template.md +53 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/references/model_selection.md +72 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/explanatory_var_eda.R +130 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/explanatory_var_eda.py +150 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/fit_outcome_model.R +181 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/fit_outcome_model.py +186 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/univariate_eda.R +149 -0
- evalrx/agent_assets/skills/outcome-driver-analysis/scripts/univariate_eda.py +177 -0
- evalrx/agent_assets/skills.py +27 -0
- evalrx/agent_runtime/__init__.py +78 -0
- evalrx/agent_runtime/_docker_runner.py +89 -0
- evalrx/agent_runtime/cli_runtime.py +103 -0
- evalrx/agent_runtime/cli_transcript.py +138 -0
- evalrx/agent_runtime/cli_types.py +68 -0
- evalrx/agent_runtime/codegen/__init__.py +5 -0
- evalrx/agent_runtime/codegen/runner.py +94 -0
- evalrx/agent_runtime/experiment_harness.py +117 -0
- evalrx/agent_runtime/factory.py +102 -0
- evalrx/agent_runtime/json_shape.py +44 -0
- evalrx/agent_runtime/judges/__init__.py +28 -0
- evalrx/agent_runtime/judges/agy.py +179 -0
- evalrx/agent_runtime/judges/autodetect.py +135 -0
- evalrx/agent_runtime/judges/claude.py +159 -0
- evalrx/agent_runtime/judges/codex.py +120 -0
- evalrx/agent_runtime/providers/__init__.py +21 -0
- evalrx/agent_runtime/providers/antigravity.py +31 -0
- evalrx/agent_runtime/providers/base.py +145 -0
- evalrx/agent_runtime/providers/claude_code.py +49 -0
- evalrx/agent_runtime/providers/codex.py +37 -0
- evalrx/agent_runtime/providers/gemini_cli.py +26 -0
- evalrx/agent_runtime/providers/kimi_cli.py +27 -0
- evalrx/agent_runtime/providers/opencode.py +27 -0
- evalrx/agent_runtime/providers/registry.py +58 -0
- evalrx/agent_runtime/sandbox.py +517 -0
- evalrx/agent_runtime/skill_audit.py +143 -0
- evalrx/agent_runtime/skills/__init__.py +19 -0
- evalrx/agent_runtime/skills/installer.py +68 -0
- evalrx/agent_runtime/skills/prompt_policy.py +86 -0
- evalrx/agent_runtime/skills/resolver.py +19 -0
- evalrx/analysis/__init__.py +132 -0
- evalrx/analysis/adjudicate.py +154 -0
- evalrx/analysis/analysis_module.py +361 -0
- evalrx/analysis/api.py +171 -0
- evalrx/analysis/case_studio.py +651 -0
- evalrx/analysis/cli.py +114 -0
- evalrx/analysis/dashboard.py +350 -0
- evalrx/analysis/eval_case_matrix.py +118 -0
- evalrx/analysis/eval_viz_theme.py +833 -0
- evalrx/analysis/explore_run.py +333 -0
- evalrx/analysis/explorer.py +1276 -0
- evalrx/analysis/failure_modes.py +607 -0
- evalrx/analysis/fused_pipeline.py +489 -0
- evalrx/analysis/holdout.py +300 -0
- evalrx/analysis/hypothesis_agent.py +230 -0
- evalrx/analysis/narration.py +177 -0
- evalrx/analysis/operationalize.py +442 -0
- evalrx/analysis/plain_language.py +42 -0
- evalrx/analysis/planner.py +283 -0
- evalrx/analysis/probe_search.py +203 -0
- evalrx/analysis/profile.py +268 -0
- evalrx/analysis/prompts/__init__.py +0 -0
- evalrx/analysis/prompts/explorer.py +417 -0
- evalrx/analysis/prompts/failure_modes.py +33 -0
- evalrx/analysis/prompts/holdout.py +27 -0
- evalrx/analysis/prompts/hypothesis_agent.py +78 -0
- evalrx/analysis/prompts/run_codebase.py +47 -0
- evalrx/analysis/prompts/stats_agent.py +72 -0
- evalrx/analysis/prompts/stats_tool_generator.py +43 -0
- evalrx/analysis/result_marker.py +47 -0
- evalrx/analysis/run_codebase.py +242 -0
- evalrx/analysis/run_view.py +205 -0
- evalrx/analysis/stage_views.py +93 -0
- evalrx/analysis/stats_agent.py +944 -0
- evalrx/analysis/stats_tool_agent.py +261 -0
- evalrx/analysis/stats_tool_generator.py +415 -0
- evalrx/analysis/stats_tools.py +1153 -0
- evalrx/analysis/trajectory_records.py +193 -0
- evalrx/analysis/workbench.py +431 -0
- evalrx/analyzers/__init__.py +42 -0
- evalrx/analyzers/agent/__init__.py +25 -0
- evalrx/analyzers/agent/counterfactual.py +84 -0
- evalrx/analyzers/agent/first_error_judge.py +96 -0
- evalrx/analyzers/agent/ignored_obs.py +81 -0
- evalrx/analyzers/agent/loop_detect.py +79 -0
- evalrx/analyzers/agent/reliability.py +165 -0
- evalrx/analyzers/agent/tool_shap.py +225 -0
- evalrx/analyzers/agent/trajectory_rubric.py +168 -0
- evalrx/analyzers/attention/__init__.py +19 -0
- evalrx/analyzers/attention/relative_attn.py +610 -0
- evalrx/analyzers/attention/rollout.py +73 -0
- evalrx/analyzers/attention/sink.py +56 -0
- evalrx/analyzers/attention/summary.py +190 -0
- evalrx/analyzers/attribution/__init__.py +6 -0
- evalrx/analyzers/attribution/generic_attn.py +31 -0
- evalrx/analyzers/attribution/gradcam.py +30 -0
- evalrx/analyzers/base.py +12 -0
- evalrx/analyzers/geometry/__init__.py +6 -0
- evalrx/analyzers/geometry/cka.py +70 -0
- evalrx/analyzers/geometry/linear_probe.py +157 -0
- evalrx/analyzers/hallucination/__init__.py +9 -0
- evalrx/analyzers/hallucination/chair.py +78 -0
- evalrx/analyzers/hallucination/opera.py +29 -0
- evalrx/analyzers/hallucination/pope.py +119 -0
- evalrx/analyzers/hallucination/selfcheck.py +155 -0
- evalrx/analyzers/hallucination/vcd.py +29 -0
- evalrx/analyzers/lens/__init__.py +7 -0
- evalrx/analyzers/lens/layer_contrast.py +133 -0
- evalrx/analyzers/lens/logit_lens.py +138 -0
- evalrx/analyzers/lens/tuned_lens.py +30 -0
- evalrx/analyzers/patching/__init__.py +5 -0
- evalrx/analyzers/patching/causal_trace.py +30 -0
- evalrx/analyzers/perturbation/__init__.py +23 -0
- evalrx/analyzers/perturbation/_shapley.py +54 -0
- evalrx/analyzers/perturbation/context_shap.py +174 -0
- evalrx/analyzers/perturbation/cot_faithfulness.py +239 -0
- evalrx/analyzers/perturbation/format_sensitivity.py +237 -0
- evalrx/analyzers/perturbation/mm_shap.py +146 -0
- evalrx/analyzers/perturbation/modality_ablation.py +196 -0
- evalrx/analyzers/perturbation/perturbation_battery.py +274 -0
- evalrx/analyzers/perturbation/prompt_contrast.py +265 -0
- evalrx/analyzers/perturbation/rise.py +94 -0
- evalrx/analyzers/perturbation/vl_shap.py +102 -0
- evalrx/analyzers/reasoning/__init__.py +33 -0
- evalrx/analyzers/reasoning/_text.py +328 -0
- evalrx/analyzers/reasoning/answer_extraction_audit.py +327 -0
- evalrx/analyzers/reasoning/arith_audit.py +226 -0
- evalrx/analyzers/reasoning/contamination.py +214 -0
- evalrx/analyzers/reasoning/knowledge_split.py +253 -0
- evalrx/analyzers/reasoning/self_repair.py +246 -0
- evalrx/analyzers/reasoning/step_rollout_value.py +216 -0
- evalrx/analyzers/reasoning/termination_audit.py +258 -0
- evalrx/analyzers/uncertainty/__init__.py +18 -0
- evalrx/analyzers/uncertainty/calibration.py +174 -0
- evalrx/analyzers/uncertainty/coverage_gap.py +199 -0
- evalrx/analyzers/uncertainty/entropy.py +90 -0
- evalrx/analyzers/uncertainty/logprob_entropy.py +69 -0
- evalrx/analyzers/uncertainty/self_consistency.py +204 -0
- evalrx/analyzers/uncertainty/verbalized_conf.py +64 -0
- evalrx/cli.py +411 -0
- evalrx/config.py +77 -0
- evalrx/contract/__init__.py +179 -0
- evalrx/contract/common.py +452 -0
- evalrx/contract/emit.py +948 -0
- evalrx/contract/export.py +237 -0
- evalrx/contract/m1.py +325 -0
- evalrx/contract/m2.py +317 -0
- evalrx/contract/m3.py +165 -0
- evalrx/contract/m4.py +130 -0
- evalrx/contract/m5.py +292 -0
- evalrx/contract/methodology.py +76 -0
- evalrx/contract/pre_m1.py +58 -0
- evalrx/contract/typescript.py +140 -0
- evalrx/core/__init__.py +85 -0
- evalrx/core/analyzer.py +174 -0
- evalrx/core/capability.py +54 -0
- evalrx/core/case.py +443 -0
- evalrx/core/experiment.py +106 -0
- evalrx/core/model.py +198 -0
- evalrx/core/pipeline.py +42 -0
- evalrx/core/registry.py +142 -0
- evalrx/core/result.py +64 -0
- evalrx/core/spec.py +173 -0
- evalrx/core/tokentype.py +165 -0
- evalrx/core/tool.py +92 -0
- evalrx/datasets/__init__.py +41 -0
- evalrx/datasets/base.py +68 -0
- evalrx/datasets/gui_os.py +52 -0
- evalrx/datasets/llm_qa.py +57 -0
- evalrx/datasets/pure_qa.py +12 -0
- evalrx/datasets/vlm_qa.py +695 -0
- evalrx/datasets/web_search_qa.py +52 -0
- evalrx/eval_agent/__init__.py +341 -0
- evalrx/eval_agent/_tools.py +81 -0
- evalrx/eval_agent/ab_runner.py +50 -0
- evalrx/eval_agent/agentic/__init__.py +43 -0
- evalrx/eval_agent/agentic/actions.py +216 -0
- evalrx/eval_agent/agentic/board.py +107 -0
- evalrx/eval_agent/agentic/loop.py +190 -0
- evalrx/eval_agent/agentic/tools.py +538 -0
- evalrx/eval_agent/checkpoint.py +57 -0
- evalrx/eval_agent/cli_agent.py +59 -0
- evalrx/eval_agent/cli_skills.py +5 -0
- evalrx/eval_agent/evolution.py +396 -0
- evalrx/eval_agent/git_manager.py +215 -0
- evalrx/eval_agent/hypothesis.py +172 -0
- evalrx/eval_agent/label_quarantine.py +209 -0
- evalrx/eval_agent/legacy.py +530 -0
- evalrx/eval_agent/log_schema.py +497 -0
- evalrx/eval_agent/loop.py +2159 -0
- evalrx/eval_agent/loop_reports.py +116 -0
- evalrx/eval_agent/model_instrumentation.py +282 -0
- evalrx/eval_agent/narration.py +193 -0
- evalrx/eval_agent/nl_runner.py +460 -0
- evalrx/eval_agent/orchestrator.py +61 -0
- evalrx/eval_agent/preregister.py +93 -0
- evalrx/eval_agent/prompts/__init__.py +1 -0
- evalrx/eval_agent/prompts/agentic.py +46 -0
- evalrx/eval_agent/prompts/case_discovery.py +25 -0
- evalrx/eval_agent/prompts/diagnosis.py +125 -0
- evalrx/eval_agent/prompts/experiment_writer.py +265 -0
- evalrx/eval_agent/prompts/explore_step.py +37 -0
- evalrx/eval_agent/prompts/fix_agent.py +257 -0
- evalrx/eval_agent/prompts/hypothesis_tester.py +15 -0
- evalrx/eval_agent/prompts/nl_runner.py +38 -0
- evalrx/eval_agent/prompts/probe_agent.py +25 -0
- evalrx/eval_agent/prompts/probe_candidate_generator.py +14 -0
- evalrx/eval_agent/prompts/probe_generator.py +35 -0
- evalrx/eval_agent/prompts/whitebox_probe_generator.py +38 -0
- evalrx/eval_agent/report.py +58 -0
- evalrx/eval_agent/run_context.py +354 -0
- evalrx/eval_agent/run_log.schema.json +1215 -0
- evalrx/eval_agent/run_logger_v2.py +1764 -0
- evalrx/eval_agent/run_metadata.py +208 -0
- evalrx/eval_agent/stages/__init__.py +56 -0
- evalrx/eval_agent/stages/case_discovery.py +293 -0
- evalrx/eval_agent/stages/diagnosis.py +1017 -0
- evalrx/eval_agent/stages/experiment_writer.py +1634 -0
- evalrx/eval_agent/stages/fix_agent.py +3916 -0
- evalrx/eval_agent/stages/fix_internals.py +499 -0
- evalrx/eval_agent/stages/fix_pipeline.py +725 -0
- evalrx/eval_agent/stages/fix_tiers.py +187 -0
- evalrx/eval_agent/stages/fix_tools.py +1034 -0
- evalrx/eval_agent/stages/hypothesis_tester.py +1014 -0
- evalrx/eval_agent/stages/probe.py +439 -0
- evalrx/eval_agent/stages/probe_agent.py +1079 -0
- evalrx/eval_agent/stages/probe_candidate_generator.py +128 -0
- evalrx/eval_agent/stages/probe_generator.py +326 -0
- evalrx/eval_agent/stages/probe_search_agent.py +106 -0
- evalrx/eval_agent/stages/protocol.py +112 -0
- evalrx/eval_agent/stages/repair_catalog.py +273 -0
- evalrx/eval_agent/stages/surgery.py +524 -0
- evalrx/eval_agent/stages/whitebox_probe_generator.py +351 -0
- evalrx/eval_agent/store.py +231 -0
- evalrx/logging_utils.py +112 -0
- evalrx/models/__init__.py +161 -0
- evalrx/models/_discover.py +101 -0
- evalrx/models/agent.py +380 -0
- evalrx/models/backends/__init__.py +58 -0
- evalrx/models/backends/api.py +169 -0
- evalrx/models/backends/base.py +57 -0
- evalrx/models/backends/gemini_compat.py +579 -0
- evalrx/models/backends/hf_local.py +2074 -0
- evalrx/models/backends/openai_compat.py +301 -0
- evalrx/models/backends/vllm_offline.py +116 -0
- evalrx/models/base.py +24 -0
- evalrx/models/blackbox/__init__.py +4 -0
- evalrx/models/blackbox/agent.py +31 -0
- evalrx/models/blackbox/base.py +29 -0
- evalrx/models/blackbox/gemini.py +279 -0
- evalrx/models/blackbox/llm_api.py +17 -0
- evalrx/models/blackbox/vlm_api.py +17 -0
- evalrx/models/compose.py +66 -0
- evalrx/models/inference.py +88 -0
- evalrx/models/paper_methods/__init__.py +8 -0
- evalrx/models/paper_methods/aad.py +53 -0
- evalrx/models/paper_methods/ifcd.py +204 -0
- evalrx/models/paper_methods/pai.py +164 -0
- evalrx/models/paper_methods/tcd.py +202 -0
- evalrx/models/paper_methods/vcd.py +45 -0
- evalrx/models/paper_methods/vicrop.py +137 -0
- evalrx/models/toolcodec.py +143 -0
- evalrx/models/tools/__init__.py +20 -0
- evalrx/models/tools/perception.py +300 -0
- evalrx/models/tools/visual.py +174 -0
- evalrx/models/whitebox/__init__.py +26 -0
- evalrx/models/whitebox/agent.py +31 -0
- evalrx/models/whitebox/base.py +24 -0
- evalrx/models/whitebox/qwen.py +61 -0
- evalrx/models/whitebox/qwen2_5_omni.py +29 -0
- evalrx/models/whitebox/qwen2_audio.py +25 -0
- evalrx/models/whitebox/qwen_omni.py +53 -0
- evalrx/models/whitebox/qwen_vl.py +62 -0
- evalrx/observability/__init__.py +21 -0
- evalrx/observability/envelope.py +122 -0
- evalrx/observability/outbox.py +111 -0
- evalrx/observability/tracer.py +882 -0
- evalrx/reporting/__init__.py +28 -0
- evalrx/reporting/case_study.py +947 -0
- evalrx/reporting/compiler.py +587 -0
- evalrx/reporting/dynamic.py +1882 -0
- evalrx/reporting/html_report.py +2225 -0
- evalrx/reporting/langfuse_exporter.py +38 -0
- evalrx/reporting/langfuse_source.py +155 -0
- evalrx/reporting/model.py +151 -0
- evalrx/reporting/run_events.py +184 -0
- evalrx/reporting/server.py +557 -0
- evalrx/reporting/stages.py +58 -0
- evalrx/reporting/static_export.py +142 -0
- evalrx/reporting/web_dist/index.html +146 -0
- evalrx/specs.py +727 -0
- evalrx/stats/__init__.py +47 -0
- evalrx/stats/api.py +192 -0
- evalrx/stats/bootstrap.py +86 -0
- evalrx/stats/ebh.py +27 -0
- evalrx/stats/evalue.py +98 -0
- evalrx/stats/friedman.py +138 -0
- evalrx/stats/mcnemar.py +40 -0
- evalrx/stats/multiplicity.py +159 -0
- evalrx/stats/subset_sampling.py +55 -0
- evalrx/term_links.py +43 -0
- evalrx/viz/__init__.py +7 -0
- evalrx/viz/labels.py +77 -0
- evalrx/viz/prompts.py +39 -0
- evalrx/viz/renderer.py +590 -0
- evalrx/viz/schema.py +36 -0
- evalrx/viz/style.py +134 -0
- evalrx-0.1.2.dist-info/METADATA +532 -0
- evalrx-0.1.2.dist-info/RECORD +339 -0
- evalrx-0.1.2.dist-info/WHEEL +5 -0
- evalrx-0.1.2.dist-info/entry_points.txt +3 -0
- evalrx-0.1.2.dist-info/licenses/LICENSE +121 -0
- evalrx-0.1.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"""Declarative discovery of pre-audited model repair capabilities.
|
|
2
|
+
|
|
3
|
+
The fix agent only sees compatible descriptions from this registry. It has no
|
|
4
|
+
method names, benchmark names, or method-specific executor branches.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from evalrx.core.capability import Capability
|
|
13
|
+
from evalrx.eval_agent.stages.fix_tiers import FixTier
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass(frozen=True)
|
|
17
|
+
class RepairMethod:
|
|
18
|
+
name: str
|
|
19
|
+
tier: FixTier
|
|
20
|
+
executor: str
|
|
21
|
+
description: str
|
|
22
|
+
source: str = "registered"
|
|
23
|
+
payload: dict[str, Any] = field(default_factory=dict)
|
|
24
|
+
baseline_executor: str | None = None
|
|
25
|
+
fidelity_key: str | None = None
|
|
26
|
+
accepted_fidelities: frozenset[str] = frozenset()
|
|
27
|
+
adapted_fidelities: frozenset[str] = frozenset()
|
|
28
|
+
required_inputs: frozenset[str] = frozenset()
|
|
29
|
+
accepted_tasks: frozenset[str] = frozenset()
|
|
30
|
+
requires_logprobs: bool = False
|
|
31
|
+
pass_baseline_answer: bool = False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def method_names() -> frozenset[str]:
|
|
35
|
+
return frozenset(method.name for method in _METHODS)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def supports_tier(model: Any, tier: FixTier) -> bool:
|
|
39
|
+
return any(
|
|
40
|
+
method.tier == tier and callable(getattr(model, method.executor, None))
|
|
41
|
+
for method in _METHODS
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def discover_methods(
|
|
46
|
+
model: Any,
|
|
47
|
+
*,
|
|
48
|
+
max_tier: FixTier,
|
|
49
|
+
has_images: bool,
|
|
50
|
+
has_audio: bool,
|
|
51
|
+
tasks: set[str],
|
|
52
|
+
allow_adapted: bool,
|
|
53
|
+
prior_names: frozenset[str] = frozenset(),
|
|
54
|
+
) -> list[RepairMethod]:
|
|
55
|
+
"""Return physically executable repairs without consulting labels or data IDs."""
|
|
56
|
+
|
|
57
|
+
fidelity_fn = getattr(model, "paper_method_fidelity", None)
|
|
58
|
+
capabilities = getattr(model, "capabilities", frozenset())
|
|
59
|
+
inputs = frozenset(
|
|
60
|
+
name for name, present in (("image", has_images), ("audio", has_audio)) if present
|
|
61
|
+
)
|
|
62
|
+
available: list[RepairMethod] = []
|
|
63
|
+
for method in _METHODS:
|
|
64
|
+
if method.name in prior_names or method.tier > max_tier:
|
|
65
|
+
continue
|
|
66
|
+
if not callable(getattr(model, method.executor, None)):
|
|
67
|
+
continue
|
|
68
|
+
if method.baseline_executor and not callable(getattr(model, method.baseline_executor, None)):
|
|
69
|
+
continue
|
|
70
|
+
if not method.required_inputs.issubset(inputs):
|
|
71
|
+
continue
|
|
72
|
+
if method.accepted_tasks and not tasks.issubset(method.accepted_tasks):
|
|
73
|
+
continue
|
|
74
|
+
if method.requires_logprobs and Capability.LOGPROBS not in capabilities:
|
|
75
|
+
continue
|
|
76
|
+
if method.fidelity_key:
|
|
77
|
+
fidelity = fidelity_fn(method.fidelity_key) if callable(fidelity_fn) else "unavailable"
|
|
78
|
+
accepted = method.accepted_fidelities | (
|
|
79
|
+
method.adapted_fidelities if allow_adapted else frozenset()
|
|
80
|
+
)
|
|
81
|
+
if fidelity not in accepted:
|
|
82
|
+
continue
|
|
83
|
+
available.append(method)
|
|
84
|
+
return available
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
_YES_NO = frozenset({"yes_no"})
|
|
88
|
+
_AUDIO_MC = frozenset({"multiple_choice", "multiple_choice_letter"})
|
|
89
|
+
|
|
90
|
+
_METHODS: tuple[RepairMethod, ...] = (
|
|
91
|
+
RepairMethod(
|
|
92
|
+
"noncolor_spatial_vision_specialist_calibrated",
|
|
93
|
+
FixTier.L2_SCAFFOLD,
|
|
94
|
+
"generate_noncolor_spatial_specialist",
|
|
95
|
+
"Route non-color spatial, size, count, and object-subtype questions to a "
|
|
96
|
+
"frozen Qwen2.5-VL vision specialist while preserving the Gemma baseline on "
|
|
97
|
+
"color questions.",
|
|
98
|
+
source="registered_calibrated",
|
|
99
|
+
payload={"model_id": "qwen2.5-vl-7b-instruct"},
|
|
100
|
+
required_inputs=frozenset({"image"}),
|
|
101
|
+
accepted_tasks=frozenset({"exact_or_numeric"}),
|
|
102
|
+
pass_baseline_answer=True,
|
|
103
|
+
),
|
|
104
|
+
RepairMethod(
|
|
105
|
+
"chart_vision_specialist_calibrated",
|
|
106
|
+
FixTier.L2_SCAFFOLD,
|
|
107
|
+
"generate_chart_vision_specialist",
|
|
108
|
+
"Route chart questions, with the original image and prompt unchanged, to a "
|
|
109
|
+
"frozen Qwen2.5-VL visual reasoning specialist.",
|
|
110
|
+
source="registered_calibrated",
|
|
111
|
+
payload={"model_id": "qwen2.5-vl-7b-instruct"},
|
|
112
|
+
required_inputs=frozenset({"image"}),
|
|
113
|
+
accepted_tasks=frozenset({"exact_or_numeric"}),
|
|
114
|
+
pass_baseline_answer=True,
|
|
115
|
+
),
|
|
116
|
+
RepairMethod(
|
|
117
|
+
"gemini_vision_specialist_calibrated",
|
|
118
|
+
FixTier.L2_SCAFFOLD,
|
|
119
|
+
"generate_vision_api_specialist",
|
|
120
|
+
"Route the original image and question to a frozen Gemini visual reasoning "
|
|
121
|
+
"specialist with deterministic short-answer and ratio normalization.",
|
|
122
|
+
source="registered_calibrated",
|
|
123
|
+
payload={"model_id": "gemini-3.7-flash"},
|
|
124
|
+
required_inputs=frozenset({"image"}),
|
|
125
|
+
accepted_tasks=frozenset({"exact_or_numeric"}),
|
|
126
|
+
pass_baseline_answer=True,
|
|
127
|
+
),
|
|
128
|
+
RepairMethod(
|
|
129
|
+
"clap_grounded_audio_presence_calibrated",
|
|
130
|
+
FixTier.L2_SCAFFOLD,
|
|
131
|
+
"generate_clap_grounded_presence",
|
|
132
|
+
"Use independent CLAP audio-text evidence to override only strongly contradicted "
|
|
133
|
+
"binary sound-presence answers.",
|
|
134
|
+
source="registered_calibrated",
|
|
135
|
+
payload={
|
|
136
|
+
"negative_threshold": -0.05,
|
|
137
|
+
"positive_threshold": 0.275,
|
|
138
|
+
"model_id": "laion/clap-htsat-unfused",
|
|
139
|
+
},
|
|
140
|
+
required_inputs=frozenset({"audio"}),
|
|
141
|
+
accepted_tasks=_YES_NO,
|
|
142
|
+
pass_baseline_answer=True,
|
|
143
|
+
),
|
|
144
|
+
RepairMethod(
|
|
145
|
+
"gemini_pro_audio_specialist_calibrated",
|
|
146
|
+
FixTier.L2_SCAFFOLD,
|
|
147
|
+
"generate_audio_api_specialist",
|
|
148
|
+
"Route the original audio and multiple-choice prompt unchanged to the frozen "
|
|
149
|
+
"Gemini 2.5 Pro audio specialist.",
|
|
150
|
+
source="registered_calibrated",
|
|
151
|
+
payload={"model_id": "gemini-2.5-pro"},
|
|
152
|
+
required_inputs=frozenset({"audio"}),
|
|
153
|
+
accepted_tasks=_AUDIO_MC,
|
|
154
|
+
pass_baseline_answer=True,
|
|
155
|
+
),
|
|
156
|
+
RepairMethod(
|
|
157
|
+
"e4b_gemini_pro_disagreement_guard_calibrated",
|
|
158
|
+
FixTier.L2_SCAFFOLD,
|
|
159
|
+
"generate_audio_api_specialist",
|
|
160
|
+
"Use the frozen Gemini 2.5 Pro audio specialist only for E4B disagreement "
|
|
161
|
+
"directions that remained high-purity across two development sets.",
|
|
162
|
+
source="registered_calibrated",
|
|
163
|
+
payload={
|
|
164
|
+
"model_id": "gemini-2.5-pro",
|
|
165
|
+
"allowed_disagreements_by_route": {
|
|
166
|
+
"music": ["AC", "AD", "BC", "BD", "CA"],
|
|
167
|
+
"sound": ["AB", "AD", "BA", "BC", "CA"],
|
|
168
|
+
"speech": ["BA", "BC", "CA", "CB", "DA", "DB"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
required_inputs=frozenset({"audio"}),
|
|
172
|
+
accepted_tasks=_AUDIO_MC,
|
|
173
|
+
pass_baseline_answer=True,
|
|
174
|
+
),
|
|
175
|
+
RepairMethod(
|
|
176
|
+
"detector_grounded_presence_calibrated",
|
|
177
|
+
FixTier.L2_SCAFFOLD,
|
|
178
|
+
"generate_detector_grounded_presence",
|
|
179
|
+
"Require independent open-vocabulary detector evidence before overriding calibrated "
|
|
180
|
+
"object-category false negatives.",
|
|
181
|
+
source="registered_calibrated",
|
|
182
|
+
payload={
|
|
183
|
+
"objects": [
|
|
184
|
+
"backpack", "banana", "baseball glove", "bird", "book", "chair",
|
|
185
|
+
"clock", "dog", "mouse", "oven", "pizza", "remote", "snowboard",
|
|
186
|
+
"spoon", "traffic light", "truck", "tv", "vase",
|
|
187
|
+
],
|
|
188
|
+
"detector_threshold": 0.25,
|
|
189
|
+
},
|
|
190
|
+
required_inputs=frozenset({"image"}),
|
|
191
|
+
accepted_tasks=_YES_NO,
|
|
192
|
+
pass_baseline_answer=True,
|
|
193
|
+
),
|
|
194
|
+
RepairMethod(
|
|
195
|
+
"vcd_diffusion_noise", FixTier.L3A_INTERNALS_READ, "generate_vcd",
|
|
196
|
+
"Contrast original and corrupted-image decoding when visual claims follow language priors.",
|
|
197
|
+
payload={"alpha": 1.0, "beta": 0.1, "noise_step": 500},
|
|
198
|
+
baseline_executor="generate_vcd_baseline",
|
|
199
|
+
fidelity_key="vcd", accepted_fidelities=frozenset({
|
|
200
|
+
"exact", "native_binary_specialization", "per_item_seeded_sampler_specialization",
|
|
201
|
+
}),
|
|
202
|
+
# VCD contrasts every generated token; it is not a binary-only
|
|
203
|
+
# executor. A yes/no gate hid it from open-ended VQA before the
|
|
204
|
+
# repair agent could inspect it.
|
|
205
|
+
required_inputs=frozenset({"image"}), requires_logprobs=True,
|
|
206
|
+
),
|
|
207
|
+
RepairMethod(
|
|
208
|
+
"aad_silence_contrast", FixTier.L3A_INTERNALS_READ, "generate_aad",
|
|
209
|
+
"Contrast normal and silenced-audio decoding when claims ignore acoustic evidence.",
|
|
210
|
+
payload={"alpha": 0.5}, fidelity_key="aad",
|
|
211
|
+
accepted_fidelities=frozenset({"native_silence_contrast"}),
|
|
212
|
+
required_inputs=frozenset({"audio"}), accepted_tasks=_YES_NO,
|
|
213
|
+
),
|
|
214
|
+
RepairMethod(
|
|
215
|
+
"icd_instruction_disturbance", FixTier.L3A_INTERNALS_READ, "generate_instruction_cd",
|
|
216
|
+
"Contrast normal and instruction-disturbed decoding when instruction priors override vision.",
|
|
217
|
+
payload={"alpha": 1.0, "beta": 0.1, "qformer_mode": "normal"}, fidelity_key="icd",
|
|
218
|
+
accepted_fidelities=frozenset({"exact", "native_binary_specialization"}),
|
|
219
|
+
adapted_fidelities=frozenset({"adapted"}), required_inputs=frozenset({"image"}),
|
|
220
|
+
accepted_tasks=_YES_NO, requires_logprobs=True,
|
|
221
|
+
),
|
|
222
|
+
RepairMethod(
|
|
223
|
+
"icd_instruction_disturbance_question", FixTier.L3A_INTERNALS_READ,
|
|
224
|
+
"generate_instruction_cd",
|
|
225
|
+
"Use architecture-native question-conditioned instruction contrast for visual grounding.",
|
|
226
|
+
payload={"alpha": 1.0, "beta": 0.1, "qformer_mode": "question"}, fidelity_key="icd",
|
|
227
|
+
accepted_fidelities=frozenset({"exact", "native_binary_specialization"}),
|
|
228
|
+
required_inputs=frozenset({"image"}), accepted_tasks=_YES_NO, requires_logprobs=True,
|
|
229
|
+
),
|
|
230
|
+
RepairMethod(
|
|
231
|
+
"opera_overtrust_binary", FixTier.L3A_INTERNALS_READ, "generate_opera_binary",
|
|
232
|
+
"Penalise binary token candidates that neglect image attention.",
|
|
233
|
+
payload={"num_attn_candidates": 5, "penalty_weight": 1.0}, fidelity_key="opera",
|
|
234
|
+
accepted_fidelities=frozenset({"native_binary_specialization"}),
|
|
235
|
+
required_inputs=frozenset({"image"}), accepted_tasks=_YES_NO,
|
|
236
|
+
),
|
|
237
|
+
RepairMethod(
|
|
238
|
+
"vicrop_relative_attention", FixTier.L3A_INTERNALS_READ, "generate_vicrop",
|
|
239
|
+
"Use attention to locate and crop visual detail before re-answering.",
|
|
240
|
+
payload={"layer": 14}, fidelity_key="vicrop",
|
|
241
|
+
accepted_fidelities=frozenset({"native_selector_specialization"}),
|
|
242
|
+
required_inputs=frozenset({"image"}),
|
|
243
|
+
),
|
|
244
|
+
RepairMethod(
|
|
245
|
+
"vicrop_consensus_guard", FixTier.L3A_INTERNALS_READ, "generate_vicrop_consensus",
|
|
246
|
+
"Use an attention crop with a label-free baseline-consensus guard.",
|
|
247
|
+
payload={"layer": 14}, fidelity_key="vicrop",
|
|
248
|
+
accepted_fidelities=frozenset({"native_selector_specialization"}),
|
|
249
|
+
required_inputs=frozenset({"image"}), pass_baseline_answer=True,
|
|
250
|
+
),
|
|
251
|
+
RepairMethod(
|
|
252
|
+
"ifcd_truthx_contrast", FixTier.L3B_INTERNALS_WRITE, "generate_ifcd",
|
|
253
|
+
"Contrast representations against a trained truthfulness direction.",
|
|
254
|
+
payload={"alpha": 0.1, "beta": 0.1, "edit_strength": 0.5, "top_layers": 15},
|
|
255
|
+
fidelity_key="ifcd", adapted_fidelities=frozenset({"adapted_truthx_artifact"}),
|
|
256
|
+
required_inputs=frozenset({"image"}), accepted_tasks=_YES_NO,
|
|
257
|
+
),
|
|
258
|
+
RepairMethod(
|
|
259
|
+
"pai_image_attention", FixTier.L3B_INTERNALS_WRITE, "generate_pai",
|
|
260
|
+
"Amplify image-attention logits with guidance when language overrides vision.",
|
|
261
|
+
payload={"alpha": 0.2, "guidance_scale": 2.0, "start_layer": 2, "end_layer": 32},
|
|
262
|
+
fidelity_key="pai", accepted_fidelities=frozenset({"native_attention_cfg_specialization"}),
|
|
263
|
+
required_inputs=frozenset({"image"}),
|
|
264
|
+
),
|
|
265
|
+
RepairMethod(
|
|
266
|
+
"tcd_temporal_blur", FixTier.L3A_INTERNALS_READ, "generate_tcd",
|
|
267
|
+
"Contrast decoding against temporally blurred audio to recover transient detail.",
|
|
268
|
+
baseline_executor="generate_tcd_baseline", fidelity_key="tcd",
|
|
269
|
+
accepted_fidelities=frozenset({"native_layer_matched_stability"}),
|
|
270
|
+
adapted_fidelities=frozenset({"adapted_truncated_layer_stability"}),
|
|
271
|
+
required_inputs=frozenset({"audio"}), accepted_tasks=_AUDIO_MC,
|
|
272
|
+
),
|
|
273
|
+
)
|