src.integrations.nlp_task_utils module#

Natural Language Task Processing Utilities.

Shared utilities for natural language task creation tools. Eliminates code duplication between create_project and add_feature.

class src.integrations.nlp_task_utils.TaskType[source]#

Bases: Enum

Task type classification.

DESIGN = 'design'#
DEPLOYMENT = 'deployment'#
IMPLEMENTATION = 'implementation'#
TESTING = 'testing'#
INTEGRATION = 'integration'#
DOCUMENTATION = 'documentation'#
INFRASTRUCTURE = 'infrastructure'#
OTHER = 'other'#
class src.integrations.nlp_task_utils.TaskClassifier[source]#

Bases: object

Classify tasks by their type based on keywords.

TASK_KEYWORDS = {TaskType.DEPLOYMENT: ['deploy', 'release', 'production', 'launch', 'rollout', 'publish', 'go-live', 'deliver', 'staging', 'live'], TaskType.DESIGN: ['design', 'architect', 'plan', 'specification', 'wireframe', 'mockup', 'diagram', 'blueprint', 'prototype', 'architecture', 'planning'], TaskType.DOCUMENTATION: ['document', 'docs', 'readme', 'guide', 'tutorial', 'manual', 'wiki', 'annotate', 'comment'], TaskType.IMPLEMENTATION: ['implement', 'build', 'create', 'develop', 'code', 'construct', 'write', 'refactor', 'program', 'engineer', 'fix', 'bugfix', 'bug', 'patch', 'hotfix', 'repair', 'resolve'], TaskType.INFRASTRUCTURE: ['setup', 'configure', 'install', 'provision', 'infrastructure', 'database', 'server', 'environment', 'docker', 'kubernetes'], TaskType.INTEGRATION: ['integration verification', 'build verification', 'smoke test', 'startup verification', 'system verification', 'health check', 'endpoint verification'], TaskType.TESTING: ['test', 'qa', 'quality', 'verify', 'validate', 'check', 'assert', 'unittest', 'e2e', 'coverage']}#
classmethod classify(task)[source]#

Classify a task based on its name and description.

Parameters:

task (Task) – Task to classify

Returns:

TaskType enum value

Return type:

TaskType

classmethod is_type(task, task_type)[source]#

Check if a task is of a specific type.

Return type:

bool

Parameters:
classmethod filter_by_type(tasks, task_type)[source]#

Filter tasks by type.

Return type:

List[Task]

Parameters:
class src.integrations.nlp_task_utils.TaskBuilder[source]#

Bases: object

Build task data structures for kanban board creation.

static build_task_data(task)[source]#

Build a dictionary of task data for kanban board creation.

Parameters:

task (Task) – Task object to convert

Returns:

Dictionary with task data ready for kanban API

Return type:

Dict[str, Any]

static build_minimal_task_data(task)[source]#

Build minimal task data (for APIs with fewer fields).

Return type:

Dict[str, Any]

Parameters:

task (Task)

class src.integrations.nlp_task_utils.SafetyChecker[source]#

Bases: object

Apply safety checks to ensure logical task ordering.

__init__()[source]#

Initialize SafetyChecker with enhanced task classifier.

Return type:

None

apply_deployment_dependencies(tasks)[source]#

Ensure deployment tasks depend on implementation and testing tasks.

This prevents premature deployment by establishing proper dependencies.

Parameters:

tasks (List[Task]) – List of tasks to check

Returns:

List of tasks with updated dependencies

Return type:

List[Task]

apply_testing_dependencies(tasks)[source]#

Ensure testing tasks depend on implementation tasks.

Parameters:

tasks (List[Task]) – List of tasks to check

Returns:

List of tasks with updated dependencies

Return type:

List[Task]

apply_implementation_dependencies(tasks)[source]#

Ensure implementation tasks depend on design tasks.

Supports both bundled domain designs (GH-108) and per-feature designs for backward compatibility with existing workflows.

Bundled designs have IDs like: design_user_authentication Per-feature designs have IDs like: task_user-login_design

Parameters:

tasks (List[Task]) – List of tasks to check

Returns:

List of tasks with updated dependencies

Return type:

List[Task]

static validate_dependencies(tasks)[source]#

Validate that all dependencies reference existing tasks.

Parameters:

tasks (List[Task]) – List of tasks to validate

Returns:

List of validation errors (empty if valid)

Return type:

List[str]