manager_utils: ignore merged tasks in dependency graph to avoid circular deps

This commit is contained in:
Rai (Michael Pokorny)
2025-06-25 00:59:40 -07:00
parent 3683bae697
commit a4a2680b39

View File

@@ -42,10 +42,12 @@ def status():
all_meta[meta.id] = meta
path_map[meta.id] = md
# Build dependency graph
# Build dependency graph, excluding already merged tasks
merged_ids = {tid for tid, m in all_meta.items() if m.status == 'Merged'}
deps_map: dict[str, list[str]] = {}
for tid, meta in all_meta.items():
deps_map[tid] = [d for d in re.findall(r"\d+", meta.dependencies) if d in all_meta]
deps_map[tid] = [d for d in re.findall(r"\d+", meta.dependencies)
if d in all_meta and d not in merged_ids]
# Topologically sort tasks by dependencies, fall back on filename order on error
try: