chore: bootstrap rdb-discovery
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from .tasks import read_tasks
|
||||
|
||||
|
||||
def project_stage(root: Path) -> str:
|
||||
if not (root / "context" / "discovery-log.md").exists():
|
||||
return "NOT_INITIALISED"
|
||||
tasks = read_tasks(root)
|
||||
if not tasks:
|
||||
return "DISCOVERY"
|
||||
if any(task.status.lower() == "in progress" for task in tasks):
|
||||
return "BUILDING"
|
||||
if any(task.status.lower() == "todo" for task in tasks):
|
||||
return "TASKS_READY"
|
||||
return "REVIEW_READY"
|
||||
|
||||
|
||||
def task_counts(root: Path) -> dict[str, int]:
|
||||
counts: dict[str, int] = {}
|
||||
for task in read_tasks(root):
|
||||
counts[task.status] = counts.get(task.status, 0) + 1
|
||||
return counts
|
||||
Reference in New Issue
Block a user