[AUTO-GUARD-1][Type/Refactor] Eliminate type: ignore usage in domain core models #8213

Closed
opened 2026-04-13 04:37:20 +00:00 by HAL9000 · 2 comments
Owner

[AUTO-GUARD-1]

Summary

  • Domain layer models still rely on type: ignore suppressions, violating the rule that forbids type error suppression.
  • The offenders include @computed_field # type: ignore[prop-decorator] in src/cleveragents/domain/models/core/multi_project.py and default_factory=lambda: ProjectSettings() # type: ignore[arg-type] in src/cleveragents/domain/models/core/project_legacy.py.

Evidence

  • CONTRIBUTING.md — "No type: ignore: Type error suppression is forbidden."
  • src/cleveragents/domain/models/core/multi_project.py line 178 and project_legacy.py line 75 both contain inline type: ignore comments, confirmed via grep.
  • These files live in the domain layer, so the suppression immediately breaks the clean architecture typing guarantees.

Impact

  • Masks real typing issues in core models, reducing confidence in static analysis for plan metadata and legacy project handling.
  • Encourages future contributors to depend on suppression instead of resolving typing gaps, increasing architectural drift.

Recommendation

  • Adjust the computed field declaration to avoid the type: ignore[prop-decorator] (e.g., annotate the property using the supported Pydantic v2 @computed_field signature or convert to a standard property returning an int).
  • Update the Project model default factory to supply a properly typed callable (e.g., default_factory=ProjectSettings or a helper function) instead of suppressing the arg-type check.
  • Run mypy/pyright on the domain package to ensure no additional suppressions are introduced.

Duplicate Check

  • Searched for existing tickets mentioning multi_project.py and type: ignore; none found.
  • Known violations list does not cover domain model suppressions.

Label note: unable to apply Type/Refactor label directly due to label ID restrictions; please add when triaging.

[AUTO-GUARD-1] ## Summary - Domain layer models still rely on type: ignore suppressions, violating the rule that forbids type error suppression. - The offenders include `@computed_field # type: ignore[prop-decorator]` in src/cleveragents/domain/models/core/multi_project.py and `default_factory=lambda: ProjectSettings() # type: ignore[arg-type]` in src/cleveragents/domain/models/core/project_legacy.py. ## Evidence - CONTRIBUTING.md — "No `type: ignore`: Type error suppression is forbidden." - src/cleveragents/domain/models/core/multi_project.py line 178 and project_legacy.py line 75 both contain inline `type: ignore` comments, confirmed via `grep`. - These files live in the domain layer, so the suppression immediately breaks the clean architecture typing guarantees. ## Impact - Masks real typing issues in core models, reducing confidence in static analysis for plan metadata and legacy project handling. - Encourages future contributors to depend on suppression instead of resolving typing gaps, increasing architectural drift. ## Recommendation - Adjust the computed field declaration to avoid the `type: ignore[prop-decorator]` (e.g., annotate the property using the supported Pydantic v2 `@computed_field` signature or convert to a standard property returning an int). - Update the `Project` model default factory to supply a properly typed callable (e.g., `default_factory=ProjectSettings` or a helper function) instead of suppressing the arg-type check. - Run mypy/pyright on the domain package to ensure no additional suppressions are introduced. ## Duplicate Check - Searched for existing tickets mentioning `multi_project.py` and `type: ignore`; none found. - Known violations list does not cover domain model suppressions. *Label note*: unable to apply Type/Refactor label directly due to label ID restrictions; please add when triaging.
Author
Owner

Verified — CONTRIBUTING.md explicitly forbids type: ignore suppressions. Domain layer violations undermine static analysis guarantees. Should Have fix — important for code quality and CONTRIBUTING.md compliance. Verified.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — CONTRIBUTING.md explicitly forbids `type: ignore` suppressions. Domain layer violations undermine static analysis guarantees. **Should Have** fix — important for code quality and CONTRIBUTING.md compliance. Verified. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Owner

superseded by next cycle

superseded by next cycle
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#8213
No description provided.