聚合根 AR
实体 Entity
值对象 VO
Repository
领域事件 Event
技术方案 · 统一线程 + InputRequest
统一消息流 + 参与者。ConversationKind 恰 4 值:dm / channel / task / issue。任务/议题各 1:1 绑定会话(ownerRef);参与者镜像订阅真相(Conformist)。仅显式发布的消息入会话;智能体冗长中间输出落 AgentActivityEvent 观测流,不污染线程。
需人介入 → 工作项进 waiting_input + 发一条带 inputRequestRef 的消息(Message 字段是 inputRequestRef,非 work_item_ref)。人在线程回应即解阻塞,工作项回 active。
会话 status:active→closed→archived(终态)
战术设计 · 聚合 / 实体 / 值对象 / 事件
会话 · Conversation internal/conversation
Conversation 会话 AR
id · kind(ConversationKind) · ownerRef(OwnerRef) · projectRef · name · description · parentConversationID · participants[]ParticipantElement · createdBy(IdentityRef) · status(active/closed/archived) · openedAt · closedAt · closedReason · closedMessage · archivedAt · archivedBy · organizationID · version
kind(恰 4 值):
dmchanneltaskissue
status:
active→
closed→
archived
实体·值对象
Message(追加写)ParticipantElementOwnerRef · ContextRefs · MessageAttachmentConversationMessageReference(carry-over)
Message 字段:id · conversationID · senderIdentityID(IdentityRef) · contentKind · content · direction · inputRequestRef(非 work_item_ref) · contextRefs · attachments[] · postedAt。
Repository · 事件
ConversationRepository · MessageRepository · ConversationMessageReferenceRepository · UserConversationReadStateRepository
conversation.openedconversation.message_addedconversation.closedconversation.archivedconversation.participant_joinedconversation.participant_left领域服务 · 参与者管理:把项目管理订阅真相投影为会话参与者(Conformist,乐观锁 R-M-W)。消息写入:校验仅 active 可写 + 参与者准入 → 追加消息 → 发 conversation.message_added。
跨域协作:本域以 CF(Conformist)镜像项目管理的订阅真相为参与者;与项目管理为 U/D(每 Task/Issue 1:1 绑定会话);向可观测性同事务发事件。完整业务流见 战略设计 · Event Storming。