docs(runtime): internal/runtime/loop 44 个文件注释改中文(逐行 1:1,代码零字节改动)

主人 2026-10-03 拍板「注释一律中文」;本模块按长期分批协议(一个模块一次派工)执行。
注释行数 1329 → 1329 逐行 1:1(含中文 33 → 1304);行尾注释 5 条一并译。
校验:机械校验(非注释改动行)= 空;独立 Go AST 程序(剥注释复渲)证明 44/44 文件代码全等;
全树 go test ./... 58 包 ok / 0 FAIL;交叉编译绿。
gofmt:capacity_loop_test.go / flow.go 改动前即未格式化,按铁律保留原样未动。
This commit is contained in:
AskaEth committed 2026-10-03 22:28:21 +08:00
1 parent 355f81d04a
commit 91e8d7a029
44 files changed
+1315 -1315

No files matched your search

+7 -7
View File
@@ -9,9 +9,9 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/trace"
)
// TestRun_PublishesFlowGraph_Trunk wires a FlowPublisher with a capturing publish
// function and a live tracer, runs one tool round and asserts ws.graph_update was
// published with the input→llm→tool→output trunk (design/19 §1 P1).
// TestRun_PublishesFlowGraph_Trunk 给 FlowPublisher 接上捕获式 publish
// 函数与实时 tracer,跑一轮工具,并断言 ws.graph_update
// 以 input→llm→tool→output 主干发布(design/19 §1 P1)。
func TestRun_PublishesFlowGraph_Trunk(t *testing.T) {
var mu sync.Mutex
var seen []*trace.FlowGraph
@@ -76,7 +76,7 @@ func TestRun_PublishesFlowGraph_Trunk(t *testing.T) {
}
}
// Walk the chain from the input node; it must reach output through llm/tool.
// 从 input 节点开始走链;它必须经 llm/tool 到达 output。
chain := []string{}
cur := inputID
for cur != "" {
@@ -98,7 +98,7 @@ func TestRun_PublishesFlowGraph_Trunk(t *testing.T) {
if chain[len(chain)-1] != "output" || !hasLLM || !hasTool {
t.Fatalf("trunk chain broken: %v", chain)
}
// The final frame should show the tool completed (done), not still running.
// 最终帧应显示该工具已完成(done),而不是仍在运行。
for _, n := range last.Nodes {
if n.Kind == "tool" && n.Status != trace.FlowStatusDone {
t.Fatalf("tool status = %q, want done", n.Status)
@@ -106,8 +106,8 @@ func TestRun_PublishesFlowGraph_Trunk(t *testing.T) {
}
}
// nextNode returns the node that cur points to, or "" when cur has no outgoing
// edge (the terminal output node). A linear chain has at most one successor.
// nextNode 返回 cur 指向的节点;cur 没有出边时返回 ""(终端的
// output 节点)。线性链至多有一个后继。
func nextNode(g *trace.FlowGraph, cur string) string {
for _, e := range g.Edges {
if e.From == cur {