CI / build (push) Has been cancelled
runnable-test-suite (parent) — complete. Three sub-tasks all complete: - make-tests-runnable: add requirements.txt pinning pytest==7.4.4, sweep all docs/prompts from bare 'python' to 'python3' (stock macOS/Windows ships python3), add idempotent .venv install block to scripts/install.sh, and add 'from __future__ import annotations' to 3 dashboard modules using PEP 604 union syntax at definition time so they import on Python 3.9+. The PEP 604 bug was caught by the streak verifier itself during implementation. - vram-detect-cross-platform: scripts/vram_detect.py now branches on platform.system() for Linux/Darwin/Windows. macOS path uses system_profiler SPDisplaysDataType (Apple Silicon unified memory via sysctl hw.memsize; Intel Macs via 'VRAM (Total):'). Windows uses wmic path win32_VideoController get AdapterRAM with PowerShell fallback. Linux /proc/meminfo and nvidia-smi/lspci paths unchanged (regression test locks them). Added 14 local-LLM context-window entries (llama-3.1, qwen2.5, mistral, deepseek-r1/v3, glm-4/4.5, gemma-2, phi-3/4) with source-cited model cards. Added _probe_ollama_model() that runs 'ollama list' as a last-resort fallback. run_command() now wraps PowerShell cmdlets on Windows (['powershell', '-NoProfile', '-NoLogo', '-Command', ...]). - vram-detect-cross-platform-tests: 11 new monkeypatched tests in tests/test_vram_detect.py covering Linux/Darwin/Windows branches for detect_ram and detect_gpu_vram, prefix-match for unknown model names, ollama probe, Windows PowerShell wrapper, and a LOCKED regression test for _detect_ram_linux(). All external subprocess/sysctl/wmic calls are mocked; no live hardware probes. Suite total: 235 passed, 0 errors. Verified on this box: gpu_vram_gb 0 -> 32 on Apple M5 (32GB unified memory), target context correctly jumped 12k -> 42k. Subtask-2 implementation was authored by local LLM (gemma-4-26B-A4B-it via headroom proxy @ localhost:8787). The 10-consecutive-clean-pass streak verifier ran as the independent checker model (article #2/#9/#13 in 'WTF Is a Loop? Part 2'). One anti-spin rail fired: local LLM produced inline branches where subtask-3 tests expected private _detect_ram_linux() helper; extracted helper to match the test contract without weakening tests. Parent + all 3 subtasks complete. Prior opencode-subagent implementation of subtask-2 preserved in git stash for reference.
5.5 KiB
5.5 KiB
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) — pinpytest==7.4.4(last 7.x; supports Python 3.9+).AGENTS.md— Build & Test Commands section:python→python3, referencerequirements.txt.README.md— every barepython→python3in commands.automaton/dashboard/README.md— same sweep.prompts/orchestrate.md— same sweep onstatus.pyinvocations.scripts/install.sh— append idempotent venv snippet (only create.venvif it doesn't already exist; onlypip install -r requirements.txtinside .venv).CHANGELOG.md—[unreleased]entry noting newrequirements.txt,python3requirement, venv install path.automaton/dashboard/core/scope.py— addfrom __future__ import annotationsat 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— samefrom __future__ import annotationsfix.automaton/dashboard/ui/app.py— same fix (transitively imports scope/board).- Any other file under
automaton/dashboard/usingX | Yannotation syntax evaluated at definition time — samefrom __future__ import annotationsfix.
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 annotationsimport line. Do NOT change function signatures, types, or behavior. The fix is purely a compatibility shim so annotations become strings (PEP 563).
Requirements (numbered)
- Create
requirements.txtat repo root with exactly:pytest==7.4.4 - In
AGENTS.md, change everypython -m py_compile,python -m pytest,python -m automaton.dashboardtopython3 -m .... Add a one-line note after the section title: "Install:pip3 install -r requirements.txt" - In
README.md, change everypython ~/.automaton/scripts/status.py ...andpython -m automaton.dashboardtopython3 .... - In
automaton/dashboard/README.md, change everypython -m automaton.dashboardtopython3 -m automaton.dashboard. - In
prompts/orchestrate.md, change everypython ~/.automaton/scripts/status.pytopython3 ~/.automaton/scripts/status.py. - In
scripts/install.sh, append a venv block:Must be# --- 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.txtset -e-safe and re-runnable without errors. - In
CHANGELOG.md, add under[unreleased]:- Added:
requirements.txtpinningpytest==7.4.4for reproducible test runs. - Changed: All documented
pythoninvocations now readpython3(stock macOS / Windows Python ship aspython3). - Added:
scripts/install.shnow creates.venv/and installs pytest into it.
- Added:
- After edits, run
rg -n "^python |\"python " AGENTS.md README.md automaton/dashboard/README.md prompts/orchestrate.md— expect ZERO matches for barepythoncommands. - Run
rg -l "^from __future__ import annotations" automaton/dashboard/and confirmscope.py,board.py, andui/app.py(and any other dashboard module using PEP 604X | Yannotations) 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. - Confirm on stock Python 3.9.6:
python3 -c "import automaton.dashboard.core.scope, automaton.dashboard.core.board, automaton.dashboard.ui.app"exits 0 withoutTypeError.
Acceptance criteria
pip3 install -r requirements.txtexits 0.python3 -m pytest tests/ -vexits 0 (N passed, 0 errors).python3 -m py_compile automaton/**/*.py automaton/dashboard/**/*.py scripts/*.pyexits 0.bash -n scripts/*.shexits 0.bash scripts/install.shexits 0 and creates.venv/containing pytest.rgsweep from requirement 8 returns zero matches.- Streak: 10 consecutive
python3 -m pytest tests/ -vruns 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/ -vfails because of avram_detect.pyimport 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
- Write
requirements.txt. pip3 install -r requirements.txt.- Run
python3 -m pytest tests/ -v. If it fails on missing pytest for OTHER reasons, stop and report (do not patch tests). - Sweep docs/prompts with
edit(batch by file; usereplaceAll=truefor thepython→python3substitution within each file). - Append venv block to
scripts/install.sh. - Write CHANGELOG entry.
- 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.