Describe the bug
copy_skill_to_target() accepts user_scope but when targets is None,
it falls back to active_targets(target_base) which performs project-scope
auto-detection. A caller passing user_scope=True without explicit targets
would select project-scope roots instead of user-scope roots.
To Reproduce
- Call
skill_integrator.copy_skill_to_target(...) with user_scope=True
and targets=None
- The method calls
active_targets() which scans project-scope directories
- Deployment uses
root_dir instead of user_root_dir
Expected behavior
When user_scope=True and targets=None, the method should resolve
user-scope targets (e.g. via a active_targets_user_scope() helper or by
requiring explicit targets when user_scope=True).
Environment (please complete the following information):
- OS: All (code-level bug, not platform-specific)
- Python Version: 3.12
- APM Version: 0.8.9
- Affected file:
src/apm_cli/integration/skill_integrator.py (line ~253)
Logs
N/A -- code-level logic issue, no runtime error logs.
Additional context
Currently low risk because the install path in install.py always passes
explicit targets. Flagged during Copilot review of #537. Options:
- Add an
active_targets_user_scope() fallback
- Raise
ValueError when user_scope=True and targets=None
- Document that callers must pass explicit targets at user scope
Related: #537, #530
Describe the bug
copy_skill_to_target()acceptsuser_scopebut whentargetsisNone,it falls back to
active_targets(target_base)which performs project-scopeauto-detection. A caller passing
user_scope=Truewithout explicittargetswould select project-scope roots instead of user-scope roots.
To Reproduce
skill_integrator.copy_skill_to_target(...)withuser_scope=Trueand
targets=Noneactive_targets()which scans project-scope directoriesroot_dirinstead ofuser_root_dirExpected behavior
When
user_scope=Trueandtargets=None, the method should resolveuser-scope targets (e.g. via a
active_targets_user_scope()helper or byrequiring explicit targets when
user_scope=True).Environment (please complete the following information):
src/apm_cli/integration/skill_integrator.py(line ~253)Logs
N/A -- code-level logic issue, no runtime error logs.
Additional context
Currently low risk because the install path in
install.pyalways passesexplicit
targets. Flagged during Copilot review of #537. Options:active_targets_user_scope()fallbackValueErrorwhenuser_scope=Trueandtargets=NoneRelated: #537, #530