UAT: LockService not exported from application/services __init__.py — inconsistent with PermissionService #4002

Open
opened 2026-04-06 08:28:10 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/lock-service-export
  • Commit Message: fix(concurrency): export LockService from application/services __init__.py
  • Milestone: Backlog (see note below)
  • Parent Epic: #362

Bug Description

LockService is not exported from src/cleveragents/application/services/__init__.py, making it inaccessible via the standard from cleveragents.application.services import LockService import pattern. This is inconsistent with PermissionService, which IS exported from the same __init__.py.

Expected Behavior

LockService should be importable via:

from cleveragents.application.services import LockService

This is the standard import pattern used throughout the codebase for all other services.

Actual Behavior

src/cleveragents/application/services/__init__.py exports PermissionService (line 470) but does NOT export LockService. The _LAZY_IMPORTS dict (lines 420-562) has no entry for LockService.

The only way to import LockService is via the direct module path:

from cleveragents.application.services.lock_service import LockService

This is the pattern used in cli/commands/system.py (line 26), which bypasses the standard services package API.

Impact

  • Inconsistency in the public API of the services package
  • Any code that tries from cleveragents.application.services import LockService will get AttributeError
  • Makes it harder to integrate LockService into other services (e.g., PlanLifecycleService) using the standard import pattern
  • The services/__init__.py TYPE_CHECKING block also lacks the LockService type stub

Code Location

  • src/cleveragents/application/services/__init__.py: _LAZY_IMPORTS dict (lines 420-562) — missing LockService entry
  • Compare with PermissionService entry at line 470

Fix

Add LockService to the TYPE_CHECKING block and _LAZY_IMPORTS dict in __init__.py:

# In TYPE_CHECKING block:
from cleveragents.application.services.lock_service import (
    LockService as LockService,
)

# In _LAZY_IMPORTS dict:
"LockService": ("lock_service", "LockService"),

Subtasks

  • Add LockService to TYPE_CHECKING block in __init__.py
  • Add LockService to _LAZY_IMPORTS dict in __init__.py
  • Add BDD scenario verifying LockService is importable from cleveragents.application.services
  • Verify coverage >= 97%
  • Run nox and fix any errors

Definition of Done

  • All subtasks completed
  • from cleveragents.application.services import LockService works
  • BDD test covers the import
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.3.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/lock-service-export` - **Commit Message**: `fix(concurrency): export LockService from application/services __init__.py` - **Milestone**: Backlog (see note below) - **Parent Epic**: #362 ## Bug Description `LockService` is not exported from `src/cleveragents/application/services/__init__.py`, making it inaccessible via the standard `from cleveragents.application.services import LockService` import pattern. This is inconsistent with `PermissionService`, which IS exported from the same `__init__.py`. ## Expected Behavior `LockService` should be importable via: ```python from cleveragents.application.services import LockService ``` This is the standard import pattern used throughout the codebase for all other services. ## Actual Behavior `src/cleveragents/application/services/__init__.py` exports `PermissionService` (line 470) but does NOT export `LockService`. The `_LAZY_IMPORTS` dict (lines 420-562) has no entry for `LockService`. The only way to import `LockService` is via the direct module path: ```python from cleveragents.application.services.lock_service import LockService ``` This is the pattern used in `cli/commands/system.py` (line 26), which bypasses the standard services package API. ## Impact - Inconsistency in the public API of the services package - Any code that tries `from cleveragents.application.services import LockService` will get `AttributeError` - Makes it harder to integrate `LockService` into other services (e.g., `PlanLifecycleService`) using the standard import pattern - The `services/__init__.py` TYPE_CHECKING block also lacks the `LockService` type stub ## Code Location - `src/cleveragents/application/services/__init__.py`: `_LAZY_IMPORTS` dict (lines 420-562) — missing `LockService` entry - Compare with `PermissionService` entry at line 470 ## Fix Add `LockService` to the `TYPE_CHECKING` block and `_LAZY_IMPORTS` dict in `__init__.py`: ```python # In TYPE_CHECKING block: from cleveragents.application.services.lock_service import ( LockService as LockService, ) # In _LAZY_IMPORTS dict: "LockService": ("lock_service", "LockService"), ``` ## Subtasks - [ ] Add `LockService` to `TYPE_CHECKING` block in `__init__.py` - [ ] Add `LockService` to `_LAZY_IMPORTS` dict in `__init__.py` - [ ] Add BDD scenario verifying `LockService` is importable from `cleveragents.application.services` - [ ] Verify coverage >= 97% - [ ] Run `nox` and fix any errors ## Definition of Done - [ ] All subtasks completed - [ ] `from cleveragents.application.services import LockService` works - [ ] BDD test covers the import - [ ] All nox stages pass - [ ] Coverage >= 97% --- > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.3.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:11 +00:00
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.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4002
No description provided.