diff --git a/.github/workflows/autonomous-cycle.yml b/.github/workflows/autonomous-cycle.yml index 60baed1..32fe0f0 100644 --- a/.github/workflows/autonomous-cycle.yml +++ b/.github/workflows/autonomous-cycle.yml @@ -35,7 +35,7 @@ jobs: - run: node scripts/run-autonomous-cycle.mjs env: ARENA_URL: https://polymarket-site-eta.vercel.app - EXPECTED_BUILD: "115" + EXPECTED_BUILD: "116" RUNTIME_BRANCH: runtime-state RUNTIME_STATE_PATH: runtime/state.json GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 5c03e27..53838ca 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 115 targets five-minute slots with a serialized, self-chained GitHub Actions runtime. +Build 116 targets five-minute slots with a serialized, 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; one concurrency group @@ -29,7 +29,10 @@ 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 -300 to keep cross-device loads small. Paper accounts, passwords, email settings, +300 to keep cross-device loads small. The API preserves oldest-first pending +observations plus fee schedules, agent promotion scopes, and verified bundle +capacity from the bounded runtime instead of applying its older lossy compactor. +Paper accounts, passwords, email settings, investment allocations, chat history, wallet information, and live-money settings are explicitly excluded. While that fallback is active, ordinary phones and computers are display-only and cannot fork the public portfolio with @@ -48,15 +51,18 @@ 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 115 cycle also scans the 1,000 most-active Polymarket events for +Each Build 116 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 -repriced from batched CLOB asks at the equal-unit size needed for at least a $50 -paper order. The scanner applies each market's Gamma fee schedule at every +repriced from batched CLOB asks from the equal-unit size needed for at least a $50 +paper order up to a $400 verified-notional ceiling. The scanner applies each market's Gamma fee schedule at every consumed ask level and checks the CLOB fee-rate endpoint for a matching enabled or fee-free state. Any opened position is capped to the exact equal-unit size -that passed this depth test. A bundle can enter Value Discipline only when that fee check +of the largest fill that stays profitable and passes this depth test; portfolio +cash, reserve, and 4% limits can reduce it further. Existing paper bundles are +never retroactively enlarged against depth their original simulated fill would +already have consumed. A bundle can enter Value Discipline only when that fee check passes and the resulting worst-case payout clears both the three-tenths-cent profit floor and the 0.15% return floor. Top-of-book gaps, missing books, incomplete fee schedules, and unavailable fee verification remain audit-only. @@ -64,7 +70,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 115 retains the directional learner's exact-fee policy, which replaced the blanket half-cent cost with +Build 116 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 @@ -80,7 +86,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 115 retains Build 100's retirement of the old 3-6 day resolution-window +Build 116 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 @@ -200,7 +206,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 115 no longer allocates capital to that rule. +reliable confidence bound, so Build 116 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/api/state.js b/api/state.js index 332f948..5f25274 100644 --- a/api/state.js +++ b/api/state.js @@ -14,7 +14,7 @@ const PAPER_KEY = "pma_paper_accounts_v1"; const LIVE_KEY = "pma_live_readiness_v1"; const AGENT_IDS = ["value", "momentum", "favorite", "longshot", "diversifier", "catalyst", "reversal", "breakout", "tailalpha", "conviction"]; const LIMITS = { closed: 80, history: 160, snapshots: 240, suggestions: 900, paperHistory: 120, paperSnapshots: 120, audit: 120 }; -const SIGNAL_LEDGER_LIMITS = { pending: 300, outcomes: 500 }; +const SIGNAL_LEDGER_LIMITS = { pending: 600, outcomes: 1000 }; const RUNTIME_ALLOWED_KEYS = new Set([AGENTS_KEY, SUG_KEY]); function withBlobAuth(options = {}) { @@ -200,8 +200,8 @@ async function latestVersionedStateBlob() { return readBlobJson(newest.pathname); } -function cycleVersion(cycle = "") { - const m = String(cycle).match(/\|v(\d+)$/); +export function cycleVersion(cycle = "") { + const m = String(cycle).match(/\|[vs](\d+)$/); return m ? Number(m[1]) : 0; } @@ -261,7 +261,7 @@ export function compactAgentState(st) { } if (st.signal_ledger && typeof st.signal_ledger === "object") { out.signal_ledger = { - pending: Array.isArray(st.signal_ledger.pending) ? st.signal_ledger.pending.slice(-SIGNAL_LEDGER_LIMITS.pending) : [], + pending: Array.isArray(st.signal_ledger.pending) ? st.signal_ledger.pending.slice(0, SIGNAL_LEDGER_LIMITS.pending) : [], outcomes: Array.isArray(st.signal_ledger.outcomes) ? st.signal_ledger.outcomes.slice(-SIGNAL_LEDGER_LIMITS.outcomes) : [], expired_ungraded: Number(st.signal_ledger.expired_ungraded || 0), }; @@ -280,15 +280,23 @@ export function compactSuggestion(s) { net_edge: s.net_edge, friction: s.friction, chase_penalty: s.chase_penalty, evidence_score: s.evidence_score, evidence_source_count: s.evidence_source_count, quality: s.quality, conviction: s.conviction, volume: s.volume, volume_24hr: s.volume_24hr, liquidity: s.liquidity, + fees_enabled: s.fees_enabled, fee_schedule: s.fee_schedule, spread: s.spread, price_change_1h: s.price_change_1h, price_change_1d: s.price_change_1d, price_change_1w: s.price_change_1w, momentum_strength: s.momentum_strength, signal_strength: s.signal_strength, signal_confidence: s.signal_confidence, signal_type: s.signal_type, trade_ready: s.trade_ready, entry_candidate: s.entry_candidate, audited_observation_only: s.audited_observation_only, adaptive_promotion: s.adaptive_promotion, + promoted_for_agents: s.promoted_for_agents, watch_only: s.watch_only, jump_risk: s.jump_risk, requires_live: s.requires_live, bundle_id: s.bundle_id, bundle_side: s.bundle_side, bundle_logic: s.bundle_logic, bundle_cost_per_unit: s.bundle_cost_per_unit, bundle_payout_per_unit: s.bundle_payout_per_unit, bundle_net_profit_per_unit: s.bundle_net_profit_per_unit, - bundle_legs: s.bundle_legs, - days_to_resolution: s.days_to_resolution, pilot_prior: s.pilot_prior, + bundle_legs: s.bundle_legs, depth_verified: s.depth_verified, fees_verified: s.fees_verified, + fee_model: s.fee_model, execution_model: s.execution_model, execution_units: s.execution_units, + execution_notional: s.execution_notional, verification_status: s.verification_status, + days_to_resolution: s.days_to_resolution, end_date: s.end_date, game_start: s.game_start, + hours_to_start: s.hours_to_start, target_horizon_days: s.target_horizon_days, + resolution_week_strategy_version: s.resolution_week_strategy_version, + sports_contest_strategy_version: s.sports_contest_strategy_version, entry_fee: s.entry_fee, + pilot_prior: s.pilot_prior, shock_move_1h: s.shock_move_1h, shock_prior_move_1h: s.shock_prior_move_1h, shock_move_3h: s.shock_move_3h, shock_observed_at: s.shock_observed_at, shock_strategy_version: s.shock_strategy_version, drivers: s.drivers, rationale: s.rationale, diff --git a/index.html b/index.html index e22652a..0e23c35 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