UAT: SkillService.get_dependents() always returns empty actors list — actor-skill associations not tracked #3805

Open
opened 2026-04-06 06:28:29 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/skill-service-get-dependents-actor-tracking
  • Commit Message: fix(skill): track actor-skill associations in SkillService.get_dependents()
  • Milestone: Backlog (no milestone — see backlog note below)
  • Parent Epic: #392

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

During UAT testing of the Skill System CLI commands, SkillService.get_dependents() was found to always return an empty actors list. This means that agents skill remove and agents skill add --update never display actor dependency warnings, even when actors actively reference the skill being removed or updated.

According to docs/specification.md, the agents skill remove command should warn users when actors reference the skill being removed, and agents skill add --update should display an "Affected Actors" panel. Neither of these behaviors is possible while get_dependents() hardcodes actors to [].

What Was Tested

The SkillService.get_dependents() method and the CLI commands agents skill remove and agents skill add --update which display dependency warnings.

Expected Behavior (from spec)

According to docs/specification.md (agents skill remove section), when removing a skill that is referenced by actors, the output should show:

Warning: 2 actors reference this skill:
- local/my-actor
- local/other-actor

Similarly, agents skill add --update should show an "Affected Actors" panel listing actors that reference the skill being updated.

Actual Behavior

SkillService.get_dependents() in src/cleveragents/application/services/skill_service.py always returns an empty actors list:

def get_dependents(self, name: str) -> dict[str, list[str]]:
    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 always empty!

The actors list is hardcoded to []. There is no mechanism to track which actors reference which skills.

Impact

  • agents skill remove never shows actor dependency warnings even when actors reference the skill
  • agents skill add --update never shows the "Affected Actors" panel
  • Users can remove skills that are actively used by actors without any warning

Code Location

  • src/cleveragents/application/services/skill_service.pyget_dependents() method (line ~251)
  • src/cleveragents/cli/commands/skill.pyremove() and add() commands that call get_dependents()

Steps to Reproduce

from cleveragents.application.services.skill_service import SkillService
from cleveragents.skills.schema import SkillConfigSchema

svc = SkillService()
config = SkillConfigSchema.from_yaml('name: local/test\ndescription: Test')
svc.add_skill(config)

dependents = svc.get_dependents('local/test')
print(dependents['actors'])  # Always []

Subtasks

  • Investigate how actor-skill associations are (or should be) stored — check ActorService, actor YAML config schema, and agents actor run --skill flag
  • Add actor-skill association tracking to SkillService (or inject ActorService dependency to query associations at call time)
  • Update get_dependents() to query and return the actual list of actor names that reference the given skill
  • Update agents skill remove CLI command to display actor dependency warnings when get_dependents()['actors'] is non-empty
  • Update agents skill add --update CLI command to display "Affected Actors" panel when get_dependents()['actors'] is non-empty
  • Tests (Behave): Add scenarios covering agents skill remove with actor dependencies present
  • Tests (Behave): Add scenarios covering agents skill add --update with actor dependencies present
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • SkillService.get_dependents() returns the correct list of actor names that reference the given skill.
  • agents skill remove displays actor dependency warnings when actors reference the skill.
  • agents skill add --update displays the "Affected Actors" panel when actors reference the skill.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/skill-service-get-dependents-actor-tracking` - **Commit Message**: `fix(skill): track actor-skill associations in SkillService.get_dependents()` - **Milestone**: Backlog (no milestone — see backlog note below) - **Parent Epic**: #392 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context During UAT testing of the Skill System CLI commands, `SkillService.get_dependents()` was found to always return an empty `actors` list. This means that `agents skill remove` and `agents skill add --update` never display actor dependency warnings, even when actors actively reference the skill being removed or updated. According to `docs/specification.md`, the `agents skill remove` command should warn users when actors reference the skill being removed, and `agents skill add --update` should display an "Affected Actors" panel. Neither of these behaviors is possible while `get_dependents()` hardcodes `actors` to `[]`. ## What Was Tested The `SkillService.get_dependents()` method and the CLI commands `agents skill remove` and `agents skill add --update` which display dependency warnings. ## Expected Behavior (from spec) According to `docs/specification.md` (agents skill remove section), when removing a skill that is referenced by actors, the output should show: ``` Warning: 2 actors reference this skill: - local/my-actor - local/other-actor ``` Similarly, `agents skill add --update` should show an "Affected Actors" panel listing actors that reference the skill being updated. ## Actual Behavior `SkillService.get_dependents()` in `src/cleveragents/application/services/skill_service.py` always returns an empty `actors` list: ```python def get_dependents(self, name: str) -> dict[str, list[str]]: 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 always empty! ``` The `actors` list is hardcoded to `[]`. There is no mechanism to track which actors reference which skills. ## Impact - `agents skill remove` never shows actor dependency warnings even when actors reference the skill - `agents skill add --update` never shows the "Affected Actors" panel - Users can remove skills that are actively used by actors without any warning ## Code Location - `src/cleveragents/application/services/skill_service.py` — `get_dependents()` method (line ~251) - `src/cleveragents/cli/commands/skill.py` — `remove()` and `add()` commands that call `get_dependents()` ## Steps to Reproduce ```python from cleveragents.application.services.skill_service import SkillService from cleveragents.skills.schema import SkillConfigSchema svc = SkillService() config = SkillConfigSchema.from_yaml('name: local/test\ndescription: Test') svc.add_skill(config) dependents = svc.get_dependents('local/test') print(dependents['actors']) # Always [] ``` ## Subtasks - [ ] Investigate how actor-skill associations are (or should be) stored — check `ActorService`, actor YAML config schema, and `agents actor run --skill` flag - [ ] Add actor-skill association tracking to `SkillService` (or inject `ActorService` dependency to query associations at call time) - [ ] Update `get_dependents()` to query and return the actual list of actor names that reference the given skill - [ ] Update `agents skill remove` CLI command to display actor dependency warnings when `get_dependents()['actors']` is non-empty - [ ] Update `agents skill add --update` CLI command to display "Affected Actors" panel when `get_dependents()['actors']` is non-empty - [ ] Tests (Behave): Add scenarios covering `agents skill remove` with actor dependencies present - [ ] Tests (Behave): Add scenarios covering `agents skill add --update` with actor dependencies present - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - `SkillService.get_dependents()` returns the correct list of actor names that reference the given skill. - `agents skill remove` displays actor dependency warnings when actors reference the skill. - `agents skill add --update` displays the "Affected Actors" panel when actors reference the skill. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3805
No description provided.