Skip to content

Bug: taskctl pipeline - no PM escalation after 3 adversarial rejections causes infinite loop #388

@randomm

Description

@randomm

What happened

When the adversarial-pipeline rejects a developer implementation 3+ times, the pipeline does not escalate to the PM. Instead, it keeps respawning the developer indefinitely until the thread dies (context limit or token budget exhausted).

Expected behaviour

After 3 adversarial rejections (ISSUES_FOUND or CRITICAL_ISSUES_FOUND), the pipeline should:

  1. Stop respawning the developer
  2. Escalate to PM with verdict summary
  3. Allow PM to decide: override, re-scope, or abort

Current behaviour

  • No maximum retry limit configured
  • No escalation logic in pulse.ts
  • Pipeline loops forever: developer → adversarial → respawn → repeat
  • Thread dies when LLM context limit reached

Steps to reproduce

  1. Run taskctl start on an issue with complex requirements
  2. Wait for adversarial to find issues in round 1
  3. Developer fixes, adversarial finds NEW issues (or same issues reworded)
  4. Repeat 3+ times
  5. Observe: No PM escalation, pipeline continues indefinitely

Environment

  • Branch: dev
  • Files involved: src/tasks/pulse.ts, src/tasks/pulse-scheduler.ts, src/tasks/pulse-verdicts.ts

Acceptance Criteria

  • Pipeline tracks pipeline.attempt counter for each task
  • After 3 adversarial rejections, pipeline escalates to PM
  • PM receives notification with verdict history and issue summary
  • Pipeline pauses, waiting for PM decision (override/re-scope/abort)
  • Test added verifying escalation after 3 retries

Definition of Done

  • Escalation logic added to pulse.ts or pulse-scheduler.ts
  • PM notification mechanism implemented (comment on issue, or session message)
  • Test written verifying escalation after 3 rejections
  • Documentation updated in AGENTS.md describing escalation behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions