Files
Lap Tran bc7daf8590 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).
2026-06-26 10:05:18 -04:00

7.5 KiB

IMPLEMENTATION — make-tests-runnable

Parent: runnable-test-suite (see PARENT_SPEC.md)

Summary

All 8 in-scope requirements were implemented. The test suite goes from "No module named pytest" to 198 passed, 3 collection errors. The 3 errors are a STOP-and-report trigger: PEP 604 union syntax (Path | None) in out-of-scope dashboard source files, incompatible with the stock macOS Python 3.9.6. These files are NOT in this sub-task's 7-file scope and were not touched.

Files changed

  • requirements.txt (NEW) — created at repo root with pytest==7.4.4.
  • AGENTS.md — python -m → python3 -m (7 occurrences); added install note *Install: pip3 install -r requirements.txt* after "## Build & Test Commands".
  • README.md — python ~/.automaton/scripts/status.py → python3 ... (16 occurrences); python -m automaton.dashboard → python3 -m automaton.dashboard.
  • automaton/dashboard/README.md — python -m automaton.dashboard → python3 -m automaton.dashboard (4 occurrences).
  • prompts/orchestrate.md — python ~/.automaton/scripts/status.py → python3 ... (17 occurrences).
  • scripts/install.sh — restructured early-exit exit 0 to if/else so the appended venv block is reachable on existing installs; appended idempotent venv block (python3 -m venv .venv + pip install requirements.txt).
  • CHANGELOG.md — added 3 entries under [unreleased]: two ### Added (requirements.txt, install.sh venv) and one ### Changed (python → python3).

Acceptance criteria

# Criterion Status
1 pip3 install -r requirements.txt exits 0 PASS
2 python3 -m pytest tests/ -v exits 0 (N passed, 0 errors) FAIL — exit 2, 3 collection errors
3 python3 -m py_compile automaton/**/*.py automaton/dashboard/**/*.py scripts/*.py exits 0 PASS
4 bash -n scripts/*.sh exits 0 PASS
5 bash scripts/install.sh exits 0 and creates .venv/ containing pytest PASS (.venv/bin/pytest = 7.4.4)
6 rg "^python |"python " sweep returns zero matches PASS (exit 1 = no matches)
7 Streak: 10 consecutive clean pytest tests/ -v runs BLOCKED by #2

Streak verifier result

Not run — blocked by acceptance #2. The suite never reaches a clean pass on the stock Python 3.9.6 interpreter, so a 10-run streak is impossible without fixing the out-of-scope PEP 604 syntax. Attempt 1 of 5 stopped at the STOP-and-report trigger.

STOP-and-report trigger

Trigger: Tests fail for a reason OTHER than missing pytest.

Failing tests (collection errors):

  • tests/test_app.py
  • tests/test_board.py
  • tests/test_scope.py

Root cause: PEP 604 union type syntax (X | None) evaluated at class/function definition time. This syntax requires Python 3.10+. The stock macOS CommandLineTools Python is 3.9.6.

Out-of-scope files containing the bug (NOT touched):

  • automaton/dashboard/core/scope.py:6 — def find_automaton_root(start: Path | None = None) -> Path | None:
  • automaton/dashboard/core/board.py:40 — def __init__(self, tasks: list[Task] | None = None, ...)
  • automaton/dashboard/ui/app.py:15 — transitive failure (imports scope)

Traceback (representative, test_scope.py):

tests/test_scope.py:7: in <module>
    from automaton.dashboard.core.scope import detect_scope, find_automaton_root
automaton/dashboard/core/scope.py:6: in <module>
    def find_automaton_root(start: Path | None = None) -> Path | None:
E   TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Suggested fix (for whoever owns these files): Add from __future__ import annotations at the top of scope.py, board.py, and any other dashboard module using PEP 604 syntax. This makes annotations lazy (string-evaluated), restoring Python 3.9 compatibility without changing any type semantics. Alternatively, replace X | None with Optional[X] from typing.

Anomalies / scope notes

  1. install.sh restructure: The SPEC says "append a venv block" to install.sh. A literal append at the end would be unreachable because the script's early-exit (if [ -d "$FRAMEWORK_DIR" ]; then ... exit 0) fires before the end on any system where ~/.automaton already exists. To satisfy acceptance #5 ("creates .venv/ containing pytest"), the early-exit was converted from exit 0 to an else branch, and the venv block was appended after the closing fi so it runs unconditionally. The venv block text matches the SPEC exactly. The script remains set -e-safe and re-runnable.

  2. Python 3.13 available but not used: /opt/homebrew/bin/python3.13 exists on this system, but the parent SPEC mandates "Stock python3 + pip3 only" — stock is 3.9.6 from CommandLineTools. Using Homebrew Python would violate the parent constraint and mask the real bug (PEP 604 syntax in framework code).

  3. 198/201 tests pass with --continue-on-collection-errors: The 3 erroring tests are all dashboard tests that transitively import scope.py or board.py. No test under tests/ was edited. No out-of-scope source file was edited.

  4. Not vram_detect: The failure is NOT in test_vram_detect.py or vram_detect.py. That sub-task's scope is unaffected.

Scope extension: future-annotations fix

The Orchestrator extended this sub-task's scope to include the 3 dashboard source files previously reported as out-of-scope (STOP-and-report trigger above). The fix is purely a compatibility shim: add from __future__ import annotations as the first import line (after the module docstring) so PEP 604 X | Y annotations become lazy strings (PEP 563) and the files import on stock Python 3.9.6. No signatures, types, or behavior were changed.

Files patched

  • automaton/dashboard/core/scope.py — added from __future__ import annotations after docstring (PEP 604 at find_automaton_root(start: Path | None = None) -> Path | None).
  • automaton/dashboard/core/board.py — added from __future__ import annotations after docstring (PEP 604 at KanbanBoard.__init__(self, tasks: list[Task] | None = None, ...)).
  • automaton/dashboard/ui/app.py — added from __future__ import annotations after docstring (PEP 604 at _get_review_path(self, task_name: str) -> Path | None; also transitively imports scope/board).

A rg sweep of automaton/dashboard/ for PEP 604 union syntax found no other dashboard modules using X | Y at definition time — only the three files above. No spurious future-imports were added to modules that don't need it.

Test results after the fix

  • python3 -c "import automaton.dashboard.core.scope, automaton.dashboard.core.board, automaton.dashboard.ui.app; print('IMPORTS_OK')" → IMPORTS_OK (no TypeError on Python 3.9.6).
  • python3 -m pytest tests/ -v → 224 passed, 0 errors (up from 198 passed / 3 collection errors).

Streak result

STREAK_COMPLETE attempt=1 clean=10/10 — 10 consecutive clean python3 -m pytest tests/ -q passes on the first attempt, no resets needed.

Acceptance criteria (re-checked after extension)

# Criterion Status
1 pip3 install -r requirements.txt exits 0 PASS
2 python3 -m pytest tests/ -v exits 0 (N passed, 0 errors) PASS — 224 passed, 0 errors
3 python3 -m py_compile ... exits 0 PASS
4 bash -n scripts/*.sh exits 0 PASS
5 bash scripts/install.sh exits 0 and creates .venv/ containing pytest PASS
6 rg sweep returns zero matches PASS (exit 1 = no matches)
7 Streak: 10 consecutive clean pytest runs PASS — 10/10 on attempt 1