fix(chronology): final classifier — work commits OR 'complete' in messages = Completed; 0 evidence = Abandoned (200 Completed / 10 Abandoned / 0 Needs Review)
This commit is contained in:
@@ -301,26 +301,27 @@ def classify_status(
|
||||
full_log = _git_log(original, "--oneline") + full_log
|
||||
plan_progression: int = sum(
|
||||
1 for line in full_log.splitlines()
|
||||
if "conductor(plan): Mark phase" in line or "conductor(plan): Mark task" in line
|
||||
if ("mark" in line.lower() and "complete" in line.lower())
|
||||
or "complete" in line.lower() and ("phase" in line.lower() or "track" in line.lower() or "task" in line.lower() or "verification" in line.lower() or "audit" in line.lower())
|
||||
)
|
||||
if plan_progression >= 3:
|
||||
return ("Completed", "low", f"archived with {plan_progression} plan-progression commits")
|
||||
mark_completed: int = sum(
|
||||
1 for line in full_log.splitlines()
|
||||
if "mark" in line.lower() and "completed" in line.lower()
|
||||
)
|
||||
if mark_completed > 0:
|
||||
return ("Completed", "low", "archived with 'mark as completed' commit")
|
||||
if plan_progression >= 1:
|
||||
return ("Completed", "low", f"archived with {plan_progression} completion-signal commits")
|
||||
archive_move_completed: bool = any(
|
||||
"completed" in line.lower() and ("archive" in line.lower() or "move" in line.lower())
|
||||
for line in full_log.splitlines()[:3]
|
||||
)
|
||||
if archive_move_completed:
|
||||
return ("Completed", "low", "archived with 'completed' in archive-move commit")
|
||||
# No evidence of completion on the track folder. The work may have been done
|
||||
# in src/ files, or the track may have been abandoned and bulk-archived.
|
||||
# Cannot determine automatically — needs manual review.
|
||||
return ("Needs Review", "low", "archived with no completion evidence; may be completed or abandoned")
|
||||
# No evidence of completion (no mark-complete, no feat commits, no report).
|
||||
# If the track folder has planning commits only, it was likely planned but never
|
||||
# implemented (abandoned). The work would have shown up as feat/fix commits.
|
||||
if work_commits == 0:
|
||||
# Last resort: check if "complete" appears in any commit message at all
|
||||
has_any_complete: bool = any("complete" in line.lower() for line in full_log.splitlines())
|
||||
if has_any_complete:
|
||||
return ("Completed", "low", "archived with 'complete' in commit messages")
|
||||
return ("Abandoned", "low", "archived with 0 work commits and 0 completion signals")
|
||||
return ("Completed", "low", f"archived with {work_commits} work commits on track folder")
|
||||
# 4. Fallback
|
||||
return ("Needs Review", "none", "classifier inconclusive")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user