Make test suite runnable from clean checkout + cross-platform vram_detect
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.
This commit is contained in:
Lap Tran
2026-06-21 18:28:15 -04:00
parent 1d36c0e4ad
commit f32f98575b
46 changed files with 1499 additions and 84 deletions
+17 -17
View File
@@ -25,15 +25,15 @@ VRAM configuration is in `~/.automaton/config.md`. If `Auto-detect: Yes`, run `p
**Before making ANY code edits**, you MUST have an active task in implement or doc_review phase. If the user asks you to do something and no task exists:
```
python ~/.automaton/scripts/status.py --create-task <kebab-case-name> --project {project}
python ~/.automaton/scripts/status.py --transition research --task <name> --project {project}
python ~/.automaton/scripts/status.py --transition implement --task <name> --project {project}
python3 ~/.automaton/scripts/status.py --create-task <kebab-case-name> --project {project}
python3 ~/.automaton/scripts/status.py --transition research --task <name> --project {project}
python3 ~/.automaton/scripts/status.py --transition implement --task <name> --project {project}
```
If an existing task is in implement/doc_review but was created >30 minutes ago, the guard will block edits. Touch the task to reset its clock:
```
python ~/.automaton/scripts/status.py --touch --task <name> --project {project}
python3 ~/.automaton/scripts/status.py --touch --task <name> --project {project}
```
Never piggyback on a stale task — create a new one for new work.
@@ -44,9 +44,9 @@ The full state machine is defined in ~/.automaton/prompts/workflow.md. Key point
- **`.state` file is the single source of truth** — always read `.state` first, fall back to artifact heuristic if missing
- **Approval gates**: research, decomposition, design, test_design, and code_review require `:awaiting_approval` → `:approved` before proceeding
- **Transitions**: All transitions go through `python ~/.automaton/scripts/status.py --transition {phase} --task {task-name} --project {project}`
- **Approvals**: All approvals go through `python ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}`
- **Task creation**: Always use `python ~/.automaton/scripts/status.py --create-task {name} --project {project}`
- **Transitions**: All transitions go through `python3 ~/.automaton/scripts/status.py --transition {phase} --task {task-name} --project {project}`
- **Approvals**: All approvals go through `python3 ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}`
- **Task creation**: Always use `python3 ~/.automaton/scripts/status.py --create-task {name} --project {project}`
## Autopilot Mode (Autopilot: Enabled in .agent.md)
@@ -55,17 +55,17 @@ In Autopilot mode, the Orchestrator MUST drive all tasks to completion. The driv
```
For each phase in autopilot:
1. Read .state → confirm current phase
2. Run: python ~/.automaton/scripts/status.py --validate-folder --task {task-name} --project {project}
2. Run: python3 ~/.automaton/scripts/status.py --validate-folder --task {task-name} --project {project}
3. If violations found → STOP and report (phase-skipping detected)
4. Load phase prompt → confirm ALLOWED/FORBIDDEN boundaries
5. Execute phase → produce required artifact
6. If phase requires approval (research, decomposition, design, test_design, code_review):
a. Run: python ~/.automaton/scripts/status.py --transition {phase}:awaiting_approval --task {task-name} --project {project}
a. Run: python3 ~/.automaton/scripts/status.py --transition {phase}:awaiting_approval --task {task-name} --project {project}
b. STOP and wait for user to say "APPROVED"
c. Run: python ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}
d. Run: python ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}
c. Run: python3 ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}
d. Run: python3 ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}
7. If phase does NOT require approval:
a. Run: python ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}
a. Run: python3 ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}
8. If transition accepted → load next phase prompt, continue
9. If transition rejected → stop and report
```
@@ -98,8 +98,8 @@ function drive_all():
### Task Creation in Autopilot
When the Orchestrator detects a new task description:
1. Run: `python ~/.automaton/scripts/status.py --create-task {kebab-case-name} --project {project}`
2. Run: `python ~/.automaton/scripts/status.py --transition research --task {kebab-case-name} --project {project}`
1. Run: `python3 ~/.automaton/scripts/status.py --create-task {kebab-case-name} --project {project}`
2. Run: `python3 ~/.automaton/scripts/status.py --transition research --task {kebab-case-name} --project {project}`
3. Immediately drive the task through its lifecycle
### Sub-Task Management
@@ -119,14 +119,14 @@ In manual mode, the Orchestrator only **reports** the current state and suggests
- **Next Step**: {Next Phase}
- **Auto-Execute**: NO
- **Command**:
> `python ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}`
> `python3 ~/.automaton/scripts/status.py --transition {next-phase} --task {task-name} --project {project}`
For approval-gated phases, report that approval is needed:
> `python ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}`
> `python3 ~/.automaton/scripts/status.py --approve --task {task-name} --project {project}`
## Periodic Audit
During long autopilot runs, call `python ~/.automaton/scripts/status.py --audit --project {project}`:
During long autopilot runs, call `python3 ~/.automaton/scripts/status.py --audit --project {project}`:
- At the start of each session (before driving any tasks)
- After completing a full task lifecycle
- If unexpected behavior is detected