Add audited adaptive resolution-window pilot

This commit is contained in:
Theodore Song
2026-08-21 18:56:58 -04:00
parent b956f50cbe
commit c0ce373833
9 changed files with 376 additions and 31 deletions
+12 -2
View File
@@ -6,9 +6,10 @@ 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 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"));
const build = Number(index.match(/const BUILD_VERSION = (\d+);/)?.[1]);
assert.equal(build, 95);
assert.equal(build, 96);
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\]\)/);
@@ -25,8 +26,17 @@ assert.match(api, /Buffer\.from\(file\.content/);
assert.match(api, /searchParams\.set\("runtime", `\$\{Date\.now\(\)\}/);
assert.match(workflow, /cron: "7,22,37,52 \* \* \* \*"/);
assert.match(workflow, /contents: write/);
assert.match(workflow, /EXPECTED_BUILD: "95"/);
assert.match(workflow, /EXPECTED_BUILD: "96"/);
assert.match(runner, /MAX_STATE_BYTES = 900_000/);
assert.equal(resolutionAudit.strategy, "resolution-window-no-50-55");
assert.deepEqual(resolutionAudit.selection.horizon_days_enabled, [3, 7]);
assert.ok(resolutionAudit.rules["3_day"].train_event_lower_90 > 0);
assert.ok(resolutionAudit.rules["3_day"].holdout_event_lower_90 > 0);
assert.ok(resolutionAudit.rules["3_day"].chronological_thirds_event_lower_90.every((value) => value > 0));
assert.ok(resolutionAudit.rules["7_day"].train_event_lower_90 > 0);
assert.ok(resolutionAudit.rules["7_day"].holdout_event_lower_90 > 0);
assert.ok(resolutionAudit.rules["7_day"].chronological_thirds_event_lower_90.every((value) => value > 0));
assert.ok(resolutionAudit.rejected_neighboring_rule.event_lower_90 < 0);
const agentIds = ["value", "momentum", "favorite", "longshot", "diversifier", "catalyst", "reversal", "breakout", "tailalpha", "conviction"];
const agents = Object.fromEntries(agentIds.map(id => [id, { cash: 10000, positions: [], lastDecision: { mode: "test" } }]));