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

+9 -9
View File
@@ -8,12 +8,12 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/model"
)
// weekdaysCN maps time.Weekday (0=Sunday) to a Chinese weekday label.
// weekdaysCN 把 time.Weekday(0=周日)映射为中文星期标签。
var weekdaysCN = [...]string{"周日", "周一", "周二", "周三", "周四", "周五", "周六"}
// loadTimezone resolves the configured IANA timezone into a *time.Location for
// the per-round time injection. An empty name (or one that fails to load) yields
// nil, disabling injection entirely (backward compatible, graceful degradation).
// loadTimezone 把配置的 IANA 时区解析为 *time.Location,供每轮
// 时间注入使用。空名(或加载失败的名字)返回 nil,
// 从而完全关闭注入(向后兼容,优雅降级)。
func loadTimezone(name string, log *slog.Logger) (*time.Location, string) {
if name == "" {
return nil, ""
@@ -26,11 +26,11 @@ func loadTimezone(name string, log *slog.Logger) (*time.Location, string) {
return loc, name
}
// currentTimeBlock renders one per-round "current time" system message so the
// model knows the wall-clock time each round (not a first-turn snapshot). It is
// called from assembleContext only when a timezone was configured. It provides
// the raw clock — whether it is "late and time to sleep" is the persona prompt's
// job, not a hard-coded rule here.
// currentTimeBlock 渲染一条每轮「当前时间」系统消息,使模型
// 每轮都知道墙上时钟时间(而非首轮快照)。它仅在配置了
// 时区时由 assembleContext 调用。它只提供原始时钟 ——
// 是否「夜深该睡了」是人格提示词的职责,不是这里的
// 硬编码规则。
func (l *Loop) currentTimeBlock() model.Message {
now := time.Now().In(l.timeLocation)
text := fmt.Sprintf("当前时间:%s %s,时区 %s",