2code icon indicating copy to clipboard operation
2code copied to clipboard

delete_profile and delete_project bypass RuntimeRouter ownership (Task 9/15 gap)

Open AkaraChen opened this issue 2 months ago • 1 comments

Summary

Parent: #394 / #419. Found while reviewing the runtime boundary (#402) on task-2-runtime-boundary. Implemented on task-9-terminal-lifecycle. Close this issue when that branch lands.

delete_profile and delete_project used to close live sessions via bridge::build_pty_context and service::{profile,project}::delete_with_context → pty::close_session_full. That path never consulted RuntimeRouter, so it did not bind or unbind session identities.

This did not block accepted #402. It did block mixed-runtime Task 9 until task-9-terminal-lifecycle routed session teardown through RuntimeRouter::teardown_session.

Implemented on task-9-terminal-lifecycle

  • RuntimeRouter::teardown_session in src-tauri/crates/service/src/runtime.rs closes Local-owned ids on Local, refuses to kill a Local PTY for unbound or Herdr-owned ids, then unbinds
  • delete_profile / delete_project handlers call service::{profile,project}::delete_with_runtime with RuntimeHandle
  • Tests: teardown_router_local_session_unbinds_and_kills_pty, teardown_refuses_unbound_live_local_pty, teardown_refuses_to_kill_local_pty_for_herdr_owned_id in runtime.rs; delete_profile_closes_live_session_and_removes_log, delete_profile_refuses_to_kill_local_pty_for_herdr_owned_id, and the matching delete_project_* tests in integration_pty_db.rs

Do not treat remaining Task 9 session-teardown work as open. Worktree/git teardown through Herdr is implemented on Task 15 (task-15-runtime-cleanup, #429).

AkaraChen avatar Sep 15 '26 03:09 AkaraChen

Verified on tip task-1-verify-gaps. The Local PTY teardown-bypass is gone. Closing the Local-kill defect only; not re-adding Local PTY teardown tests.

  • Project delete: src-tauri/crates/service/src/project.rs:607-630 delete_with_runtime calls forget_project_session (release attachments, no pane.close / worktree.remove). Handler: src-tauri/src/handler/project.rs:360-368. Test: project_delete_is_forget_retain.
  • src-tauri/crates/service/src/runtime.rs:332-338 forget_project_session: "without pane.close / worktree.remove".
  • Profile delete: src-tauri/src/handler/profile.rs:41 → delete_with_runtime → Herdr worktree.remove / workspace.close (profile.rs:963-1051). Not pty::close_session_full / Local kill.
  • production_source_has_no_local_pty_runtime (runtime.rs:1045-1055): no Local adapter.

The old build_pty_context / close_session_full Local-kill path does not exist on this tip.

AkaraChen avatar Sep 16 '26 19:09 AkaraChen