Submatter/plans/Plan-automation-foundation/Epic-apps-worker-v1/Task-worker-draft-pr.md
Randall Stillwell d1b2b9695e docs(plans): expand automation foundation for owner cockpit vision
Add epics 10–12 (plans UI, completion artifacts, ops copilot), worker
draft-PR and live E2E verify tasks, and phase A–E execution order after
A1 gap review.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 14:11:20 -05:00

2.3 KiB

kind slug title plan_slug epic_slug status priority tenant_id owner cursor_todo_id updated_at agent_prompt
task worker-draft-pr Worker opens draft PR via forge adapter on implementer success automation-foundation apps-worker-v1 ready P1 global unassigned null 2026-08-12 Epic 7 gap: apps/worker never calls the forge adapter to open a PR. Wire createPullRequest (or equivalent) after a successful implementer session. Use connected repo from convoy/workspace. Branch naming must match Epic 8 conventions. claim_task / complete_task this task; run pnpm lint && pnpm type-check && pnpm test.

Task summary

When an implementer role_dispatch job succeeds, open a draft PR on the connected forge (GitHub/Forgejo) from the worktree branch, and store PR URL/metadata on the convoy for Mission Control and Epic 8 webhooks.

Description

Gap check (2026-08-12): Task-worker-minimal-tool-loop was marked done and checkpoints shipped, but apps/worker has no forge PR call. Epic 7 acceptance (“branch + PR draft output”) and Epic 8 dogfood both require this.

Behavior

  • After successful implementer session (and before worktree teardown): push branch if needed, call forge adapter createPullRequest (draft).
  • PR body includes convoy slug, brief id, echodo marker for webhooks (echodo-convoy: <uuid>).
  • Persist PR url / number on convoy content or convoy_events metadata.
  • Non-implementer roles skip PR creation.
  • Failures: log + mark run notes; do not silently claim success if PR was required.

Dependencies

  • Epic 3 forge adapters
  • Worktree + branch from worker tool loop

Subtasks

  • Resolve repo_links for convoy workspace
  • Push worktree branch with stored credentials pattern
  • createPullRequest draft via adapter
  • Write PR metadata for Mission Control detail panel
  • Document branch + marker convention in docs/worker.md

Estimation

M

Acceptance criteria

  • Successful implementer job produces a draft PR URL on a connected test repo
  • PR body contains convoy marker consumable by Epic 8
  • Planning-only roles do not open PRs
  • Mission control detail can show PR link when present