#!/usr/bin/env python3
"""Evidence-only enhancement: actual list JSON, never actual file delivery."""
import hashlib
import json
import subprocess
import sys
from pathlib import Path
import integrate_20261010 as tool
from integrate_20261011_batches46_48 import item

def verify():
    path = Path('/private/tmp/cdx-ai-hk-course-b.Kmdirn/review-s3-601-603/verify_review.py')
    assert hashlib.sha256(path.read_bytes()).hexdigest() == 'ef7ad4afef4f2a66847cf84cab64c2c60bfea56ab77e5daffca4c4ad0f2b3410'
    result = json.loads(subprocess.check_output([sys.executable, '-B', str(path)]))
    assert result['offline'] and result['checks'] == 1656 and result['raw_business_HTTP'] == 14
    assert result['positive_requests'] == 12 and result['original_terminal401'] == 2
    assert result['mock_log_files_not_download_proof'] and not result['business_patch']
    subprocess.check_call(['git', '-C', str(tool.source_root('ai_api')), 'merge-base', '--is-ancestor', result['source_commit'], 'develop_dameng'])

if __name__ == '__main__':
    audit = Path(__file__).with_name('integration-20261013-export-list.json')
    assert not audit.exists(), 'Never replay main'
    report = tool.AI + 'parallel-export-list-20261013/ROOT_REVIEW.md'
    rows = [item('ai_api', 'GET', '/' + app + '/order.export/list', '', evidence=report, evidence_only=True)
            for app in ['store', 'terminal']]
    tool.main(rows, audit, verify)
