From 8f1ce1826465395469862a4a890eb46f85b772ff Mon Sep 17 00:00:00 2001 From: Tom Softreck Date: Tue, 24 Nov 2026 19:48:12 +0100 Subject: [PATCH] fix(bottlenecks): distinguish blocked execution and input waits (ticket-012) --- project/TICKETS.md | 1 + project/ticket-012/README.md | 37 ++++++++++++++++++++++++++++++++++ project/ticket-012/intent.json | 25 +++++++++++++++++++++++ src/bottlenecks/delivery.py | 14 +++++++++++-- tests/test_delivery.py | 7 +++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 project/ticket-012/README.md create mode 100644 project/ticket-012/intent.json diff --git a/project/TICKETS.md b/project/TICKETS.md index 59a9b9e..36bb620 100644 --- a/project/TICKETS.md +++ b/project/TICKETS.md @@ -14,4 +14,5 @@ | **ticket-009** | [`README.md`](./ticket-009/README.md) | - | - | - | - | - | | **ticket-010** | [`README.md`](./ticket-010/README.md) | - | - | - | - | - | | **ticket-011** | [`README.md`](./ticket-011/README.md) | - | - | - | - | - | +| **ticket-012** | [`README.md`](./ticket-012/README.md) | - | - | - | - | - | diff --git a/project/ticket-012/README.md b/project/ticket-012/README.md new file mode 100644 index 0000000..3ebe2db --- /dev/null +++ b/project/ticket-012/README.md @@ -0,0 +1,37 @@ +# Ticket 012: Expose input and blocked execution states in the Reflex queue report (PLF-25983) + +- **ID**: ticket-012 +- **Owner**: agent:codex +- **Status**: IN_PROGRESS +- **Workflow state**: EDIT +- **Created**: 2026-11-24 + +## Goal and scope + +The user asked to detect the actual anomalies through Reflex. A canonical Planfile read-back of 67 repositories showed three execution input waits and one explicit execution block missing after PR 12. + +## Acceptance criteria + +- Cover all four weekly observations, keeping blocked execution distinct from a blocked label. +- Preserve deduplication and ignore normal queued, running and completed execution states. + +## Tracking boundary + +This directory contains the minimal reviewed intent. Optional participant prose +and raw command logs are not required delivery output. + + +## Ticket Radar + +Initial planned-scope estimate; advisory only, not execution or merge approval. + +| Measure | Initial assessment | +| --- | --- | +| Impact score | 52/100 | +| Complexity | M | +| Estimated effort | 51 min | +| Planning budget | 30 min | +| Split recommended | yes | + +Diagnostics: RADAR-ACCEPTANCE-MISSING, RADAR-BUDGET-EXCEEDED. + diff --git a/project/ticket-012/intent.json b/project/ticket-012/intent.json new file mode 100644 index 0000000..25a70d7 --- /dev/null +++ b/project/ticket-012/intent.json @@ -0,0 +1,25 @@ +{ + "schema": "new-project.intent/v3", + "ticket": "ticket-012", + "summary": "Expose input and blocked execution states in the Reflex queue report (PLF-25983)", + "workstream": "application", + "classification": { + "kind": "BUG", + "priority": "P1", + "origin": "requested" + }, + "allowedPaths": [ + "project/ticket-012/**", + "TODO.md", + "project/TICKETS.md", + "src/bottlenecks/delivery.py", + "tests/test_delivery.py" + ], + "forbiddenPaths": [ + "project/ticket-*/user-*.md" + ], + "stacks": [], + "dependsOn": [], + "conflictsWith": [], + "integrationTicket": null +} diff --git a/src/bottlenecks/delivery.py b/src/bottlenecks/delivery.py index 77cc733..63b90a4 100644 --- a/src/bottlenecks/delivery.py +++ b/src/bottlenecks/delivery.py @@ -117,6 +117,15 @@ def _finding(report, repo, kind, ids, message, group="", *, target=None): "status_blocked": "These tickets have explicit blocked status.", "blocked": "Planfile excluded these tickets because they carry the blocked label.", "waiting_dependency": "Execution is waiting for a dependency.", + "waiting_input": "Execution is waiting for input.", + "execution_blocked": "Planfile reports that execution is blocked.", +} + + +_EXECUTION_BLOCKERS = { + "exec_state:blocked": "execution_blocked", + "exec_state:waiting_input": "waiting_input", + "exec_state:waiting_dependency": "waiting_dependency", } @@ -127,8 +136,9 @@ def _queue_report(data): groups = defaultdict(set) for row in data["skipped"]: kind = row["category"] - if kind == "exec_state" and row.get("reason") == "exec_state:waiting_dependency": - kind = "waiting_dependency" + reason = row.get("reason") + if kind == "exec_state" and isinstance(reason, str): + kind = _EXECUTION_BLOCKERS.get(reason, kind) if kind in _QUEUE_REASONS: ticket = row["id"] if not isinstance(ticket, str) or not _ID.fullmatch(ticket): diff --git a/tests/test_delivery.py b/tests/test_delivery.py index 0a49a35..c4185c8 100644 --- a/tests/test_delivery.py +++ b/tests/test_delivery.py @@ -67,6 +67,12 @@ def test_queue_emits_reflex_observations_only_for_explicit_blockers(tmp_path): {"id": "T-2", "category": "exec_state", "reason": "exec_state:waiting_dependency"}, {"id": "T-3", "category": "exec_state", "reason": "exec_state:queued"}, {"id": "T-4", "category": "exec_state"}, + {"id": "T-5", "category": "exec_state", "reason": "exec_state:waiting_input"}, + {"id": "T-6", "category": "exec_state", "reason": "exec_state:blocked"}, + {"id": "T-7", "category": "exec_state", "reason": "exec_state:running"}, + {"id": "T-8", "category": "exec_state", "reason": "exec_state:done"}, + {"id": "T-9", "category": "exec_state", "reason": "exec_state:other"}, + {"id": "T-10", "category": "exec_state", "reason": []}, ] data = {"schema": "planfile.executable-queue/v1", "repository": "org/repo", "candidates": [], "skipped": skipped} @@ -75,6 +81,7 @@ def test_queue_emits_reflex_observations_only_for_explicit_blockers(tmp_path): found = {item.kind: item.metrics for item in result.report.items} assert {kind: m["examples"] for kind, m in found.items()} == { "blocked": ["T-1"], "waiting_dependency": ["T-2"], + "waiting_input": ["T-5"], "execution_blocked": ["T-6"], } for metrics in found.values(): assert metrics["reflex"]["status"] == "blocked"