MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / can_start

Function can_start

s13_background_tasks/code.py:98–107  ·  view source on GitHub ↗

Check if all blockedBy dependencies are completed. Missing dependencies are treated as blocked.

(task_id: str)

Source from the content-addressed store, hash-verified

96
97
98def can_start(task_id: str) -> bool:
99 """Check if all blockedBy dependencies are completed.
100 Missing dependencies are treated as blocked."""
101 task = load_task(task_id)
102 for dep_id in task.blockedBy:
103 if not _task_path(dep_id).exists():
104 return False
105 if load_task(dep_id).status != "completed":
106 return False
107 return True
108
109
110def claim_task(task_id: str, owner: str = "agent") -> str:

Callers 2

claim_taskFunction · 0.70
complete_taskFunction · 0.70

Calls 3

existsMethod · 0.80
load_taskFunction · 0.70
_task_pathFunction · 0.70

Tested by

no test coverage detected