Skip to content
Merged
70 changes: 70 additions & 0 deletions .github/workflows/d1-third-order-law.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: D1 third-order law controls

'on':
pull_request:
paths:
- 'frontiers/d1_third_order_law_20261001/**'
- '.github/workflows/d1-third-order-law.yml'
# bound merged sources (cited_only in SOURCES.json)
- 'reviews/literature_lifetime_law_recon_20260929/RECONNAISSANCE.md'
- 'imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md'
- 'reviews/d1_section9_borel_repair_20260925/REPAIR.md'
workflow_dispatch:

permissions:
contents: read

jobs:
exact-controls:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11.16'
- name: Verify sources, replay both modes, reject mutants
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
set -euo pipefail
python -B -S - <<'PY'
import hashlib, json, pathlib, subprocess, sys
root = pathlib.Path('frontiers/d1_third_order_law_20261001').resolve()
manifest = json.loads((root / 'SOURCES.json').read_text())
present = sorted(p.name for p in root.iterdir())
expected_names = sorted([e['path'] for e in manifest['files']] + ['SOURCES.json'])
if present != expected_names:
raise ValueError('packet tree differs from manifest: ' + repr(present))
for entry in manifest['files']:
path = root / entry['path']
if path.is_symlink():
raise ValueError('symlink: ' + entry['path'])
data = path.read_bytes()
if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256']:
raise ValueError('packet file identity mismatch: ' + entry['path'])
for entry in manifest['consumed'] + manifest['cited_only']:
data = pathlib.Path(entry['path']).read_bytes()
framed = b'blob ' + str(len(data)).encode() + b'\0' + data
if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256'] or hashlib.sha1(framed).hexdigest() != entry['git_blob']:
raise ValueError('merged source drifted: ' + entry['path'])
if manifest.get('consumed_unmerged'):
raise ValueError('this packet declares no unmerged dependency')
script = str(root / 'd1_check.py')
expected = (root / 'RESULTS.json').read_bytes()
for flags in (['-B', '-S'], ['-B', '-O', '-S']):
out = subprocess.run([sys.executable, *flags, script], check=True, capture_output=True, timeout=600).stdout
if out != expected:
raise RuntimeError('output differs from RESULTS.json under ' + ' '.join(flags))
for m in manifest['mutants']:
rc = subprocess.run([sys.executable, *flags, script, '--mutant', m], capture_output=True, timeout=600).returncode
if rc != 1:
raise RuntimeError('mutant ' + m + ' not rejected')
rc = subprocess.run([sys.executable, *flags, script, '--mutant', 'M9'], capture_output=True, timeout=600).returncode
if rc != 2:
raise RuntimeError('unknown mutant label not rejected with exit 2')
print(json.dumps({'scientific_effect': 'NONE', 'mathematical_acceptance': False}))
PY
git diff --exit-code
Loading
Loading