emrg: scheduler self-heal — ensure projects.yml emrg entry on startup - #535
Conversation
Packaged installs got tasks.yml auto-generated (emrg-task) but projects.yml
lacked the emrg entry. The only other writer (_ensure_evolution_workspace's
clone branch) needs a first tick + network, so _resolve_project_path('emrg')
returned None and the handler's _source_dir degenerated to the relative
string 'emrg' (dangling cwd — same root cause as the ~/Downloads/source
mis-clone incident).
Fix: _ensure_self_evolution_task() now ensures the projects.yml emrg entry
(path fixed to ~/.emrg/evolution/emrg) before appending the task, preserving
any existing entry as-is (dev-machine custom paths untouched). No network,
no first-tick wait. Adds 3 tests (missing append / present preserve / other
entries preserved); doc counts synced 499 → 502.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (1/3). Self-review of my own PR: rant 02:58 spec implemented exactly — _ensure_self_evolution_task() now ensures projects.yml emrg entry first (path fixed to ~/.emrg/evolution/emrg via EVOLUTION_CWD), preserves existing entries (dev paths untouched), then appends the task. 3 new tests cover missing-append / present-preserve / other-entries-kept; idempotent double-call verified. CI green (31143420194).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3). Re-verified: _ensure_self_evolution_task() ensures projects.yml emrg entry first (fixed path EVOLUTION_CWD/emrg), preserves existing entries, then appends task; 3 new tests cover missing-append/present-preserve/other-entries; idempotent. CI green (31143420194).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3). Final re-verification: _ensure_self_evolution_task() project-entry self-heal matches rant 02:58 spec (fixed path EVOLUTION_CWD/emrg, preserve existing, 3 new tests incl. idempotency). CI green (31143420194). 3 consecutive ✅ from different cycles — mergeable.
…lf-heal entry Feature entry for the merged scheduler self-heal: _ensure_self_evolution_task now ensures the projects.yml emrg entry at daemon startup (fixed path ~/.emrg/evolution/emrg, existing entries preserved) — the tasks.yml startup self-heal had no projects.yml counterpart until #535.
…lf-heal entry (#538) Feature entry for the merged scheduler self-heal: _ensure_self_evolution_task now ensures the projects.yml emrg entry at daemon startup (fixed path ~/.emrg/evolution/emrg, existing entries preserved) — the tasks.yml startup self-heal had no projects.yml counterpart until #535. Co-authored-by: EMRG Evolution <emrg@argszero.dev>
…uler work (#540) Version bump 0.2.9 → 0.2.10 across all 6 version sources (pyproject.toml / emrg/__init__.py / gui/package.json / uv.lock / make-installer.sh / build-runtime.sh). test_version_sync all green. Release includes #539 flaky session-ID entropy fix, #533/#534 README restructure (core differentiator front + MANIFESTO anglicized), #535 scheduler projects.yml self-heal, #537/#538 quick-ref updates. Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Packaged installs (or clean first runs) auto-generate the emrg evolution task in
tasks.ymlvia_ensure_self_evolution_task()(load_and_start→ no network, no wait), but the corresponding project entry inprojects.ymlwas never guaranteed. The only other writer is_ensure_evolution_workspace()'s clone-success branch, which requires a first tick (60s) and a successful network clone.Root cause chain
_resolve_project_path("emrg")returnsNonewhen projects.yml lacks the entryEvolutionHandler.__init__then falls back topath or name→_source_dir = "emrg"(relative string, dangling cwd)~/Downloads/sourcemis-clone incident (unregistered project path → agent explores under a dangling cwd){{ project.* }}configFix (rant 02:58 spec)
_ensure_self_evolution_task()now:emrgentry first (path fixed to~/.emrg/evolution/emrg, i.e.EVOLUTION_CWD / "emrg") — only appends when missing, preserves any existing entry as-is (dev-machine custom paths untouched)emrg-taskto tasks.yml (existing logic unchanged)_ensure_project_entry()(clone-branch semantics, overwrite-on-exists) and the tasks.yml append logic are untouched, per spec.Acceptance coverage (new tests)