fix: bound native session recovery and metadata shutdown (Refs #15) #16

Merged
abaishu0730 merged 40 commits from codex/issue15-runtime-unblock into main 2026-11-18 10:15:46 +08:00
Owner

Refs #15.

Cancelled PCB startup, slow metadata and historical session records could block independent work or let abandoned recovery continue. The branch separates task/native exit, scoped fresh release proof and data recovery; adds guarded pre-write cancellation cleanup and a persisted one-shot observer continuation; removes manifest interpreter-exit joins and the recovery metadata global mutex.

Review follow-ups preserve Verify handoff control flow and its result, guarantee Repair local cleanup, bind ICDB fallback Stop correctly, clarify unique relative iCDBDir input, and ignore management signals after their Qt receiver is destroyed. Production ownership/write protection and the approved three-second defaults remain intact.

Final release preparation 14cacb1 sets version 0.2.4b4 (v0.2.4-beta.4). Full source validation: 2428 passed in 659.54 seconds, exit0, zero failures/errors/skips. Compile and whitespace checks passed. Both the small-fix and release-delta scoped independent reviews are clean. Lifecycle simulation fixtures isolate unrelated WMI/file-probe latency; actual occupancy, exclusive-handle, fresh-proof and writer-barrier coverage remains. Failed/interrupted runs are retained locally.

The user authorized merging PR16 and issuing the new package. Packaging will use this merged main commit on the Windows host, then verify modules/resources/icons, frozen smoke, ZIP contents and remote downloads before publishing the prerelease. No cloud Windows build workflow is configured.

Earlier B13 actual ordinary cancellation/queued Versions and full CBB backup recovery passes retain their exact source/build identities; they are not new-release native replays. Automatic ICDB Repair stays disabled. Original field inconsistency, separate retained-phase native No/Close, Windows10 and production SMB are not accepted. Merging/publication must not close issue15.

Details: docs/releases/2026-11-18-v0.2.4-beta.4.md and the prior acceptance matrix.

Refs #15. Cancelled PCB startup, slow metadata and historical session records could block independent work or let abandoned recovery continue. The branch separates task/native exit, scoped fresh release proof and data recovery; adds guarded pre-write cancellation cleanup and a persisted one-shot observer continuation; removes manifest interpreter-exit joins and the recovery metadata global mutex. Review follow-ups preserve Verify handoff control flow and its result, guarantee Repair local cleanup, bind ICDB fallback Stop correctly, clarify unique relative iCDBDir input, and ignore management signals after their Qt receiver is destroyed. Production ownership/write protection and the approved three-second defaults remain intact. Final release preparation 14cacb1 sets version 0.2.4b4 (v0.2.4-beta.4). Full source validation: 2428 passed in 659.54 seconds, exit0, zero failures/errors/skips. Compile and whitespace checks passed. Both the small-fix and release-delta scoped independent reviews are clean. Lifecycle simulation fixtures isolate unrelated WMI/file-probe latency; actual occupancy, exclusive-handle, fresh-proof and writer-barrier coverage remains. Failed/interrupted runs are retained locally. The user authorized merging PR16 and issuing the new package. Packaging will use this merged main commit on the Windows host, then verify modules/resources/icons, frozen smoke, ZIP contents and remote downloads before publishing the prerelease. No cloud Windows build workflow is configured. Earlier B13 actual ordinary cancellation/queued Versions and full CBB backup recovery passes retain their exact source/build identities; they are not new-release native replays. Automatic ICDB Repair stays disabled. Original field inconsistency, separate retained-phase native No/Close, Windows10 and production SMB are not accepted. Merging/publication must not close issue15. Details: docs/releases/2026-11-18-v0.2.4-beta.4.md and the prior acceptance matrix.
abaishu0730 added 30 commits 2026-11-17 10:06:57 +08:00
abaishu0730 added 3 commits 2026-11-17 11:45:29 +08:00
abaishu0730 added 4 commits 2026-11-17 13:55:27 +08:00
abaishu0730 changed title from fix: scope native ownership and unblock cancelled-session recovery (Refs #15) to fix: bound native session recovery and metadata shutdown (Refs #15) 2026-11-17 13:55:42 +08:00
abaishu0730 added 1 commit 2026-11-17 14:09:22 +08:00
Author
Owner

审查:PR #16 issue 15 运行时/恢复边界(b4737b5)

范围:head b4737b5,base main e4875b4;38 个提交、118 文件、+10967/−788,可 fast-forward,main 未前移。c1e2596..b4737b5 仅两个 release 文档提交,代码与 c1e2596 相同(PR 描述的 2418 项全量对应代码提交)。

结论:代码层面通过,可以合并。 未发现阻断性缺陷;重点检查的“未知占用/未知弹窗/活动写入/未确认释放”均保持 fail-closed,未发现假释放或假成功路径。

独立验证

  • 测试收集 2418 项,与 PR 描述一致。
  • 新增/改动重点用例 446 项:436 通过 / 10 失败。失败全部由当前沙箱禁止 WMI ExecQuery(占用查询约 1s 后失败)及由此造成的 0.3s/1s 计时超时引起;把 owner_probe.query_owners 换成空快照后,这 10 项全部通过(8 项管理 stop-after-current、1 项 worker 退出读取、1 项恢复 handoff)。
  • 既有回归 517 项:510 通过 / 7 失败;7 项(6 项 test_verify_runner fake-worker、1 项 test_residual_sessions unknown-scope)在 main 基线同环境逐项复跑,失败完全一致,不是本分支回归。
  • 其余改动相关回归 241 项全部通过。
  • compileall、git -c core.whitespace=cr-at-eol diff --check 通过;源码/测试 diff 未见敏感信息。
  • 全量 2418 未能在本沙箱独立跑完(GUI/私有桌面限制);B14 真实 Mentor 冒烟、冻结包哈希、Windows 10/生产 SMB 未复现。

建议合并前确认(P2)

  1. run_verify 的 finally 中 hold_native_handoff() 抛出的 TaskHandoff 被同一层 except Exception 吞掉(verify_runner.py:1323-1326)。abandoned 标志仍能让外层交接,但异常被记成 close error,且后续清理继续执行;建议单独重抛。
  2. run_native_repair 的 finally 在 hold_native_handoff() 抛异常时会跳过 worker.close()(native_repair.py:343-346);若同库已有 observer,句柄释放依赖 observer/GC。建议保证句柄清理。
  3. _start_icdb_check 交换 job.context 后没有同步 self.stop,仍指向被丢弃的 context(main_window.py:1109-1116);全局 Stop 实际靠遍历 _jobs 仍有效,但 fallback 路径状态不一致。
  4. 版本/修复工具现在要求 PRJ 的 iCDBDir 唯一且为相对路径(native_backup.py:56-72);现场若有绝对/多 iCDBDir 老工程,会从“可打开”变为拒绝。请确认兼容边界,必要时补错误提示。
  5. 3 秒无人值守默认对管理/恢复/保存确认框默认 Yes(management_dialog.py:174、backup_recovery_dialog.py:97、main_window.py:1491)。efb8cae 是本次分支新增、main 尚无此行为;这是产品决策,建议在验收记录中单独确认。

观察(P3,不阻断)

  • release_retained_library 多 block 时 reconciled_foreign_blockers 仍按单 block_name 计算,可能少报其他 block;未知检查点 + 多 block 会因 block_names 与 allow_unknown_checkpoint 组合被直接拒绝(安全但无法完成)。
  • worker_native_channel 的退出等待无上限;客户端永不退出时会长期占用 writer barrier,建议明确提示/设上限。
  • 2026-11-16-unattended-prompts-validation.json 有 4 处本机 F:\... 路径,外发前建议脱敏。
  • 38 个提交均无正文;REPOSITORY-NOTES.md 未更新全量/换行检查命令。

合并建议

按 fast-forward 合并;合并后在作者机器重跑全量 2418 并保留 JUnit/log,按 B14 清单重建冻结包做一次冒烟。合并不等于现场验收或正式发布:Windows 10、生产 SMB、B13 retained-phase No/Close 真实重放、原始故障快照仍未验收;issue #15 不应因合并自动关闭。

### 审查:PR #16 issue 15 运行时/恢复边界(`b4737b5`) 范围:head `b4737b5`,base `main` `e4875b4`;38 个提交、118 文件、+10967/−788,可 fast-forward,main 未前移。`c1e2596..b4737b5` 仅两个 release 文档提交,代码与 `c1e2596` 相同(PR 描述的 2418 项全量对应代码提交)。 **结论:代码层面通过,可以合并。** 未发现阻断性缺陷;重点检查的“未知占用/未知弹窗/活动写入/未确认释放”均保持 fail-closed,未发现假释放或假成功路径。 #### 独立验证 - 测试收集 **2418 项**,与 PR 描述一致。 - 新增/改动重点用例 446 项:**436 通过 / 10 失败**。失败全部由当前沙箱禁止 WMI `ExecQuery`(占用查询约 1s 后失败)及由此造成的 0.3s/1s 计时超时引起;把 `owner_probe.query_owners` 换成空快照后,这 10 项全部通过(8 项管理 stop-after-current、1 项 worker 退出读取、1 项恢复 handoff)。 - 既有回归 517 项:**510 通过 / 7 失败**;7 项(6 项 `test_verify_runner` fake-worker、1 项 `test_residual_sessions` unknown-scope)在 `main` 基线同环境逐项复跑,失败完全一致,不是本分支回归。 - 其余改动相关回归 241 项全部通过。 - `compileall`、`git -c core.whitespace=cr-at-eol diff --check` 通过;源码/测试 diff 未见敏感信息。 - 全量 2418 未能在本沙箱独立跑完(GUI/私有桌面限制);B14 真实 Mentor 冒烟、冻结包哈希、Windows 10/生产 SMB 未复现。 #### 建议合并前确认(P2) 1. `run_verify` 的 `finally` 中 `hold_native_handoff()` 抛出的 `TaskHandoff` 被同一层 `except Exception` 吞掉(`verify_runner.py:1323-1326`)。abandoned 标志仍能让外层交接,但异常被记成 close error,且后续清理继续执行;建议单独重抛。 2. `run_native_repair` 的 `finally` 在 `hold_native_handoff()` 抛异常时会跳过 `worker.close()`(`native_repair.py:343-346`);若同库已有 observer,句柄释放依赖 observer/GC。建议保证句柄清理。 3. `_start_icdb_check` 交换 `job.context` 后没有同步 `self.stop`,仍指向被丢弃的 context(`main_window.py:1109-1116`);全局 Stop 实际靠遍历 `_jobs` 仍有效,但 fallback 路径状态不一致。 4. 版本/修复工具现在要求 PRJ 的 `iCDBDir` 唯一且为相对路径(`native_backup.py:56-72`);现场若有绝对/多 `iCDBDir` 老工程,会从“可打开”变为拒绝。请确认兼容边界,必要时补错误提示。 5. 3 秒无人值守默认对管理/恢复/保存确认框默认 Yes(`management_dialog.py:174`、`backup_recovery_dialog.py:97`、`main_window.py:1491`)。`efb8cae` 是本次分支新增、main 尚无此行为;这是产品决策,建议在验收记录中单独确认。 #### 观察(P3,不阻断) - `release_retained_library` 多 block 时 `reconciled_foreign_blockers` 仍按单 `block_name` 计算,可能少报其他 block;未知检查点 + 多 block 会因 `block_names` 与 `allow_unknown_checkpoint` 组合被直接拒绝(安全但无法完成)。 - `worker_native_channel` 的退出等待无上限;客户端永不退出时会长期占用 writer barrier,建议明确提示/设上限。 - `2026-11-16-unattended-prompts-validation.json` 有 4 处本机 `F:\...` 路径,外发前建议脱敏。 - 38 个提交均无正文;`REPOSITORY-NOTES.md` 未更新全量/换行检查命令。 #### 合并建议 按 fast-forward 合并;合并后在作者机器重跑全量 2418 并保留 JUnit/log,按 B14 清单重建冻结包做一次冒烟。合并不等于现场验收或正式发布:Windows 10、生产 SMB、B13 retained-phase No/Close 真实重放、原始故障快照仍未验收;issue #15 不应因合并自动关闭。
abaishu0730 added 1 commit 2026-11-18 09:05:31 +08:00
abaishu0730 added 1 commit 2026-11-18 10:14:25 +08:00
Ignore queued management completion after its Qt receiver is destroyed. Isolate unrelated WMI and file-proof latency in simulated lifecycle tests while retaining real occupancy and writer-barrier coverage. Validation: 2428 tests passed, compile and whitespace checks passed, scoped review clean. Field ICDB inconsistency and Windows 10/production SMB remain unaccepted.
abaishu0730 merged commit 14cacb1d1c into main 2026-11-18 10:15:46 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Skyworth_Digital_Hardware/cbb-refresh-verify-795#16