Skip to Content
Amaru
Amaru LightGet started

How it works

The Amaru Light ticket lifecycle and states, the result file, deterministic checks, worker slots, dependent issues, analysis mode and restarts.

Every issue the daemon claims becomes a ticket, worked on in its own Git worktree by one agent CLI session. This page explains how a ticket moves from claim to merge.

The lifecycle

claim → QUEUED → PREPARING → IMPLEMENTING → CHECKING → SELF_REVIEW → PUBLISHING
      → AWAITING_REVIEW ⇄ ADDRESSING_REVIEW → DONE (after you merge)
any step → BLOCKED (with the reason on the issue) → resumes when unblocked

An issue claimed for analysis goes PREPARING → ANALYZING → DONE instead. A ticket can also end CANCELLED. Ticket IDs are the daemon's own numbers, shown by amaru status, not issue numbers.

Principles

  • One agent session per ticket. Implementation, check fixes, self-review and review rounds all resume the same CLI session, so the agent keeps its context and the prompt cache. If a session is lost, the daemon starts a new one with a compact context pack: the issue, the current diff and the review threads.
  • A result file, not prose. At the end of every step the agent writes .amaru/result.json. The daemon reads it instead of parsing the agent's output; see Result file.
  • Deterministic checks. The daemon runs the project's checks itself after every turn and sends the failures back to the same session, up to max_fix_rounds.
  • At most two tickets in progress. max_parallel is 1 or 2. A ticket waiting for review frees its worker slot.
  • Dependent issues. An issue whose body says Depends on #12 or Blocked by #12 starts once #12 has a pull request, on a branch stacked on it.
  • Restartable. Tickets live in SQLite. After a restart or a crash every unfinished ticket continues from its last state.
  • Never merges. The daemon pushes only to the branches it created. Closing the issue cancels the ticket.

Labels on the issue

LabelMeaning
amaru:workingAdded while the daemon works on the issue.
amaru:blockedAdded when it needs you, with a comment that gives the reason. Remove it, or run amaru unblock <ticket>, to continue.
amaru:hold, needs-humanThe default skip labels: the issue is never started.

Labelling needs write access to the repository. Without it, for example for a bot that contributes through a fork, the daemon works without the labels and you unblock tickets with amaru unblock <ticket>.

State and disk

The state directory (state_dir) holds amaru.db, the tickets and their event log, and repos/<owner>/<name>/, a mirror clone with one worktree per ticket. The daemon deletes a worktree as soon as nothing will run in it again. A blocked ticket keeps its worktree for workspace.keep_blocked, 7 days by default; branches always stay, so unblocking recreates it. amaru clean does the same at once.

Based on README.md, docs/design.md and src/ticket.rs.

Next steps

On this page