Files
dxdesigner-part-replacement/docs/testing/2026-10-30-phase1-lifecycle-optimization.md
T

27 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Phase 1:生命周期优化验证
日期:2026-10-30(北京时间)
分支:`codex/project-optimization`
## 本轮修复
批次执行发生一次可重试的预写失败时,运行时会先释放旧代资源,再重建 CAD 会话。此前如果旧代 CAD 的 `__exit__` 抛出异常,`BatchCadRuntime._close_resources(rebuilding=True)` 只写入 `shutdown_warning`,没有把异常加入资源错误集合,随后可能继续创建下一代桌面和 CAD。
现在该异常同时保留在诊断字段和资源错误集合中,批次状态保持 `blocked`,不会继续重建。外层上下文再次退出时也不会立即重复 close 并把 blocked 改写为 released。已有 `manual_retry` 清理入口仍可在资源状态修复后重新尝试释放。
上一轮的安全停止证据重试修复仍在本分支中:保护记录 fsync 失败后采用短轮询,强制结束前必须成功写入保护证据。
## 回归证据
- 新增 `test_rebuild_does_not_hide_cad_shutdown_failure`,先验证旧行为会吞掉 CAD 收尾异常,再验证修复后保持 blocked。
- `tests/v1_1/test_batch_runtime.py`、`test_batch_runtime_windows.py`、`test_batch_supervisor.py`、`test_supervisor_result.py`:53 passed。
- `test_isolated_cad.py`、`test_isolated_desktop.py`、`test_safe_user_stop.py`、`test_failed_native_recovery_guard.py`:93 passed。
- `python -m compileall -q src`:通过。
- `git diff --check`:通过。
## 当前边界
当前代码已经包含辅助进程自然退出宽限,以及诊断记录失败时仍尝试身份校验后的 CAD Quit。本轮没有重复修改这些路径,也没有声称真实 DxDesigner 现场桌面持有者问题已经闭环。
仍需在工程副本和实际 CAD 环境验证:CAD 收尾异常后的人工清理、跨重启资源复核、保存中断后的恢复入口,以及冻结包中的同一行为。