#!/usr/bin/env python3
"""Enhance six existing menu keys without hiding original FLOAT copy failures."""
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():
    p = Path('/Users/wiscourper/Documents/workspace/local/dm8-independent-20261013/session-store-nutrition/verify-copy-621-639.py')
    q = tool.ROOT.parent / 'worktrees/dm8-compat-20261012/private-prepay-harness/review-s1-copy621-639/verify_independent.py'
    assert hashlib.sha256(p.read_bytes()).hexdigest() == '1d02af01a95ea0863e04c2299cf2f300132e7ab47b1487211b975bd76a1525a7'
    assert hashlib.sha256(q.read_bytes()).hexdigest() == '81b016803969015df8cdd03131dd599911fc0c3fd68f105260458dde514a22c9'
    a = json.loads(subprocess.check_output([sys.executable, '-B', str(p)]))
    b = json.loads(subprocess.check_output([sys.executable, '-B', str(q)]))
    assert a['checks'] == 141839 and a['old_mysql_copy_semantics_preserved']
    assert b['checks'] == 1931 and b['original_business_HTTP'] == 48 and b['red_physical_field_comparisons_preserved'] == 5
    subprocess.check_call(['git', '-C', str(tool.source_root('store')), 'merge-base', '--is-ancestor', '2582b37be1ae3a7cccfc08eac8a8459c55596453', 'develop_dameng'])

if __name__ == '__main__':
    audit = Path(__file__).with_name('integration-20261013-menu-copy.json')
    assert not audit.exists(), 'Never replay main'
    report = tool.STORE + 'parallel-menu-copy-float-20261013/ROOT_REVIEW.md'
    paths = ['/m/date_menu/' + a for a in ['submitmenu', 'editnumber', 'delmenu']]
    paths += ['/p/datemenu/' + a for a in ['editmenu', 'getmenuinfo', 'getbutton']]
    tool.main([item('store', 'POST', p, '', evidence=report, evidence_only=True) for p in paths], audit, verify)
