From 584dd7c3c8b35c37568d91dc1c278b4ca4cac70e Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Fri, 30 Oct 2026 07:17:09 -0500 Subject: [PATCH 1/4] fix(Math-): bind contact-small-gap mutants to expected tests --- .../run_validation.py | 83 +++++++++++++++++-- 1 file changed, 74 insertions(+), 9 deletions(-) diff --git a/reviews/contact_kernel_tail_20260925/run_validation.py b/reviews/contact_kernel_tail_20260925/run_validation.py index 97dbbe044..c60624104 100644 --- a/reviews/contact_kernel_tail_20260925/run_validation.py +++ b/reviews/contact_kernel_tail_20260925/run_validation.py @@ -4,11 +4,13 @@ import argparse import hashlib import json +import re import shutil import subprocess import sys ROOT=Path(__file__).resolve().parent +TEST_COUNT=24 MUTANTS={ 'lose_midpoint_shift':('u*u-u*w+Q(1,4)','u*u-u*w'), 'wrong_q_parameter':('q=6*k*(w-2*u)/v','q=6*k*(w-u)/v'), @@ -18,6 +20,43 @@ 'wrong_gaussian_moment':('(n-1)*out[n-2]/(2*a)','(n+1)*out[n-2]/(2*a)'), 'promote_small_gap_uniformity':("'finite_r_small_k_uniformity':False","'finite_r_small_k_uniformity':True"), } +EXPECTED_FAILURES={ + 'lose_midpoint_shift':frozenset({ + 'test_contact_tools.ContactTests.test_critical_constraints', + 'test_contact_tools.ContactTests.test_exact_contact_fixture', + 'test_contact_tools.ContactTests.test_typed_determinant_forms', + }), + 'wrong_q_parameter':frozenset({ + 'test_contact_tools.ContactTests.test_critical_constraints', + 'test_contact_tools.ContactTests.test_exact_contact_fixture', + 'test_contact_tools.ContactTests.test_typed_determinant_forms', + }), + 'lose_endpoint_k2':frozenset({ + 'test_contact_tools.ContactTests.test_w_jacobian_is_counted_once', + }), + 'wrong_type_region':frozenset({ + 'test_contact_tools.ContactTests.test_claim_scope_metadata', + 'test_contact_tools.ContactTests.test_exact_shape_integral', + 'test_contact_tools.ContactTests.test_two_pieces', + 'test_contact_tools.ContactTests.test_type_area', + 'test_contact_tools.ContactTests.test_universal_rational_coefficient', + }), + 'wrong_height_orientation':frozenset({ + 'test_contact_tools.ContactTests.test_critical_constraints', + 'test_contact_tools.ContactTests.test_saddle_side_remainder_identity', + }), + 'wrong_gaussian_moment':frozenset({ + 'test_contact_tools.ContactTests.test_gaussian_moments_symmetric', + 'test_contact_tools.ContactTests.test_gaussian_polynomial_reduction_against_simpson', + }), + 'promote_small_gap_uniformity':frozenset({ + 'test_contact_tools.ContactTests.test_claim_scope_metadata', + }), +} +FAIL_RE=re.compile(r'^FAIL: ([^\s]+) \(([^)]+)\)$',re.MULTILINE) +ERROR_RE=re.compile(r'^ERROR: ',re.MULTILINE) +RUN_RE=re.compile(r'^Ran (\d+) tests? in [^\n]+$',re.MULTILINE) +FAILED_RE=re.compile(r'^FAILED \(failures=(\d+)\)$',re.MULTILINE) def require(ok,message): if not ok:raise RuntimeError(message) @@ -31,23 +70,48 @@ def identities(): require({'bytes':len(raw),'sha256':hashlib.sha256(raw).hexdigest()}==identity,'identity mismatch: '+name) return pins -def run_cmd(cmd,cwd,out,name,mutant=False): +def _failure_ids(stderr,name): + matches=list(FAIL_RE.finditer(stderr)) + ids=[] + for match in matches: + short,full=match.groups() + require(short==full.rsplit('.',1)[-1],'malformed unittest failure identity '+name) + ids.append(full) + block_end=matches[matches.index(match)+1].start() if matches.index(match)+1 Date: Fri, 30 Oct 2026 07:17:27 -0500 Subject: [PATCH 2/4] chore(Math-): pin repaired contact-small-gap runner --- reviews/contact_kernel_tail_20260925/SOURCE_FILES.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reviews/contact_kernel_tail_20260925/SOURCE_FILES.json b/reviews/contact_kernel_tail_20260925/SOURCE_FILES.json index 0f7358334..a096b6bc5 100644 --- a/reviews/contact_kernel_tail_20260925/SOURCE_FILES.json +++ b/reviews/contact_kernel_tail_20260925/SOURCE_FILES.json @@ -29,8 +29,8 @@ "sha256": "e85d55f3f2cf4a93b7a3bec22e38fb90c02e37a42a8b208b8b56143a9894b09c" }, "run_validation.py": { - "bytes": 3914, - "sha256": "a0cde0beda096a027adca71a8e05f64a7bb21e825e7d4f68d8fc6f8cf6709a0b" + "bytes": 7061, + "sha256": "e5b5efe4737ca12bb7d57215f5decc712565107b2a3d8d624053c93bcd4e2fda" }, "test_contact_tools.py": { "bytes": 6000, From f0256ef1bf3b9b24dd03915e58946779b773604e Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Fri, 30 Oct 2026 07:17:31 -0500 Subject: [PATCH 3/4] fix(Math-): trigger contact replay on reviewer input changes --- .github/workflows/contact-small-gap.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/contact-small-gap.yml b/.github/workflows/contact-small-gap.yml index 86cadd90a..a1cae2e2f 100644 --- a/.github/workflows/contact-small-gap.yml +++ b/.github/workflows/contact-small-gap.yml @@ -1,7 +1,10 @@ name: Contact small-gap law and source-bound review replay 'on': pull_request: - paths: ['reviews/contact_kernel_tail_20260925/**', '.github/workflows/contact-small-gap.yml'] + paths: + - 'reviews/contact_kernel_tail_20260925/**' + - 'reviews/pr16_fixed_transverse_nonauthor_20260925/**' + - '.github/workflows/contact-small-gap.yml' workflow_dispatch: permissions: contents: read From aba43cce0fad06c8ed8a6f6f8e5dfc1b495ffa8b Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Fri, 30 Oct 2026 07:36:14 -0500 Subject: [PATCH 4/4] fix(Math-): pin contact replay runner and manifest before execution --- .github/workflows/contact-small-gap.yml | 54 ++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contact-small-gap.yml b/.github/workflows/contact-small-gap.yml index a1cae2e2f..10e958e00 100644 --- a/.github/workflows/contact-small-gap.yml +++ b/.github/workflows/contact-small-gap.yml @@ -32,9 +32,59 @@ jobs: PYTHONDONTWRITEBYTECODE: '1' run: | python -B -S - <<'PY' - import hashlib,json,os,pathlib,shutil,subprocess,sys - root=pathlib.Path('reviews/contact_kernel_tail_20260925').resolve() + import hashlib,json,os,pathlib,shutil,subprocess,sys,tempfile + root=pathlib.Path('reviews/contact_kernel_tail_20260925') out=pathlib.Path(os.environ['RUNNER_TEMP'])/'contact-small-gap' + # Fixed workflow-side trust pins; the candidate manifest cannot authorize its own runner. + EXPECTED_BLOBS={ + 'run_validation.py':'c60624104972b5f619dfcf7c63429e573297125f', + 'SOURCE_FILES.json':'a096b6bc5643b983ade7c9f3d02b6490e932ebab', + } + EXPECTED_FILES={ + 'ANNULUS_ASYMPTOTIC_BRIDGE.md', + 'COORDINATION.md', + 'KERNEL_TAILS_AND_SMALL_GAP.md', + 'README.md', + 'RECONNAISSANCE.md', + 'RESULTS.json', + 'contact_tools.py', + 'run_validation.py', + 'test_contact_tools.py', + } + EXPECTED_ENTRIES=EXPECTED_FILES|{'SOURCE_FILES.json'} + def require(ok,message): + if not ok:raise RuntimeError(message) + def git_blob(path): + raw=path.read_bytes() + return hashlib.sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest() + def verify_packet(packet): + require(not packet.is_symlink() and packet.is_dir(),'packet root must be a real directory') + entries=list(packet.iterdir()) + require({p.name for p in entries}==EXPECTED_ENTRIES,'unexpected packet directory membership') + require(all(not p.is_symlink() and p.is_file() for p in entries),'packet entries must be regular files') + for name,expected in EXPECTED_BLOBS.items(): + require(git_blob(packet/name)==expected,'workflow trust-pin mismatch: '+name) + manifest=json.loads((packet/'SOURCE_FILES.json').read_text()) + require(set(manifest.get('files',{}))==EXPECTED_FILES,'manifest path set mismatch') + verify_packet(root) + with tempfile.TemporaryDirectory(dir=os.environ['RUNNER_TEMP']) as temp: + for attack in ('manifest-removal','noop-runner','combined'): + packet=pathlib.Path(temp)/attack + shutil.copytree(root,packet) + if attack in ('manifest-removal','combined'): + manifest=json.loads((packet/'SOURCE_FILES.json').read_text()) + manifest['files'].pop('run_validation.py',None) + (packet/'SOURCE_FILES.json').write_text(json.dumps(manifest,indent=2,sort_keys=True)+'\n') + if attack in ('noop-runner','combined'): + (packet/'run_validation.py').write_text( + 'import argparse\nfrom pathlib import Path\nparser=argparse.ArgumentParser()\nparser.add_argument("--output",type=Path,required=True)\nargs=parser.parse_args()\nargs.output.mkdir(parents=True)\n' + ) + try: + verify_packet(packet) + except RuntimeError: + pass + else: + raise RuntimeError('adverse candidate accepted: '+attack) subprocess.run([sys.executable,'-B','-S',str(root/'run_validation.py'),'--output',str(out)],check=True,timeout=150) review=pathlib.Path('reviews/pr16_fixed_transverse_nonauthor_20260925') script=review/'algebra_check.py'