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:
@@ -0,0 +1,81 @@
|
||||
# RESEARCH: add-self-improvement-loop
|
||||
|
||||
## Objective
|
||||
|
||||
Make the self-improvement loop default-on at install time (D21). The template `templates/loops/self-improvement/loop.json` was already created in task 6. This task wires it into `install.sh` and `update.sh` so that:
|
||||
- Fresh installs get the loop created and scheduled automatically
|
||||
- Existing users who run `update.sh` get the loop bootstrapped (idempotent -- skip if already exists)
|
||||
|
||||
## Current State
|
||||
|
||||
### `install.sh` (lines 1-79)
|
||||
- Clones repo to `~/.automaton`
|
||||
- Runs VRAM detection
|
||||
- Registers pre-edit guards via `register-guards.sh`
|
||||
- Sets up `.venv` and pip deps
|
||||
- Does NOT create any loops
|
||||
|
||||
### `update.sh` (lines 1-74)
|
||||
- Pulls latest from git
|
||||
- Checks for deprecated file locations
|
||||
- Registers guards
|
||||
- Installs git hooks in current project
|
||||
- Does NOT create any loops
|
||||
|
||||
### `--create-loop` (status.py:1773)
|
||||
- Takes `--create-loop <name>`, `--from-template <name>`, `--project <path>`
|
||||
- Creates `~/.automaton/loops/<name>/` (when project is `~/.automaton/`)
|
||||
- Copies `loop.json` from template, patches `name` field
|
||||
- Creates `.state.loop` with initial state (`running`)
|
||||
- Creates empty `.state.log`
|
||||
- Returns error if loop already exists
|
||||
|
||||
### `--install-schedule` (status.py:1807)
|
||||
- Takes `--install-schedule <name>`, `--interval <seconds>`, `--project <path>`
|
||||
- Generates OS-specific tick stub (`automaton-loop-tick.sh` or `.bat`)
|
||||
- Installs OS schedule unit (launchd plist on macOS, cron on Linux, schtasks on Windows)
|
||||
- Interval defaults to `loop.json schedule.interval_seconds` or 3600
|
||||
|
||||
### `_loops_dir` (status.py:1609)
|
||||
- When project is `~/.automaton/`, loops dir is `~/.automaton/loops/`
|
||||
- When project is other, loops dir is `<project>/.automaton/loops/`
|
||||
|
||||
## Design Decisions
|
||||
|
||||
### D1: Where to add the install hook
|
||||
In `install.sh`, after the clone and guard registration, add:
|
||||
```bash
|
||||
# Bootstrap self-improvement loop (default-on, D21)
|
||||
python3 "$FRAMEWORK_DIR/scripts/status.py" --create-loop self-improvement \
|
||||
--from-template self-improvement --project "$FRAMEWORK_DIR"
|
||||
python3 "$FRAMEWORK_DIR/scripts/status.py" --install-schedule self-improvement \
|
||||
--interval 3600 --project "$FRAMEWORK_DIR"
|
||||
```
|
||||
|
||||
### D2: Where to add the update hook
|
||||
In `update.sh`, after the git pull and guard registration, add an idempotent bootstrap:
|
||||
```bash
|
||||
# Bootstrap self-improvement loop if not present (default-on, D21)
|
||||
if [ ! -d "$FRAMEWORK_DIR/loops/self-improvement" ]; then
|
||||
python3 "$FRAMEWORK_DIR/scripts/status.py" --create-loop self-improvement \
|
||||
--from-template self-improvement --project "$FRAMEWORK_DIR"
|
||||
python3 "$FRAMEWORK_DIR/scripts/status.py" --install-schedule self-improvement \
|
||||
--interval 3600 --project "$FRAMEWORK_DIR"
|
||||
fi
|
||||
```
|
||||
|
||||
### D3: Test approach
|
||||
The test `test_self_improvement_installs_default_on` should verify that `install.sh` contains the create-loop and install-schedule commands for the self-improvement loop. A full integration test (actually running install.sh) would require a mock git clone target and is fragile. Instead, test the script content for the required commands, and test that `--create-loop self-improvement --from-template self-improvement --project <framework>` produces the expected directory structure (this is already tested in the status.py tests but we add a specific test for the self-improvement template).
|
||||
|
||||
### D4: User opt-out
|
||||
Users can disable the self-improvement loop with:
|
||||
```bash
|
||||
python3 ~/.automaton/scripts/status.py --pause-loop self-improvement --project ~/.automaton/
|
||||
```
|
||||
This should be documented in the install output and README.
|
||||
|
||||
## Risks
|
||||
|
||||
- **install.sh failure**: if `--create-loop` fails (e.g. Python not in PATH yet), install.sh should continue (the loop is optional, not critical for framework operation). Use `|| true` to non-fatal the loop bootstrap.
|
||||
- **update.sh idempotency**: the `if [ ! -d ... ]` check ensures existing users don't get errors on repeated updates.
|
||||
- **Platform differences**: `--install-schedule` handles platform dispatch internally. No shell-level platform checks needed.
|
||||
Reference in New Issue
Block a user