Skip to content

016-2: Backend Automation - Planning Trigger + Task Approval #199

Description

@frankbria

Part of #197 - Planning Phase Automation

Scope

This issue covers the backend automation that triggers after PRD generation and the task approval flow.

Tasks

1. Planning Automation Trigger (~2h)

  • Modify codeframe/ui/routers/discovery.py
  • After PRD generation completes, trigger background task
  • Call LeadAgent.generate_issues(sprint_number=1)
  • Call LeadAgent.decompose_prd()
  • Add WebSocket events:
    • planning_started - when automation begins
    • issues_generated - with count of issues created
    • tasks_decomposed - with count of tasks created
    • tasks_ready - when ready for user review
  • Handle errors gracefully (allow retry)

2. Task Approval Endpoint (~1.5h)

  • Add POST /api/projects/:id/tasks/approve to tasks.py
  • Request body:
    {
      "approved": true,
      "excluded_task_ids": []
    }
  • Use PhaseManager to transition to "development"
  • Mark approved tasks as "pending" (ready for assignment)
  • Broadcast development_started event
  • Return approval summary

Acceptance Criteria

  • PRD completion triggers automatic issue/task generation
  • WebSocket events broadcast at each step
  • Task approval transitions phase to "development"
  • Excluded tasks are not marked as pending
  • All unit tests pass

Dependencies

  • Requires: 016-1 (PhaseManager class)

Blocks

Files

  • codeframe/ui/routers/discovery.py (modify)
  • codeframe/ui/routers/tasks.py (modify)
  • tests/ui/test_discovery_automation.py (new)
  • tests/ui/test_task_approval.py (new)

Effort

~3.5 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0-blocker-betaCritical blocker - must fix before beta testingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions