Archive completed tasks, add cleanup commands, self-documenting dashboard UI
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
This commit is contained in:
Lap Tran
2026-06-24 22:43:33 -04:00
parent e13513faaa
commit 4a2301b077
572 changed files with 856 additions and 101 deletions
@@ -0,0 +1 @@
complete
@@ -0,0 +1,2 @@
research:approved|2026-06-21T18:49:57.455154+00:00|user
code_review:approved|2026-06-21T19:23:34.089408+00:00|user
@@ -0,0 +1,3 @@
# ADVERSARIAL_BUG_REPORT
10/10 streak clean = independent checker (article #2). No adversarial findings.
@@ -0,0 +1,3 @@
# BUG_REPORT
No bugs found. PEP 604 issue caught by verifier during implementation; not a post-impl finding.
@@ -0,0 +1,3 @@
# CODE_REVIEW
Satisfied by the 10-streak verifier (Boris loop, article #2). See IMPLEMENTATION.md.
@@ -0,0 +1,3 @@
# DOC_REVIEW
Doc changes part of IMPLEMENTATION.md. No further work.
@@ -0,0 +1,146 @@
# 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 |
@@ -0,0 +1,60 @@
# Parent Task: runnable-test-suite
This is the parent SPEC for the runnable-test-suite task. Each sub-task references
this for context, scope boundaries, and the parent acceptance contract.
## Parent Goal
Make `python3 -m pytest tests/ -v` pass from a clean checkout of `~/.automaton`,
with deterministic Python deps pinned and docs that reflect the actual interpreter
on stock macOS/Windows/Linux. In the same wave, make `scripts/vram_detect.py`
cross-platform (macOS, Windows, Linux) — the existing version was developed on
Cachyos and only fully works on Linux.
## Parent Acceptance Contract
1. `pip3 install -r requirements.txt` succeeds on stock macOS CommandLineTools + pip3.
2. `python3 -m pytest tests/ -v` exits 0 from a clean clone, zero `error` lines.
3. **Streak verifier:** 10 consecutive clean `python3 -m pytest tests/ -v` runs with
no edits between runs. A single failure resets the count. Cap: 5 attempts.
4. `python3 -m py_compile automaton/**/*.py automaton/dashboard/**/*.py scripts/*.py` exits 0.
5. `bash -n scripts/*.sh` exits 0.
6. `rg "^python " AGENTS.md README.md automaton/dashboard/README.md prompts/orchestrate.md`
returns zero matches for a bare `python ` command.
7. `python3 scripts/vram_detect.py` on Darwin prints `gpu_vram_gb > 0` (was 0 before).
8. `python3 scripts/vram_detect.py` JSON shape identical to before on Linux/Cachyos.
## Sub-tasks
- `make-tests-runnable` — Wave 1, parallel-ok
- `vram-detect-cross-platform` — Wave 1, parallel-ok
- `vram-detect-cross-platform-tests` — Wave 2, depends on `vram-detect-cross-platform`
Parent is complete ONLY when ALL three sub-tasks pass and the streak verifier above
runs 10 consecutive clean passes.
## Anti-spin rails (from the source article)
- The streak verifier IS the independent checker model from Boris's loop. The
worker (local LLM) does not grade its own homework.
- If a test is genuinely broken (not just import-failing due to missing pytest),
STOP and report. Do not patch the test to make it pass. An agent that grades
itself will delete the failing test and call it done.
- Unknown model name → fail open with `0`. Wrong-context detection is worse than none.
- No new third-party deps beyond `pytest`. Pure stdlib for `vram_detect.py`.
## Hardware/VRAM context
- Detected by `vram_detect.py` on this box: **32GB RAM, no GPU, model unknown**
(because `vram_detect.py` is broken on macOS — subtask-2 fixes that)
- Target context: 12k tokens, headroom 25%, max peak per sub-task: 9k tokens.
- Sub-task peak estimates all fit within 9k. No further decomposition.
## Constraints / non-goals (parent)
- No `psutil`, `wmi`, `pywin32`, `tox`, `pytest-cov`, or other third-party deps.
- No removal of existing OpenAI/Anthropic entries in `MODEL_CONTEXT_WINDOWS`.
- No changes to `status.py`, `autopilot.py`, or any other runtime script's behavior.
- No touching files under `tasks/` (those are state, not source).
- No Docker, no conda, no `pyenv`. Stock `python3` + `pip3` only.
- VRAM detection is additive — Linux/Cachyos output must NOT regress.
@@ -0,0 +1,107 @@
# SPEC — make-tests-runnable
Parent: `runnable-test-suite` (see PARENT_SPEC.md).
## Scope
Establish the green-test baseline the other sub-tasks depend on. Pin pytest,
sweep docs/prompts for `python` → `python3`, add install snippet, verify the
streak contract.
## Files this sub-task touches (and ONLY these)
- `requirements.txt` (NEW) — pin `pytest==7.4.4` (last 7.x; supports Python 3.9+).
- `AGENTS.md` — Build & Test Commands section: `python` → `python3`, reference
`requirements.txt`.
- `README.md` — every bare `python ` → `python3 ` in commands.
- `automaton/dashboard/README.md` — same sweep.
- `prompts/orchestrate.md` — same sweep on `status.py` invocations.
- `scripts/install.sh` — append idempotent venv snippet (only create `.venv` if
it doesn't already exist; only `pip install -r requirements.txt` inside .venv).
- `CHANGELOG.md` — `[unreleased]` entry noting new `requirements.txt`, `python3`
requirement, venv install path.
- `automaton/dashboard/core/scope.py` — add `from __future__ import annotations`
at top (after module docstring) so PEP 604 annotations become lazy strings
(PEP 563) and the file imports on Python 3.9.
- `automaton/dashboard/core/board.py` — same `from __future__ import annotations` fix.
- `automaton/dashboard/ui/app.py` — same fix (transitively imports scope/board).
- Any other file under `automaton/dashboard/` using `X | Y` annotation syntax
evaluated at definition time — same `from __future__ import annotations` fix.
## MUST NOT touch
- `scripts/vram_detect.py` (subtask-2 owns it)
- `tests/test_vram_detect.py` (subtask-3 owns it)
- Any other test file (`tests/*.py`)
- `scripts/status.py`, `scripts/autopilot.py`, or other runtime scripts
- Logic in the dashboard files — ONLY add the `from __future__ import annotations`
import line. Do NOT change function signatures, types, or behavior. The fix
is purely a compatibility shim so annotations become strings (PEP 563).
## Requirements (numbered)
1. Create `requirements.txt` at repo root with exactly: `pytest==7.4.4`
2. In `AGENTS.md`, change every `python -m py_compile`, `python -m pytest`,
`python -m automaton.dashboard` to `python3 -m ...`. Add a one-line note
after the section title: *"Install: `pip3 install -r requirements.txt`"*
3. In `README.md`, change every `python ~/.automaton/scripts/status.py ...` and
`python -m automaton.dashboard` to `python3 ...`.
4. In `automaton/dashboard/README.md`, change every `python -m automaton.dashboard`
to `python3 -m automaton.dashboard`.
5. In `prompts/orchestrate.md`, change every `python ~/.automaton/scripts/status.py`
to `python3 ~/.automaton/scripts/status.py`.
6. In `scripts/install.sh`, append a venv block:
```bash
# --- Python deps (idempotent) ---
if [ ! -d ".venv" ]; then
python3 -m venv .venv
fi
.venv/bin/pip install --quiet --upgrade pip
.venv/bin/pip install --quiet -r requirements.txt
```
Must be `set -e`-safe and re-runnable without errors.
7. In `CHANGELOG.md`, add under `[unreleased]`:
- **Added:** `requirements.txt` pinning `pytest==7.4.4` for reproducible test runs.
- **Changed:** All documented `python` invocations now read `python3` (stock macOS
/ Windows Python ship as `python3`).
- **Added:** `scripts/install.sh` now creates `.venv/` and installs pytest into it.
8. After edits, run `rg -n "^python |\"python " AGENTS.md README.md automaton/dashboard/README.md prompts/orchestrate.md` — expect ZERO matches for bare `python ` commands.
9. Run `rg -l "^from __future__ import annotations" automaton/dashboard/` and confirm
`scope.py`, `board.py`, and `ui/app.py` (and any other dashboard module using
PEP 604 `X | Y` annotations) are listed. If a dashboard module uses PEP 604 at
definition time and lacks the future import, add it. Do NOT add it to modules
that don't use PEP 604 — keep the change surgical.
10. Confirm on stock Python 3.9.6: `python3 -c "import automaton.dashboard.core.scope, automaton.dashboard.core.board, automaton.dashboard.ui.app"` exits 0 without `TypeError`.
## Acceptance criteria
1. `pip3 install -r requirements.txt` exits 0.
2. `python3 -m pytest tests/ -v` exits 0 (N passed, 0 errors).
3. `python3 -m py_compile automaton/**/*.py automaton/dashboard/**/*.py scripts/*.py` exits 0.
4. `bash -n scripts/*.sh` exits 0.
5. `bash scripts/install.sh` exits 0 and creates `.venv/` containing pytest.
6. `rg` sweep from requirement 8 returns zero matches.
7. **Streak:** 10 consecutive `python3 -m pytest tests/ -v` runs all clean.
Cap: 5 attempts. Reset on first failure.
## Anti-spin rails
- If a test fails for a reason OTHER than missing pytest, STOP and report — do
not edit the failing test. It is subtask-3's job to add/fix tests; subtask-1
only makes existing tests *runnable*.
- If `python3 -m pytest tests/ -v` fails because of a `vram_detect.py` import
in test_vram_detect.py, STOP and report. That's a bug in subtask-2's scope.
- Do NOT add `pytest-cov`, `pytest-mock`, `tox`, or any other dep.
## Recommended approach
1. Write `requirements.txt`.
2. `pip3 install -r requirements.txt`.
3. Run `python3 -m pytest tests/ -v`. If it fails on missing pytest for OTHER
reasons, stop and report (do not patch tests).
4. Sweep docs/prompts with `edit` (batch by file; use `replaceAll=true` for
the `python ` → `python3 ` substitution within each file).
5. Append venv block to `scripts/install.sh`.
6. Write CHANGELOG entry.
7. Run streak verifier: `for i in $(seq 1 10); do python3 -m pytest tests/ -q || break; done`.
If all 10 pass, done. Otherwise reset up to 5 times.
@@ -0,0 +1,3 @@
# VERDICT
PASS — 235 passed, 0 errors. 10/10 streak on attempt 1.