UAT: Decision, ContextSnapshot, and DecisionType not exported from domain/models/core/__init__.py — public API incomplete #3190

Open
opened 2026-04-05 07:34:50 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/decision-core-init-exports
  • Commit Message: fix(domain): export Decision, ContextSnapshot, and DecisionType from core models __init__
  • Milestone: (backlog — no milestone assigned)
  • Parent Epic: #357

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

Bug Report

Feature Area: Decision Recording During Strategize Phase (v3.2.0)

What was tested

Code analysis of src/cleveragents/domain/models/core/__init__.py and src/cleveragents/domain/models/core/decision.py.

Expected behavior (from spec)

Per docs/specification.md and the Clean Architecture principle enforced by CONTRIBUTING.md, the domain layer's public API (the __init__.py of each package) should export all public domain models. The Decision, ContextSnapshot, DecisionType, STRATEGIZE_TYPES, and EXECUTE_TYPES are core domain concepts introduced in v3.2.0 (Epic #357) and should be importable as:

from cleveragents.domain.models.core import Decision, ContextSnapshot, DecisionType

Actual behavior (from code analysis)

src/cleveragents/domain/models/core/__init__.py does NOT export Decision, ContextSnapshot, DecisionType, STRATEGIZE_TYPES, or EXECUTE_TYPES. Only EscalationDecision and PermissionDecision (unrelated models) are exported.

Any code attempting:

from cleveragents.domain.models.core import Decision

will raise ImportError: cannot import name 'Decision' from 'cleveragents.domain.models.core'.

The decision_service.py works around this by importing directly from the submodule:

from cleveragents.domain.models.core.decision import (
    ArtifactRef, ContextSnapshot, Decision, DecisionType,
)

But this bypasses the package's public API contract and makes the domain layer's interface inconsistent.

Code locations

  • src/cleveragents/domain/models/core/__init__.py — missing exports for Decision-related types
  • src/cleveragents/domain/models/core/decision.py — defines Decision, ContextSnapshot, DecisionType, ResourceRef, ArtifactRef, STRATEGIZE_TYPES, EXECUTE_TYPES

Subtasks

  • Add Decision, ContextSnapshot, DecisionType, ResourceRef, ArtifactRef, STRATEGIZE_TYPES, EXECUTE_TYPES to src/cleveragents/domain/models/core/__init__.py imports and __all__
  • Verify no circular import issues arise from the addition
  • Run nox -e typecheck to verify no type errors
  • Run nox -e unit_tests to verify no regressions
  • Run nox -e coverage_report to verify coverage >= 97%

Definition of Done

  • from cleveragents.domain.models.core import Decision succeeds without error
  • from cleveragents.domain.models.core import ContextSnapshot succeeds without error
  • from cleveragents.domain.models.core import DecisionType succeeds without error
  • All Decision-related types appear in domain/models/core/__all__
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/decision-core-init-exports` - **Commit Message**: `fix(domain): export Decision, ContextSnapshot, and DecisionType from core models __init__` - **Milestone**: *(backlog — no milestone assigned)* - **Parent Epic**: #357 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.2.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Bug Report **Feature Area**: Decision Recording During Strategize Phase (v3.2.0) ### What was tested Code analysis of `src/cleveragents/domain/models/core/__init__.py` and `src/cleveragents/domain/models/core/decision.py`. ### Expected behavior (from spec) Per `docs/specification.md` and the Clean Architecture principle enforced by `CONTRIBUTING.md`, the domain layer's public API (the `__init__.py` of each package) should export all public domain models. The `Decision`, `ContextSnapshot`, `DecisionType`, `STRATEGIZE_TYPES`, and `EXECUTE_TYPES` are core domain concepts introduced in v3.2.0 (Epic #357) and should be importable as: ```python from cleveragents.domain.models.core import Decision, ContextSnapshot, DecisionType ``` ### Actual behavior (from code analysis) `src/cleveragents/domain/models/core/__init__.py` does NOT export `Decision`, `ContextSnapshot`, `DecisionType`, `STRATEGIZE_TYPES`, or `EXECUTE_TYPES`. Only `EscalationDecision` and `PermissionDecision` (unrelated models) are exported. Any code attempting: ```python from cleveragents.domain.models.core import Decision ``` will raise `ImportError: cannot import name 'Decision' from 'cleveragents.domain.models.core'`. The `decision_service.py` works around this by importing directly from the submodule: ```python from cleveragents.domain.models.core.decision import ( ArtifactRef, ContextSnapshot, Decision, DecisionType, ) ``` But this bypasses the package's public API contract and makes the domain layer's interface inconsistent. ### Code locations - `src/cleveragents/domain/models/core/__init__.py` — missing exports for Decision-related types - `src/cleveragents/domain/models/core/decision.py` — defines `Decision`, `ContextSnapshot`, `DecisionType`, `ResourceRef`, `ArtifactRef`, `STRATEGIZE_TYPES`, `EXECUTE_TYPES` ## Subtasks - [ ] Add `Decision`, `ContextSnapshot`, `DecisionType`, `ResourceRef`, `ArtifactRef`, `STRATEGIZE_TYPES`, `EXECUTE_TYPES` to `src/cleveragents/domain/models/core/__init__.py` imports and `__all__` - [ ] Verify no circular import issues arise from the addition - [ ] Run `nox -e typecheck` to verify no type errors - [ ] Run `nox -e unit_tests` to verify no regressions - [ ] Run `nox -e coverage_report` to verify coverage >= 97% ## Definition of Done - [ ] `from cleveragents.domain.models.core import Decision` succeeds without error - [ ] `from cleveragents.domain.models.core import ContextSnapshot` succeeds without error - [ ] `from cleveragents.domain.models.core import DecisionType` succeeds without error - [ ] All Decision-related types appear in `domain/models/core/__all__` - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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
Reference
cleveragents/cleveragents-core#3190
No description provided.