# T311 — outcome-hooks-scout-outbox-publish

> Status: `done`  
> Milestone: `M1`  
> Kind: `feat`  
> Est. change: `~160 lines`

## Goal

完成後系統應：Scout 外展 published／標記完成、Outbox step published 時自動建立 OutcomeEvent（observing，window=72h）。

## Depends on

- T310

## Inputs

- Spec：`../spec.md` §4.1、OC-01
- 既有：scout outreach、outbox worker publish 成功路徑

## Outputs

| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/**/scout/**` | edit | hook on publish/mark done |
| `apps/backend/internal/**/outbox/**` 或 worker | edit | hook on step published |
| `apps/backend/internal/**/outcome/**` | edit | CreateFromSource |

### 行為變更

- draft/new/skipped **不**建 Outcome
- 冪等：同一 source 不重複建（或更新同一筆）

## Out of scope

- 自動訊號觀測（T312）
- FE

## Acceptance

- [ ] Spec：OC-01
- [ ] Test：`TestOC_01_CreateOnPublished`
- [ ] 指令：

```bash
cd apps/backend && go test ./internal/... -run OC_01|OutcomeHook -count=1
```

## Notes

—
