Skip to content

Commit 43ab740

Browse files
Trecekclaude
andcommitted
fix: correct vacuous-gate detection, import path, test mock, and symbol count
- Fix _is_vacuous_gate to skip the gate step itself when scanning for live capability references (gate_backend_write references its own capability ingredient in with_args, which was falsely preventing vacuous detection) - Fix import path violation: use autoskillit.core gateway instead of autoskillit.core.types subpackage directly - Fix deferred-recall test: add AsyncMock for ctx.disable_components to prevent "MagicMock can't be used in await" error - Update symbol count from 93 to 94 for new CAPABILITY_INGREDIENT_TO_SKIP_GUARD Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8c6660 commit 43ab740

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/autoskillit/recipe/_recipe_composition.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
import regex as re
1111

12-
from autoskillit.core import YAMLError, load_yaml
13-
from autoskillit.core.types import CAPABILITY_INGREDIENT_TO_SKIP_GUARD
12+
from autoskillit.core import CAPABILITY_INGREDIENT_TO_SKIP_GUARD, YAMLError, load_yaml
1413
from autoskillit.recipe._contracts_types import INPUT_REF_RE
1514
from autoskillit.recipe.io import find_sub_recipe_by_name
1615
from autoskillit.recipe.io import load_recipe as _load_recipe_from_path
@@ -165,6 +164,7 @@ def _compute_capability_feasibility(
165164
continue
166165
if _is_vacuous_gate(
167166
gate_input_keys,
167+
gate_step_name=step_name,
168168
skip_resolutions=skip_resolutions,
169169
pre_prune_steps=pre_prune_steps,
170170
post_prune_steps=steps,
@@ -178,6 +178,7 @@ def _compute_capability_feasibility(
178178
def _is_vacuous_gate(
179179
gate_input_keys: set[str],
180180
*,
181+
gate_step_name: str,
181182
skip_resolutions: dict[str, bool | None] | None,
182183
pre_prune_steps: dict[str, Any] | None,
183184
post_prune_steps: dict[str, Any],
@@ -200,8 +201,8 @@ def _is_vacuous_gate(
200201
if not pruned_for_capability:
201202
return False
202203
live_uses_capability = False
203-
for s in post_prune_steps.values():
204-
if s is None:
204+
for sn, s in post_prune_steps.items():
205+
if s is None or sn == gate_step_name:
205206
continue
206207
with_args = getattr(s, "with_args", None) or {}
207208
if cap_key in with_args:

tests/arch/test_subpackage_structure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def test_type_constants_split_completeness(self):
6060
assert len(combined) == len(remaining) + len(env) + len(features) + len(registries), (
6161
"Duplicate symbols across split modules"
6262
)
63-
assert len(combined) == 93, (
64-
f"Expected 93 symbols total, got {len(combined)} "
63+
assert len(combined) == 94, (
64+
f"Expected 94 symbols total, got {len(combined)} "
6565
f"(remaining={len(remaining)}, env={len(env)}, "
6666
f"features={len(features)}, registries={len(registries)})"
6767
)

tests/server/test_open_kitchen_deferred_recall.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ async def test_deferred_recall_returns_infeasible_when_dispatch_feasible_false()
275275
mock_recipe_obj = MagicMock()
276276
mock_recipe_obj.steps = {"gate_backend_write": MagicMock()}
277277
mock_ctx.recipes.load.return_value = mock_recipe_obj
278+
mock_ctx.disable_components = AsyncMock()
278279

279280
with patch("autoskillit.server._get_ctx", return_value=mock_ctx):
280281
result = await open_kitchen(name="test-recipe", ctx=mock_ctx)

0 commit comments

Comments
 (0)