Repository navigation
[CTX-1776] fix(runtime,ui): release every generation family at the panel unbind edge and key panel restore by workspace+persistent id - #3094
Conversation
…nel unbind edge and key panel restore by workspace+persistent id release_generation_scope now drains the generation's queued bus events, unregisters the panel commands it registered, and dismisses its attributed overlays in addition to the grant row, and writes a per-family GenerationReleaseRecord (created even when every family releases nothing). The retired-ceiling tombstone write order and fail-closed refusal are unchanged. Panel overlays gain (PanelId, generation) attribution through create_panel_overlay. PanelLifecycle::can_transition gains Created->Disposed and Focused->Disposed (OQ-084 C.8). PersistedPanel carries the (WorkspaceId, PersistentId) restore key at manifest v2, and plan_restore refuses PersistencePolicy::StableIdentity (B.4/B.5). Related #2476
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Xuepoo
left a comment
There was a problem hiding this comment.
Independent guard review of PR #3094 (CTX-1776) at head bb3765d — a different agent from the implementer, read-only on the lane worktree.
Scope checked: the four audit items this PR claims, plus gate integrity, MSRV, and bound/leak behaviour.
release_generation_scopenow releases four families (grants, queued bus events, panel commands, attributed overlays) after the tombstone write — PASS. Ordering is correct:retain_grant_ceilingruns first and a failure returns before any other family is touched (panel.rs:1808-1811), so the fail-closed contract is preserved. Thealready_endedearly return still prevents a double release (:1794-1800).GenerationReleaseRecord+unbind_release_count— PASS.None(no edge) vsSome(0)(edge released nothing) is genuinely distinguishable, records are dropped with the container (:1471-1472) and cleared on registry disposal (:2083-2085), and the table is one-per-live-panel.Created -> DisposedandFocused -> DisposedinPanelLifecycle::can_transition— PASS, one test per edge that also drives the state machine (panel_state.rs:1014-1055).PersistedPanel.key: PanelRestoreKey{WorkspaceId, PersistentId}+ manifest v2 +plan_restorerefusingStableIdentity— PASS.PersistentIdis bounded (1..=64 bytes,[a-z0-9_-]) and validated on both the constructor and decode paths; v1 documents are refused rather than reinterpreted, which is the fail-closed direction.
No gate weakening, no #[allow(...)] additions, no hardcoded host/environment values, no let-chains (MSRV 1.85 safe — the let (Some..) destructure form used here is stable). Overlay attribution cannot leak: the only OverlayManager::dismiss/clear call sites are the two attribution-cleaning paths and registry disposal.
Two caveats recorded rather than treated as defects, because the PR body already discloses them:
create_panel_overlayhas no production caller yet, so in production the overlay family always releases 0. The overlay-attribution enforcement is implemented-only (unwired) until the plugin-boundary edge calls it (audit item 7).plan_restorechanges a public signature (Vec->Result); it has no production caller today (onlylib.rsre-export + tests), so nothing else needs migrating.
Base-tree note, verified independently: bash scripts/check-pty-gated-tests.sh on a clean checkout of origin/main 9db82bb reports the same five UNGATED live-spawn markers the lane hit, so that just check failure is pre-existing and not caused by this PR.
VERDICT: APPROVE
Related #2476 (not
Closes: the issue's code-side acceptance is not fully satisfied — see deferred list).Bounded residual slice for OQ-084 panel generation ownership, re-verified against current
origin/main(9db82bb9) before editing.release_generation_scopereleases queued bus events, the generation's panel commands, and its overlay attribution for(panel, generation); retired-ceiling tombstone write order/fail-closed refusal unchangedcargo test -p bitty-runtime --test panel_unbind_release --test panel_grant_ceilingunbind_release_count(PanelId)+ per-familyGenerationReleaseRecord, created even when every family releases nothingcargo test -p bitty-runtime --test panel_unbind_releaseCreated -> DisposedandFocused -> Disposedadded toPanelLifecycle::can_transitioncargo test -p bitty-ui --lib disposesPersistedPanelkey is(WorkspaceId, PersistentId)at manifest v2;plan_restorerefusesStableIdentitycargo test -p bitty-ui --lib panel_persist;cargo test -p bitty-ui --test pw_seriesVerification
cargo check -p bitty-runtime -p bitty-ui --tests --offline— clean.cargo test -p bitty-runtime -p bitty-ui --offline— exit 0 (242 test binaries/suites, 0 failures).cargo clippy -p bitty-runtime -p bitty-ui --all-targets --locked -- -D warnings— clean.cargo fmt --all -- --check— clean. (There is nojust fmtrecipe in this repo;fmt-checkiscargo fmt --all -- --check.)just check— failed atpty-gateon five pre-existing ungated live-spawn markers (bitty-daemon/src/service/dispatch.rs,bitty-daemon/src/worker.rs,bitty-daemon/tests/service_loop.rs,bitty-runtime/src/runtime/panes.rs,bitty-runtime/tests/spawn_pane_cwd.rs), none in this diff. The same five hits and exit 1 reproduce byte-identically on a pristineorigin/mainexport, so this is a base-tree gate failure, not a regression here. Everything before it passed:fmt-check, workspace clippy, workspace nextest (10,978 passed / 24 skipped), supply-chain, scratch-paths.panel_unbind_releasetests red), item 3 (both lifecycle tests red), item 4 (both refusal tests red) — then restored and green.Deferred (explicitly out of scope)
PanelRecordowner + controller-generation re-key (audit items 2/3),rebind_panel(4), unbound/placeholder state + recovery counter (9), bulk dispose-by-workspace (11), PGO matrix (13), docs edits (separate lane).Residual risk
create_panel_overlayis the new attribution entry point but has no production caller yet; overlays created throughcreate_overlayremain unattributed, and the edge release is still reached only viadispose_panel(plugin-boundary wiring is audit item 7, deferred). The machinery is enforced and tested; the wiring is not in this slice.plan_restorehas no production caller today, so no live migration is involved.