From 84e0ef703b0b6275e054d3eebb6b737cf0e2c3b2 Mon Sep 17 00:00:00 2001 From: Theodore Song Date: Fri, 21 Aug 2026 17:17:22 -0400 Subject: [PATCH] Serve the latest autonomous snapshot --- .github/workflows/autonomous-cycle.yml | 2 +- README.md | 2 +- api/state.js | 2 +- index.html | 8 ++++---- scripts/run-autonomous-cycle.mjs | 2 +- scripts/test-autonomous-runtime.mjs | 5 +++-- sw.js | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/autonomous-cycle.yml b/.github/workflows/autonomous-cycle.yml index 135fa63..4a28514 100644 --- a/.github/workflows/autonomous-cycle.yml +++ b/.github/workflows/autonomous-cycle.yml @@ -34,7 +34,7 @@ jobs: - run: node scripts/run-autonomous-cycle.mjs env: ARENA_URL: https://polymarket-site-eta.vercel.app - EXPECTED_BUILD: "89" + EXPECTED_BUILD: "90" RUNTIME_BRANCH: runtime-state RUNTIME_STATE_PATH: runtime/state.json GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e938606..87f032e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ market snapshots. During an outage, cycles continue locally; cached entries are allowed for 90 minutes, older snapshots become mark-only, and all cached data expires after 24 hours. -Build 89 adds a headless GitHub Actions runtime that checks the production site +Build 90 adds a headless GitHub Actions runtime that checks the production site at seven minutes past every hour, continues from the previous agent snapshot, and runs the next due paper cycle even when no browser is open. It writes a sanitized snapshot to the `runtime-state` branch and `/api/state` uses that as a diff --git a/api/state.js b/api/state.js index 8eb919d..8386bdb 100644 --- a/api/state.js +++ b/api/state.js @@ -111,7 +111,7 @@ async function readGithubRuntimeState() { const timeout = setTimeout(() => controller.abort(), 8000); try { const url = new URL(GITHUB_RUNTIME_STATE_URL); - url.searchParams.set("minute", String(Math.floor(Date.now() / 60000))); + url.searchParams.set("runtime", `${Date.now()}-${Math.random().toString(36).slice(2)}`); const response = await fetch(url, { cache: "no-store", headers: { Accept: "application/json", "Cache-Control": "no-cache" }, diff --git a/index.html b/index.html index 50150d6..d5aa8b6 100644 --- a/index.html +++ b/index.html @@ -341,7 +341,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color