name: Rebuild V2 candidate verification on: push: branches: [codex/videoreg-rebuild-v2] workflow_dispatch: jobs: candidate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "22" - run: npm ci --no-audit --no-fund - name: Types, tests and complete static build env: COMMIT_SHA: ${{ github.sha }} NEXT_TELEMETRY_DISABLED: "1" run: npm run ci:quality - name: Install pinned recovery verification dependencies run: | python3 -m venv .local-run/recovery-env .local-run/recovery-env/bin/python -m pip install --disable-pip-version-check -r scripts/rebuild-v2/requirements.txt - name: Validate complete export and safe preview shell: bash run: | set -euo pipefail py=.local-run/recovery-env/bin/python "$py" scripts/rebuild-v2/check-preview.py "$py" deploy/serve-local.py > "${RUNNER_TEMP}/videoreg-v2-preview.log" 2>&1 & preview_pid=$! trap 'kill "$preview_pid" 2>/dev/null || true' EXIT base=$("$py" - "$preview_pid" <<'PYREADY' import json, pathlib, sys, time, urllib.request expected_pid = int(sys.argv[1]) for attempt in range(50): try: state = json.loads(pathlib.Path('.local-run/server.json').read_text()) if state['pid'] == expected_pid: with urllib.request.urlopen(state['url'] + '/health/ready', timeout=1) as response: if response.status == 200: print(state['url']) break except (OSError, ValueError, KeyError): pass time.sleep(0.1) else: raise SystemExit('Candidate preview did not become ready') PYREADY ) "$py" scripts/rebuild-v2/check-built.py --base "$base" - name: Record verification identity and failures in job log if: always() run: | python3 - <<'PYREPORT' import json, pathlib path = pathlib.Path('docs/rebuild-v2/evidence/built-crawl.json') if path.is_file(): data = json.loads(path.read_text()) print(json.dumps({key: data.get(key) for key in ('sourceCommit', 'sourceManifestSha256', 'exportManifestSha256', 'summary', 'errors')}, ensure_ascii=False, indent=2)) else: print('No complete crawl report: inspect earlier setup/build failure') PYREPORT