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
+1
View File
@@ -0,0 +1 @@
complete
@@ -0,0 +1,2 @@
research:approved|2026-06-22T14:28:48.582737+00:00|user
code_review:approved|2026-06-22T14:36:53.578676+00:00|user
@@ -0,0 +1,13 @@
# Adversarial Bug Report: fix-stale-task-mtime-proxy
## Attack Vectors Tested
1. **Manual .state.lastedit manipulation**: A user could `touch .state.lastedit` to reset the timer — this is equivalent to `--touch` and is acceptable behavior
2. **Deleted .state.lastedit**: `_get_edit_timestamp()` falls back to `.state` mtime — correct
3. **Multiple tasks in implement phase**: `_touch_lastedit` called only for `primary` task (the first in-scope task) — acceptable, as the primary task is the one being edited
4. **Clock skew**: Uses `time.time()` consistently — not a concern on local system
5. **Stale task in single-task path**: Now correctly checked (was missing before this fix)
## Findings
No bugs found.
## Verdict: PASS
@@ -0,0 +1,13 @@
# Bug Report: fix-stale-task-mtime-proxy
## Scope
Reviewed `scripts/status.py` `_get_edit_timestamp()`, `_touch_lastedit()`, `cmd_can_edit()`, `cmd_same_session()`, `cmd_touch()`.
## Findings
No bugs found. The `.state.lastedit` mechanism correctly:
- Is touched on ALLOWED `--can-edit` responses
- Falls back to `.state` mtime when `.state.lastedit` doesn't exist
- Is excluded from `NON_ARTIFACT_FILES`
- Used consistently across `--can-edit`, `--same-session`, and `--touch`
## Verdict: PASS
@@ -0,0 +1,22 @@
# Code Review: fix-stale-task-mtime-proxy
## Reviewed Files
- `scripts/status.py` (`_get_edit_timestamp()`, `_touch_lastedit()`, `cmd_can_edit()`, `cmd_same_session()`, `cmd_touch()`, `NON_ARTIFACT_FILES`)
## Changes
1. Added `.state.lastedit` file as the stale-task timer source
2. `_touch_lastedit()` called on ALLOWED `--can-edit` responses
3. `_get_edit_timestamp()` reads `.state.lastedit` with fallback to `.state` mtime
4. Added staleness check to single-task `--can-edit --task` path
5. `--touch` now touches `.state.lastedit` instead of `.state`
## Analysis
- **Correctness**: Using `.state.lastedit` (touched on actual edit activity) is a better proxy for staleness than `.state` mtime (which only reflects phase transitions)
- **Backward compatibility**: Falls back to `.state` mtime when `.state.lastedit` doesn't exist
- **Non-artifact**: `.state.lastedit` correctly added to `NON_ARTIFACT_FILES` to avoid being treated as a phase artifact
- **Single-task path**: Adding staleness check to `--can-edit --task` makes enforcement consistent across both code paths
- **`--touch` command**: Updated to touch `.state.lastedit` — consistent with the new activity tracking model
## Verdict: PASS
The fix is well-structured, maintains backward compatibility, and correctly addresses the mtime proxy issue. Tests cover creation, staleness detection, and fallback behavior.
@@ -0,0 +1,16 @@
# Doc Review: fix-stale-task-mtime-proxy
## Documentation Impact
- Updated `--touch` help text in status.py to reflect `.state.lastedit` instead of `.state` mtime
- No AGENTS.md changes needed (AGENTS.md describes the staleness concept, not the implementation detail)
- system-prompt.md mentions "Tasks idle for >30 minutes become stale" — still accurate
- prompts/orchestrate.md mentions `--touch` to reset clock — still accurate
## Checklist
- [x] `--touch` help text updated to mention `.state.lastedit`
- [x] AGENTS.md staleness description still accurate
- [x] system-prompt.md stale task description still accurate
- [x] prompts/orchestrate.md `--touch` usage still accurate
- [x] CHANGELOG.md will be updated for the release
## Verdict: PASS
@@ -0,0 +1,26 @@
# Implementation: fix-stale-task-mtime-proxy
## Bug
`--can-edit` used `.state` file mtime as a proxy for "last edit activity" to detect stale tasks. But `.state` is modified by phase transitions, not by actual editing. A task in `implement` phase for 30+ minutes would be flagged as stale even if the developer was actively editing files the whole time, because `.state` mtime only reflects the last phase transition.
## Fix
1. Added `_get_edit_timestamp()` — reads `.state.lastedit` mtime if it exists, falls back to `.state` mtime for backward compatibility
2. Added `_touch_lastedit()` — creates/updates `.state.lastedit` file
3. `--can-edit` now calls `_touch_lastedit()` on ALLOWED responses (both project-level and task-level paths), recording actual edit activity
4. Staleness check uses `_get_edit_timestamp()` instead of raw `.state` mtime
5. Added `.state.lastedit` to `NON_ARTIFACT_FILES` so it's not treated as a phase artifact
6. `--same-session` uses `_get_edit_timestamp()` for consistent activity tracking
7. `--touch` command now touches `.state.lastedit` instead of `.state`
8. Added staleness check to the single-task `--can-edit --task` path (previously only project-level `--can-edit` checked staleness)
## Files Changed
- `scripts/status.py`: Added `_get_edit_timestamp()`, `_touch_lastedit()`, updated `cmd_can_edit()`, `cmd_same_session()`, `cmd_touch()`, `NON_ARTIFACT_FILES`
- `tests/test_status.py`: Added `TestStateLastEdit` class with 5 tests and `TestTestPlanPhaseMapping` class
## Tests
- `test_can_edit_creates_lastedit_on_allowed`: Verifies `.state.lastedit` is created on ALLOWED
- `test_can_edit_creates_lastedit_with_file_scope`: Same for file-scoped can-edit
- `test_stale_uses_lastedit_not_state_mtime`: Old `.state` + recent `.state.lastedit` → not stale
- `test_stale_when_lastedit_old`: Recent `.state` + old `.state.lastedit` → stale
- `test_falls_back_to_state_mtime_without_lastedit`: No `.state.lastedit` → falls back to `.state` mtime
- All 249 tests pass
+14
View File
@@ -0,0 +1,14 @@
# Spec: fix-stale-task-mtime-proxy
## Problem
`scripts/status.py:965,1072` uses the `.state` file's mtime as a proxy for "last edit activity." But every `--transition` rewrites `.state`, resetting its mtime. A task that was transitioned 29 minutes ago appears "fresh" even though no editing happened. The `--same-session` check also gives false positives after any transition.
## Fix
Use a separate `.state.lastedit` timestamp file that is updated only when `--can-edit` returns ALLOWED (actual edit activity). Check `.state.lastedit` mtime instead of `.state` mtime for stale-task detection. If `.state.lastedit` doesn't exist, fall back to `.state` mtime (backward compat).
## Acceptance Criteria
- Transitioning a task does NOT reset the stale-task timer
- Running `--can-edit` (and getting ALLOWED) DOES reset the timer
- If `.state.lastedit` doesn't exist, falls back to `.state` mtime
- Existing tests still pass
- Add test verifying transition doesn't reset timer but can-edit does
@@ -0,0 +1,13 @@
# Verdict: fix-stale-task-mtime-proxy
## Status: PASS
## Summary
Fixed stale-task detection to use `.state.lastedit` timestamp (touched on actual edit activity via `--can-edit` ALLOWED) instead of `.state` mtime (which only reflects phase transitions). Added backward-compatible fallback to `.state` mtime. Added staleness check to single-task `--can-edit --task` path. Updated `--touch` and `--same-session` for consistency. 5 new tests added.
## Artifacts
- IMPLEMENTATION.md: Complete
- CODE_REVIEW.md: PASS
- BUG_REPORT.md: No bugs found
- ADVERSARIAL_BUG_REPORT.md: No bugs found
- DOC_REVIEW.md: PASS