Refactor: Separate business logic from data models in domain/models/core #3905

Open
opened 2026-04-06 07:19:58 +00:00 by freemo · 0 comments
Owner

The src/cleveragents/domain/models/core directory contains a number of files that violate the Single Responsibility Principle by mixing data models with business logic (e.g., resolvers, builders, serializers, policies, and helper functions).

Affected Files (so far):

  • src/cleveragents/domain/models/core/definition_of_done.py
  • src/cleveragents/domain/models/core/diff_review.py
  • src/cleveragents/domain/models/core/error_recovery.py
  • src/cleveragents/domain/models/core/multi_project.py
  • src/cleveragents/domain/models/core/safety_profile.py
  • src/cleveragents/domain/models/core/async_job.py

Recommendation:

A concerted effort should be made to refactor the files in the domain/models/core directory to ensure that they contain only data models. Any business logic, such as resolvers, builders, serializers, policies, and helper functions, should be moved to the appropriate layer of the application (e.g., application/services, application/utils, etc.).

This will improve the overall architecture of the application, making it more modular, maintainable, and testable.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: ca-architecture-guard

The `src/cleveragents/domain/models/core` directory contains a number of files that violate the Single Responsibility Principle by mixing data models with business logic (e.g., resolvers, builders, serializers, policies, and helper functions). **Affected Files (so far):** * `src/cleveragents/domain/models/core/definition_of_done.py` * `src/cleveragents/domain/models/core/diff_review.py` * `src/cleveragents/domain/models/core/error_recovery.py` * `src/cleveragents/domain/models/core/multi_project.py` * `src/cleveragents/domain/models/core/safety_profile.py` * `src/cleveragents/domain/models/core/async_job.py` **Recommendation:** A concerted effort should be made to refactor the files in the `domain/models/core` directory to ensure that they contain only data models. Any business logic, such as resolvers, builders, serializers, policies, and helper functions, should be moved to the appropriate layer of the application (e.g., `application/services`, `application/utils`, etc.). This will improve the overall architecture of the application, making it more modular, maintainable, and testable. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
freemo added the
Points
5
label 2026-04-06 07:26:27 +00:00
Sign in to join this conversation.
No Label
Points
5
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#3905