import json
from pathlib import Path
p=Path(__file__).parent
b,c=[json.loads((p/f'result-{lane}.json').read_text()) for lane in 'BC']
fields={'dingtalk_avatar','update_time','dingtalk_userid','primary_department_uuid','dingtalk_last_seen_full_batch_id','dingtalk_sync_time','dingtalk_sync_md5'}
for r in (b,c):
    assert r['business_dml']==r['ddl']==r['external_calls']==0
    assert r['effective_database_verified'] and r['triggers']==[]
assert b['column_count']==77 and c['column_count']==70
assert set(c['missing_seven'])==fields and b['missing_seven']==[]
source_indexes={x['index_name']:x for x in b['indexes'] if x['column_name'] in fields}
assert set(source_indexes)=={'uk_dingtalk_userid','idx_dd_staff_full_batch','idx_dd_staff_sync_md5','idx_staff_primary_department'}
assert source_indexes['uk_dingtalk_userid']['non_unique']=='0'
assert c['probes']['case_flag_function']['rows'][0]['case_flag']==0
assert b['probes']['case_bin']['rows'][0]['eq']=='0'
assert b['probes']['trailing_bin']['rows'][0]['eq']=='1'
assert c['bound_comparisons']['bound_default_case'][0]['eq']==1
assert c['probes']['max_uint64']['php_types']['exact_text']=='double'
assert c['probes']['max_uint64_cast_text']['rows'][0]['exact_text']=='18446744073709551615'
assert c['probes']['max_uint64_cast_text']['php_types']['exact_text']=='string'
assert c['probes']['cast_datetime0']['rows'][0]['dt']=='2026-10-10 11:22:33'
assert c['bound_raw_hex']['upper'][0]['hex']=='416243'
assert c['bound_raw_hex']['lower'][0]['hex']=='616263'
assert c['bound_comparisons']['bound_raw_hex_case'][0]['eq']==1  # Open: not a proven binary comparator.
print('PASS: read-only seven-column/4-index mapping evidence; binary uniqueness, historical ON UPDATE and wide output remain explicitly open; no DDL or HTTP pass claimed')
