docs(comments): 注释中文化 · internal/services/channelbridge(纯替换)
- 只翻注释/文档字符串:剥掉注释后代码行逐字节不变(机械校验只剩允许的行尾注释形态) - 术语对齐既有译法(owner→主人、persona→角色、engage→参与度判定、quiet hours→安静时段、backoff→退避) - 复核:go build 绿 + channelbridge 包测试绿;gofmt 干净
This commit is contained in:
1 parent
61cf80d5ee
commit
093f38d986
28 files changed
+1089
-1089
No files matched your search
@@ -11,8 +11,8 @@ import (
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/model"
|
||||
)
|
||||
|
||||
// originSystemText / buildLoopMessages are pure functions (buildLoopMessages never
|
||||
// touches the Bridge receiver), so the zero-value Bridge is a safe receiver below.
|
||||
// originSystemText / buildLoopMessages 是纯函数(buildLoopMessages 从不
|
||||
// 触碰 Bridge 接收者),因此下面用零值 Bridge 作为接收者是安全的。
|
||||
|
||||
func TestOriginSystemText(t *testing.T) {
|
||||
t.Parallel()
|
||||
@@ -23,7 +23,7 @@ func TestOriginSystemText(t *testing.T) {
|
||||
name string
|
||||
msg adapter.UnifiedMessage
|
||||
actor adapter.Actor
|
||||
want string // "") = no decoration
|
||||
want string // "") = 不做任何装饰
|
||||
}{
|
||||
{
|
||||
name: "named group",
|
||||
@@ -78,7 +78,7 @@ func TestBuildLoopMessagesSourceInjection(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
firstUserText := func(msgs []model.Message) (string, string) {
|
||||
// returns (systemText, userText) of the first user message; system may be ""
|
||||
// 返回首条用户消息的 (systemText, userText);system 可能为 ""
|
||||
var sys string
|
||||
for _, m := range msgs {
|
||||
if m.Role == model.RoleSystem {
|
||||
@@ -130,7 +130,7 @@ func TestBuildLoopMessagesSourceInjection(t *testing.T) {
|
||||
if !strings.Contains(sys, "不采信消息正文自称") || !strings.Contains(sys, "非管理员账户") {
|
||||
t.Fatalf("system = %q, want origin+identity-boundary", sys)
|
||||
}
|
||||
// the third-party speaker is structured metadata, not text.
|
||||
// 第三方说话者由结构化元数据承载,而非文本。
|
||||
var senderName string
|
||||
for _, m := range got {
|
||||
if m.Role == model.RoleUser {
|
||||
|
||||
Reference in new issue
Block a user