Refactor: Decompose definition_of_done.py into smaller modules #3894

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

The src/cleveragents/domain/models/core/definition_of_done.py file has been identified as a violation of the Single Responsibility Principle.

Issues:

The file mixes several distinct concerns:

  1. Data Models: DoDCriterion, DoDResult, and DoDSummary.
  2. Abstract Interface: DoDEvaluator.
  3. Concrete Implementation: TextMatchEvaluator.
  4. Helper Functions: render_dod_template and parse_dod_criteria.

Recommendation:

Refactor the definition_of_done.py file by splitting it into smaller, more focused modules:

  • Move the data models (DoDCriterion, DoDResult, DoDSummary) to a new file within src/cleveragents/domain/models/core/.
  • Move the DoDEvaluator protocol and the TextMatchEvaluator implementation to the src/cleveragents/application layer, possibly in a new validation or dod package.
  • Move the helper functions (render_dod_template, parse_dod_criteria) to a utils or helpers module.

This refactoring will improve the modularity, maintainability, and testability of the Definition of Done functionality.


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

The `src/cleveragents/domain/models/core/definition_of_done.py` file has been identified as a violation of the Single Responsibility Principle. **Issues:** The file mixes several distinct concerns: 1. **Data Models:** `DoDCriterion`, `DoDResult`, and `DoDSummary`. 2. **Abstract Interface:** `DoDEvaluator`. 3. **Concrete Implementation:** `TextMatchEvaluator`. 4. **Helper Functions:** `render_dod_template` and `parse_dod_criteria`. **Recommendation:** Refactor the `definition_of_done.py` file by splitting it into smaller, more focused modules: * Move the data models (`DoDCriterion`, `DoDResult`, `DoDSummary`) to a new file within `src/cleveragents/domain/models/core/`. * Move the `DoDEvaluator` protocol and the `TextMatchEvaluator` implementation to the `src/cleveragents/application` layer, possibly in a new `validation` or `dod` package. * Move the helper functions (`render_dod_template`, `parse_dod_criteria`) to a `utils` or `helpers` module. This refactoring will improve the modularity, maintainability, and testability of the Definition of Done functionality. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
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#3894
No description provided.