From 931ebfb6523785f3e9a7d036a64ce087bb03b797 Mon Sep 17 00:00:00 2001 From: tegwick Date: Wed, 8 Jul 2026 11:42:33 +0200 Subject: [PATCH] fix(consistency): skip terminal orphan DB tasks in C-12 check 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. --- scripts/consistency_check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/consistency_check.py b/scripts/consistency_check.py index e3b4925..507a221 100644 --- a/scripts/consistency_check.py +++ b/scripts/consistency_check.py @@ -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: db_t_status = normalise_task_status(db_t.get("status", "todo")) open_task = db_t_status not in TERMINAL_TASK_STATUSES - # Closed workstreams can legitimately retain terminal historical - # DB tasks from earlier duplicates. The public task DELETE route + # Terminal orphans (cancel/done) are historical duplicates after + # file linkage or explicit retirement. The public task DELETE route # is a cancel operation, so these are not further actionable. - if ws_finished and not open_task: + if not open_task: continue # Auto-cancel fixable when workstream is finished and task is open. fixable = ws_finished and open_task