feat: distinguish save close and resource release facts
This commit is contained in:
1 parent
3e7ae2b76f
commit
7bd7cd3966
3 files changed
+142
-6
No files matched your search
@@ -10,7 +10,7 @@
|
||||
|
||||
**Spec:** [2026-11-06-runtime-lifecycle-safety-design.md](../specs/2026-11-06-runtime-lifecycle-safety-design.md)
|
||||
|
||||
**Status:** 计划草案。用户已确认范围;本轮明确要求完成计划,因此设计和实施清单同时供审阅,不能视为设计已经批准或代码实施已经授权。基线为 `5eb4b2d7ed09947f19310ba80ba3b9a2a09b6f7d`;本文件没有修改生产行为。
|
||||
**Status:** 用户已于 2026-11-06 授权按本计划实施,正在独立分支执行。基线为 `5eb4b2d7ed09947f19310ba80ba3b9a2a09b6f7d`;本文件没有修改生产行为。
|
||||
|
||||
## Global Constraints
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
- Produces: `stop_disposition(*, call_started: bool | None, call_returned: bool | None, identity_confirmed: bool) -> str`,返回 CANCEL_BEFORE_CALL / WAIT_FOR_RETURN / CLEANUP_RETURNED / OBSERVE_UNCONFIRMED。
|
||||
- 返回字段固定为 save_state、close_state、helper_state、resource_state、interrupted、detail,取值见设计第 4 节;其他任务不得另造不兼容枚举。
|
||||
|
||||
- [ ] **Step 1: 写失败测试,证明 Save/Close/释放不能互相替代。**
|
||||
- [x] **Step 1: 写失败测试,证明 Save/Close/释放不能互相替代。**
|
||||
|
||||
```python
|
||||
from cbb_refresh_verify.operation_lifecycle import classify_save_state, stop_disposition
|
||||
@@ -71,8 +71,8 @@ def test_an_unreturned_call_requires_waiting():
|
||||
identity_confirmed=True) == "WAIT_FOR_RETURN"
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 运行并确认 RED。** `python -m pytest -q tests/test_operation_lifecycle.py`;预期缺少新模块/函数。再加取消前、SAVE_REJECTED、CLOSE_FAILED、日志截断/矛盾、forced=True 的行为断言,不把进程退出断言成保存完成。
|
||||
- [ ] **Step 3: 实现纯判据。** 核心映射从明确证据出发:
|
||||
- [x] **Step 2: 运行并确认 RED。** `python -m pytest -q tests/test_operation_lifecycle.py`;预期缺少新模块/函数。再加取消前、SAVE_REJECTED、CLOSE_FAILED、日志截断/矛盾、forced=True 的行为断言,不把进程退出断言成保存完成。
|
||||
- [x] **Step 3: 实现纯判据。** 核心映射从明确证据出发:
|
||||
|
||||
```python
|
||||
save_state = ("COMMITTED" if "SAVE_OK" in markers else
|
||||
@@ -83,8 +83,8 @@ resource_state = ("RELEASED" if native_released is True and helper_exited is Tru
|
||||
```
|
||||
|
||||
不把 UNKNOWN 当 False;矛盾标记降为 UNKNOWN 并记录原因。`forced=True` 不能把 UNKNOWN 的保存状态升级为成功。
|
||||
- [ ] **Step 4: 运行该文件及 `tests/test_runtime_timing.py`,确认已有标记消费保持兼容。**
|
||||
- [ ] **Step 5: 提交。** `git commit -m "feat: distinguish save close and resource release facts"`。
|
||||
- [x] **Step 4: 运行该文件及 `tests/test_runtime_timing.py`,确认已有标记消费保持兼容。**
|
||||
- [x] **Step 5: 提交。** `git commit -m "feat: distinguish save close and resource release facts"`。
|
||||
|
||||
### Task 2:保存 helper 的启动门和完整返回事实
|
||||
|
||||
|
||||
Reference in new issue
Block a user