Private
Public Access
0
0

fix(chronology): honest classifier — archive tracks without completion evidence are Needs Review (not completed, not abandoned)

This commit is contained in:
2026-07-02 09:13:20 -04:00
parent b6adb15666
commit b803f56d58
2 changed files with 178 additions and 77 deletions
+33 -6
View File
@@ -288,12 +288,39 @@ def classify_status(
return ("Active", "medium", "0 work commits in tracks/ (spec/plan only)")
# 3. Directory location
if is_archive:
# Archive tracks are almost always completed work — the act of `git mv` to archive/
# IS the completion signal. You don't archive abandoned tracks; you leave them or
# delete them. Default to Completed unless a TRACK_ABORTED report says otherwise
# (already checked above). The work was typically done in src/ files, not the
# track folder, so commit-count heuristics on the track folder are unreliable here.
return ("Completed", "low", "archived (work in src/, not track folder)")
# Archive tracks: the git mv to archive/ is a signal but not a definitive one.
# Tracks can be archived because they're completed OR because they're abandoned.
# Check the metadata.json status for human-set values, then fall back to Needs Review.
# (The state.toml override and TRACK_ABORTED report check already ran above.)
if work_commits >= 3:
return ("Completed", "medium", f"{work_commits} work commits")
# Check for plan-progression / "mark as completed" heuristics
full_log: str = _git_log(folder_link, "--oneline")
if folder_link.startswith("conductor/archive/"):
original: str = folder_link.replace("conductor/archive/", "conductor/tracks/", 1)
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 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")
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")
# 4. Fallback
return ("Needs Review", "none", "classifier inconclusive")