fix: report pending PCB recovery version without obscuring native repair
This commit is contained in:
1 parent
99a708b40c
commit
d76475a1d7
8 files changed
+315
-3
No files matched your search
@@ -264,6 +264,8 @@ def read_library_flag_with_retry(reader, library, block_name, *, attempts=3,
|
||||
def classify_failure_category(detail):
|
||||
text = str(detail or '')
|
||||
lower = text.casefold()
|
||||
if 'pcb_version_choice_required' in lower:
|
||||
return 'PCB_VERSION_CHOICE_REQUIRED'
|
||||
from .icdb_recovery import ERROR_CODE, parse_session_loss
|
||||
if ERROR_CODE.casefold() in lower or parse_session_loss(text):
|
||||
return ERROR_CODE
|
||||
@@ -811,7 +813,7 @@ def _run_verify(request, *, timing, progress=None, flag_reader=None, process_run
|
||||
'start_gate': str(root/'start-worker.signal')}
|
||||
consent = None
|
||||
if request.post_repair_proof is not None:
|
||||
from .post_repair_consent import PostRepairProof, ConsentController
|
||||
from .post_repair_consent import PostRepairProof, ConsentController, exact_prompt
|
||||
if not isinstance(request.post_repair_proof, PostRepairProof):
|
||||
return finish(VerifyResult('BLOCKED', stderr='POST_REPAIR_PROOF_REQUIRED', safe_to_continue=False))
|
||||
job['post_repair_consent'] = request.post_repair_proof.for_job(job)
|
||||
@@ -938,12 +940,16 @@ def _run_verify(request, *, timing, progress=None, flag_reader=None, process_run
|
||||
dialog_result = dialog_supervisor.poll()
|
||||
if (consent is not None and dialog_agent is not None
|
||||
and dialog_result.error_code == 'DATABASE_RECOVERY_REQUIRED'
|
||||
and dialog_result.snapshot is not None):
|
||||
and dialog_result.snapshot is not None and exact_prompt(dialog_result.snapshot)):
|
||||
consent_snapshot = dialog_result.snapshot
|
||||
if consent_snapshot.hwnd in {int(h) for h in process.desktop.EnumDesktopWindows()}:
|
||||
dialog_result = consent.handle(consent_snapshot, dialog_result.observed_snapshots,
|
||||
target_pid=target_pid, launcher_pid=launcher_pid, worker_pid=process.pid,
|
||||
companion_pids=tuple(process.companion_pids), perform=dialog_supervisor.backend.perform)
|
||||
if dialog_result.error_code == 'PCB_VERSION_CHOICE_REQUIRED' and dialog_result.snapshot is not None:
|
||||
from .dialog_rules import archive_version_choice
|
||||
choice_path = archive_version_choice(dialog_result.snapshot, root)
|
||||
dialog_result = replace(dialog_result, detail=dialog_result.detail + f'\n版本候选与原生窗口证据:{choice_path}')
|
||||
# Normal progress stays in memory. Only actions/errors and the
|
||||
# last failure snapshots are persisted, not every elapsed tick.
|
||||
latest_snapshots = dialog_result.observed_snapshots
|
||||
|
||||
Reference in new issue
Block a user