Skip to content

Commit 53ae32a

Browse files
nikolasdehorclaude
andcommitted
fix: filter completedEpics to exclude on-demand epics (progress >100% fix)
Addresses Copilot review feedback: completedEpics was counting ALL epics (including on-demand) while totalEpics excluded on-demand. This could cause progress to be inaccurate or exceed 100% when an on-demand epic completes. Fix: use Object.entries() + filter by !EPIC_CONFIG[num]?.onDemand in both _calculateProgressFromState() and getProgressPercentage(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0e168c commit 53ae32a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.aios-core/core/orchestration/master-orchestrator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,8 +1357,8 @@ class MasterOrchestrator extends EventEmitter {
13571357
const totalEpics = Object.keys(EPIC_CONFIG).filter((num) => !EPIC_CONFIG[num].onDemand).length;
13581358
if (totalEpics === 0) return 0;
13591359

1360-
const completedEpics = Object.values(state.epics).filter(
1361-
(epic) => epic.status === EpicStatus.COMPLETED,
1360+
const completedEpics = Object.entries(state.epics).filter(
1361+
([num, epic]) => epic.status === EpicStatus.COMPLETED && !EPIC_CONFIG[num]?.onDemand,
13621362
).length;
13631363

13641364
return Math.round((completedEpics / totalEpics) * 100);
@@ -1414,8 +1414,8 @@ class MasterOrchestrator extends EventEmitter {
14141414
const totalEpics = Object.keys(EPIC_CONFIG).filter((num) => !EPIC_CONFIG[num].onDemand).length;
14151415
if (totalEpics === 0) return 0;
14161416

1417-
const completedEpics = Object.values(this.executionState.epics).filter(
1418-
(epic) => epic.status === EpicStatus.COMPLETED,
1417+
const completedEpics = Object.entries(this.executionState.epics).filter(
1418+
([num, epic]) => epic.status === EpicStatus.COMPLETED && !EPIC_CONFIG[num]?.onDemand,
14191419
).length;
14201420

14211421
return Math.round((completedEpics / totalEpics) * 100);

0 commit comments

Comments
 (0)