spark-server/docs/daily/2026-09-29-change-list.md
2026-09-29 16:37:36 +08:00

169 lines
4.2 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-09-29
## 10:18 — 提交门禁:无 Go 不得跳过 make test
### 概要
- `make test` / pre-commit 在缺少 `go` 或 `golangci-lint` 时明确失败,禁止把「本机无 go」当作验证 skipped。
- 新增 `make setup`(装 hook + `check-dev`)。
### 变更范围
| 类型 | 说明 |
|------|------|
| 配置 | Makefile `check-go` / `check-golangci-lint` / `setup` |
| 配置 | `scripts/git-hooks/pre-commit` 前置工具检查 |
| 文档 | AGENTS、verify/git-commit 规则、spark-im-v3 skill、daily-change-list skill、README |
### 主要文件
- `Makefile` — `lint: check-dev`;缺工具 exit 1
- `scripts/git-hooks/pre-commit` — 无 go/lint 直接拒绝 commit
- `.cursor/rules/verify-before-done.mdc` / `git-commit-gate.mdc` — 策略说明
### 验证
- `make test`: pass
## 11:24 — 敏感词发送处罚详细设计
### 概要
- 对照当前发送链、用户状态、Admin 封禁与 `StatusHidden`,写成可实施的机审设计:`moderation` 模块、AccountGate、分类处罚、表结构、错误码与分期;v1 不做 hide。
### 变更范围
| 类型 | 说明 |
|------|------|
| 文档 | `docs/moderation.md` |
### 主要文件
- `docs/moderation.md` — IM 文本敏感词与处罚设计稿
### 验证
- `make test`: skipped(纯文档,无编译/测试面)
### 关联
- 对话:文本发送敏感词分类处罚
## 11:35 — 敏感词匹配算法设计
### 概要
- 补全匹配:逐 rune 折叠+丢分隔、Aho-Corasick、区间映回原文、replace 合并打码;v1 无简繁、无英文词边界。
### 变更范围
| 类型 | 说明 |
|------|------|
| 文档 | `docs/moderation.md` §6 |
### 主要文件
- `docs/moderation.md` — 匹配流水线与用例
### 验证
- `make test`: skipped(纯文档)
### 关联
- 对话:敏感词如何匹配
## 15:10 — 敏感词机审 v1 实现
### 概要
- 落地 `pkg/sensitive`(Fold + Aho-Corasick)、`moderation` 模块、发送链 AccountGate/Scan/处罚、`40302`/`40303`、Admin 词库与命中查询;封禁与机审 disable 统一踢线。
### 变更范围
| 类型 | 说明 |
|------|------|
| 功能 | 文本发送敏感词;全站禁言;封号踢线 |
| 迁移 | `0028_moderation.sql` |
| HTTP Admin | `/api/admin/spark|pop/sensitive-words*`、`sensitive-hits` |
### 主要文件
- `migrations/0028_moderation.sql`
- `internal/pkg/sensitive/`、`internal/module/moderation/`
- `internal/module/message/logic/send_moderation.go`
- `internal/module/user/logic/account_send.go`
- `internal/bootstrap/app.go`、`internal/transport/http/router_admin.go`
### 验证
- `make test`: pass
### 关联
- `docs/moderation.md`
## 15:32 — 敏感词种子 SQL 与 OpenAPI
### 概要
- 新增 `0029_sensitive_words_seed.sql`(按分类默认处罚 16 条示例词);OpenAPI 增加 `admin-moderation` 路径与 schema;envelope 增加 `40302`/`40303`。
### 变更范围
| 类型 | 说明 |
|------|------|
| 迁移 | `0029_sensitive_words_seed.sql` |
| 文档 | `internal/transport/http/docs/openapi.yaml` |
| API | 词条/命中 JSON 字段 snake_case |
### 主要文件
- `migrations/0029_sensitive_words_seed.sql`
- `internal/transport/http/docs/openapi.yaml`
- `internal/module/moderation/entity/word.go`
### 验证
- `make test`: pass
## 15:55 — OpenAPI 管理端 tag 统一为 admin
### 概要
- 不改 Gin 路由;去掉 tag `admin-music`,音乐与敏感词等管理接口统一为 `admin`,description 按 `…/spark/im|music|sensitive-words` 等路径分模块。
### 变更范围
| 类型 | 说明 |
|------|------|
| 文档 | `openapi.yaml`、`docs/moderation.md`、`docs/popadmin-music-novels-deploy.md` |
### 主要文件
- `internal/transport/http/docs/openapi.yaml`
### 验证
- `make test`: pass
## 15:55 — OpenAPI 管理端 tag 统一为 admin
### 概要
- 不改 Gin 路由;去掉 tag `admin-music`,音乐与敏感词等统一为 `admin`,description 按 `…/spark/im|music|sensitive-words` 等路径分模块。
### 变更范围
| 类型 | 说明 |
|------|------|
| 文档 | `openapi.yaml`、`docs/moderation.md`、`docs/popadmin-music-novels-deploy.md` |
### 主要文件
- `internal/transport/http/docs/openapi.yaml`
### 验证
- `make test`: pass