thread-master/old/docs/cleanup-log.md

88 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 死碼清理紀錄
日期2026-07-09
對齊 `docs/post-project-plan.md`(砍掉舊 Flow A 完整 pipeline與靜態引用分析。
**保留**目前 Missions 仍在用的inspire、content_ops、copy_draft、topic/formula/rewrite workers。
---
## 已移除
### 1. 假成功的 copy_mission API除 inspire
- 刪除 21 組 stub handler/logicgoctl `// todo` + `return nil` → HTTP 200 null
- `routes.go` 只掛 `POST /:personaId/copy-mission-inspiration`
- `generate/api/copy_mission.api` 縮成 inspire only
### 2. 幽靈 Job template / worker
已刪 template 定義與 Ensure*
- `analyze-copy-mission` / `go-analyze-copy-mission`
- `expand-copy-mission-graph` / `go-expand-copy-mission-graph`
- `generate-copy-matrix` / `go-generate-copy-matrix`
- `generate-copy-draft` / `go-generate-copy-draft`
- `refill-publish-inventory` / `go-refill-publish-inventory`
已從 `scripts/dev-all.sh`、`deploy/docker-compose.yml` 拿掉對應 process。
### 3. Refill job HTTP
-`start_publish_inventory_refill_job` handler/logic
- 路由與 `.api` 一併移除
- **保留** `publish_inventory` policy APIslot insights 仍讀 policy
### 4. 從未接線的 model / library
| 項目 | 說明 |
|------|------|
| `model/crm_contact` | 只在 DI/index無 API |
| `model/publish_draft` | 只有 domain 空殼 |
| `library/embedding` | 註解寫未接線 |
| `library/matrix/copy_generate.go` 的 prompt 路徑 | 無 caller共用 helper 移到 `research_map.go` |
| `prompt/files/matrix_copy.*` | 僅上述路徑使用 |
| `library/copymission` knowledge/research/reference helpers | 僅測或無 production caller**保留** `matrix_lock.go` |
### 5. 前端標籤
- `jobLabels.ts` 去掉已刪 template 文案
---
## 刻意保留(還不能刪)
| 項目 | 原因 |
|------|------|
| `model/copy_mission` | `scan_viral`、部分 draft 路徑仍耦合 `copy_mission_id` |
| `model/copy_draft` / `content_ops` | MissionsPage 主線 |
| `inspire` API | 前端主題發想 |
| topic/formula/rewrite workers | Missions 產稿 |
| Flow Bbrand / patrol / outreach | 海巡主線 |
| `publish_inventory` policy | 設定與 slot insights |
完整 drop collection / 換 Post Project 見 `docs/post-project-plan.md`
---
## 驗證
```bash
cd backend
go build -o bin/gateway gateway.go
go build -o bin/worker ./cmd/worker
go test ./...
```
2026-07-09 當次:`go test ./...` 通過。
---
## 下一步可清(未做)
1. `types.go` 裡 copy_mission CRUD / refill 的殘餘 type`make gen-api` 後會自然消失;手刪易漏)
2. `copy_mission` model 在 scan_viral 解耦後整包刪
3. 前端 `GapsPage` 與真實功能對齊
4. `dev-console/` 若團隊不用可刪
5. Job P0 bugrewrite dedupe、ClaimNext、Heartbeat`docs/improvement-notes.md`