replace_profile_workspace leaves session workspace_id stale (Task 8 gap)
Summary
Parent: #394 / #417. Found while reviewing runtime mapping (#414) on task-7-runtime-mapping. Implemented on task-8-profile-adoption (commit 27ea6b4). Close this issue when that branch lands.
replace_profile_workspace used to update only profile_runtime_mappings.workspace_id. require_session_workspace_matches_profile ran on bind_session_pane / replace_session_pane, not on profile replace. Existing session_runtime_mappings rows for that profile kept the old workspace_id.
This did not block accepted #414. It did block Task 8 adoption until task-8-profile-adoption unbound those session rows so both mappings’ workspace_id stay consistent.
Implemented on task-8-profile-adoption
replace_profile_workspace(lines 179–219) callsunbind_session_mappings_for_profilebefore writing a newworkspace_id- Same-id replace returns the existing row and does not unbind
- Tests:
profile_replace_unbinds_stale_session_workspace_idsinruntime_mapping.rs; adoption coverage inruntime_adoption.rs
Do not treat remaining Task 8 replace-integrity work as open. Session→pane bind is implemented on Task 9 (task-9-terminal-lifecycle, #419).
Verified on tip task-1-verify-gaps. Mapping tables and replace_profile_workspace are gone; this defect cannot happen.
- No
runtime_mapping.rsin the tree. src-tauri/crates/service/src/runtime/herdr.rs:2414assertsreplace_profile_workspaceabsent.src-tauri/crates/service/src/profile.rsherdr_profile_create_does_not_use_forbidden_opsalso assertsreplace_profile_workspaceabsent.- sqlite
profiles/ mapping tables are DROPped (db::tests::drop_profiles_migration_removes_mapping_tables).
Closing as superseded by dropped mapping tables, not by re-adding them.