delete_profile and delete_project bypass RuntimeRouter ownership (Task 9/15 gap)
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_sessioninsrc-tauri/crates/service/src/runtime.rscloses Local-owned ids on Local, refuses to kill a Local PTY for unbound or Herdr-owned ids, then unbindsdelete_profile/delete_projecthandlers callservice::{profile,project}::delete_with_runtimewithRuntimeHandle- Tests:
teardown_router_local_session_unbinds_and_kills_pty,teardown_refuses_unbound_live_local_pty,teardown_refuses_to_kill_local_pty_for_herdr_owned_idinruntime.rs;delete_profile_closes_live_session_and_removes_log,delete_profile_refuses_to_kill_local_pty_for_herdr_owned_id, and the matchingdelete_project_*tests inintegration_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).
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-630delete_with_runtimecallsforget_project_session(release attachments, nopane.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-338forget_project_session: "withoutpane.close/worktree.remove".- Profile delete:
src-tauri/src/handler/profile.rs:41→delete_with_runtime→ Herdrworktree.remove/workspace.close(profile.rs:963-1051). Notpty::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.