MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / are_dependencies_satisfied

Function are_dependencies_satisfied

api/dependency_resolver.py:97–119  ·  view source on GitHub ↗

Check if all dependencies have passes=True. Args: feature: Feature dict to check all_features: List of all feature dicts passing_ids: Optional pre-computed set of passing feature IDs. If None, will be computed from all_features. Pass this when cal

(
    feature: dict,
    all_features: list[dict],
    passing_ids: set[int] | None = None,
)

Source from the content-addressed store, hash-verified

95
96
97def are_dependencies_satisfied(
98 feature: dict,
99 all_features: list[dict],
100 passing_ids: set[int] | None = None,
101) -> bool:
102 """Check if all dependencies have passes=True.
103
104 Args:
105 feature: Feature dict to check
106 all_features: List of all feature dicts
107 passing_ids: Optional pre-computed set of passing feature IDs.
108 If None, will be computed from all_features. Pass this when
109 calling in a loop to avoid O(n^2) complexity.
110
111 Returns:
112 True if all dependencies are satisfied (or no dependencies)
113 """
114 deps = feature.get("dependencies") or []
115 if not deps:
116 return True
117 if passing_ids is None:
118 passing_ids = {f["id"] for f in all_features if f.get("passes")}
119 return all(dep_id in passing_ids for dep_id in deps)
120
121
122def get_blocking_dependencies(

Callers 2

get_ready_featuresMethod · 0.90

Calls

no outgoing calls

Tested by 1