# Tham chiếu workflow

Mỗi workflow là một đồ thị trung lập với provider. `av run <workflow> --validate` chứng minh đồ thị mà không cần liên hệ provider nào; xem khái niệm thực thi đồ thị để hiểu vòng đời một lần chạy.

## `bugfix-delivery`

**Root-cause bugfix delivery** — Diagnose a defect, obtain bounded change authority, implement the cause-aligned fix, and verify it.

### Chú giải

- **Loại node**: `agent`, `function`, `human`, `skill`, `terminal`
- **Loại edge**: `approval`, `cancel`, `failure`, `handoff`, `retry`, `success`

### Topology

**Điểm vào** — vào được mà không có edge tới:

- `intake` (function)

**Điểm kết**:

- `cancelled` (terminal)
- `complete` (terminal)
- `failed` (terminal)

**Luồng (từ → đến)**:

- `approve`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `fix` — approval
- `cancelled` — *không có edge đi ra*
- `complete` — *không có edge đi ra*
- `diagnose`:
  - → `approve` — success
  - → `cancelled` — cancel
  - → `diagnose` — retry
  - → `failed` — failure
- `failed` — *không có edge đi ra*
- `fix`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `fix` — retry
  - → `test` — success
- `inspect`:
  - → `cancelled` — cancel
  - → `diagnose` — handoff
  - → `failed` — failure
- `intake`:
  - → `failed` — failure
  - → `inspect` — success
- `review`:
  - → `complete` — success
  - → `failed` — failure
- `test`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `review` — success

### Node

| Node | Loại | Bộ xử lý |
| --- | --- | --- |
| `approve` | human | human: `change-approval` |
| `cancelled` | terminal | terminal: `cancelled` |
| `complete` | terminal | terminal: `success` |
| `diagnose` | agent | agent: `debugger` |
| `failed` | terminal | terminal: `failure` |
| `fix` | skill | skill: `fix` |
| `inspect` | skill | skill: `scout` |
| `intake` | function | function: `normalize-request` |
| `review` | skill | skill: `code-review` |
| `test` | skill | skill: `test` |

### Edge

| Từ | Đến | Kiểu |
| --- | --- | --- |
| `approve` | `cancelled` | cancel |
| `approve` | `failed` | failure |
| `approve` | `fix` | approval |
| `diagnose` | `approve` | success |
| `diagnose` | `cancelled` | cancel |
| `diagnose` | `diagnose` | retry |
| `diagnose` | `failed` | failure |
| `fix` | `cancelled` | cancel |
| `fix` | `failed` | failure |
| `fix` | `fix` | retry |
| `fix` | `test` | success |
| `inspect` | `cancelled` | cancel |
| `inspect` | `diagnose` | handoff |
| `inspect` | `failed` | failure |
| `intake` | `failed` | failure |
| `intake` | `inspect` | success |
| `review` | `complete` | success |
| `review` | `failed` | failure |
| `test` | `cancelled` | cancel |
| `test` | `failed` | failure |
| `test` | `review` | success |

## `read-only-delivery`

**Read-only repository delivery** — Inspect a repository, answer from evidence, and verify proof without granting mutation authority.

### Chú giải

- **Loại node**: `function`, `gate`, `skill`, `terminal`
- **Loại edge**: `cancel`, `failure`, `success`

### Topology

**Điểm vào** — vào được mà không có edge tới:

- `intake` (function)

**Điểm kết**:

- `cancelled` (terminal)
- `complete` (terminal)
- `failed` (terminal)

**Luồng (từ → đến)**:

- `answer`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `verify` — success
- `cancelled` — *không có edge đi ra*
- `complete` — *không có edge đi ra*
- `failed` — *không có edge đi ra*
- `inspect`:
  - → `answer` — success
  - → `cancelled` — cancel
  - → `failed` — failure
- `intake`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `inspect` — success
- `verify`:
  - → `cancelled` — cancel
  - → `complete` — success
  - → `failed` — failure

### Node

| Node | Loại | Bộ xử lý |
| --- | --- | --- |
| `answer` | skill | skill: `ask` |
| `cancelled` | terminal | terminal: `cancelled` |
| `complete` | terminal | terminal: `success` |
| `failed` | terminal | terminal: `failure` |
| `inspect` | skill | skill: `scout` |
| `intake` | function | function: `normalize-request` |
| `verify` | gate | gate: `evidence-complete` |

### Edge

| Từ | Đến | Kiểu |
| --- | --- | --- |
| `answer` | `cancelled` | cancel |
| `answer` | `failed` | failure |
| `answer` | `verify` | success |
| `inspect` | `answer` | success |
| `inspect` | `cancelled` | cancel |
| `inspect` | `failed` | failure |
| `intake` | `cancelled` | cancel |
| `intake` | `failed` | failure |
| `intake` | `inspect` | success |
| `verify` | `cancelled` | cancel |
| `verify` | `complete` | success |
| `verify` | `failed` | failure |

## `safe-change-delivery`

**Safe repository change delivery** — Plan, approve, apply, test, and review a bounded workspace change with explicit fallback and idempotency.

### Chú giải

- **Loại node**: `agent`, `function`, `human`, `skill`, `terminal`, `tool`
- **Loại edge**: `approval`, `cancel`, `conditional`, `failure`, `handoff`, `retry`, `success`

### Topology

**Điểm vào** — vào được mà không có edge tới:

- `intake` (function)

**Điểm kết**:

- `cancelled` (terminal)
- `complete` (terminal)
- `decline` (terminal)
- `failed` (terminal)

**Luồng (từ → đến)**:

- `apply`:
  - → `apply` — retry
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `test` — success
- `approve`:
  - → `apply` — approval
  - → `cancelled` — cancel
  - → `failed` — failure
- `assess`:
  - → `approve` — conditional
  - → `cancelled` — cancel
  - → `decline` — conditional
  - → `failed` — failure
- `cancelled` — *không có edge đi ra*
- `complete` — *không có edge đi ra*
- `decline` — *không có edge đi ra*
- `failed` — *không có edge đi ra*
- `intake`:
  - → `failed` — failure
  - → `plan` — success
- `plan`:
  - → `assess` — handoff
  - → `cancelled` — cancel
  - → `failed` — failure
- `review`:
  - → `complete` — success
  - → `failed` — failure
- `test`:
  - → `cancelled` — cancel
  - → `failed` — failure
  - → `review` — success

### Node

| Node | Loại | Bộ xử lý |
| --- | --- | --- |
| `apply` | tool | tool: `workspace.apply` |
| `approve` | human | human: `change-approval` |
| `assess` | agent | agent: `code-reviewer` |
| `cancelled` | terminal | terminal: `cancelled` |
| `complete` | terminal | terminal: `success` |
| `decline` | terminal | terminal: `declined` |
| `failed` | terminal | terminal: `failure` |
| `intake` | function | function: `normalize-request` |
| `plan` | skill | skill: `cook` |
| `review` | skill | skill: `code-review` |
| `test` | skill | skill: `test` |

### Edge

| Từ | Đến | Kiểu |
| --- | --- | --- |
| `apply` | `apply` | retry |
| `apply` | `cancelled` | cancel |
| `apply` | `failed` | failure |
| `apply` | `test` | success |
| `approve` | `apply` | approval |
| `approve` | `cancelled` | cancel |
| `approve` | `failed` | failure |
| `assess` | `approve` | conditional |
| `assess` | `cancelled` | cancel |
| `assess` | `decline` | conditional |
| `assess` | `failed` | failure |
| `intake` | `failed` | failure |
| `intake` | `plan` | success |
| `plan` | `assess` | handoff |
| `plan` | `cancelled` | cancel |
| `plan` | `failed` | failure |
| `review` | `complete` | success |
| `review` | `failed` | failure |
| `test` | `cancelled` | cancel |
| `test` | `failed` | failure |
| `test` | `review` | success |
