docs(comments): 注释中文化 · internal/runtime/orchestration(29 文件,纯替换)
- 只翻注释/文档字符串:剥离注释后代码行逐字节不变(机械校验只剩允许的行尾注释形态) - 裁决编号与 design 节号(02.4.3 / 11.4.2 / design/05 §9 等)逐字保留 - 复核:go build 绿;orchestration 及其子包(audit/comm)测试绿;gofmt 干净
This commit is contained in:
1 parent
fe90f64a56
commit
eb1828ee7a
29 files changed
+751
-949
No files matched your search
@@ -7,19 +7,15 @@ import (
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/memory"
|
||||
)
|
||||
|
||||
// This file owns the scheduler's long-term-memory half: handing a sub-agent's task
|
||||
// memory to the injected *memory.Store. It sits next to persona.go because the role
|
||||
// a sub-agent runs as (design/22 §8-2) is exactly the scope its memory is filed
|
||||
// under.
|
||||
// 本文件持有调度器的长期记忆那一半:把子代理的任务记忆交给注入的 *memory.Store。
|
||||
// 它紧挨 persona.go,因为子代理以哪个角色运行(design/22 §8-2)正是其记忆归档的
|
||||
// 作用域。
|
||||
|
||||
// SinkMemory persists a task memory item for a sub-agent through the injected
|
||||
// *memory.Store. The role the sub-agent ran as is used as the persona/role key —
|
||||
// the dispatched target persona when one was named, otherwise the legacy RoleID
|
||||
// binding — so a sub-agent standing in for another role writes that role's memory
|
||||
// domain, never the spawning session's (design/22 §8-2/§8-5). Content and the
|
||||
// scope/kind classification (user/persona/project) are supplied by the caller,
|
||||
// keeping scope policy at the call site. It returns ErrNoMemory when no store was
|
||||
// injected.
|
||||
// SinkMemory 通过注入的 *memory.Store 为子代理持久化一条任务记忆。子代理以哪个
|
||||
// 角色运行即用作 persona/角色键 —— 指名了派发目标角色时用该角色,否则沿用旧的
|
||||
// RoleID 绑定 —— 因此替班另一个角色的子代理写入的是那个角色的记忆域,绝不是派发
|
||||
// 会话的(design/22 §8-2/§8-5)。内容与作用域/类别归类(user/persona/project)由
|
||||
// 调用方提供,使作用域策略留在调用点。未注入 store 时返回 ErrNoMemory。
|
||||
func (s *Scheduler) SinkMemory(ctx context.Context, sub *SubAgent, content string, scope memory.Scope, kind memory.Kind) (memory.MemoryItem, error) {
|
||||
if s.memory == nil {
|
||||
return memory.MemoryItem{}, fmt.Errorf("orchestration: sink memory: %w", ErrNoMemory)
|
||||
|
||||
Reference in new issue
Block a user