FN-7160: unify live agent counts and fix use markers
Unifies running-agent slot accounting across engine, CLI, and dashboard surfaces.
- Add shared core helpers for identifying and counting active top-level agent tasks, including in-review reviewer, merger, fix, and PR merge states.
- Reuse the shared count in engine semaphore repair, project health displays, and dashboard project-store routes.
- Correct Command Center utilization markers to use a zero-based active/cap ratio.
- Cover the shared predicate and affected CLI, dashboard, and engine behaviors with regression tests.
Files changed:
.changeset/fn-7160-running-agent-count.md | 7 ++++
docs/dashboard-guide.md | 2 +-
.../cli/src/commands/__tests__/project.test.ts | 40 ++++++++++++++----
packages/cli/src/commands/project.ts | 15 +++----
.../core/src/__tests__/live-agent-count.test.ts | 47 ++++++++++++++++++++++
packages/core/src/index.ts | 2 +
packages/core/src/live-agent-count.ts | 30 ++++++++++++++
packages/core/src/types.ts | 2 +-
.../command-center/CommandCenterControls.tsx | 14 ++++---
.../__tests__/CommandCenterControls.test.tsx | 22 +++++++++-
.../dashboard/src/__tests__/project-routes.test.ts | 31 +++++++++-----
.../src/__tests__/project-store-resolver.test.ts | 20 ++++++---
packages/dashboard/src/project-store-resolver.ts | 9 ++---
.../src/routes/register-project-routes.ts | 7 ++--
packages/engine/src/__tests__/concurrency.test.ts | 18 +++++++++
packages/engine/src/concurrency.ts | 12 +++---
16 files changed, 220 insertions(+), 58 deletions(-)
Fusion-Task-Id: FN-7160
Fusion-Task-Lineage: f48332f8-ac5d-46eb-b975-d2f6c880ddd5
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>