Repository navigation
refactor(task): move TaskService's reads into five mixins - #1268
Merged
Merged
Conversation
Wave 3 of the god-class plan (trail #51) starts on TaskService, 379 methods. Its read side moves, every method body byte-identical, into five mixins in task.py, above the class: - TaskListQueries (14): listings by project, team, assignee and status, search, recency, archive candidates, FIFO order; - TaskQueueQueries (11): the review and escalation queues and the Board's strategic list; - TaskStatistics (6): counts, delivery statistics, spend; - TaskAgentQueries (8): one agent's tasks and the held task blocking its next claim; - TaskRoleLookup (11): the agent holding a role, by team or slug. They stay in task.py so the module-level names tests patch there keep reaching the code that uses them. TaskService keeps 329 methods; its bases are BaseService first, so mypy finds `session` and `log` before TaskServiceSelf's declarations of them, then the mixins alphabetically. roboco/services/_task_service_types.py holds TaskServiceSelf, each mixin's TYPE_CHECKING-only base: one surface per class whose members the mixins reach through `self`, with each method's own signature, plus the instance attributes. tests/unit/services/test_task_service_mixins.py fails on a member defined twice and on a stub its class doesn't define. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rennf93
marked this pull request as ready for review
October 31, 2026 20:48
|
Thanks for opening your first pull request on RoboCo! Quick checklist before review (most of these are enforced by CI, but worth a glance):
See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow. Welcome aboard — a maintainer will review shortly. |
This was referenced Oct 31, 2026
Closed
This was referenced Oct 31, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to trail #51 (change 119): wave 3 of the god-class plan starts on
TaskService, the largest class left (379 methods). This first part moves its read side into five mixins, every method body byte-identical.Why
The conventions check flags 39 classes over its 15-method limit. Trail #51's plan splits them by responsibility, one family per PR, then makes
god_classblocking. Wave 3 is the core services,TaskServicefirst, in several parts. This part takes the reads, which nothing else depends on in order.What changed
Five mixins in
roboco/services/task.py, aboveTaskService:TaskListQueriesTaskQueueQueriesTaskStatisticsTaskAgentQueriesTaskRoleLookupresolve_agent_idWhy in
task.py: tests patch module-level names there (get_event_bus,extract_original_developer,main_pm_cannot_own_code, and others). Moved bodies keep resolving those names in the same module, so every patch still reaches them.ContentActionsandBaseChoreographerwere split the same way in wave 2.TaskServicekeeps 329 methods. Its bases areBaseServicefirst, then the mixins alphabetically.BaseServicecomes first so mypy finds itssessionandlogbefore the declarations of them inTaskServiceSelf. It defines onlyservice_nameand__init__, whichTaskServiceoverrides, so nothing resolves differently at runtime.New
roboco/services/_task_service_types.py:TaskServiceSelf, each mixin's TYPE_CHECKING-only base.self: two ofTaskListQueries's and six ofTaskService's.BaseService's andTaskService's instance attributes.....New
tests/unit/services/test_task_service_mixins.py:TaskServiceredefines a mixin's member;Map: the slice gets the new file, a row per mixin and a dated note. Seventy-six line citations follow the move. Ten prose citations of a line inside a method keep their offset in it. One of them pointed into
_bump_coordination_ceo_rejectwhile namingceo_reject; it still points at the same statement.Verification
TaskService's 379 methods at slave appears exactly once acrossTaskServiceand the five mixins, with an identical source segment, and nothing else was added. I checked this with an AST comparison of the class atb22282deagainst this branch.mypy roboco/ tests/(1,797 files), vulture, xenon, import-linter. The codebase map is 0 errors and 0 warnings, with the concat in sync and reflow clean. Conventions has one finding in the touched files,TaskService's owngod_class, which the later parts close.🤖 Generated with Claude Code