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

Task 6 projection ignores pane.exited, layout.updated, and tab.moved (Task 9/12 gap)

Open AkaraChen opened this issue 2 months ago • 1 comments

Summary

Parent: #394. Found while reviewing runtime snapshot sync (#411) on task-6-runtime-sync.

RuntimeProjection::apply_event (lines 106–125) applies pane_closed, pane_moved, tab_created / tab_renamed / tab_closed, and workspace/worktree lifecycle. It does not apply subscribed pane.exited, layout.updated, or tab.moved (they fall through to ApplyOutcome::Ignored). Those types are in SUBSCRIBE_TYPES and in the #411 spec.

This does not block accepted #411 (snapshot rebuild still drops disappeared panes; flattened pane listing does not reconstruct BSP). Task 9 (#419) on task-9-terminal-lifecycle was accepted using snapshot / pane.get / pane.list reconcile, not live event apply. It does still block Task 12 (reattachment) and later tasks that rely on live layout, tab-move, or process-exit updates until Herdr pane.exited semantics are confirmed against v0.9.0.

Current path

  • Subscribe includes pane.exited, layout.updated, tab.moved (runtime_sync.rs SUBSCRIBE_TYPES)
  • apply_event matches pane_closed / pane_moved / pane_updated but not pane_exited
  • No cached layouts map is updated on layout_updated
  • tab.moved is not applied (insert_index / ordered tabs list ignored)

Documented vs verified

Herdr docs (not live-probed in #395): pane.exited carries {pane_id, workspace_id} and is distinct from pane.closed; layout.updated is a full PaneLayoutSnapshot for one tab and should replace the cached layout for the same workspace_id+tab_id; tab.moved carries tab_id, workspace_id, insert_index, and the updated tabs list. Task 1 verified pane_closed + layout_updated on pane.split / pane.close, not pane.exited or tab.moved.

Needed before Task 12

  • Confirm on pinned Herdr v0.9.0 whether pane.exited means the PTY exited while the pane record remains, or that the pane should be dropped like pane.closed
  • Apply or explicitly ignore pane.exited / layout.updated / tab.moved with tests once that meaning is known
  • Do not assume live layout or tab-move updates from the Task 6 projection

Do not treat #411 as having live pane.exited, layout, or tab-move projection. Do not treat remaining Task 9 lifecycle work as blocked on this issue.

AkaraChen avatar Sep 15 '26 08:09 AkaraChen

Verified on tip task-1-verify-gaps. The ignore is intentional. Exited/missing panes cannot linger as live tabs after pane_closed or snapshot rebuild. Flattened splits stay extra tabs. No BSP layout.

  • src-tauri/crates/service/src/runtime_sync.rs:152-175 RuntimeProjection::apply_event: pane.exited / layout.updated / tab.moved fall through to ApplyOutcome::Ignored. pane_closed is applied.
  • runtime_sync.rs:141-143 apply_snapshot: objects missing from session.snapshot are dropped, not recreated.
  • Tests: agent_events_do_not_apply_exited_layout_or_tab_moved (pane_exited is Ignored and the pane remains — process exit ≠ pane gone); snapshot_drops_disappeared_panes_without_recreating; disconnect_rebuilds_and_drops_stale_events; list_flattens_split_and_extra_tab_panes / extra_terminals_use_tab_create_not_split (no pane.split).

No production behavior change. Closing as an intentional ignore backed by those tests.

AkaraChen avatar Sep 16 '26 19:09 AkaraChen