feat(channel,runtime): 批次2 后端 — 消息级角色归属进上下文 + IM 私聊随主会话角色 + 渠道级绑定
按 design/22 §2/§3/§4.4/§7(3/4/5)。 - ①「消息级角色归属」进入模型上下文(批次 1 只做存储+DTO):历史消息的发送角色现在对模型可见,且**不把系统元数据塞进用户正文**(design/11 §10 红线) - ② IM owner 私聊镜像解析出的角色 = **主会话绑定的角色**(§7-3) - ③ 渠道级绑定:ChannelAccount 加 personaId(channels.json 读写/校验/脱敏沿用既有约定)+ 角色解析优先级 **会话 > 渠道 > 默认** + **群聊/陌生人强制默认角色**(§7-4);admin 渠道配置端点支持 personaId - Docs/api-client 版本 +1 - 验收:go build/vet/test 全绿 + linux/darwin 交叉编译
This commit is contained in:
1 parent
3732c538cc
commit
5969bba3bd
22 files changed
+1396
-23
No files matched your search
@@ -61,6 +61,15 @@ func WithSessionEnv(ctx context.Context, env SessionEnv) context.Context {
|
||||
return context.WithValue(ctx, sessionEnvKey{}, env)
|
||||
}
|
||||
|
||||
// SessionEnvFrom returns the environment attached to ctx by WithSessionEnv, or the
|
||||
// owner-full default when none was attached (backward compatible). It is the read
|
||||
// side of WithSessionEnv, for a caller that receives only a context — a Chatter
|
||||
// implementation that must know the turn's role/isolation boundary, or a test
|
||||
// asserting what an inbound path resolved. The value is display/scope metadata
|
||||
// only: identity and permission were already decided by the actor metadata before
|
||||
// the env existed (project red line).
|
||||
func SessionEnvFrom(ctx context.Context) SessionEnv { return sessionEnvFrom(ctx) }
|
||||
|
||||
// sessionEnvFrom returns the env attached to ctx, or the owner-full default when
|
||||
// none was attached (backward compatible).
|
||||
func sessionEnvFrom(ctx context.Context) SessionEnv {
|
||||
|
||||
Reference in new issue
Block a user