diff --git a/packages/core/src/live-agent-count.ts b/packages/core/src/live-agent-count.ts index 0a8659a263..5bf368a6e6 100644 --- a/packages/core/src/live-agent-count.ts +++ b/packages/core/src/live-agent-count.ts @@ -108,6 +108,22 @@ export function enrichRunningAgentTaskShape(tas } /** Attach the same traits from dashboard board-column flags without loading an IR. */ +/* +FNXC:ConcurrencyIndicators 2026-07-30-03:40 DELIBERATE-LITERAL: the no-enrichment fallback only. +Every literal below sits after a `??` or a `flags ? … :` — it is reached ONLY when the caller +supplied no trait flags and no enriched shape, which is the case the enrichers exist to remove. +There is nothing to resolve from in that state, so converting is not possible; the choice is only +between the known legacy answer and a different guess. + +That choice is not neutral here. Running and Waiting are COMPLEMENTS over the same rows, so a card +matching neither arm is reported as neither running nor waiting and the footer's queued total +silently under-reports it. Guessing "not WIP" or "not review" is therefore worse than the legacy id, +which at least matches every pre-rename board. + +The fix for a renamed board is at the CALLER — pass flags, or use `enrichRunningAgentTaskShape`, +which takes the IR and resolves every role by trait. Same reasoning as the marker above +`isLegacyPreImplementationColumn`, which this file already records. +*/ export function enrichRunningAgentTaskShapeFromFlags(task: T, flags?: Pick): T & Required> { return { ...task, @@ -137,6 +153,12 @@ function hasLiveWorkflowStepLease(task: RunningAgentTaskShape): boolean { return task.workflowStepResults?.some((result) => result.status === "pending") === true; } +/* +FNXC:ConcurrencyIndicators 2026-07-30-03:40 DELIBERATE-LITERAL: the no-enrichment fallback only. +Full rationale at the first marker of this name above (enrichRunningAgentTaskShapeFromFlags): these +legacy-id literals are the flag-less fallback the enrichers exist to remove; converting here would +guess, and a wrong guess under-reports the queued total. Fix at the CALLER by passing flags/IR. +*/ function terminalKind(task: RunningAgentTaskShape): ColumnTerminalKind { // Legacy literals are intentionally fixture-only degradation when workflow IR is unavailable. return task.columnTerminalKind ?? (task.column === "done" ? "complete" : task.column === "archived" ? "archived" : "none"); @@ -150,6 +172,12 @@ function terminalKind(task: RunningAgentTaskShape): ColumnTerminalKind { * A live `pending` workflow-step lease (e.g. an in-flight Code Review gate) * counts in any non-terminal column, since gate sessions run with null status. */ +/* +FNXC:ConcurrencyIndicators 2026-07-30-03:40 DELIBERATE-LITERAL: the no-enrichment fallback only. +Full rationale at the first marker of this name above (enrichRunningAgentTaskShapeFromFlags): these +legacy-id literals are the flag-less fallback the enrichers exist to remove; converting here would +guess, and a wrong guess under-reports the queued total. Fix at the CALLER by passing flags/IR. +*/ export function isRunningAgentTask(task: RunningAgentTaskShape): boolean { if (task.paused || task.userPaused || terminalKind(task) !== "none") return false; if (task.status === "planning") return true; diff --git a/scripts/lib/lifecycle-column-census-baseline.json b/scripts/lib/lifecycle-column-census-baseline.json index b0d9d84ec8..8f2ee876d3 100644 --- a/scripts/lib/lifecycle-column-census-baseline.json +++ b/scripts/lib/lifecycle-column-census-baseline.json @@ -8,7 +8,6 @@ "packages/core/src/task-store/async-comments-attachments.ts": 9, "packages/dashboard/app/components/TaskContextMenu.tsx": 9, "packages/dashboard/app/components/Column.tsx": 7, - "packages/core/src/live-agent-count.ts": 6, "packages/core/src/task-merge.ts": 6, "packages/dashboard/app/components/ListView.tsx": 6, "packages/dashboard/src/routes/register-task-workflow-routes.ts": 5, @@ -125,6 +124,8 @@ }, "deliberateByFile": { "packages/dashboard/src/reliability-metrics.ts\u0000in-review": 4, + "packages/core/src/live-agent-count.ts\u0000in-progress": 2, + "packages/core/src/live-agent-count.ts\u0000in-review": 2, "packages/dashboard/app/components/TaskCard.tsx\u0000triage": 2, "packages/dashboard/app/components/TaskDetailModal.tsx\u0000triage": 2, "packages/engine/src/scheduler.ts\u0000in-progress": 2, @@ -135,6 +136,8 @@ "packages/cli/src/commands/task.ts\u0000done": 1, "packages/cli/src/extension.ts\u0000archived": 1, "packages/cli/src/extension.ts\u0000done": 1, + "packages/core/src/live-agent-count.ts\u0000archived": 1, + "packages/core/src/live-agent-count.ts\u0000done": 1, "packages/core/src/task-store/task-store-helpers.ts\u0000in-progress": 1, "packages/core/src/task-store/task-store-helpers.ts\u0000todo": 1, "packages/dashboard/app/components/command-center/MissionControlPanel.tsx\u0000done": 1,