Files
Volcano-Engine-TTS-UI/.gitignore
T
tts-stage1 a614ab55c9 feat(route): 阶段 1 多渠道路由分发层 (Channel + Router)
- store: 新增 channels 表 (name unique, credentials_json, voices CSV,
  priority, weight, status, auto_ban) + CRUD (List/Get/Insert/SetStatus/Delete)
  + ErrChannelDuplicate 区分 (避免与 ErrDuplicate 互相误报)
- store/db.go: schemaVersion 1 -> 2; channels 表 CREATE IF NOT EXISTS + 复合索引
- adapter/route: 新包,Channel (含 BuildRequest 覆盖 template.Credentials)
  + Router (Select / SelectAndSynthesize / pickByWeight 纯函数)
  + 错误区分 ErrNoChannels (走兜底) vs ErrVoiceNotFound (400)
  + AggregateError 聚合多渠道失败, 供 controller 日志逐个打印
- controller/router.go: SetRouter/GetRouter 句柄 (与 SetAdminStore 同一模式)
- controller/tts.go: 接入 Router, 零 channel 走 setting 兜底 (行为=阶段 0);
  voice 不被任何 channel 接受 -> 400 + voice_not_found; 抽出 finalizeSynth
  收敛合成结果->响应+metrics+日志三件套
- main.go: 启动期从 store 加载 channels, 转 route.Channel, 注入 controller;
  credentials_json 加载失败 -> fail-fast (避免一个错渠道拖崩全部请求)
- .gitignore: 补 .gotmp/ .gomodcache/ .dsh-acl/

验收 (设计文档 §9):
  - 零 channel 兜底, 行为=阶段 0
  - 加 1 个 channel: 走该渠道
  - 加 2+ 个同档不同 weight: pickByWeight weight-1-to-3 分布 ±5% (单测覆盖)
  - 不同 priority: 高优先级优先 (单测覆盖)
  - disabled 不参与选择 (单测覆盖)
  - 失败降级: 同档换下一个 -> 降档, 全失败返 AggregateError (单测覆盖)
  - go build ./... + go vet ./... 全绿
  - go test ./... (adapter/route 15 个, store 2 个, 全部通过)
2026-10-11 15:33:22 +08:00

57 lines
1.4 KiB
Plaintext

# Go build cache
.gocache/
.gotmp/
.gomodcache/
*.exe
*.test
*.out
# Go 测试源码:不入库(测试保留在本地磁盘,由开发者自行 go test ./... -count=1)
# 理由:测试用例会暴露内部实现细节与断言,不作为交付物外流。
# 注意:本规则会把测试文件挡在 git 之外,因此仓库内不提供自动化测试,
# 也没有自动化质量门 —— 守行为回归只能靠开发者在本地执行测试。
*_test.go
# Editor / OS
.vscode/
.idea/
.DS_Store
Thumbs.db
# Logs
*.log
# Secrets (do NOT commit local .env files; keep .env.example tracked as template)
.env
.env.*
!.env.example
# Local-only working notes (use task board for shared tracking)
TODO.md
# Release artifacts (build output)
release/
# Local build output (start-local.ps1 builds to bin/)
bin/
# Local dev scripts (per-user; not part of repo)
start-local.ps1
# Windows / PowerShell 脚本:一律不入库、不外流
# ui-handoff/serve.ps1 与 start-local.ps1 是本地起服便利脚本(含本机路径与端口),
# 不属于交付物。这两个文件在文件系统层面删除被拒,因此只能在 git 层屏蔽。
*.ps1
# UI handoff bundle(改造前的单文件副本 + 离线 mock 预览;仅本地对照,不部署)
ui-handoff/
# Runtime database artifacts (created by M1 installer flow)
tts.db
tts.db-*
tts.db.*
installed.lock
# DSH sandbox ACL repair artifacts (created by diagnose-windows-sandbox-acl skill)
.dsh-acl/