Add bounded six-hour adaptive probation

This commit is contained in:
Theodore Song
2026-08-22 03:02:35 -04:00
parent e3086ed5fb
commit dcede02676
9 changed files with 161 additions and 38 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ async function main() {
const branch = process.env.RUNTIME_BRANCH || "runtime-state";
const pathname = process.env.RUNTIME_STATE_PATH || "runtime/state.json";
const arenaUrl = (process.env.ARENA_URL || "https://polymarket-site-eta.vercel.app").replace(/\/$/, "");
const expectedBuild = Number(required("EXPECTED_BUILD", "118"));
const expectedBuild = Number(required("EXPECTED_BUILD", "119"));
await ensureRuntimeBranch(repository, branch);
const prior = await readRuntimeFile(repository, branch, pathname);
if (prior.snapshot) validateRuntimeSnapshot(prior.snapshot, 0, { allowIncomplete: true });
+9 -2
View File
@@ -10,7 +10,7 @@ const resolutionAudit = JSON.parse(fs.readFileSync(new URL("../research/resoluti
const sportsContestAudit = JSON.parse(fs.readFileSync(new URL("../research/sports-contest-no-exploration-audit.json", import.meta.url), "utf8"));
const build = Number(index.match(/const BUILD_VERSION = (\d+);/)?.[1]);
assert.equal(build, 118);
assert.equal(build, 119);
assert.deepEqual([...ALLOWED_RUNTIME_KEYS].sort(), ["pma_agents_v2", "pma_suggestions_v5"]);
assert.match(index, /function collectPublicRuntimeItems\(\)/);
assert.match(index, /const PUBLIC_RUNTIME_KEYS=Object\.freeze\(\[AGENTS_KEY,SUG_KEY\]\)/);
@@ -30,6 +30,13 @@ assert.match(index, /reservedCount=Math\.min\(PUBLIC_SIGNAL_OUTCOME_RESERVE,outc
assert.match(index, /return fitPublicRuntimeSnapshot\(snapshot\)/);
assert.match(index, /publicCompactionPreservesForwardGrading:/);
assert.match(index, /publicCompactionPreservesAgentCalibration:/);
assert.match(index, /const DIRECTIONAL_PROBATION_HORIZON_HOURS = 6;/);
assert.match(index, /const DIRECTIONAL_PROBATION_MIN_EVENTS = 12;/);
assert.match(index, /sixHourEvidenceStartsBoundedProbation:/);
assert.match(index, /probationMetadataSurvivesOfflineCompaction:/);
assert.match(index, /probationExitsAtExecutableSixHourPrice:/);
assert.match(index, /claimedProbationEvents/);
assert.match(api, /adaptive_probation: s\.adaptive_probation, probation_exit_hours: s\.probation_exit_hours/);
assert.match(index, /function buildRuntimeFallbackMarketCache\(stored,state\)/);
assert.match(index, /buildRuntimeFallbackMarketCache\(stored,st\)/);
assert.match(index, /window\.PMA_AUTOMATION=Object\.freeze/);
@@ -44,7 +51,7 @@ assert.match(api, /Buffer\.from\(file\.content/);
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: "118"/);
assert.match(workflow, /EXPECTED_BUILD: "119"/);
assert.match(workflow, /actions: write/);
assert.match(workflow, /cancel-in-progress: false/);
assert.match(workflow, /next=\$\(\( \(now \/ 300 \+ 1\) \* 300 \+ 15 \)\)/);
+3
View File
@@ -17,5 +17,8 @@ assert.match(worker, /"\/cycle-worker\.js"/);
assert.match(cycleWorker, /const INTERVAL_MS = 60000;/);
assert.match(index, /requires_live:true/);
assert.match(index, /runMode==="live"\|\|!next\.requires_live/);
assert.match(index, /adaptive_probation:s\.adaptive_probation/);
assert.match(index, /probation_exit_hours:s\.probation_exit_hours/);
assert.match(index, /awaiting-probation-executable-exit/);
console.log(`offline runtime verified for Build ${build}`);
+10
View File
@@ -9,6 +9,7 @@ assert.equal(normalizeDatabaseUrl("DATABASE_URL=postgresql://user:pass@example.t
"postgresql://user:pass@example.test/db");
assert.equal(cycleVersion("2026-08-21T20|v59"), 59);
assert.equal(cycleVersion("2026-08-21T20:05|s62"), 62);
assert.equal(cycleVersion("2026-08-21T20:05|s63"), 63);
assert.equal(cycleVersion("2026-08-21T20:05"), 0);
const originalDatabaseUrl = process.env.DATABASE_URL;
@@ -62,6 +63,15 @@ assert.equal(compactedShock.shock_move_3h, 0.12);
assert.equal(compactedShock.shock_strategy_version, 3);
assert.equal(compactedShock.pilot_prior.modeled_cost_cents, 2);
const compactedProbation = compactSuggestion({
market_id: "probation:1", event_key: "event:probation", side: "YES", signal_type: "trend",
trade_ready: true, entry_candidate: true, adaptive_probation: true, probation_exit_hours: 6,
promoted_for_agents: ["momentum"], fee_schedule: { rate: 0.04, exponent: 1, takerOnly: true },
});
assert.equal(compactedProbation.adaptive_probation, true);
assert.equal(compactedProbation.probation_exit_hours, 6);
assert.deepEqual(compactedProbation.promoted_for_agents, ["momentum"]);
const compactedState = compactAgentState({
agents: { reversal: {
positions: [], closed: [], history: [], snapshots: [],