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
+59
View File
@@ -0,0 +1,59 @@
# VERDICT: add-goal-mode
**Status: PASS**
Task delivers goal-oriented loop extensions: work-source dispatch (`single`/`audit`/`backlog`), verifier prompt token plumbing (`{task_brief}`, `{acceptance_criteria}`, `{next_hint}`), `next_hint` feedback loop closure, `--audit --json` machine-readable mode, and ci-triage template updates. All changes are in `scripts/loop-runner.py`, `scripts/status.py`, `templates/loops/ci-triage/loop.json`, and `tests/test_goal_mode.py`.
## Requirement coverage
| Req | Status | Tests |
|-----|--------|-------|
| R1 find_work dispatch | delivered | TestFindWorkDispatch (3) |
| R2 audit work_source | delivered | TestAuditWorkSource (4) |
| R3 backlog work_source | delivered | TestBacklogWorkSource (3) |
| R4 verifier tokens | delivered | TestVerifierTokens (4) |
| R5 _truncate_tokens | delivered | TestTruncateTokens (3) |
| R6 next_hint feedback loop | delivered | TestNextHintFeedback (2) |
| R7 loop.json schema additions | delivered | TestLoopJsonSchemaAdditions (3) |
| R8 --audit --json | delivered | TestAuditJson (3) |
| Regression backward compat | delivered | TestRegressionBackwardCompat (1) |
Tests: 26 new. Full suite: **354 passed** (was 328 + 26 new). No regressions.
## Goal-mode loop closure
- **Work discovery**: `single` (unchanged), `audit` (highest-severity violation), `backlog` (top unchecked BACKLOG.md item). Missing/unknown falls back to `single` with WARNING.
- **Goal injection**: `{task_brief}` from RESEARCH/DESIGN/SPEC.md, `{acceptance_criteria}` from loop.json, `{next_hint}` from last verdict -- all truncated and fed to both Implement and Verify roles.
- **Feedback loop**: tick N's verifier `next_hint` becomes tick N+1's `{next_hint}` context. First tick / post-approve: empty string (no KeyError).
- **Audit integration**: `--audit --json` produces the violation list the `audit` work source consumes. Self-healing: violations without tasks trigger `--create-task`.
## Defense against loop death modes -- unchanged
The runner's brake enforcement is unchanged from task 3. Goal-mode additions are purely additive to the work-discovery and token-substitution layers; they do not touch gate logic, state-write atomicity, or halt semantics. The `no_work` skip reason is a clean scheduler exit (exit 0, no state advance) -- same pattern as `no_current_task`.
## Agnosticism preserved
- **Harness-agnostic**: new tokens are substitution placeholders in `harness.command`; only active when the operator's command template includes them. Default command unchanged.
- **OS-agnostic**: no platform-specific code added. `--audit --json` is pure Python.
- **Model-agnostic**: runner still never inspects model size/provider. Goal tokens are text content, not model directives.
## Doc impact landed
- `CHANGELOG.md` `[unreleased]` entry for `add-goal-mode` (test counts updated to actual).
- `design/loops/technical.md` schema section already documents `work_source` and `acceptance_criteria`.
- `design/loops/functional.md` already documents the fields.
- `templates/loops/ci-triage/loop.json` updated with explicit fields.
No code-doc mismatches.
## Hardening items deferred (tracked in BUG_REPORT + ADVERSARIAL_BUG_REPORT)
1. `work_source.area` path-traversal validation (A3) -> v1.1 defense-in-depth.
2. `current_task` from audit JSON path-traversal validation (A5) -> v1.1 defense-in-depth.
3. `_truncate_tokens` marker edge case with tiny budgets (O5) -> v1.1.
All three are explicit follow-ups; none block this task.
## Resolution
**PASS -- proceed to `complete`.** Task 4 closes the goal-oriented loop on the runner side. With work-source dispatch, acceptance-criteria injection, and next_hint feedback, the runner can now drive loops that discover their own work (audit/backlog) and improve across ticks. Remaining tasks: 5 (blast-radius-scheduler), 6 (templates-onboarding), 7 (self-improvement-loop), 8 (install-update-flow), 9 (move-completed-tasks).