Fix DC uptime always showing 100% despite rack failures
CI / build-and-push (push) Successful in 34s

Failed racks were removed from dc.racks in Phase 3 before uptime was
calculated in Phase 4, so healthyCount always equaled totalInDc. Now
counts racks in the repair pipeline as down capacity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 22:22:42 -04:00
parent f702a82539
commit d36d9d61a8
@@ -238,8 +238,9 @@ export function processInfrastructure(state: GameState): InfraTickResult {
let dcFlops = 0; let dcFlops = 0;
let usedPowerKW = 0; let usedPowerKW = 0;
const repairingForDc = rackPipeline.filter(o => o.dataCenterId === dc.id && o.stage === 'repair').length;
const healthyCount = dc.racks.length; const healthyCount = dc.racks.length;
const totalInDc = dc.racks.length; const totalInDc = dc.racks.length + repairingForDc;
for (const rack of dc.racks) { for (const rack of dc.racks) {
const sku = RACK_SKU_CONFIGS[rack.skuId]; const sku = RACK_SKU_CONFIGS[rack.skuId];