Skip to content

emrg: scheduler self-heal — ensure projects.yml emrg entry on startup - #535

Merged
argszero merged 1 commit into
masterfrom
feature/scheduler-project-self-heal
Aug 7, 2026
Merged

emrg: scheduler self-heal — ensure projects.yml emrg entry on startup#535
argszero merged 1 commit into
masterfrom
feature/scheduler-project-self-heal

Conversation

@argszero

@argszero argszero commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Packaged installs (or clean first runs) auto-generate the emrg evolution task in tasks.yml via _ensure_self_evolution_task() (load_and_start → no network, no wait), but the corresponding project entry in projects.yml was 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") returns None when projects.yml lacks the entry
  • EvolutionHandler.__init__ then falls back to path or name_source_dir = "emrg" (relative string, dangling cwd)
  • Same root cause as the earlier ~/Downloads/source mis-clone incident (unregistered project path → agent explores under a dangling cwd)
  • Templates also can't resolve {{ project.* }} config

Fix (rant 02:58 spec)

_ensure_self_evolution_task() now:

  1. Ensures the projects.yml emrg entry 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)
  2. Then appends the emrg-task to 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)

  • ✅ Missing projects.yml / missing entry → entry added with fixed path, no network, no first-tick wait; idempotent (no duplicate on repeated startup)
  • ✅ Existing emrg entry (custom dev path) → preserved verbatim
  • ✅ Non-emrg entries (e.g. paper) survive the self-heal
  • ✅ 502 Python tests pass (3 new; doc counts synced 499 → 502)

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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszero
argszero merged commit 4c4919e into master Aug 7, 2026
1 check passed
@argszero
argszero deleted the feature/scheduler-project-self-heal branch August 7, 2026 03:41
argszero pushed a commit that referenced this pull request Aug 7, 2026
…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.
argszero added a commit that referenced this pull request Aug 7, 2026
…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>
argszero added a commit that referenced this pull request Aug 7, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant