Strategy modes: Accelerate / Pocket-a-% / Park-and-collect — one selector drives engine (pocketPct + parked terminals), table, timeline, chart, Year-1, summary cards, share URL, and single-path plan text (dual narrative removed). Tests cover all three modes.

This commit is contained in:
Claude (via Marty)
2026-07-30 22:43:03 +00:00
parent e2caf73c19
commit ee13321067
2 changed files with 171 additions and 82 deletions
+24
View File
@@ -110,5 +110,29 @@ console.log("6) timeline months advance ~19d per cycle (not 1 month per cycle):"
last.m === Math.ceil(cycles * 19 / 30.4), `rows=${cycles}`);
}
console.log("7) strategy modes:");
{
const phases = getPhaseSequence(0);
const accel = computePlan(phases);
const pk50 = computePlan(phases, 50);
const pk75 = computePlan(phases, 75);
let stretched = true, finite = true;
for (const k of phases) {
if (k === "3xL7") continue;
if (pk50[k].cycles < accel[k].cycles) stretched = false;
if (pk75[k].cycles >= 500) finite = false;
}
check("pocket 50% stretches every phase (or equal)", stretched);
check("pocket 75% still finite everywhere", finite);
check(`pocket 50% L1: ${pk50["L1-only"].cycles} > accel ${accel["L1-only"].cycles}`, pk50["L1-only"].cycles > accel["L1-only"].cycles);
const parked = computePlan(["L4+L3"]);
check("park at L4+L3: terminal flagged parked", parked["L4+L3"] && parked["L4+L3"].parked === true);
const y = estimateYear1Cum(["L4+L3"], 10, 0);
// parked from day one: floor(365/19)=19 cycles x $58.32
check(`parked-terminal year1 = ${y}`, y === Math.round(19 * 58.32), `want ${Math.round(19 * 58.32)}`);
const tl = buildMonthlyTimeline(["L4+L3"], 10);
check("parked timeline runs 10 collection cycles", tl.length === 10);
}
console.log(failures === 0 ? "\nALL PASS" : `\n${failures} FAILURE(S)`);
process.exit(failures === 0 ? 0 : 1);