From 2181d62104a35a35d953e0c83fd0566b108cbfc4 Mon Sep 17 00:00:00 2001 From: Theodore Song Date: Fri, 21 Aug 2026 22:48:09 -0400 Subject: [PATCH] Chain autonomous five-minute cycles --- .github/workflows/autonomous-cycle.yml | 26 ++++++++++++++++++++++++-- README.md | 21 +++++++++++---------- index.html | 8 ++++---- scripts/run-autonomous-cycle.mjs | 2 +- scripts/test-autonomous-runtime.mjs | 9 +++++++-- sw.js | 2 +- 6 files changed, 48 insertions(+), 20 deletions(-) diff --git a/.github/workflows/autonomous-cycle.yml b/.github/workflows/autonomous-cycle.yml index b8a37ea..62fbdae 100644 --- a/.github/workflows/autonomous-cycle.yml +++ b/.github/workflows/autonomous-cycle.yml @@ -14,10 +14,11 @@ on: permissions: contents: write + actions: write concurrency: group: autonomous-paper-cycle - cancel-in-progress: false + cancel-in-progress: true jobs: cycle: @@ -34,7 +35,28 @@ jobs: - run: node scripts/run-autonomous-cycle.mjs env: ARENA_URL: https://polymarket-site-eta.vercel.app - EXPECTED_BUILD: "112" + EXPECTED_BUILD: "113" RUNTIME_BRANCH: runtime-state RUNTIME_STATE_PATH: runtime/state.json GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Wait for the next five-minute slot + if: success() + shell: bash + run: | + now=$(date +%s) + next=$(( (now / 300 + 1) * 300 + 15 )) + delay=$(( next - now )) + echo "Next autonomous slot starts in ${delay}s" + sleep "$delay" + - name: Dispatch the next autonomous cycle + if: success() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl --fail-with-body --silent --show-error \ + --request POST \ + --header "Accept: application/vnd.github+json" \ + --header "Authorization: Bearer ${GITHUB_TOKEN}" \ + --header "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/autonomous-cycle.yml/dispatches" \ + --data '{"ref":"main"}' diff --git a/README.md b/README.md index 4cde5b4..fc5b3d9 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,12 @@ 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 112 runs the headless GitHub Actions runtime every five minutes, continues -from the previous agent snapshot, -and runs the next due paper cycle even when no browser is open. It writes a +Build 113 targets five-minute slots with a self-chained GitHub Actions runtime. +It continues from the previous agent snapshot and runs the next due paper cycle +even when no browser is open. After each successful cycle, one repo-scoped +workflow dispatch waits for the next five-minute boundary; concurrency +cancellation prevents competing chains, a failed cycle does not self-repeat, +and the cron schedule remains as recovery. The runtime writes a sanitized snapshot to the `runtime-state` branch and `/api/state` uses that as a read-only fallback while Neon or Vercel Blob is unavailable. The public snapshot contains only `pma_agents_v2` and `pma_suggestions_v5`, with suggestions capped at @@ -36,9 +39,7 @@ headless browser also rebuilds a minimal timestamped market cache from those two public items on every restart. A complete network outage can therefore continue the existing 90-minute cached-entry and 24-hour mark-only policy without adding another synchronized key; strategies that require fresh order-book depth remain -blocked until live connectivity returns. -The -five shock-strategy adopters now learn from one shared, +blocked until live connectivity returns. The five shock-strategy adopters now learn from one shared, event-deduplicated forward ledger. A trade allocated to one agent therefore teaches the other four without copying its cash or P&L; shared positive evidence can promote bounded size and shared negative evidence disables the lane. @@ -47,7 +48,7 @@ Polymarket event key. Related Ethereum or Bitcoin contracts cannot create several simultaneous copies of one move, and outcomes from the same underlying three-hour shock window count as one learner event. -Each Build 112 cycle also scans the 1,000 most-active Polymarket events for +Each Build 113 cycle also scans the 1,000 most-active Polymarket events for complete negative-risk bundles and logically nested threshold or deadline pairs. Gamma's market-specific fee flag replaces the old blanket 0.5-cent fee reserve for markets declared fee-free. The closest 60 structures are then @@ -63,7 +64,7 @@ The Suggestions view stores scan, depth, fee, actionable, and closest executable-margin counts so an empty lane is evidence rather than an ambiguous failure. -Build 112 retains the directional learner's exact-fee policy, which replaced the blanket half-cent cost with +Build 113 retains the directional learner's exact-fee policy, which replaced the blanket half-cent cost with the market's Gamma fee schedule at both the entry and future checkpoint, plus a separate half-cent round-trip slippage allowance. Fee-free markets pay only the slippage allowance; an unavailable fee schedule gets a conservative four-cent @@ -79,7 +80,7 @@ directional evidence under fee policy 2 and keeps those lanes observation-only until current independent 24-hour and 72-hour cohorts pass the existing promotion gate. -Build 112 retains Build 100's retirement of the old 3-6 day resolution-window +Build 113 retains Build 100's retirement of the old 3-6 day resolution-window capital permission. That audit clustered confidence by event but still averaged several correlated contracts inside each event, while production could choose only one. The corrected replay chooses the highest-volume eligible contract per event and @@ -199,7 +200,7 @@ evidence proves an edge. Run `npm run evaluate:sports-favorites` for the retired pregame favorite audit. Its 12-hour, 60%-75% cohort had positive point estimates but did not establish a -reliable confidence bound, so Build 112 no longer allocates capital to that rule. +reliable confidence bound, so Build 113 no longer allocates capital to that rule. Strategy 62 instead uses the exact-fee settlement calibration's three-day Sports NO cohort as a bounded paper exploration lane. The corrected 5,000-market run diff --git a/index.html b/index.html index 6cddf78..4c842db 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