From b4f03c9f8560e3d7c1682f8e8642b1647f3c0c29 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 00:52:49 +0000 Subject: [PATCH] intake: dashboard no longer lists parked prompts as In flight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A parked task's prompt file legitimately stays in active/ (parked.md holds started-then-parked work), so the bare active/*.md glob rendered the same task under both In flight and Parked — on 2026-08-19 the dashboard showed "In flight 5" when only one task was genuinely in flight, which is how a backlog of completed-but-unwrapped tasks went unnoticed. The in-flight list now excludes prompts claimed by parked.md rows; they render under Parked only, and the header count matches genuinely issued work. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01AS2MB8X4vW3s27YW1ncviK --- agents/conductors/intake/_intake.py | 8 ++++++++ tests/test_intake_dashboard.py | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/agents/conductors/intake/_intake.py b/agents/conductors/intake/_intake.py index 2f22126..a4eb185 100755 --- a/agents/conductors/intake/_intake.py +++ b/agents/conductors/intake/_intake.py @@ -453,11 +453,19 @@ def _count(key): if e["prompt"] and e["prompt"] not in by_prompt: by_prompt[e["prompt"]] = e + # A parked task's prompt file legitimately stays in active/ (parked.md + # holds "started, then parked" work), so a bare active/ glob would list it + # under BOTH In flight and Parked — inflating the in-flight count with + # tasks that are deliberately not in flight. + parked_prompts = {e["prompt"] for e in parked if e["prompt"]} + in_flight = [] active = mind / "active" for f in sorted(active.glob("*.md")) if active.is_dir() else []: text = f.read_text(encoding="utf-8", errors="replace") rel = str(f.relative_to(mind)) + if rel in parked_prompts: + continue header = parse_header(text) row = by_prompt.get(rel, {}) in_flight.append({ diff --git a/tests/test_intake_dashboard.py b/tests/test_intake_dashboard.py index 69f72f6..c359d63 100644 --- a/tests/test_intake_dashboard.py +++ b/tests/test_intake_dashboard.py @@ -130,6 +130,33 @@ def test_in_flight_links_the_registry_issue_and_its_live_status(tmp_path): "a prompt's conception-time Status: is stale once issued — never show it" +def test_parked_prompt_still_in_active_is_not_listed_in_flight(tmp_path): + """A parked task's prompt file legitimately stays in active/ (parked.md + holds started-then-parked work), so the in-flight list must exclude it — + otherwise the same task renders under BOTH In flight and Parked and the + in-flight count inflates with tasks deliberately not in flight.""" + mind = _mind( + tmp_path, + active={"widget_rework.md": _prompt("Widget rework"), + "gadget_polish.md": _prompt("Gadget polish")}, + registries={ + "active.md": ("# Active\n\n## gadget-polish\n" + "- prompt: active/gadget_polish.md\n"), + "parked.md": ("# Parked\n\n## widget-rework\n" + "- prompt: active/widget_rework.md\n" + "- parked: deliberate deferral\n"), + }, + ) + page = _page(mind) + flight = page.split("## In flight")[1].split("## Parked")[0] + assert "gadget_polish.md" in flight + assert "widget_rework.md" not in flight, \ + "a parked prompt must not double-list as in flight" + parked = page.split("## Parked")[1].split("## Planned")[0] + assert "widget_rework.md" in parked + assert "| [In flight](#in-flight) (`active/`) | 1 |" in page + + def test_in_flight_prompt_with_no_registry_row_claims_no_issue(tmp_path): """Silence beats a wrong link: prose issue URLs are usually cross-references.""" body = _prompt("Orphan task") + \