src.core.phase_dependency_enforcer module#

Phase Dependency Enforcer.

Enforces strict development lifecycle phase dependencies within features, ensuring tasks follow the correct order: Design → Implementation → Testing → Documentation

class src.core.phase_dependency_enforcer.TaskPhase[source]#

Bases: Enum

Development lifecycle phases in execution order.

DESIGN = 1#
INFRASTRUCTURE = 2#
IMPLEMENTATION = 3#
TESTING = 4#
INTEGRATION = 5#
DOCUMENTATION = 6#
DEPLOYMENT = 7#
classmethod get_dependencies(phase)[source]#

Get all phases that must complete before this phase.

Return type:

List[TaskPhase]

Parameters:

phase (TaskPhase)

class src.core.phase_dependency_enforcer.DependencyType[source]#

Bases: Enum

Types of task dependencies.

PHASE = 'phase'#
FEATURE = 'feature'#
TECHNICAL = 'technical'#
DATA = 'data'#
GLOBAL = 'global'#
MANUAL = 'manual'#
class src.core.phase_dependency_enforcer.FeatureGroup[source]#

Bases: object

Represents a group of tasks belonging to the same feature.

feature_name: str#
tasks: List[Task]#
phase_tasks: Dict[TaskPhase, List[Task]]#
get_tasks_by_phase(phase)[source]#

Get all tasks in a specific phase.

Return type:

List[Task]

Parameters:

phase (TaskPhase)

has_phase(phase)[source]#

Check if feature has tasks in a specific phase.

Return type:

bool

Parameters:

phase (TaskPhase)

__init__(feature_name, tasks, phase_tasks)#
Parameters:
Return type:

None

class src.core.phase_dependency_enforcer.PhaseDependencyEnforcer[source]#

Bases: object

Enforces development lifecycle phase dependencies.

Ensures tasks within the same feature follow proper phase ordering: Design → Infrastructure → Implementation → Testing → Documentation → Deployment

PHASE_ORDER = [TaskPhase.DESIGN, TaskPhase.INFRASTRUCTURE, TaskPhase.IMPLEMENTATION, TaskPhase.TESTING, TaskPhase.INTEGRATION, TaskPhase.DOCUMENTATION, TaskPhase.DEPLOYMENT]#
TYPE_TO_PHASE_MAP = {TaskType.DEPLOYMENT: TaskPhase.DEPLOYMENT, TaskType.DESIGN: TaskPhase.DESIGN, TaskType.DOCUMENTATION: TaskPhase.DOCUMENTATION, TaskType.IMPLEMENTATION: TaskPhase.IMPLEMENTATION, TaskType.INFRASTRUCTURE: TaskPhase.INFRASTRUCTURE, TaskType.INTEGRATION: TaskPhase.INTEGRATION, TaskType.OTHER: TaskPhase.IMPLEMENTATION, TaskType.TESTING: TaskPhase.TESTING}#
__init__()[source]#

Initialize the phase dependency enforcer.

Return type:

None

enforce_phase_dependencies(tasks)[source]#

Apply phase-based dependencies to tasks.

Parameters:

tasks (List[Task]) – List of tasks to process.

Return type:

List[Task]

Returns:

List of tasks with phase dependencies added

validate_phase_ordering(tasks)[source]#

Validate that tasks follow proper phase ordering.

Return type:

Tuple[bool, List[str]]

Returns:

Tuple of (is_valid, list_of_errors)

Parameters:

tasks (List[Task])

get_phase_statistics(tasks)[source]#

Get statistics about phase distribution and dependencies.

Return type:

Dict[str, Any]

Returns:

Dictionary with phase statistics

Parameters:

tasks (List[Task])