Skip to content

Parallel Tickets: spec.parallel and parallel <n> #143

Closed

Description

@JacobStephens2

Parent

#139

What to build

A Spec run runs several ready Tickets at once.

  • The limit. [spec] parallel in the User config: a positive integer, default 3. It is a new known section and key; anything else in [spec] is an unknown key, as for other sections. thirdshift setup writes it at its default with a comment, like every other setting, and doesn't ask about it.
  • The flag. parallel <n> / --parallel <n>, in any position, takes the next token as the number, follows the flag-once rule, and wins over the config. 0, a negative number or a non-number is an argument error (exit 2, with the help). parallel on an issue that turns out not to be a Spec stops at preflight before any work.
  • Scheduling. Whenever a Ticket's Run ends, the Spec run starts ready Tickets (lowest number first) until the limit is reached.
  • Concurrency safety. Child Runs share the Launch directory. Creating worktrees, fetching and choosing Issue branches there at the same time must not fail on git's lock files (e.g. serialise worktree creation, or retry on a lock).
  • Harness. The fake gh takes a file lock around every read and write of its state, since parallel child Runs call it at once.

Help and the README document parallel and spec.parallel.

Acceptance criteria

  • With two independent Tickets, both Ticket sessions start before either Ticket lands, and a Ticket blocked by both starts only after both land
  • parallel 1 runs the same Tickets one at a time
  • spec.parallel = 1 in the User config does the same, and --parallel 2 wins over it
  • Without either, at most 3 Tickets run at once
  • parallel 0, parallel -1 and parallel x exit 2 with the help; a repeated parallel exits 2
  • spec.parallel = 0, a non-integer, and an unknown key in [spec] are User config errors before any work
  • parallel 2 on an issue with no sub-issues stops before any work, naming the flag
  • Two Tickets starting together in one Launch directory both get their worktrees
  • thirdshift setup writes spec.parallel = 3 with a comment
  • Help and README document parallel and spec.parallel

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions