From a045683c8a6d6918ec701e2944d0e20c25296b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=99=BD=E5=8F=94?= <11794527+absfan@user.noreply.gitee.com> Date: Mon, 9 Nov 2026 14:44:09 +0800 Subject: [PATCH] fix: publish management receipt before orphan-exitable terminal state --- .../2026-11-09-full-review-followup.md | 2 ++ src/cbb_refresh_verify/native_management.py | 3 ++- tests/test_management_supervision.py | 21 ++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/releases/2026-11-09-full-review-followup.md b/docs/releases/2026-11-09-full-review-followup.md index ae4513d..01fc25d 100644 --- a/docs/releases/2026-11-09-full-review-followup.md +++ b/docs/releases/2026-11-09-full-review-followup.md @@ -36,4 +36,6 @@ The unreadable-window poisoning and oversized repeated-output findings target th The final focused integration run passed 211 tests. New tests were first observed failing for missing dispatch/receipt facts, dispatch veto after accepted Remove, missing queue explanations, changed wait reasons, stale mapping cleanup and dialog lifecycle boundaries. Independent review's two queue timing findings were corrected and re-reviewed with no remaining important introduced finding. +The first full run exposed one terminal-publication race (1,773 passed, one failed): management wrote FINISHED before its result receipt, allowing the orphan watchdog to exit between them. The result is now flushed before FINISHED. The regression accepts either the normal failure exit or orphan exit only after checking the saved result and the absence of a subsequent native action. A new test first reproduced the missing receipt at the FINISHED transition; 159 focused lifecycle/management tests then passed. The failed full XML is preserved separately, and the full suite is rerun on the corrected tree. + Full-suite counts, source hashes and immutable XML copies are in the accompanying validation JSON. Compilation/diff checks and icon equality are checked on the integrated tree. No frozen package was rebuilt; the old iconfix package does not contain this revision. No real Mentor Save/Close/Add/Remove or shared/network/cross-machine acceptance was performed. ICDB automatic Repair remains off. No merge to main, formal release, issue closure, native address/lock deletion, foreground mouse control, or native process termination is authorized by this validation. diff --git a/src/cbb_refresh_verify/native_management.py b/src/cbb_refresh_verify/native_management.py index eafd18c..3515d52 100644 --- a/src/cbb_refresh_verify/native_management.py +++ b/src/cbb_refresh_verify/native_management.py @@ -1303,6 +1303,7 @@ def management_worker_main(request_path): result['exception'] = _exception_details(error) finally: from .session_record import update_worker_state - update_worker_state(job, 'FINISHED' if result.get('safe_to_continue') is True else 'UNCONFIRMED') _write_json(root/'result.json', result) + # FINISHED permits the orphan watchdog to exit immediately. + update_worker_state(job, 'FINISHED' if result.get('safe_to_continue') is True else 'UNCONFIRMED') return 0 if result['success'] and result['safe_to_continue'] else 2 diff --git a/tests/test_management_supervision.py b/tests/test_management_supervision.py index 7afedcc..2acfa24 100644 --- a/tests/test_management_supervision.py +++ b/tests/test_management_supervision.py @@ -103,7 +103,9 @@ def test_real_management_worker_parent_loss_waits_for_native_boundary(tmp_path): while not cancel.exists() and time.monotonic()