Files
cbb-refresh-verify-795/docs/superpowers/plans/2026-11-09-review-319.md
T

2.5 KiB

PR #13 comment 319: residual lifecycle fixes

Goal: Fix the P2 and three P3 findings against head 96e179b without interrupting an in-flight native writer.

Scope: #13 (comment)

Constraints: Python 3.12/PySide6/pywin32, no new dependencies; existing isolated worktree and icon retained; no automatic ICDB Repair, native process termination, merge, release or issue closure. Real Mentor and shared-network acceptance remains outstanding.

1. Release proof and queue state

  • Reproduce an ended UNCONFIRMED observer leaving its library unavailable after explicit successful release.
  • Snapshot retained entries before proof; acknowledge only those entries, for the matching library, while proof handles are still held. Failed proof and newer handoffs remain blocked. Test independent libraries and queue resumption.
  • Retain final observer states for the existing residual panel, including unreadable journals; expose fresh recheck through that panel.

2. Passive discovery

  • Test that discovery of an exited session never calls release proof or modifies library checkpoints.
  • Separate process observation from explicit reconciliation; startup observation stays read-only, reports ACTIVE/UNCONFIRMED and cannot claim RELEASED without proof.
  • Refresh journal/status information from the running residual dialog, keeping all I/O off the Qt thread.

3. Supervisor loss

  • Use harmless real subprocesses to test PRECALL/POSTCALL exit, NATIVE_CALL/CLOSING retention, missing/unreadable journals and failed cancellation/journal writes.
  • Synchronize phase transitions and helper registration with watchdog shutdown. Only matching durable and in-memory non-pending state allows worker-only exit; preserve active helpers and unknown states. Prevent subsequent calls after supervisor loss.
  • Recheck after retained calls return; do not kill a native child or interpret worker exit as release proof.

4. Dead code and validation

  • Delete unused _terminate_pid; replace obsolete test hooks with assertions at actual process termination boundaries.
  • Run focused regressions, full Python suite, compileall and diff checks. Record results and field-validation limits, then commit scoped changes. Do not rebuild or publish a candidate without documenting its source and validation.

Execution: implement inline in the existing isolated worktree; red/green tests per task. The user has authorized these fixes, so no further plan confirmation is needed.