Skip to content

refactor(taskctl): extract generateDiffForRespawn utility from respawnDeveloper #386

@randomm

Description

@randomm

Task Description

The respawnDeveloper function in pulse-scheduler.ts has grown to ~200 lines and exceeds the single responsibility principle. Extract the git diff generation logic into a dedicated utility function.

Quality Gates

  • TDD: Write tests before implementation
  • Coverage: 80%+ test coverage for new utility
  • Linting: All code passes project linting rules
  • Documentation: Update README.md if needed

Acceptance Criteria

  • Create generateDiffForRespawn(worktree: string, baseCommit: string | null, taskId: string): Promise<string> utility function
  • Move git diff generation logic (ancestor check, diff generation, size limits, worktree validity) from respawnDeveloper to the new utility
  • respawnDeveloper should be a focused orchestrator function (~100 lines)
  • All existing tests still pass
  • Add unit tests for the new utility function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions