Picking the next ticket
tkt next names the next startable ticket; --claim also claims it in one atomic step and prints its bundle.
On this page
Exit 1: nothing startable (tkt next --explain says why).
- Startable:
todo, not anepic, everyblockedBydone,has_blockers: false, noassigneeor the caller's own (--assignee,AITODO_ASSIGNEE). - Ranking: step 0 of the loop; a priority set by hand overrides value. Inside the project focus (The project focus),
--alllooks at everything. - Empty result:
--jsonaddsbyStatus,promoteCandidates(the top 3 backlog tickets, e.g.tkt ticket update SG-107 --status todo) andstalledEpics. Backlog → todo is the user's decision: propose it, never promote it yourself.
Details13 items
-
Ranking: an earlier
targetDatefirst; value decides within a priority; last an oldercreatedAt, then the id. With a milestone scope (focus or--milestone) only that milestone counts, another active one never boosts. -
At claim time a ticket without a repo anchor is skipped (
repo_anchor_missing) and the claim moves on to the next one. -
--include-backlogranks backlog too and exits 0 with a candidate; with--claim: 2.--claimneeds--assigneeorAITODO_ASSIGNEE(else 2); a store-wide lock (.aitodo/claim.lock) keeps two claims off one ticket. -
A running ticket counts as already picked:
in_progress,in_review(not merged yet) or a live claim in any worktree, this one too; never a candidate, its repo refs from the committed file. A candidate notparallelwith one is left out (running: true); a running one without repo refs makes every candidateunknown.--ignore-runningchecks the candidates only against each other (RESTignoreRunning=true; there only the status counts). -
Value per point = (own or inherited value + 0.5 × the value of the open tickets waiting on it over
blockedBy, transitively, each once) / estimate (min 0.5; none: the store's median, andwhysays so); no value: after the valued ones. Each candidate'swhynames its keys. -
A candidate without a value (none own, none inherited):
whysaysno value,--jsonvalued: false; if any, one line counts them, with the command:tkt ticket update PAY-001 --value 5. Same rule as theunvaluedcount oftkt milestone get. -
A promote candidate is no epic, has every
blockedBydone and is neverdeferred. -
tkt next --parallel Nsuggests the best N that are safe to start together and claims nothing (N ≥ 2; with--claim: 2): the best ranked candidate, then each next one that thetkt plan parallelrules callparallelwith every picked one (noblockedBypath, shared path or risky pattern: at most one touches migrations), until N. One without own repo refs is never picked, not even the top one (unknown,no_repo_refs). The text says why each one examined was left out. Exit 1: none picked. REST:GET /v1/tickets:next?parallel=N. -
tkt next:--milestone,--group,--epic,--type,--assigneenarrow the scope,--focussets your own focus. -
--json:{ticket, candidates[], skipped[{id, reason, detail}], reasons}; candidates carryvalue,valueSource,effectiveValue,estimate,score,unlocks,promoteFirst,decidedBy,valued. Skip reasons (tkt meta,enums.skip_reason):claimed_elsewhere(<branch> @ <worktree>),not_todo,epic,assigned,open_blocker,has_blockers, at claim timerepo_anchor_missing(the claim moves on). -
decidedBy({key, over}): the first key (tkt meta,enums.rank_key) in which the candidate beats the one below it (over);nullfor the last;--explain:above PAY-002 by priority. -
byStatussplits thenot_todoskips by status (backlog 40, deferred 2); a promote candidate haspromoteCommandandpromoteFirst: true;stalledEpicsaretodo/in_progressepics with notodochild, with their best child. -
--parallel N --json:parallel: {requested, picked[], leftOut[{id, rank, verdict, reasons, conflicts[{with, running, verdict, reasons}]}]}, apickedcandidate with itsrank;running[{id, title, status, claim}],ignoreRunning.