From e087d824ca75ad43e342a8378ac93fa4b0fd8bc2 Mon Sep 17 00:00:00 2001 From: Theodore Song Date: Sat, 22 Aug 2026 20:52:21 -0400 Subject: [PATCH] Schedule protected routing deployment retry --- .../workflows/release-protected-routing.yml | 51 +++++++++++++++++++ scripts/test-autonomous-runtime.mjs | 4 ++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/release-protected-routing.yml diff --git a/.github/workflows/release-protected-routing.yml b/.github/workflows/release-protected-routing.yml new file mode 100644 index 0000000..30c7397 --- /dev/null +++ b/.github/workflows/release-protected-routing.yml @@ -0,0 +1,51 @@ +name: Release protected agent routing after Vercel quota reset + +on: + schedule: + - cron: "25 1-23/2 23 8 *" + - cron: "25 1-13/2 24 8 *" + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: release-protected-routing + cancel-in-progress: false + +jobs: + release: + runs-on: ubuntu-latest + timeout-minutes: 35 + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - name: Trigger the deferred production deployment + env: + ARENA_URL: https://polymarket-site-eta.vercel.app + run: | + if curl --fail --silent --show-error "${ARENA_URL}/?routing_preflight=${GITHUB_RUN_ID}" | grep -q 'routesExclusiveNoPairToTailAlpha'; then + echo "Protected agent routing is already live." + exit 0 + fi + printf 'Protected routing deployment retry from run %s at %s\n' "$GITHUB_RUN_ID" "$(date -u +%FT%TZ)" > .protected-routing-release-trigger + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add .protected-routing-release-trigger + git commit -m "Retry protected agent routing deployment" + git push origin HEAD:main + - name: Verify the exact routing revision in production + env: + ARENA_URL: https://polymarket-site-eta.vercel.app + run: | + for attempt in $(seq 1 40); do + if curl --fail --silent --show-error "${ARENA_URL}/?routing_wait=${GITHUB_RUN_ID}-${attempt}" | grep -q 'routesExclusiveNoPairToTailAlpha'; then + echo "Protected agent routing is live." + exit 0 + fi + sleep 30 + done + echo "The Vercel quota has not admitted this revision yet; a later scheduled retry will continue." + exit 1 diff --git a/scripts/test-autonomous-runtime.mjs b/scripts/test-autonomous-runtime.mjs index 4875459..88e9cce 100644 --- a/scripts/test-autonomous-runtime.mjs +++ b/scripts/test-autonomous-runtime.mjs @@ -5,6 +5,7 @@ import { ALLOWED_RUNTIME_KEYS, compactRuntimeTransportSnapshot, validateRuntimeS const index = fs.readFileSync(new URL("../index.html", import.meta.url), "utf8"); const api = fs.readFileSync(new URL("../api/state.js", import.meta.url), "utf8"); const workflow = fs.readFileSync(new URL("../.github/workflows/autonomous-cycle.yml", import.meta.url), "utf8"); +const routingReleaseWorkflow = fs.readFileSync(new URL("../.github/workflows/release-protected-routing.yml", import.meta.url), "utf8"); const vercelConfig = JSON.parse(fs.readFileSync(new URL("../vercel.json", import.meta.url), "utf8")); const runner = fs.readFileSync(new URL("./run-autonomous-cycle.mjs", import.meta.url), "utf8"); const resolutionAudit = JSON.parse(fs.readFileSync(new URL("../research/resolution-week-no-audit.json", import.meta.url), "utf8")); @@ -72,6 +73,9 @@ assert.match(api, /searchParams\.set\("runtime", `\$\{Date\.now\(\)\}/); assert.match(workflow, /cron: "2,7,12,17,22,27,32,37,42,47,52,57 \* \* \* \*"/); assert.match(workflow, /contents: write/); assert.match(workflow, /EXPECTED_BUILD: "124"/); +assert.match(routingReleaseWorkflow, /name: Release protected agent routing after Vercel quota reset/); +assert.match(routingReleaseWorkflow, /routesExclusiveNoPairToTailAlpha/); +assert.match(routingReleaseWorkflow, /cron: "25 1-23\/2 23 8 \*"/); assert.match(workflow, /actions: write/); assert.match(workflow, /cancel-in-progress: false/); assert.match(workflow, /next=\$\(\( \(now \/ 300 \+ 1\) \* 300 \+ 15 \)\)/);