|
| 1 | +name: agent-port-lcm-current-v2 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - agent/port-lcm-replay-v2 |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + port: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v5 |
| 16 | + with: |
| 17 | + ref: agent/port-lcm-replay-v2 |
| 18 | + fetch-depth: 0 |
| 19 | + - name: Reuse port script with exact import anchor |
| 20 | + shell: bash |
| 21 | + run: | |
| 22 | + python - <<'PY' |
| 23 | + from pathlib import Path |
| 24 | +
|
| 25 | + workflow = Path('.github/workflows/agent-port-lcm-current.yml') |
| 26 | + text = workflow.read_text() |
| 27 | + old = ''' " FactorizationRequest,\\n",\n " FactorizationRequest,\\n IntegerPairRequest,\\n",''' |
| 28 | + new = ''' "from jacobian.contracts.number_theory import (\\n FactorizationRequest,\\n",\n "from jacobian.contracts.number_theory import (\\n FactorizationRequest,\\n IntegerPairRequest,\\n",''' |
| 29 | + if text.count(old) != 1: |
| 30 | + raise SystemExit(f'expected one workflow anchor, found {text.count(old)}') |
| 31 | + text = text.replace(old, new, 1) |
| 32 | + lines = text.splitlines() |
| 33 | + start = lines.index(" python - <<'PY'") + 1 |
| 34 | + end = lines.index(" PY", start) |
| 35 | + script = '\n'.join( |
| 36 | + line[10:] if line.startswith(' ') else line |
| 37 | + for line in lines[start:end] |
| 38 | + ) + '\n' |
| 39 | + Path('/tmp/port_lcm.py').write_text(script) |
| 40 | + PY |
| 41 | + python /tmp/port_lcm.py |
| 42 | + rm -f .github/workflows/agent-port-lcm-current-v2.yml |
| 43 | + - name: Validate focused source |
| 44 | + run: python -m compileall -q src/jacobian/domains/number_theory/checkers.py src/jacobian/exact_domain_checkers.py src/jacobian_checkers/integer_lcm.py tests/domain/number_theory/test_lcm_verification.py |
| 45 | + - name: Commit port |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + git config user.name github-actions[bot] |
| 49 | + git config user.email 41898282+github-actions[bot]@users.noreply.github.com |
| 50 | + git add -A |
| 51 | + git commit -m "feat(checkers): independently replay bounded LCM" |
| 52 | + git push origin HEAD:agent/port-lcm-replay-v2 |
0 commit comments