fix(cli): compute real impact counts in agents actor remove command #3463

Merged
freemo merged 1 commits from fix/actor-remove-impact-computation into master 2026-04-05 18:18:08 +00:00

1 Commits

Author SHA1 Message Date
freemo 294b49bc72 fix(cli): compute real impact counts in agents actor remove command
CI / lint (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 53s
CI / security (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 26s
CI / unit_tests (pull_request) Failing after 6m41s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 18m37s
CI / integration_tests (pull_request) Successful in 23m9s
CI / coverage (pull_request) Successful in 11m18s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m21s
Replaces hardcoded 0 values in the Impact panel of `agents actor remove`
with real DB-backed counts:

- Sessions: counts sessions whose `actor_name` matches the removed actor
- Active Plans: counts lifecycle plans in queued/processing state that
  reference the actor via `strategy_actor` or `execution_actor`
- Actions Referencing: counts actions that reference the actor in any
  actor field (strategy, execution, review, apply, estimation, invariant)

The new `_compute_actor_impact()` helper queries each subsystem via the
DI container and returns (session_count, active_plan_count, action_count).
All queries are wrapped in broad exception handlers so that DB unavailability
never blocks the removal itself.

Adds a BDD feature file and step definitions that verify the Impact panel
shows real non-zero counts when the actor is referenced, and zero counts
when it is not.

Removes the misleading comment about 'conservative estimates'.

ISSUES CLOSED: #3420
2026-04-05 17:58:16 +00:00