feat: integrate native diagnostics and coordinated CBB transactions

This commit is contained in:
阿白叔 committed 2026-11-05 23:18:00 +08:00
1 parent 9e230e1a46
commit da67de026f
91 files changed
+14370 -435

No files matched your search

+25 -2
View File
@@ -99,7 +99,7 @@ def test_timeout_isolated_and_later_item_continues(tmp_path):
assert records[1].status == "PENDING"
def test_protocol_path_mismatch_stops_repeating_same_global_failure(tmp_path):
def test_protocol_path_mismatch_records_each_queried_item(tmp_path):
class BrokenProtocolBridge:
def __init__(self):
self.requests = []
@@ -116,7 +116,7 @@ def test_protocol_path_mismatch_stops_repeating_same_global_failure(tmp_path):
['A', 'B', 'C'], lmc, tmp_path / 'scan.jsonl'
)
assert bridge.requests == ['A']
assert bridge.requests == ['A', 'B', 'C']
assert [record.status for record in records] == ['MALFORMED'] * 3
@@ -172,3 +172,26 @@ def test_authoritative_status_map_never_reuses_previous_scan_status(tmp_path, mo
assert first == {'A': 'PENDING'}
assert second == {'A': 'READY'}
assert calls == ['A', 'A']
def test_retry_rechecks_failed_scan_without_library_changes(tmp_path):
lmc = tmp_path/'library.lmc'; lmc.write_bytes(b'library')
checkpoint = tmp_path/'scan.jsonl'
first = BatchStatusSession(FakeBridge(timeout_name='A')).scan(['A', 'B'], lmc, checkpoint)
assert first[0].status == 'TIMEOUT'
bridge = FakeBridge()
second = BatchStatusSession(bridge).scan(['A', 'B'], lmc, checkpoint)
assert bridge.requests == ['A']
assert second[0].status == 'READY'
def test_missing_x86_runtime_does_not_restart_for_every_cbb(tmp_path):
class BrokenBridge(FakeBridge):
def query(self, library, name, **kwargs):
self.requests.append(name)
raise BridgeResponseError('状态桥进程失败: -1073741515')
lmc = tmp_path/'library.lmc'; lmc.write_bytes(b'library')
bridge = BrokenBridge()
result = BatchStatusSession(bridge).scan(['A', 'B', 'C'], lmc, tmp_path/'scan.jsonl')
assert bridge.requests == ['A']
assert [row.status for row in result] == ['UNAVAILABLE'] * 3