Restore archived tasks, fix dashboard scroll-reset, bind ornith, add Playwright smoke test
- **Restore 82 completed tasks** from tasks/complete/ back to tasks/ top level (all <7 days old per the cleanup policy; premature bulk archive was fixed). - **Dashboard: fix scroll-reset on auto-refresh** — renderBoard rebuilds the board via innerHTML every 2s, destroying each column-body's scrollTop. Now snapshots column-body scrollTop + board.scrollLeft + view.scrollTop before rebuild and restores after (matched by PHASE_GROUPS index). - **Dashboard UI additions** (pre-existing unstaged work): approval section cards, transition buttons, inline artifact editor (textarea for writing missing SPEC/VERDICT/etc from the detail modal). - **Bind ornith as Implement model** — config.md: Model explicit to omlx/Ornith-1.0-35B-4bit-mlx, context window 32768. Interactive autopilot already used ornith via opencode default; now explicit. - **Fix cleanup stub** — automaton-cleanup.sh had a stale --project arg pointing at a pytest temp dir (test isolation leak). Rewired to point at ~/.automaton. - **Fix plist-isolation test** — test asserted host plist doesn't exist, but a real install creates it. Now snapshots mtime before run, asserts unchanged after (only a write during the test counts as bleed). - **New Playwright smoke test** (tests/test_dashboard_ui.py) — 2 tests: board renders tasks, column scroll survives auto-refresh tick. Verified the test fails without the scroll fix (scrollTop resets to 0). Skipped via importorskip when playwright is absent (main CI stays green). - **Clarify SI loop scope in README** — new-project onboarding section documents the framework-scoped self-improvement loop and options (leave/pause/create project loop). - **CHANGELOG** documents all changes including the known model-divergence gap (mde tasks marked complete but per-role model binding was never implemented).
This commit is contained in:
+24
-24
@@ -26,14 +26,14 @@ def _make_task(tmp_path: Path, name: str, artifacts: dict[str, str]) -> Path:
|
||||
|
||||
def test_backlog_state(tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "backlog-task", {})
|
||||
state, artifacts = determine_task_state(task_dir)
|
||||
state, phase_raw, artifacts = determine_task_state(task_dir)
|
||||
assert state == TaskState.BACKLOG
|
||||
assert not artifacts
|
||||
|
||||
|
||||
def test_research_state(tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "research-task", {"SPEC.md": "# Spec"})
|
||||
state, artifacts = determine_task_state(task_dir)
|
||||
state, phase_raw, artifacts = determine_task_state(task_dir)
|
||||
assert state == TaskState.RESEARCH
|
||||
assert "SPEC.md" in artifacts
|
||||
|
||||
@@ -44,7 +44,7 @@ def test_implementation_state(tmp_path: Path) -> None:
|
||||
"impl-task",
|
||||
{"SPEC.md": "# Spec", "TEST_PLAN.md": "# Tests", "IMPLEMENTATION.md": "# Impl"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.IMPLEMENT
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def test_implementation_from_test_plan(tmp_path: Path) -> None:
|
||||
"impl-test-plan",
|
||||
{"SPEC.md": "# Spec", "TEST_PLAN.md": "# Tests"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.TEST_DESIGN
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ def test_bug_find_state(tmp_path: Path) -> None:
|
||||
"bug-task",
|
||||
{"SPEC.md": "# Spec", "IMPLEMENTATION.md": "# Impl", "BUG_REPORT.md": "# Bugs"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BUG_FIND
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def test_adv_bug_find_state(tmp_path: Path) -> None:
|
||||
"ADVERSARIAL_BUG_REPORT.md": "# Adv",
|
||||
},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.ADV_BUG_FIND
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ def test_done_state(tmp_path: Path) -> None:
|
||||
"done-task",
|
||||
{"SPEC.md": "# Spec", "VERDICT.md": "## Status: PASS"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DONE
|
||||
|
||||
|
||||
@@ -99,13 +99,13 @@ def test_blocked_state(tmp_path: Path) -> None:
|
||||
"blocked-task",
|
||||
{"SPEC.md": "# Spec", "VERDICT.md": "## Status: FAIL"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BLOCKED
|
||||
|
||||
|
||||
def test_empty_verdict_is_blocked(tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "empty-verdict", {"VERDICT.md": ""})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BLOCKED
|
||||
|
||||
|
||||
@@ -166,43 +166,43 @@ class TestVerdictParsing:
|
||||
def test_pass_verdict_with_fail_in_findings(self, tmp_path: Path) -> None:
|
||||
ver = "## Status: PASS\n\nThe previous FAIL finding was resolved."
|
||||
task_dir = _make_task(tmp_path, "pass-with-fail", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DONE
|
||||
|
||||
def test_pass_verdict_with_needs_review_in_body(self, tmp_path: Path) -> None:
|
||||
ver = "## Status: PASS\n\nNote: NEEDS_REVIEW was discussed but resolved."
|
||||
task_dir = _make_task(tmp_path, "pass-with-nr", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DONE
|
||||
|
||||
def test_fail_verdict_structured(self, tmp_path: Path) -> None:
|
||||
ver = "## Status: FAIL\n\n2 tests PASS, 1 test FAIL."
|
||||
task_dir = _make_task(tmp_path, "fail-mentions-pass", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BLOCKED
|
||||
|
||||
def test_needs_review_verdict_structured(self, tmp_path: Path) -> None:
|
||||
ver = "## Status: NEEDS_REVIEW\n\nSome items PASS but need review."
|
||||
task_dir = _make_task(tmp_path, "nr-mentions-pass", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BLOCKED
|
||||
|
||||
def test_verdict_with_bold_status(self, tmp_path: Path) -> None:
|
||||
ver = "# Verdict\n\n- **Status**: PASS\n- **Timestamp**: 2025-01-01"
|
||||
task_dir = _make_task(tmp_path, "bold-status", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DONE
|
||||
|
||||
def test_verdict_no_status_line(self, tmp_path: Path) -> None:
|
||||
ver = "# Verdict\nEverything looks good, PASS!"
|
||||
task_dir = _make_task(tmp_path, "no-status-line", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.REFEREE # no structured ## Status: header → ambiguous
|
||||
|
||||
def test_verdict_no_status_no_keywords(self, tmp_path: Path) -> None:
|
||||
ver = "# Verdict\n\nNeeds further discussion."
|
||||
task_dir = _make_task(tmp_path, "no-status-no-keywords", {"SPEC.md": "# Spec", "VERDICT.md": ver})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.REFEREE
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ class TestStateMachineAlignment:
|
||||
|
||||
def test_implementation_alone_shows_implement(self, tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "impl-only", {"IMPLEMENTATION.md": "# Impl"})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.IMPLEMENT
|
||||
|
||||
def test_bug_report_without_adversarial(self, tmp_path: Path) -> None:
|
||||
@@ -219,7 +219,7 @@ class TestStateMachineAlignment:
|
||||
tmp_path, "bug-only",
|
||||
{"SPEC.md": "# Spec", "IMPLEMENTATION.md": "# Impl", "BUG_REPORT.md": "# Bugs"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BUG_FIND
|
||||
|
||||
def test_both_bug_reports_shows_adv_bug_find(self, tmp_path: Path) -> None:
|
||||
@@ -228,7 +228,7 @@ class TestStateMachineAlignment:
|
||||
{"SPEC.md": "# Spec", "IMPLEMENTATION.md": "# Impl",
|
||||
"BUG_REPORT.md": "# Bugs", "ADVERSARIAL_BUG_REPORT.md": "# Adv"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.ADV_BUG_FIND
|
||||
|
||||
def test_adv_bug_report_alone_shows_bug_find(self, tmp_path: Path) -> None:
|
||||
@@ -237,22 +237,22 @@ class TestStateMachineAlignment:
|
||||
{"SPEC.md": "# Spec", "IMPLEMENTATION.md": "# Impl",
|
||||
"ADVERSARIAL_BUG_REPORT.md": "# Adv bugs only"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.BUG_FIND
|
||||
|
||||
def test_spec_alone_shows_research(self, tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "spec-only", {"SPEC.md": "# Spec"})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.RESEARCH
|
||||
|
||||
def test_test_plan_shows_test_design(self, tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "testplan", {"SPEC.md": "# Spec", "TEST_PLAN.md": "# Tests"})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.TEST_DESIGN
|
||||
|
||||
def test_design_with_spec_shows_design(self, tmp_path: Path) -> None:
|
||||
task_dir = _make_task(tmp_path, "design-spec", {"SPEC.md": "# Spec", "DESIGN.md": "# Design"})
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DESIGN
|
||||
|
||||
def test_doc_review_shows_doc_review(self, tmp_path: Path) -> None:
|
||||
@@ -262,7 +262,7 @@ class TestStateMachineAlignment:
|
||||
"BUG_REPORT.md": "# Bugs", "ADVERSARIAL_BUG_REPORT.md": "# Adv",
|
||||
"DOC_REVIEW.md": "# Docs"},
|
||||
)
|
||||
state, _ = determine_task_state(task_dir)
|
||||
state, phase_raw, _ = determine_task_state(task_dir)
|
||||
assert state == TaskState.DOC_REVIEW
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user