From /simplify codebase sweep (2026-06-10).
The adapters' DEFAULT invoke paths carry inline algorithm-name special cases, although the per-entry invoker field (#266) and per-entry ExplainerAlgorithmSpec hints are the project's canonical seam for exactly this non-uniformity:
transparency/explainers/captum_explainer.py:251-257: if explainer.algorithm == "Occlusion"
transparency/explainers/captum_explainer.py:266-273: algorithm.startswith("Layer") or algorithm == "GuidedGradCam" -- excludes Neuron* by comment, not by data; the prefix check drifts as Captum adds methods
transparency/explainers/shap_explainer.py:349,358,385: three independent algorithm-name tuples branching background-requirement, numpy-wrapping, and tensor-vs-numpy input format -- must stay mutually consistent by hand; adding e.g. PermutationExplainer means auditing all three branches
Each special case in the shared path makes the default invoker less default.
Fix: declarative spec fields per registry entry (takes_layer: bool, requires_background: bool, input_format: tensor|numpy, kwarg_normaliser), or a per-entry invoker for the genuinely divergent ones (Occlusion, KernelExplainer). The startswith("Layer") check is data masquerading as code. Related deferred outliers: #276, #277, #278, #279, #280.
From /simplify codebase sweep (2026-06-10).
The adapters' DEFAULT invoke paths carry inline algorithm-name special cases, although the per-entry
invokerfield (#266) and per-entryExplainerAlgorithmSpechints are the project's canonical seam for exactly this non-uniformity:transparency/explainers/captum_explainer.py:251-257:if explainer.algorithm == "Occlusion"transparency/explainers/captum_explainer.py:266-273:algorithm.startswith("Layer") or algorithm == "GuidedGradCam"-- excludesNeuron*by comment, not by data; the prefix check drifts as Captum adds methodstransparency/explainers/shap_explainer.py:349,358,385: three independent algorithm-name tuples branching background-requirement, numpy-wrapping, and tensor-vs-numpy input format -- must stay mutually consistent by hand; adding e.g.PermutationExplainermeans auditing all three branchesEach special case in the shared path makes the default invoker less default.
Fix: declarative spec fields per registry entry (
takes_layer: bool,requires_background: bool,input_format: tensor|numpy,kwarg_normaliser), or a per-entryinvokerfor the genuinely divergent ones (Occlusion, KernelExplainer). Thestartswith("Layer")check is data masquerading as code. Related deferred outliers: #276, #277, #278, #279, #280.