UAT: SkillService.get_dependents() always returns empty actors list — spec requires actor dependency tracking #2824

Open
opened 2026-04-04 20:41:24 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/skill-get-dependents-actor-tracking
  • Commit Message: fix(skills): query actor registry in get_dependents() to return actors referencing a skill
  • Milestone: v3.7.0
  • Parent Epic: #392

Bug Report

Feature Area

Tool & Skill Abstraction — agents skill add --update / agents skill remove CLI commands / SkillService.get_dependents()

What Was Tested

The SkillService.get_dependents() method in src/cleveragents/application/services/skill_service.py was analyzed against the specification's requirements for skill dependency tracking and actor reference warnings.

Expected Behavior (from spec)

The specification (docs/specification.md, lines 6613–6618 and 6750–6840) explicitly requires that when a skill is updated or removed, the system must warn about actors that reference the skill.

For agents skill add --update:

╭─ Affected Actors ─────────────────────────────╮
│ Warning: 2 actors reference this skill:       │
│ - local/code-assistant                        │
│ - local/full-stack-assistant                  │
│ These actors will pick up changes on next use │
╰───────────────────────────────────────────────╯

For agents skill remove:

│ Warning: 2 actors reference this skill:            │
│ - local/code-assistant                             │
│ - local/full-stack-assistant                       │

The get_dependents() method is supposed to return both skills (skills that include this skill) AND actors (actors that reference this skill).

Actual Behavior (from code analysis)

The SkillService.get_dependents() method (src/cleveragents/application/services/skill_service.py, lines 251–265) always returns an empty list for actors:

def get_dependents(self, name: str) -> dict[str, list[str]]:
    """Find skills and actors that reference a given skill."""
    dependent_skills: list[str] = []
    for sname, skill in self._skills.items():
        if sname == name:
            continue
        for inc in skill.includes:
            if inc.name == name:
                dependent_skills.append(sname)
                break
    return {"skills": dependent_skills, "actors": []}  # actors is ALWAYS empty!

The method correctly finds skills that include the target skill, but never queries the actor registry to find actors that reference the skill via their skills: field in their YAML configuration. This means:

  1. agents skill add --update never shows "Affected Actors" warnings even when actors reference the skill
  2. agents skill remove never shows actor dependency warnings
  3. The spec-required cascading impact warnings are silently suppressed
  4. Operators have no visibility into which actors will be affected by skill changes

Code Location

  • File: src/cleveragents/application/services/skill_service.py
  • Method: SkillService.get_dependents()
  • Lines: 251–265

Also Affected

  • src/cleveragents/cli/commands/skill.py_print_skill_update_changes() and remove() both call get_dependents() and display the (always-empty) actors list

Steps to Reproduce

  1. Register a skill: agents skill add --config my-skill.yaml
  2. Register an actor that references the skill via skills: [my-skill-name] in its YAML
  3. Update the skill: agents skill add --config my-skill.yaml --update
  4. Observe: No "Affected Actors" panel is shown, even though an actor references the skill
  5. Expected: "Warning: 1 actor references this skill" should appear

Severity

High — This is a functional gap where operators cannot see which actors will be affected by skill changes, violating the spec's explicit requirement for actor dependency tracking. This could lead to silent breakage of actor configurations when skills are modified or removed.

Subtasks

  • Inject or access the actor registry within SkillService (via constructor DI or service locator)
  • Implement actor dependency scanning in get_dependents(): iterate all registered actors and check if any reference the target skill name in their skills: list
  • Return the populated actors list alongside skills in the return dict
  • Verify _print_skill_update_changes() in skill.py correctly renders the "Affected Actors" panel when the list is non-empty
  • Verify remove() in skill.py correctly renders actor dependency warnings when the list is non-empty
  • Add Behave BDD unit test scenarios covering: actor referencing skill shows in get_dependents(), actor not referencing skill is absent, empty actor registry returns empty list
  • Add/update Robot Framework integration test for agents skill add --update showing "Affected Actors" panel
  • Add/update Robot Framework integration test for agents skill remove showing actor dependency warning
  • Ensure all nox stages pass

Definition of Done

  • SkillService.get_dependents() queries the actor registry and returns all actors that reference the target skill in their skills: configuration
  • agents skill add --update renders the spec-required "Affected Actors" panel when one or more actors reference the updated skill
  • agents skill remove renders the spec-required actor dependency warning when one or more actors reference the skill being removed
  • Behave BDD scenarios cover the actor dependency tracking logic with ≥3 scenarios (actor present, actor absent, empty registry)
  • Robot Framework integration tests validate the CLI output panels end-to-end
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/skill-get-dependents-actor-tracking` - **Commit Message**: `fix(skills): query actor registry in get_dependents() to return actors referencing a skill` - **Milestone**: v3.7.0 - **Parent Epic**: #392 ## Bug Report ### Feature Area Tool & Skill Abstraction — `agents skill add --update` / `agents skill remove` CLI commands / `SkillService.get_dependents()` ### What Was Tested The `SkillService.get_dependents()` method in `src/cleveragents/application/services/skill_service.py` was analyzed against the specification's requirements for skill dependency tracking and actor reference warnings. ### Expected Behavior (from spec) The specification (`docs/specification.md`, lines 6613–6618 and 6750–6840) explicitly requires that when a skill is updated or removed, the system must warn about actors that reference the skill. For `agents skill add --update`: ``` ╭─ Affected Actors ─────────────────────────────╮ │ Warning: 2 actors reference this skill: │ │ - local/code-assistant │ │ - local/full-stack-assistant │ │ These actors will pick up changes on next use │ ╰───────────────────────────────────────────────╯ ``` For `agents skill remove`: ``` │ Warning: 2 actors reference this skill: │ │ - local/code-assistant │ │ - local/full-stack-assistant │ ``` The `get_dependents()` method is supposed to return both `skills` (skills that include this skill) AND `actors` (actors that reference this skill). ### Actual Behavior (from code analysis) The `SkillService.get_dependents()` method (`src/cleveragents/application/services/skill_service.py`, lines 251–265) **always returns an empty list for actors**: ```python def get_dependents(self, name: str) -> dict[str, list[str]]: """Find skills and actors that reference a given skill.""" dependent_skills: list[str] = [] for sname, skill in self._skills.items(): if sname == name: continue for inc in skill.includes: if inc.name == name: dependent_skills.append(sname) break return {"skills": dependent_skills, "actors": []} # actors is ALWAYS empty! ``` The method correctly finds skills that include the target skill, but **never queries the actor registry** to find actors that reference the skill via their `skills:` field in their YAML configuration. This means: 1. `agents skill add --update` never shows "Affected Actors" warnings even when actors reference the skill 2. `agents skill remove` never shows actor dependency warnings 3. The spec-required cascading impact warnings are silently suppressed 4. Operators have no visibility into which actors will be affected by skill changes ### Code Location - **File**: `src/cleveragents/application/services/skill_service.py` - **Method**: `SkillService.get_dependents()` - **Lines**: 251–265 ### Also Affected - `src/cleveragents/cli/commands/skill.py` — `_print_skill_update_changes()` and `remove()` both call `get_dependents()` and display the (always-empty) actors list ### Steps to Reproduce 1. Register a skill: `agents skill add --config my-skill.yaml` 2. Register an actor that references the skill via `skills: [my-skill-name]` in its YAML 3. Update the skill: `agents skill add --config my-skill.yaml --update` 4. Observe: No "Affected Actors" panel is shown, even though an actor references the skill 5. Expected: "Warning: 1 actor references this skill" should appear ### Severity **High** — This is a functional gap where operators cannot see which actors will be affected by skill changes, violating the spec's explicit requirement for actor dependency tracking. This could lead to silent breakage of actor configurations when skills are modified or removed. ## Subtasks - [ ] Inject or access the actor registry within `SkillService` (via constructor DI or service locator) - [ ] Implement actor dependency scanning in `get_dependents()`: iterate all registered actors and check if any reference the target skill name in their `skills:` list - [ ] Return the populated `actors` list alongside `skills` in the return dict - [ ] Verify `_print_skill_update_changes()` in `skill.py` correctly renders the "Affected Actors" panel when the list is non-empty - [ ] Verify `remove()` in `skill.py` correctly renders actor dependency warnings when the list is non-empty - [ ] Add Behave BDD unit test scenarios covering: actor referencing skill shows in `get_dependents()`, actor not referencing skill is absent, empty actor registry returns empty list - [ ] Add/update Robot Framework integration test for `agents skill add --update` showing "Affected Actors" panel - [ ] Add/update Robot Framework integration test for `agents skill remove` showing actor dependency warning - [ ] Ensure all nox stages pass ## Definition of Done - [ ] `SkillService.get_dependents()` queries the actor registry and returns all actors that reference the target skill in their `skills:` configuration - [ ] `agents skill add --update` renders the spec-required "Affected Actors" panel when one or more actors reference the updated skill - [ ] `agents skill remove` renders the spec-required actor dependency warning when one or more actors reference the skill being removed - [ ] Behave BDD scenarios cover the actor dependency tracking logic with ≥3 scenarios (actor present, actor absent, empty registry) - [ ] Robot Framework integration tests validate the CLI output panels end-to-end - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-04 20:41:29 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-07 00:42:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2824
No description provided.