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:
Lap Tran
2026-06-26 10:05:18 -04:00
parent fe43b9e1fc
commit bc7daf8590
666 changed files with 15994 additions and 69 deletions
@@ -0,0 +1,42 @@
# Implementation: fix-harness-command-template
## Summary
Fixed the broken default `harness.command` in `scripts/loop-runner.py`. The old default `["opencode", "run", "--prompt-file", "{prompt}", "--cwd", "{cwd}"]` used flags that do not exist in `opencode run` (`--prompt-file`, `--cwd`). The new default is `["opencode", "run", "--dir", "{cwd}", "{prompt_content}"]` and introduces a new `{prompt_content}` substitution token that carries the resolved prompt's text as a single argv element. Added an explicit "Harness agnosticism" section to the SPEC confirming the contract is preserved (token substitution only; runner core has zero harness awareness; D8 intact).
## Files changed
| File | Change |
|------|--------|
| `scripts/loop-runner.py` (lines 315-330) | Replaced default `harness.command` with `--dir {cwd} {prompt_content}`; added `{prompt_content}` token derived from reading the resolved prompt file |
| `design/loops/technical.md` §8 | Updated default command in §8 and §9 to the new shape; documented `{prompt_content}` token; added Pi Dev / aider / generic examples |
| `templates/loops/self-improvement/loop.json` | Updated `harness.command` to new default |
| `tests/test_loop_runner.py` | `_make_loop` helper now writes loop-local prompt stubs (with role-marker content) so default-command tests' substring matchers still work; removed obsolete `--prompt-file` stub rules; updated the no-harness-invocation assertion to match `opencode` substring |
| `tests/test_blast_radius.py` | Same `_make_loop` helper change (with framework-prompt guard); no other test changes needed |
| `tests/test_goal_mode.py` | Same `_make_loop` helper change; three custom-`{prompt}`-command test matcher substrings updated from `test-impl`/`test-verify`/`test-orch` to `implement-prompt`/`verify-prompt`/`orchestrate-prompt` (those tests' matchers identify roles by the resolved temp-file path) |
| `tests/test_loop_templates.py` | Same `_make_loop` helper change (with framework-prompt guard); `TestTickPromptSubstitution.test_tick_substitutes_prompt_tokens` now uses a custom `harness.command` with `{prompt}` so its `--prompt-file` path extractor still works |
| `tests/test_harness_command.py` (NEW) | 7 new tests for `_invoke_harness` covering: default uses `--dir` not `--cwd`/`--prompt-file`; default passes prompt content; prompt content preserves special chars (quotes, dollar signs, single quotes); `{prompt}` token still available for custom commands; `{cwd}` token still works in custom commands; empty `command` falls back to new default; Pi Dev-shaped command substitution works correctly (proves harness-agnostic token substitution) |
## Key decisions applied
- **D-H1** `{prompt_content}` is a single argv element under `subprocess.run` list mode; no shell expansion, no quoting. Safe for any prompt text including special characters.
- **D-H2** `{prompt}` (file path) retained for backwards compat and file-attachment harnesses.
- **D-H3** Default does not hardcode `--model`; inherits from opencode config.
- **D-H4** No per-role `harness.command` override in this task; one command for all roles, as in v1. Per-role model selection requires the per-role override feature (future task).
- The framework's harness-agnostic contract is preserved and extended: `{prompt_content}` makes the framework MORE harness-agnostic (covering harnesses that want a message arg, not a file path).
## Verification
- `python3 -m py_compile scripts/loop-runner.py` ✓
- `python3 -m pytest tests/test_harness_command.py -v` 7 passed
- `python3 -m pytest tests/test_loop_runner.py -v` 18 passed
- `python3 -m pytest tests/ -q` **440 passed** (baseline was 433; +7 new harness command tests)
- No live harness invocation; all subprocess calls mocked via fixtures.
## Manual smoke (recommended before closing)
When `opencode` is on PATH (it is on this machine):
```
opencode run --dir /tmp --model local-mlx/AEON-7/Qwen3.6-27B-AEON-ULtimate-Uncensored-Multimodal-MLX-FP4 "echo hello"
```
should produce stdout and exit non-interactively. This confirms the new default shape actually invokes.