#!/usr/bin/env python3 """C324 finite ingredient audit. No endpoint search, anchor fitting, or C325 work. Run: python C324_Independent_Audit.py --sources DIR --out DIR DIR must contain frozen C322_DATA.json. Source interpretations are in the review, not inferred from numerical checks or textual non-matches. """ import argparse import hashlib import json from fractions import Fraction as F from pathlib import Path def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--sources', type=Path, required=True) parser.add_argument('--out', type=Path, required=True) args = parser.parse_args() raw = (args.sources / 'C322_DATA.json').read_bytes() data = json.loads(raw) E, K = F(25, 23), F(529) checks = [] def check(name, actual, expected): ok = actual == expected checks.append({'name': name, 'actual': str(actual), 'expected': str(expected), 'pass': ok}) if not ok: raise AssertionError(name) check('E times 460', E * 460, F(500)) check('expansion gain', E * 460 - 460, F(40)) check('E times 529', E * K, F(575)) check('E squared times 529', E * E * K, F(625)) check('File46 first expansion', E * 4232, F(4600)) check('File46 second expansion', E * E * 4232, F(5000)) check('File46 4232 is 8K', F(4232), 8 * K) check('460 is not divisible by 529', 460 % 529 == 0, False) check('second 460 expansion is nonintegral', E * E * 460, F(12500, 23)) check('File09 bilateral outer width', 40 + 460 + 40, 540) check('File09 older shoulder completion', 14511 - 14011, 500) check('File09 younger shoulder completion', 14471 - 13971, 500) check('File09 central source width', 14471 - 14011, 460) local_examples = [] for family, older, base, completed in [ ('Flood/Arphaxad opening', 5296, 4836, 4796), ('Flood/Arphaxad terminal', 5289, 4829, 4789), ('Cainan/Shelah opening', 4858, 4398, 4358), ('Cainan/Shelah terminal', 4851, 4391, 4351), ]: check(f'{family} source', older - base, 460) check(f'{family} shoulder', base - completed, 40) check(f'{family} expanded', older - completed, 500) local_examples.append({'family': family, 'older': older, 'base': base, 'completed_generated': completed, 'source_width': 460, 'completion': 40, 'expanded_width': 500}) biographies = [] center_count = component_count = 0 check('held primary biography count', len(data['biographies']), 3) for row in data['biographies']: label = f"i{row['i']}/G{row['gear']}" sp = [F(x) for x in row['SP_chain_BC']] mt = [F(x) for x in row['MT_chain_BC']] check(label + ' role count', len(sp), 5) for role, s, m in zip(row['roles'], sp, mt): check(label + '/' + role + ' context translation', m - s, -460) center_count += 1 for phase in row['components']: for role, s, m in zip(row['roles'], phase['SP'], phase['MT']): check(label + '/' + phase['phase'] + '/' + role, F(m) - F(s), -460) component_count += 1 for name, chain in [('SP', sp), ('MT', mt)]: widths = [chain[i] - chain[i + 1] for i in range(4)] check(label + '/' + name + ' internal widths', widths, [F(500), F(100), F(350), F(150)]) check(label + '/' + name + ' Noah lifespan', chain[0] - chain[3], 950) check(label + '/' + name + ' Shem lifespan', chain[1] - chain[4], 600) check(label + ' cross-role near gap', mt[0] - sp[1], 40) check(label + ' cross-role outer gap', sp[0] - mt[1], 960) check(label + ' anchored E mapping span obstruction', E * (sp[0] - sp[1]) - (mt[0] - mt[1]), F(1000, 23)) biographies.append({ 'i': row['i'], 'gear': row['gear'], 'SP_centers': [int(x) for x in sp], 'MT_centers': [int(x) for x in mt], 'translation': -460, 'Noah_bound_gap_both': 500, 'MT_Noah_minus_SP_Shem': 40, 'SP_Noah_minus_MT_Shem': 960, 'E_expanded_Noah_Shem_width': str(E * 500), 'E_width_minus_actual_target_width': str(E * 500 - 500), }) check('center checks', center_count, 15) check('exact component checks', component_count, 30) check('textual binding retained', data['MT_binding_control']['Noah_G2_to_Shem_G1'], 502) result = { 'step': 'C324', 'scope': 'Finite arithmetic ingredients and operator distinction only.', 'source': {'name': 'C322_DATA.json', 'sha256': hashlib.sha256(raw).hexdigest()}, 'parameters': {'K': '529', 'E': str(E)}, 'biographies': biographies, 'positive_local_File09_examples': local_examples, 'affine_span_obstruction': { 'translation': 'T(b)=b-460', 'anchored_expansion': 'D_a(b)=a+(25/23)*(b-a)', 'anchor_independent_difference': 'D_a(u)-D_a(v)=(25/23)*(u-v)', 'source_and_target_Noah_bound_span': '500', 'expanded_span': '12500/23', 'residual': '1000/23', 'conclusion': 'No one common anchored E map equals the held whole-biography translation.', 'limit': 'This does not deny distinct endpoint-specific constructions or source prescriptions.' }, 'source_audit_limit': 'No numerical check proves source absence. The bounded textual audit is recorded separately.', 'prohibitions_observed': ['No fitted anchors', 'No new endpoint search', 'No C325 calculation', 'No cumulative Gear operation', 'No imported MT/LXX SP companions'], 'checks': checks, 'check_count': len(checks), 'all_checks_passed': all(c['pass'] for c in checks), } args.out.mkdir(parents=True, exist_ok=True) target = args.out / 'C324_Independent_Audit_Results.json' target.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') print(json.dumps({'result': str(target), 'checks': len(checks), 'passed': result['all_checks_passed']}, sort_keys=True)) if __name__ == '__main__': main()