# Workflow Model ## Navigation - [Home](Home.md) | [Operator Guide](Operator-Guide.md) | [Repositories Map](Repositories.md) | [Identity and Profiles](Identity-and-Profiles.md) | [Workflow Model](Workflow.md) | [Safety and Gates](Safety-and-Gates.md) | [MCP Tools Reference](MCP-Tools.md) | [Operator Runbooks](Runbooks.md) | [Open Decisions](Open-Decisions.md) | [Project History](History.md) ## Step 1: Review queue first (reviewer profile) 1. `gitea_resolve_task_capability(task="review_pr")` 2. List open PRs; pick the oldest eligible PR (not self-authored, mergeable). 3. Pin head SHA; validate diff scope and run tests locally. 4. `gitea_mark_final_review_decision` → `gitea_review_pr` / `gitea_submit_pr_review` 5. `gitea_merge_pr` only with `confirmation="MERGE PR "` and pinned head SHA. ## Step 2: Implement issues (author profile) 0. Work Selection Rule — verify a work lease before any mutations (open PRs, issue-linked PRs, branches, worktrees, dirty worktrees, active leases/ handoffs, merged-PR completion). Stop if another session owns the lease. 1. `gitea_resolve_task_capability` for the author task. 2. `gitea_lock_issue` before implementation mutations. 3. Claim with `gitea_mark_issue` / `status:in-progress` label. 4. Branch, implement, test, push, `gitea_create_pr`. 5. Release claim when done; never self-review the PR. ## Step 3: Operator follow-ups Wiki publication, credential provisioning, and cross-repo mirror operations are operator-confirmed actions — see [Runbooks](Runbooks.md). Full Gitea-specific runbooks: `docs/llm-workflow-runbooks.md` in the repository.