fix: bind UI jobs and recovery actions to captured scope

This commit is contained in:
阿白叔 committed 2026-11-16 22:11:17 +08:00
1 parent 601dd7b6b2
commit cd7a5e0ca1
20 files changed
+1570 -297

No files matched your search

+10 -10
View File
@@ -35,7 +35,7 @@ def test_reader_accepts_com_collections_exposing_callable_count():
def test_reader_fast_scans_reusable_blocks_without_com(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'B_CBB').mkdir(parents=True)
(tmp_path / 'ReusableBlocksLP' / 'A_CBB').mkdir()
from cbb_refresh_verify.library_reader import read_library_fast
@@ -45,7 +45,7 @@ def test_reader_fast_scans_reusable_blocks_without_com(tmp_path):
def test_reader_fast_applies_status_reader(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'READY_CBB').mkdir(parents=True)
from cbb_refresh_verify.library_reader import read_library_fast
result = read_library_fast(lmc, status_reader=lambda name: 'READY' if name == 'READY_CBB' else 'PENDING')
@@ -53,7 +53,7 @@ def test_reader_fast_applies_status_reader(tmp_path):
def test_reader_fast_bulk_status_reader_is_called_once(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'A_CBB').mkdir(parents=True)
(tmp_path / 'ReusableBlocksLP' / 'B_CBB').mkdir()
calls = []
@@ -68,7 +68,7 @@ def test_reader_fast_bulk_status_reader_is_called_once(tmp_path):
def test_reader_fast_preserves_unavailable_bridge_status(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'A_CBB').mkdir(parents=True)
from cbb_refresh_verify.library_reader import read_library_fast
result = read_library_fast(lmc, status_reader=lambda path, names: {'A_CBB': 'UNAVAILABLE'})
@@ -77,7 +77,7 @@ def test_reader_fast_preserves_unavailable_bridge_status(tmp_path):
def test_reader_fast_exposes_status_reader_failure_as_unavailable(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'A_CBB').mkdir(parents=True)
from cbb_refresh_verify.library_reader import read_library_fast
result = read_library_fast(lmc, status_reader=lambda path, names: (_ for _ in ()).throw(RuntimeError('bridge down')))
@@ -86,7 +86,7 @@ def test_reader_fast_exposes_status_reader_failure_as_unavailable(tmp_path):
def test_filesystem_status_uses_complete_fresh_cert_artifacts(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
root = tmp_path / 'ReusableBlocksLP'
ready = root / 'READY_CBB' / 'Work'
pending = root / 'PENDING_CBB' / 'Work'
@@ -325,7 +325,7 @@ def test_status_scan_logs_each_cbb_image_id(caplog, tmp_path):
def test_status_scan_without_native_observation_does_not_guess_status(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
root = lmc.parent / 'ReusableBlocksLP'
ready = root / 'READY_CBB' / 'Work'
(ready / 'PCB' / 'Layout').mkdir(parents=True)
@@ -353,7 +353,7 @@ def test_status_scan_without_native_observation_does_not_guess_status(tmp_path):
def test_filesystem_evidence_exposes_multiple_persistent_dimensions(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
work = tmp_path / 'ReusableBlocksLP' / 'A_CBB' / 'Work'
(work / 'PCB' / 'Layout').mkdir(parents=True)
(work / 'A_CBB.prj').write_text('KEY PCBDesignPath "PCB\\actual.pcb"', encoding='utf-8')
@@ -375,7 +375,7 @@ def test_filesystem_evidence_exposes_multiple_persistent_dimensions(tmp_path):
def test_filesystem_evidence_preserves_mapped_drive_paths(tmp_path, monkeypatch):
"""Legacy evidence scanning must not resolve a mapped drive back to UNC."""
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
work = tmp_path / 'ReusableBlocksLP' / 'A_CBB' / 'Work'
(work / 'PCB' / 'Layout').mkdir(parents=True)
(work / 'A_CBB.prj').write_text('KEY PCBDesignPath "PCB\\actual.pcb"', encoding='utf-8')
@@ -393,7 +393,7 @@ def test_filesystem_evidence_preserves_mapped_drive_paths(tmp_path, monkeypatch)
def test_missing_work_project_is_a_pending_calibration_anchor(tmp_path):
lmc = tmp_path / 'center.lmc'
lmc.touch()
lmc.write_bytes(b'fixture metadata; native format is not checked')
(tmp_path / 'ReusableBlocksLP' / 'IMPORTED_CBB').mkdir(parents=True)
from cbb_refresh_verify.library_reader import filesystem_evidence_map
evidence = filesystem_evidence_map(lmc, ('IMPORTED_CBB',))['IMPORTED_CBB']