UAT: ProjectService missing link_resource/unlink_resource service methods — spec-required project-resource linking not in service layer #3699

Open
opened 2026-04-05 22:14:09 +00:00 by freemo · 0 comments
Owner

Bug Report

What Was Tested

src/cleveragents/application/services/project_service.py was analyzed against the spec requirements for agents project link-resource and agents project unlink-resource.

Expected Behavior (from spec)

The spec defines two commands (lines 2805+):

  • agents project link-resource <PROJECT> <RESOURCE> — associates a resource with a project
  • agents project unlink-resource <PROJECT> <RESOURCE> — removes the association

Per clean architecture (ADR-007), these operations should be implemented as service-layer methods on ProjectService:

  • link_resource(project_name: str, resource_id: str, read_only: bool = False, alias: str | None = None) -> NamespacedProject
  • unlink_resource(project_name: str, resource_id: str) -> NamespacedProject

The spec also requires that:

  • A resource can be linked to multiple projects
  • Deleting a project unlinks resources but does not delete them from the registry
  • The agents project show output includes linked_resources with read_only status and sandbox strategy

Actual Behavior (from code analysis)

ProjectService (494 lines) has NO link_resource or unlink_resource methods. The service only provides:

  • initialize_project / create_project
  • get_current_project
  • get_project_by_name
  • get_project_by_path
  • list_projects
  • update_project
  • update_file_filters
  • get_project_filters
  • delete_project

The NamespacedProject domain model (domain/models/core/project.py) does implement link_resource() and unlink_resource() as domain methods (lines 463-521), but these return new immutable instances — they are NOT persisted. There is no service method to persist these changes.

Impact

  • agents project link-resource and agents project unlink-resource CLI commands cannot delegate to a proper service method
  • Resource-project associations cannot be managed through the service layer
  • The spec-required linked_resources field in project output cannot be populated via the service
  • Multi-project plans (MultiProjectService) cannot properly resolve project-resource associations

Code Locations

  • Missing methods: src/cleveragents/application/services/project_service.py
  • Domain model with unpersisted link/unlink: src/cleveragents/domain/models/core/project.py lines 463-521
  • Spec reference: lines 2805-2847 (project link-resource), lines 2847+ (unlink-resource)

Steps to Reproduce

  1. Review ProjectService — no link_resource or unlink_resource methods exist
  2. Review NamespacedProject.link_resource() — returns a new model instance but has no persistence path through the service layer

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### What Was Tested `src/cleveragents/application/services/project_service.py` was analyzed against the spec requirements for `agents project link-resource` and `agents project unlink-resource`. ### Expected Behavior (from spec) The spec defines two commands (lines 2805+): - `agents project link-resource <PROJECT> <RESOURCE>` — associates a resource with a project - `agents project unlink-resource <PROJECT> <RESOURCE>` — removes the association Per clean architecture (ADR-007), these operations should be implemented as service-layer methods on `ProjectService`: - `link_resource(project_name: str, resource_id: str, read_only: bool = False, alias: str | None = None) -> NamespacedProject` - `unlink_resource(project_name: str, resource_id: str) -> NamespacedProject` The spec also requires that: - A resource can be linked to multiple projects - Deleting a project unlinks resources but does not delete them from the registry - The `agents project show` output includes `linked_resources` with `read_only` status and `sandbox` strategy ### Actual Behavior (from code analysis) `ProjectService` (494 lines) has NO `link_resource` or `unlink_resource` methods. The service only provides: - `initialize_project` / `create_project` - `get_current_project` - `get_project_by_name` - `get_project_by_path` - `list_projects` - `update_project` - `update_file_filters` - `get_project_filters` - `delete_project` The `NamespacedProject` domain model (`domain/models/core/project.py`) does implement `link_resource()` and `unlink_resource()` as domain methods (lines 463-521), but these return new immutable instances — they are NOT persisted. There is no service method to persist these changes. ### Impact - `agents project link-resource` and `agents project unlink-resource` CLI commands cannot delegate to a proper service method - Resource-project associations cannot be managed through the service layer - The spec-required `linked_resources` field in project output cannot be populated via the service - Multi-project plans (`MultiProjectService`) cannot properly resolve project-resource associations ### Code Locations - Missing methods: `src/cleveragents/application/services/project_service.py` - Domain model with unpersisted link/unlink: `src/cleveragents/domain/models/core/project.py` lines 463-521 - Spec reference: lines 2805-2847 (project link-resource), lines 2847+ (unlink-resource) ### Steps to Reproduce 1. Review `ProjectService` — no `link_resource` or `unlink_resource` methods exist 2. Review `NamespacedProject.link_resource()` — returns a new model instance but has no persistence path through the service layer --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
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.

Dependencies

No dependencies set.

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