Skip to content

emrg: daemon remove_project command (GUI multi-session rant P1) - #619

Merged
argszero merged 2 commits into
masterfrom
feature/remove-project
Aug 10, 2026
Merged

emrg: daemon remove_project command (GUI multi-session rant P1)#619
argszero merged 2 commits into
masterfrom
feature/remove-project

Conversation

@argszero

Copy link
Copy Markdown
Owner

P1 of the GUI multi-session feature (rant 2026-08-10T15:07:19 — each open session gets its own websocket connection; sidebar = open-session list). Per the rant's staged plan, the daemon-side change is minimal: a single remove_project command.

Changes

  • emrg/server/daemon.py: _handle_remove_project(name, ws) — removes the matching name entry from projects.yml (atomic write, mirrors _touch_project's read path). On-disk session data under <path>/.emrg/sessions/ is preserved — a later _touch_project re-registers the project.
  • Dispatch branch in _process_message for remove_project (requires non-empty name).
  • Response: {"type": "project_removed", "removed": true, "name": ...}; removed: false + optional error key on failure (missing file, corrupt YAML, non-list data, unknown name, write error).

Tests (+5, 674→679, all green)

  • removes matching entry, keeps others
  • unknown name → removed=false, file untouched
  • on-disk session data preserved after removal
  • no projects.yml → removed=false, no crash
  • corrupt YAML → removed=false + error key

Doc counts synced in README.md / README.cn.md / Agent.md per the #511 guard.

@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 20260810-151705

P1 of the GUI multi-session rant (2026-08-10T15:07:19): daemon remove_project command. Removes a projects.yml entry by name (atomic write, mirrors _touch_project read path), preserves on-disk session data (re-registered by next _touch_project). Response {"type":"project_removed","removed":bool,"name":...}, error key on failure. +5 tests (exists/unknown/data-preserve/no-file/corrupt-yaml), 679 pytest green, doc counts synced (README/README.cn/Agent). Test CI 31365113124 SUCCESS.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR locally (checked out `pr-619`, ran the full suite): 624 passed + 55 skipped = 679, matching the documented count; all 5 new `remove_project` tests pass. The implementation mirrors `_touch_project`'s read path and `atomic_write_yaml` signature correctly, and `_handle_list_projects` reads from disk each time, so a removal is immediately reflected in the next `projects_list` (no stale in-memory cache).

@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 20260810-151547

Verified on feature/remove-project:

  • Full suite: 679 passed (doc counts 674→679 synced across Agent.md/README.md/README.cn.md; GUI 111 unchanged).
  • All 5 new remove_project tests pass: matching removal, unknown-name no-op, on-disk session data preserved, missing projects.yml, corrupt YAML → removed=false + error.
  • Implementation mirrors _touch_project: same read path (yaml.safe_load + read_text(encoding=utf-8)), same atomic_write_yaml + .projects_ prefix, non-dict entries preserved; dispatch validates non-empty name.
  • No workflow changes. MERGEABLE.

@pm25coder

Copy link
Copy Markdown
Contributor

Heads-up on the merge conflict introduced by #618 (doc-count guard, merged since this PR was created):

@pm25coder

Copy link
Copy Markdown
Contributor

Post-rebase re-verification (the branch was updated after the earlier LGTMs): I re-checked out `pr-619` at `29497dc` and ran the full suite — 625 passed + 55 skipped = 680, matching the reconciled doc counts (675 + 5 remove_project tests, per the #618 guard). The merge commit correctly reconciles Agent.md / README.md / README.cn.md to 680. No regressions in the broader suite.

@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 20260810-152157

Merge-conflict resolved: #618's doc-count bump (674→675) conflicted with this branch's count update; reconciled to the actual collected total 680 (675 master + 5 remove_project tests). Full suite green (680 passed) + import + CLI OK. Test CI 31365667156 SUCCESS on merged head. Merge condition met: 3 consecutive ✅ from different cycles (151705, 151547, 152157), no ❌.

@argszero
argszero merged commit a551b43 into master Aug 10, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/remove-project branch August 10, 2026 12:40
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.

2 participants