docs(comments): 注释中文化 · internal/runtime/model + internal/services/backthink(54 文件,纯替换)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 只翻注释/文档字符串:`go/scanner` 剥注释后按 token 序列+literal 逐 token 比对,**54/54 文件 SAME**;
  改动文件总行数与 HEAD 漂移 = 0(严格 1:1,无合并/拆行)
- 裁决编号与 design 节号逐字保留(03.4.1/03.4.2/03.4.3/14.4.1/14.4.5/07.4.2-4、design/04 §3.1/§3.2 等);
  `chat_template_kwargs` / `enable_thinking` / `reasoning_effort` / `thinking:{type}` 字段名与形状说明未动
- 存疑译法(已登记):`persona` 在叙事语境用「角色」、标识符语境保留 `persona`(仓库既有模块本身混用);
  `rung`→「级」;`provider` 存在「提供商/提供者」两种落笔(可按需一键统一)
- 复核:build/vet 绿 + 两包测试绿;gofmt 干净;残留英文注释 0 条
- 既有存量(未修,只报告):`model/anthropic_test.go` 612 行 >500;`applyAnthropicEvent` 115 行 >80
This commit is contained in:
AskaEth committed 2026-10-04 16:27:54 +08:00
1 parent f5cf117482
commit 3dc1232bc2
54 files changed
+1923 -1923

No files matched your search

+14 -14
View File
@@ -6,9 +6,9 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/config/runtimeconfig"
)
// TestRouter_RouteRequestForPersona pins 裁决 03.4.1: the "role" of per-role
// routing is the persona a turn answers as, and a persona without a binding keeps
// the message-role behavior.
// TestRouter_RouteRequestForPersona 钉住裁决 03.4.1:按角色路由里的
// 「角色」是本回合作答所依据的 persona,而未绑定的 persona 保持
// 消息角色行为。
func TestRouter_RouteRequestForPersona(t *testing.T) {
t.Parallel()
r := NewRouter("default",
@@ -39,10 +39,10 @@ func TestRouter_RouteRequestForPersona(t *testing.T) {
}
}
// TestRouter_PersonaBindingIgnoresBlankAndImageDoesNotSwitch pins two edges: a
// blank persona/model cannot create a binding, and a persona-routed image request
// is not silently re-routed to a vision model (that decision belongs to
// vision.Router, 裁决 14.4.1/14.4.5).
// TestRouter_PersonaBindingIgnoresBlankAndImageDoesNotSwitch 钉住两个边界:空
// persona/模型无法创建绑定,而按 persona 路由的图像请求
// 不会被静默改道到视觉模型(那个决策属于
// vision.Router,裁决 14.4.1/14.4.5)。
func TestRouter_PersonaBindingIgnoresBlankAndImageDoesNotSwitch(t *testing.T) {
t.Parallel()
r := NewRouter("default",
@@ -63,9 +63,9 @@ func TestRouter_PersonaBindingIgnoresBlankAndImageDoesNotSwitch(t *testing.T) {
}
}
// TestRuntimeLLM_PersonaRoutesFromModelsJSON pins the carrier: a per-persona
// binding written on the models.json group reaches the router through the hot
// snapshot, and a reload picks up a changed binding (裁决 03.4.1 载体 = models.json)。
// TestRuntimeLLM_PersonaRoutesFromModelsJSON 钉住载体:写在
// models.json 组上的按 persona 绑定经热
// 快照到达路由器,且一次重载会拾取改过的绑定(裁决 03.4.1 载体 = models.json)。
func TestRuntimeLLM_PersonaRoutesFromModelsJSON(t *testing.T) {
path := writeRTFile(t, []runtimeconfig.Group{{
ID: "openai", Provider: ProviderOpenAI, BaseURL: "https://x", Model: "group-model",
@@ -96,10 +96,10 @@ func TestRuntimeLLM_PersonaRoutesFromModelsJSON(t *testing.T) {
}
}
// TestRuntimeLLM_NoVisionPreemptionOnImage pins that the runtime snapshot no longer
// carries the env vision model: a configured LLM_VISION_MODEL must not switch an
// image-bearing request to another model, because image routing is owned by
// vision.Router (裁决 14.4.1/14.4.5).
// TestRuntimeLLM_NoVisionPreemptionOnImage 钉住运行时快照不再
// 携带 env 视觉模型:已配置的 LLM_VISION_MODEL 不得把
// 携带图片的请求切到另一个模型,因为图像路由归
// vision.Router 所有(裁决 14.4.1/14.4.5)。
func TestRuntimeLLM_NoVisionPreemptionOnImage(t *testing.T) {
path := writeRTFile(t, []runtimeconfig.Group{{
ID: "openai", Provider: ProviderOpenAI, BaseURL: "https://x", Model: "group-model",