Skip to content

Commit 48977ee

Browse files
Trecekclaude
andcommitted
fix(review): add arch test enforcing CAPABILITY_INGREDIENT_TO_SKIP_GUARD keys subset
Add test_capability_ingredient_to_skip_guard_keys_subset to ensure every key in CAPABILITY_INGREDIENT_TO_SKIP_GUARD exists in BACKEND_CAPABILITY_INGREDIENTS, preventing silent vacuous-gate detection failures when new capability keys are added. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e13a818 commit 48977ee

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/arch/test_capability_admission_control.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,21 @@ def test_capability_gate_callables_have_matching_ingredient() -> None:
198198
assert len(CAPABILITY_GATE_CALLABLES) > 0, (
199199
"CAPABILITY_GATE_CALLABLES must declare at least one capability gate callable."
200200
)
201+
202+
203+
def test_capability_ingredient_to_skip_guard_keys_subset() -> None:
204+
"""CAPABILITY_INGREDIENT_TO_SKIP_GUARD keys must be BACKEND_CAPABILITY_INGREDIENTS subset."""
205+
from autoskillit.core import (
206+
BACKEND_CAPABILITY_INGREDIENTS,
207+
CAPABILITY_INGREDIENT_TO_SKIP_GUARD,
208+
)
209+
210+
orphaned = set(CAPABILITY_INGREDIENT_TO_SKIP_GUARD) - set(BACKEND_CAPABILITY_INGREDIENTS)
211+
assert not orphaned, (
212+
f"CAPABILITY_INGREDIENT_TO_SKIP_GUARD keys {orphaned} are not in "
213+
f"BACKEND_CAPABILITY_INGREDIENTS — vacuous-gate detection will silently "
214+
f"malfunction for these keys."
215+
)
216+
assert len(CAPABILITY_INGREDIENT_TO_SKIP_GUARD) > 0, (
217+
"CAPABILITY_INGREDIENT_TO_SKIP_GUARD must declare at least one mapping."
218+
)

0 commit comments

Comments
 (0)