fix(consistency): skip terminal orphan DB tasks in C-12 check
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 5s

Cancelled or done DB tasks without file backing are historical duplicates
after workplan linkage. Do not warn on active workstreams when the orphan
is already terminal.
This commit is contained in:
tegwick 2026-07-08 11:42:33 +02:00
parent d07a2711d2
commit 931ebfb652

View file

@ -1264,10 +1264,10 @@ def check_repo(api_base: str, repo_slug: str, repo_path_override: str | None = N
if db_t["id"] not in file_task_sh_ids: if db_t["id"] not in file_task_sh_ids:
db_t_status = normalise_task_status(db_t.get("status", "todo")) db_t_status = normalise_task_status(db_t.get("status", "todo"))
open_task = db_t_status not in TERMINAL_TASK_STATUSES open_task = db_t_status not in TERMINAL_TASK_STATUSES
# Closed workstreams can legitimately retain terminal historical # Terminal orphans (cancel/done) are historical duplicates after
# DB tasks from earlier duplicates. The public task DELETE route # file linkage or explicit retirement. The public task DELETE route
# is a cancel operation, so these are not further actionable. # is a cancel operation, so these are not further actionable.
if ws_finished and not open_task: if not open_task:
continue continue
# Auto-cancel fixable when workstream is finished and task is open. # Auto-cancel fixable when workstream is finished and task is open.
fixable = ws_finished and open_task fixable = ws_finished and open_task