fix: reconcile historical leases and record scoped native changes
This commit is contained in:
1 parent
d8156c57f0
commit
8eefecd9f0
6 files changed
+188
-8
No files matched your search
@@ -82,6 +82,28 @@ def has_retained_library(library):
|
||||
return bool(owner and owner['retained'])
|
||||
|
||||
|
||||
def recheck_previous_release(library, evidence_dir, *, block_name=None, required=False, progress=None):
|
||||
"""Historical records trigger fresh proof, never process termination or repair."""
|
||||
if not (required or has_blocker(library) or has_retained_library(library)):
|
||||
return None
|
||||
def notify(stage, **details):
|
||||
if progress is not None:
|
||||
try:
|
||||
progress({'stage': stage, 'block': block_name or '', **details})
|
||||
except Exception:
|
||||
import logging
|
||||
logging.getLogger(__name__).warning('Release progress observer failed', exc_info=True)
|
||||
notify('previous_release_check', detail='正在复核历史记录对应的实际占用')
|
||||
try:
|
||||
proof = release_retained_library(library, evidence_dir, block_name=block_name)
|
||||
except Exception as error:
|
||||
notify('previous_release_unconfirmed', detail=str(error))
|
||||
raise
|
||||
notify('previous_release_confirmed', release_proof=proof,
|
||||
detail='已确认会话释放并归档历史记录;这不表示历史数据已恢复')
|
||||
return proof
|
||||
|
||||
|
||||
def _persist_blocker(library, status='OWNER_RELEASE_UNCONFIRMED', *, lease_id, block_name=None):
|
||||
import win32api, win32process
|
||||
path = blocker_path(library)
|
||||
@@ -499,7 +521,7 @@ def _prove_library_released(library, block_name=None, *, allow_unknown_checkpoin
|
||||
|
||||
|
||||
def release_retained_library(library, evidence_dir, *, block_name=None):
|
||||
"""Explicit user-requested release, after fresh owner/address/access proof.
|
||||
"""Reconcile historical leases after fresh owner/address/access proof.
|
||||
|
||||
The upload sidecar is never deleted. This acknowledges process release,
|
||||
not the correctness of a partially changed library or its recovery state.
|
||||
|
||||
Reference in new issue
Block a user