# T016 — Outbox simulate publish + retry rules

> Status: `done`
> Completed: 2026-07-09  
> Milestone: `M7`  
> Est. change: `~180 lines`

## Goal

「模擬發送」依序 root→replies；root 未成功不發後續；失敗可重試該步；可模擬 root 失敗。

## Depends on

- T015

## Inputs

- Spec §3.3 規則、§4.4、驗收 4–5

## Outputs

### 程式變更

| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/data/mock/outboxSimulate.ts` | add | 狀態機 |
| OutboxDetailPage | edit | 模擬成功 / 模擬 root 失敗 / 重試 |
| 可選觸發 notification | edit | 完成時寫通知（或 T018 接） |

### 行為變更

- publishing 中 UI 可 disable 重入  
- root failed → replies blocked/scheduled 不 published

## Out of scope

- 真 Threads API

## Acceptance

- [ ] 全成功路徑  
- [ ] root 失敗路徑  
- [ ] 重試 root 後可繼續  
- [ ] `npm run build` 通過

```bash
cd apps/web && npm run build
```
