CI / build (push) Has been cancelled
- Archive 79 completed framework-dev tasks from tasks/ -> tasks/complete/ - status.py: add --cleanup-done and --install-cleanup-schedule commands - Add scripts/automaton-cleanup.sh for periodic task archiving - Dashboard: rename 'Background' tab -> 'Agent', 'Cleanup' agent -> 'Completed Task Archiver', remove redundant group headers and pill badges, dim inactive agent placeholders - .rules.md: add Self-Documenting UI Names rule - New tests: test_cleanup_done.py, expanded test_app.py and test_task.py
2.7 KiB
2.7 KiB
Bug Report: task-status-reason
Summary
Audit of status_reason implementation against SPEC.md found minor issues: a dead-code branch in the status_reason message, and a pre-existing REFEREE state that's never produced.
Bugs Found
Bug 1: Dead message branch in status_reason for BLOCKED state
- Severity: Low
- Location:
automaton/dashboard/core/task.py:149 - Description: The message
"Verdict is empty or could not be parsed"has two scenarios:- Empty verdict → reachable (content is
"", correctly returns this message) - Unparseable verdict → unreachable. When
parse_verdict_status()returnsNone, the state machine indetermine_task_state()doesn't classify the task as BLOCKED — it falls through to earlier state checks. So a task is never both BLOCKED and "could not be parsed".
- Empty verdict → reachable (content is
- Suggested Fix: Change message to
"Verdict is empty"to accurately reflect the only reachable case.
Bug 2: REFEREE state never produced by state machine
- Severity: Low
- Location:
automaton/dashboard/core/task.py:174(fallbackstatus_reasonline), andtask.py:226-272(determine_task_state) - Description:
TaskState.REFEREEexists in the enum and in the sort order, butdetermine_task_statenever returns it. When a VERDICT.md is present but unparseable, the state machine falls through to earlier artifact checks instead of assigning REFEREE. This means the fallback status reason"In referee phase"is unreachable, and tasks with ambiguous verdicts silently show as earlier states (e.g., RESEARCH if only SPEC.md exists alongside an unparseable VERDICT.md). - Pre-existing: This predates the task and is not introduced by the implementation, but the status_reason property exposes it because the REFEREE branch is dead code.
- Suggested Fix: Add
if "VERDICT.md" in artifacts: return TaskState.REFEREE, artifactsafter the terminal-state checks indetermine_task_state(), before the state machine fallthrough.
Bug 3: REFEREE status reason is generic
- Severity: Low
- Location:
automaton/dashboard/core/task.py:175 - Description: The fallthrough line
return f"In {self.state.value} phase"would produce generic messages like"In blocked phase"or"In done phase"for states that are handled above it. This is actually dead code for all defined states since everyTaskStatevalue is covered by an explicitifbranch. If a new state is added without adding a status_reason handler, it gets a generic message rather than failing loudly. - Suggested Fix: Replace the fallthrough with a clear signal: either raise an error, or explicitly list the catch to alert developers when adding states.
Score
+5