docs(cyrene): cmd/cyrene 存量英文注释中文化(22 个非测试文件,仅注释)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 四组并行完成:main/wire*.go、wire_capacity|channels|runtime、channels|persona_*|emotion|observability、
  voice|plugins|stream|skills|vision|subagent_tool|extractor|mcp|sessionread_tool|terminal_tool。
- 机械校验(git diff -U0 去 // 行与空行)仅剩 wire_frontend.go:84 一处行尾注释:代码前缀
  「\ta.gw = gw 」经 cat -A 与 HEAD 逐字节比对一致(allow 清单已声明)。
- 验收:隔离 worktree(HEAD + 本批 patch)go build/vet 绿、全树 58 包 ok、
  linux/amd64 + darwin/arm64 交叉编译绿;gofmt -l 干净。
- 备注:整树两次红均为负载敏感 flake(backthink / orchestration 的 timeout 类用例单独 -count=20 全过)。
This commit is contained in:
AskaEth committed 2026-10-04 16:58:06 +08:00
1 parent 5c2189efb0
commit 52f08dc343
22 files changed
+455 -586

No files matched your search

+10 -12
View File
@@ -19,8 +19,8 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/services/backthink"
)
// wireAuxiliary builds the execution provider, task manager, IoT manager,
// channel session manager, automations and background thinking services.
// wireAuxiliary 组装执行提供者、任务管理器、IoT 管理器、渠道会话管理器、
// 自动化服务与后台思考服务。
func (a *app) wireAuxiliary() error {
provider, err := exec.New(a.cfg.ExecSandbox, a.log)
if err != nil {
@@ -84,10 +84,9 @@ func (a *app) wireAuxiliary() error {
return nil
}
// pushOutletConfig maps the environment push-outlet block into the backthink
// exporter config. The Getui credentials are read by config but not consumed:
// the fallback SDK is not integrated yet, so the outlet logs the pending tier
// instead of faking a push. The token is passed through and never logged.
// pushOutletConfig 把环境变量里的推送出口配置块映射为 backthink 的导出器配置。
// 个推(Getui)凭据只被 config 读取、并不消费:备用 SDK 尚未接入,因此出口在
// 待接入该档位时记日志,而不是伪造一次推送。token 只透传,绝不写日志。
func (a *app) pushOutletConfig() backthink.PushOutletConfig {
po := a.cfg.PushOutlet
return backthink.PushOutletConfig{
@@ -99,7 +98,7 @@ func (a *app) pushOutletConfig() backthink.PushOutletConfig {
}
}
// close shuts down every subsystem in dependency order and releases resources.
// close 按依赖顺序关闭每个子系统并释放资源。
func (a *app) close(ctx context.Context) {
if a.backthink != nil {
_ = a.backthink.Stop(ctx)
@@ -137,9 +136,8 @@ func (a *app) close(ctx context.Context) {
a.log.Info("cyrene shutdown complete")
}
// resolveDataDir returns the configured data directory (from .env / env, via
// cfg.DataDir), falling back to the OS-appropriate default only when no
// directory is configured.
// resolveDataDir 返回配置的数据目录(来自 .env / 环境变量,经 cfg.DataDir);
// 只有在没有配置目录时才回落到与操作系统相称的默认值。
func resolveDataDir(cfg *config.Config) string {
if cfg.DataDir != "" {
return cfg.DataDir
@@ -147,8 +145,8 @@ func resolveDataDir(cfg *config.Config) string {
return platform.DefaultDataDir()
}
// resolveSQLitePath returns the SQLite path to use, deriving it under the data
// directory when the configured default is left untouched.
// resolveSQLitePath 返回实际使用的 SQLite 路径:当配置里仍是默认值时,
// 把它推导到数据目录下。
func resolveSQLitePath(cfg *config.Config, dataDir string) string {
p := cfg.DB.SQLitePath
if strings.TrimSpace(p) == "" || p == defaultSQLitePath {