Skip to content

TypeScript prototype: Ticket run Delivery, CI Repair loop, and discriminated-union state machines #1837

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Parent

#1831

What to build

Extend the TypeScript prototype's Ticket run from the completed Harness session through Delivery: pushing the Issue branch, opening or verifying the pull request, watching head CI checks, merging Base branch updates, running bounded Repair sessions when CI checks fail or the branch conflicts with the Base branch, and salvaging a draft pull request on a Failed ticket run. Model Run, Claim, Delivery, and CI check states as discriminated unions enforced at compile time via satisfies never (with zero any/as casts).

Acceptance criteria

  • After the opening Harness session commits to the Issue branch, Delivery pushes the branch, opens or verifies the pull request for that branch, and marks it ready for review once CI checks pass.
  • When CI checks on the watched head fail or the branch conflicts with the Base branch, the Ticket run runs bounded Repair sessions (up to the Repair limit) and re-verifies CI before completing Delivery.
  • When a Ticket run fails with commits ahead of the Base branch, Failed ticket run salvage pushes the branch and opens or keeps a draft pull request while preserving the in-progress Claim; when it ends with nothing on origin, it releases the Claim and restores ready-for-agent.
  • Run outcomes, Claim transitions, Delivery states, and CI check states are represented as tagged discriminated unions with compile-time exhaustiveness (satisfies never / assertNever), verified by tsc --noEmit.
  • End-to-end CLI tests in bun test with fake gh and Harness executables cover green Delivery, CI failure Repair recovery, merge-conflict Repair recovery, and Failed ticket run draft salvage.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions