- 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
4.2 KiB
Fix Verdict Parsing and State Machine Alignment
Goal
Fix the critical verdict-parsing bug that causes PASS verdicts to be falsely classified as BLOCKED, and align the dashboard's determine_task_state() with the orchestrator's state machine specification.
Requirements
R1. Use structured status-line parsing instead of substring search
automaton/dashboard/core/task.py:159-169 currently uses substring search for FAIL/NEEDS_REVIEW/PASS. This means a PASS verdict that mentions a previous failure (which referee.md explicitly requires when comparing bug finder outputs) gets misclassified as BLOCKED.
Fix: Parse the actual status line (## Status: PASS, **Status**: FAIL, etc.) extracted from the verdict content, falling back to substring search only when no structured status line is found.
R2. Fix verdict check ordering
The current code checks FAIL/NEEDS_REVIEW substrings before PASS. A correctly parsed status line makes this irrelevant for structured verdicts — only fall back to substring search for unstructured verdicts, using the same check order (check FAIL/NEEDS_REVIEW first, then PASS) but document the limitation.
R3. Use same parsing in parse_sub_tasks
task.py:215-220 has the same substring-search issue for sub-task verdicts. Apply the same fix.
R4. Align determine_task_state() with orchestrate.md state machine
Four concrete divergences between orchestrate.md:266-282 and task.py:135-198:
| Orchestrator says | Dashboard does | Fix |
|---|---|---|
IMPLEMENTATION.md → Bug Find |
IMPLEMENTATION.md → Implement |
Match orchestrator: show Bug Find when IMPLEMENTATION.md exists but no BUG_REPORT.md or ADVERSARIAL_BUG_REPORT.md |
BUG_REPORT.md + SPEC.md (no ADV) → Adversarial Bug Find |
BUG_REPORT.md alone → Bug Find |
Match orchestrator: BUG_REPORT.md → Bug Find, ADVERSARIAL_BUG_REPORT.md alone → Adversarial Bug Find. When both exist, advance to Doc Review or Referee. |
ADVERSARIAL_BUG_REPORT.md alone → not specified |
ADVERSARIAL_BUG_REPORT.md alone → ADV_BUG_FIND |
Follow orchestrator's intent: a lone ADVERSARIAL_BUG_REPORT without BUG_REPORT technically doesn't reach Adversarial Bug Find per spec. Treat ADV alone same as BUG alone for the dashboard (Bug Find). |
SPEC.md alone → Design or Implement |
SPEC.md alone → Research |
Keep dashboard behavior. The orchestrator spec says "Design or Implement" meaning those are the next steps the orchestrator would drive. The dashboard should show the task in its current state (Research). No change needed. |
R5. Update parse_sub_tasks to match the same logic
Sub-task state determination uses the same function, so these fixes propagate automatically. Verify that sub-tasks with only PARENT_SPEC.md or VRAM_CONFIG.md correctly show as BACKLOG.
R6. Document the minimal verdict schema
Add a note in prompts/referee.md requiring that VERDICT.md include ## Status: PASS / ## Status: FAIL / ## Status: NEEDS_REVIEW as a structured machine-parseable field. The dashboard relies on this for correct classification.
Acceptance Criteria
## Status: PASSverdict mentioning the word "FAIL" in findings → DONE (not BLOCKED)## Status: PASSverdict mentioning "NEEDS_REVIEW" in body → DONE (not BLOCKED)## Status: FAILverdict → BLOCKED## Status: NEEDS_REVIEWverdict → BLOCKEDIMPLEMENTATION.mdalone (no BUG_REPORT, no ADVERSARIAL_BUG_REPORT) → BUG_FIND (not IMPLEMENT)BUG_REPORT.md+SPEC.md(no ADVERSARIAL_BUG_REPORT) → BUG_FINDADVERSARIAL_BUG_REPORT.md+BUG_REPORT.md+SPEC.md→ ADV_BUG_FIND (or higher if DOC_REVIEW/VERDICT present)SPEC.mdalone → RESEARCH (unchanged, confirmed as correct)- Existing tests in
tests/test_task.pystill pass - New tests cover: PASS-verdict-mentions-FAIL, unstructured-verdict-fallback, implement-to-bug-find transition
parse_sub_taskscorrectly parses structured sub-task verdicts
Non-Goals
- Not removing substring fallback entirely (backward compat for unstructured verdicts)
- Not changing orchestrator.md (that spec is the authority)
- Not modifying
ui/app.pyverdict display logic