Refactor: Reduce length of decision.py #4157

Closed
opened 2026-04-06 12:00:23 +00:00 by freemo · 1 comment
Owner

The src/cleveragents/domain/models/core/decision.py file has been identified as violating the 500-line limit guideline.

Issues:

The file is over 500 lines long, which makes it difficult to read and maintain. It contains a significant number of data models, enums, and constants related to the decision tree subsystem.

Recommendation:

Refactor the decision.py file by splitting it into smaller, more focused modules. For example:

  • Keep the main Decision model in src/cleveragents/domain/models/core/decision.py.
  • Move the enums (DecisionType) and constants (STRATEGIZE_TYPES, EXECUTE_TYPES) to src/cleveragents/domain/models/core/enums.py or a new decision_enums.py file.
  • Move the other data models (ResourceRef, ArtifactRef, ContextSnapshot) to their own files within the core directory.

This refactoring will improve the modularity and readability of the decision-related models.


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

The `src/cleveragents/domain/models/core/decision.py` file has been identified as violating the 500-line limit guideline. **Issues:** The file is over 500 lines long, which makes it difficult to read and maintain. It contains a significant number of data models, enums, and constants related to the decision tree subsystem. **Recommendation:** Refactor the `decision.py` file by splitting it into smaller, more focused modules. For example: * Keep the main `Decision` model in `src/cleveragents/domain/models/core/decision.py`. * Move the enums (`DecisionType`) and constants (`STRATEGIZE_TYPES`, `EXECUTE_TYPES`) to `src/cleveragents/domain/models/core/enums.py` or a new `decision_enums.py` file. * Move the other data models (`ResourceRef`, `ArtifactRef`, `ContextSnapshot`) to their own files within the `core` directory. This refactoring will improve the modularity and readability of the decision-related models. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
Author
Owner

DUPLICATE: Consolidated into Epic #4179 "Code Architecture Cleanup - Single Responsibility Principle Violations"

This refactoring task for reducing the length of decision.py is part of the broader architectural cleanup effort. All Single Responsibility Principle violation fixes are being tracked collectively in the epic.

Action: Closing as duplicate in favor of Epic #4179

**DUPLICATE**: Consolidated into Epic #4179 "Code Architecture Cleanup - Single Responsibility Principle Violations" This refactoring task for reducing the length of `decision.py` is part of the broader architectural cleanup effort. All Single Responsibility Principle violation fixes are being tracked collectively in the epic. **Action**: Closing as duplicate in favor of Epic #4179
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#4157
No description provided.