Conversation
- Introduced a comprehensive refactor plan for the Core CQRS architecture, focusing on establishing a unified abstraction layer for the Workflow and Maker subsystems. - Documented current state analysis, architectural goals, and phased implementation strategies to enhance modularity and facilitate cross-system integration. - Included detailed interface specifications and project organization restructuring to support the transition towards a more cohesive CQRS framework.
- Introduced the `Aevatar.CQRS.Core` and `Aevatar.CQRS.Core.Abstractions` projects to establish a unified CQRS framework, including essential interfaces and default implementations for command execution and correlation. - Integrated the Maker subsystem into the solution, restructuring its components and updating references to improve modularity and maintainability. - Updated various project files and documentation to reflect the new architecture, including changes to dependency injection and service registration. - Enhanced the `InMemoryStream` class to support concurrent subscriber dispatching, improving performance in event handling scenarios. - Revised README files to provide clearer guidance on the new subsystem structure and its components.
…text management - Introduced a new `CommandContext` structure to replace the previous `CommandCorrelation` model, enhancing clarity in command execution and metadata handling. - Removed obsolete command correlation policies and streamlined the command execution process by integrating the new context management. - Updated various components, including command envelope factories and execution services, to utilize the new command context, improving modularity and maintainability. - Revised dependency injection configurations to reflect the architectural changes and ensure proper service registration. - Enhanced documentation to provide clear guidance on the new command context structure and its implications for the CQRS framework.
…command context management - Eliminated the RunId concept from the CQRS framework, simplifying the architecture and reducing complexity in command execution. - Introduced a new CommandId to replace RunId, improving clarity in command tracking and metadata handling. - Updated various components, including command context policies and projection lifecycle services, to reflect the removal of RunId and the introduction of CommandId. - Revised dependency injection configurations and documentation to align with the new command context structure and its implications for the CQRS framework. - Enhanced the InMemoryStream class to support improved event handling and subscriber dispatching.
- Introduced the Aevatar.Platform and Aevatar.Maker subsystems, establishing a modular architecture for command and query handling. - Implemented CQRS patterns in the new subsystems, including command dispatching and state management. - Updated solution and project files to include new components, enhancing overall structure and maintainability. - Revised README documentation to reflect the new architecture and provide guidance on subsystem usage and integration. - Improved dependency injection configurations to support the new subsystems and their respective services.
…em implementations - Introduced `Aevatar.CQRS.Runtime.Abstractions` to define core command and execution contracts, improving modularity and separation of concerns. - Added `Aevatar.CQRS.Runtime.FileSystem` for local file system storage of command states, inbox, outbox, and dead letters, facilitating persistence without external dependencies. - Updated solution and project files to include new runtime components, enhancing overall structure and maintainability. - Created comprehensive documentation for the new abstractions and file system implementations, providing guidance on usage and integration. - Revised dependency injection configurations to support the new runtime components and their respective services.
- Introduced `Aevatar.Workflow.Host.Api` as the new entry point for workflow-related chat protocols, replacing the previous `Aevatar.Host.Api`. - Updated project references and configurations to support the new workflow architecture, enhancing modularity and maintainability. - Revised documentation to reflect the transition from `Aevatar.Host.Api` to `Aevatar.Workflow.Host.Api`, clarifying the roles and responsibilities of the new subsystem. - Implemented dependency injection for the new runtime hosting components, ensuring seamless integration with existing services. - Removed obsolete `Aevatar.Host.Api` components, streamlining the codebase and reducing complexity.
- Deleted the `Aevatar.Host.Gateway` project and its associated files, including `Program.cs`, `GlobalUsings.cs`, and `README.md`, to streamline the architecture. - Updated the solution file to reflect the removal of the `Aevatar.Host.Gateway` project, enhancing modularity and reducing complexity in the codebase.
- Replaced legacy host project references in the solution file with a new long-term architecture maintenance document, enhancing clarity on architectural goals. - Added checks in the CI workflow to enforce architectural guidelines, preventing the inclusion of legacy host projects and ensuring proper usage of runtime components in host programs. - Introduced a new documentation file outlining long-term maintenance strategies and subsystem responsibilities, promoting sustainable architecture evolution.
…ion and eliminate redundancy in architectural planning. This deletion supports ongoing efforts to consolidate project documentation and enhance clarity in the refactoring strategy.
- Introduced a new documentation file outlining the complete architecture of the Aevatar project, covering system goals, structure, and responsibilities. - Updated the solution file to include the new documentation, improving accessibility to architectural guidelines and promoting better understanding of subsystem interactions.
- Introduced a comprehensive README.md file detailing the architecture of the `src/workflow` subsystem, including layered dependencies, execution flow, and internal class relationships. - Enhanced understanding of the workflow execution process through visual diagrams and descriptions, promoting clarity in subsystem interactions and responsibilities.
- Extended the `IEventPublisher` interface to include an optional `correlationId` parameter in `PublishAsync` and `SendToAsync` methods, ensuring that correlation IDs are passed through the event handling pipeline. - Updated implementations in `GAgentBase`, `LocalActorPublisher`, and `EventHandlerContext` to support the new correlation ID functionality, enhancing traceability of events across the system. - Added tests to verify that correlation IDs are correctly propagated during event publishing and sending, ensuring consistency and reliability in event handling. - Introduced a new documentation file outlining the correlation ID change plan, detailing the rationale, current issues, and implementation steps for the new feature.
…eability - Replaced `correlationId` with `EventEnvelope` in the `IEventPublisher` interface methods, ensuring that event metadata is consistently propagated through the system. - Introduced `IEnvelopePropagationPolicy` and `ICorrelationLinkPolicy` to manage correlation and causation links between inbound and outbound envelopes, improving event traceability. - Updated implementations in `GAgentBase`, `LocalActorPublisher`, and `EventHandlerContext` to utilize the new envelope-based approach, enhancing the clarity of event handling. - Added a new `ProjectionDispatcher` to streamline the projection process, replacing the previous subscription registry approach, and ensuring a unified dispatch mechanism. - Enhanced documentation to reflect changes in event handling and projection architecture, promoting better understanding and maintainability of the system.
…d registration handling - Updated `BuiltInAgentCatalog` to utilize a dictionary for subsystem registrations, enhancing flexibility and maintainability. - Refactored `List` method to return capabilities from the new registration structure. - Modified `SubsystemEndpointOptions` to support a list of subsystem registrations, replacing legacy base URL fields with optional properties. - Introduced `SubsystemEndpointRegistration` class to encapsulate subsystem details and resolve registrations dynamically. - Added new methods for endpoint resolution and template application, improving the overall architecture of agent command routing.
- Introduced new projects for Saga abstractions, core, and runtime, establishing a foundation for long-running transaction management. - Updated solution files to include new Saga projects and removed the obsolete LONG_TERM_ARCHITECTURE_MAINTENANCE.md document. - Enhanced CI workflow to enforce architectural guidelines, including checks for Saga project dependencies and restrictions on read-model usage in Saga states. - Added comprehensive documentation for Saga introduction, detailing architecture, implementation phases, and compliance with best practices. - Updated PROJECT_ARCHITECTURE.md to reflect the integration of Saga capabilities and clarify subsystem responsibilities.
- Deleted the `Aevatar.Platform.Sagas` project and its associated files, including saga-related commands, queries, and states, to streamline the architecture and eliminate redundancy. - Updated solution files to reflect the removal of the Saga project, enhancing modularity and reducing complexity in the codebase. - Adjusted documentation to remove references to Saga capabilities, ensuring clarity in the project's current architecture and responsibilities.
- Introduced comprehensive documentation for the Aevatar CQRS and Saga architectures, detailing implementation principles, project responsibilities, and execution paths. - Included diagrams to illustrate the overall architecture and command execution models, enhancing understanding of the system's structure and interactions. - Removed the obsolete SAGA_INTRODUCTION_ANALYSIS.md file to streamline documentation and focus on the current architecture.
PR6 Review Report (Re-run on Correct Branch)Review Scope
Findings (ordered by severity)1) HIGH - Path Traversal in Platform command status store
2) HIGH -
|
| # | 问题 | 说明 |
|---|---|---|
| 5.1 | WorkflowCallModule 无递归深度限制 |
嵌套 workflow_call 可无限递归,RunId 拼接无限增长 |
| 5.2 | WorkflowVariables 完整实现但未使用 |
支持点路径访问、插值、合并,但无 Module 引用 |
| 5.3 | StepDefinition.Branches/Children 已解析但未消费 |
结构存在但功能缺失 |
| 5.4 | WorkflowOutputFrame 15 个 nullable 属性的扁平 DTO |
位于 Application.Abstractions,可下沉到 Presentation 层 |
| 5.5 | 四个平行的 CompletionStatus 枚举 | 维护成本高,新增状态需改 4 处枚举 + 3 处映射 |
| 5.6 | AIGAgentExecutionHookContext.LLMRequest/LLMResponse 类型为 object? |
丢失类型安全 |
| 5.7 | RoleAgentConfig 与 AIAgentConfig 字段完全重复 |
手工映射维护负担 |
| 5.8 | EnsureRuntime() 跳过 RegisterToolsFromSourcesAsync |
如果在激活前调用 ChatAsync,工具可能缺失 |
| 5.9 | ProjectionSubscriptionRegistry / ProjectionCoordinator 未 sealed |
子类化可能破坏线程安全不变式 |
| 5.10 | ListRuns 查询端点无分页游标 |
仅支持 take,无 skip/after |
| 5.11 | 中英文日志消息混用 | 如 "工作流未编译或未配置" vs "workflow yaml is empty" |
| 5.12 | TransformModule 吞掉异常并以 Success = true 传递错误信息 |
错误字符串被作为正常数据传给下一步 |
| 5.13 | ToolCallModule._toolIndexLock SemaphoreSlim 未 Dispose |
轻微资源泄露 |
| 5.14 | ActorStreamSubscriptionHub 顺序分发 handler |
慢 handler 阻塞同 actor 的后续 handler |
| 5.15 | ChatInput.Prompt 无长度校验 |
超大 prompt 直接传给 LLM |
6. 测试覆盖
6.1 覆盖概况
| 测试项目 | 文件数 | 用例数(约) | 评价 |
|---|---|---|---|
| Foundation.Abstractions.Tests | 4 | ~12 | 充分 |
| Foundation.Core.Tests | 13 | ~40+ | 优秀(含 7 个 BDD) |
| Host.Api.Tests | 13 | ~55+ | 良好 |
| Workflow.Application.Tests | 2 | ~12 | 良好 |
| Integration.Tests | 8 | ~25+ | 优秀 |
| 合计 | 42 | ~144+ |
6.2 核心关注:Module 行为测试缺失
14 个 Workflow Module 中,仅 ConnectorCallModule 有完整的行为集成测试(5 个用例)。其余 Module 仅通过 WorkflowIntegrationTests.Scenario7_AllCoreModules 验证了可被 factory 创建,无 HandleAsync 行为测试:
| Module | 行为测试 | 风险 |
|---|---|---|
| ToolCallModule | 无 | 工具解析、执行、失败路径未验证 |
| WhileModule | 无 | 迭代计数、max_iterations、DONE 终止未验证 |
| ConditionalModule | 无 | 分支路由(已确认非功能性)未验证 |
| VoteConsensusModule | 无 | 投票收集、共识判断未验证 |
| TransformModule | 无 | 转换逻辑、异常处理未验证 |
| ForEachModule | 无 | 列表展开、子步骤收集未验证 |
| AssignModule | 无 | 变量赋值未验证 |
| WorkflowCallModule | 无 | 嵌套工作流、递归场景未验证 |
| RetrieveFactsModule | 无 | 事实检索逻辑未验证 |
| CheckpointModule | 无 | 检查点行为未验证 |
建议:至少为 ToolCallModule、WhileModule、WorkflowLoopModule 补充行为单元测试,这三个是执行主路径上的关键模块。
6.3 测试质量:优秀
已有测试质量很高:
- 使用真实 in-memory 实现而非 mock,验证真实行为
- 错误路径覆盖充分(projection 失败、超时、disabled、owner binding 违规、connector 缺失)
- FluentAssertions 断言清晰
WorkflowExecutionOwnerBindingTests是最完善的集成测试,验证了 bind-once 语义、RunId 强制、元数据不匹配拒绝等
6.4 其他测试缺口
- WebSocket 端点无测试(仅 HTTP 有)
WorkflowChatRunApplicationService.ExecuteAsync缺少 happy path 测试WorkflowExecutionGAgent销毁竞态无回归测试(DESTROY_RACE_MEMO.md中已提出但未实现)- CancellationToken 传播未在 module pipeline 中测试
7. CI 与文档
7.1 CI 守卫
三项架构守卫有效:
- 禁止
GetAwaiter().GetResult()同步阻塞 - 禁止
TypeUrl.Contains字符串路由 - 禁止
Workflow.Core依赖AI.Core
问题:CI push 触发器配置为 main/dev/refactor/**,但本 PR 目标分支为 master。合并到 master 的 push 不会触发 CI。pull_request 触发器可覆盖,但 push-based 守卫存在盲区。
建议:将 master 加入 push.branches 列表,或统一默认分支名。
7.2 文档质量
| 文档 | 评价 |
|---|---|
WORKFLOW_RUN_LIFECYCLE.md |
优秀。清晰区分 WorkflowGAgent(长生命周期)与 WorkflowExecutionGAgent(per-run),序列图与代码一致 |
IDENTIFIER_RELATIONSHIPS.md |
良好。EventEnvelope.Id / RunId / MessageId / ActorId 职责清晰 |
WORKFLOW_EXECUTION_DESTROY_RACE_MEMO.md |
优秀。诚实的工程备忘,明确问题范围、现有缓解、三种方案比较 |
README.md |
良好。面向目标读者("略懂技术"),快速开始 3 步、架构图、步骤类型参考表 |
8. 亮点
值得肯定的设计:
- CQRS Projection Pipeline 的泛型三层设计:Abstractions → Core → Workflow.Projection,真正可复用(demos 中的 CaseProjection 验证了这一点)
ActiveRunState并发原语:Interlocked.CompareExchange单次状态转换、TaskCompletionSource+RunContinuationsAsynchronously避免重入、per-runCancellationTokenSourceConnectorCallModule的健壮性:retry、timeout、on_error/on_missing策略、域名/方法/路径白名单WorkflowExecutionOwnerBindingTests:bind-once 语义、幂等重绑定、未绑定快速失败、RunId 强制、元数据不匹配拒绝——集成测试标杆- Endpoint 拆分:6 个聚焦文件各司其职,Host 层零业务逻辑
- Hook Pipeline 最佳实践:优先级排序、best-effort 执行、默认方法减少实现负担
DESTROY_RACE_MEMO.md:诚实记录已知低概率问题,而非掩盖
9. 修复优先级总结
合并前必须修复
| # | 问题 | 严重度 |
|---|---|---|
| 3.1 | SSE \\n\\n 字面量 bug |
Critical |
| 3.2 | WhileModule 两处硬编码 | High |
| 3.3 | ToolTruncationHook 截断无效 | High |
| 3.4 | WebSocket 消息无大小限制 | High |
合并后尽快修复
| # | 问题 | 严重度 |
|---|---|---|
| 4.1 | ConditionalModule 分支路由未实现 | Medium |
| 4.2 | ToolManager 异常信息泄露 + JSON 未转义 | Medium |
| 4.3 | 有状态 Module 孤立条目未清理 | Medium |
| 4.9 | HttpConnector new HttpClient() | Medium |
跟踪 backlog
| # | 问题 | 严重度 |
|---|---|---|
| 6.2 | Module 行为测试补充 | Medium |
| 7.1 | CI push 触发器加入 master | Medium |
| 4.4-4.8 | 持久化、拓扑性能、projection 语义等 | Medium |
| 5.x | 低优先级改善项 | Low |
10. 结论
本 PR 的架构设计水平较高,分层严谨,CQRS 投影管道的泛型抽象是值得学习的工程范例。已有测试质量优秀,文档完整诚实。
主要风险集中在 4 个必须修复的 bug(SSE 换行、WhileModule 硬编码、Hook 截断无效、WebSocket OOM)和 Module 行为测试的系统性缺失。修复这些问题后,PR 可以合并。
|
针对 PR 变更统计:9 个文件,+127 / -14 行 验证与定性结果
修复详情修复 1:路径遍历防护(HIGH)问题描述
private string BuildPath(string commandId) => Path.Combine(_statesPath, $"{commandId}.json");攻击者可构造 修复方案 使用
private string? SafeBuildPath(string id)
{
var fullPath = Path.GetFullPath(Path.Combine(_statesPath, $"{id}.json"));
var normalizedBase = Path.GetFullPath(_statesPath + Path.DirectorySeparatorChar);
return fullPath.StartsWith(normalizedBase, StringComparison.OrdinalIgnoreCase) ? fullPath : null;
}影响文件
新增测试(7 个用例) 文件:
辅助变更:
修复 2:
|
| 用例 | 验证内容 |
|---|---|
HandleCommand_WhenExecutionThrows_ShouldReturn500WithStructuredBody |
服务抛出异常时返回 500 + JSON {code: "EXECUTION_FAILED"} |
修复 3:HTTP 端点 prompt 校验对齐(MEDIUM)
问题描述
WebSocket 入口 ChatWebSocketCommandParser.TryParse 对空 prompt 有明确校验并返回 INVALID_PROMPT 错误码。但 HTTP 端点 HandleChat 和 HandleCommand 未做等价检查,空 prompt 会直接传入业务层,导致多入口行为不一致。
修复方案
在两个 HTTP handler 入口处增加校验:
if (string.IsNullOrWhiteSpace(input.Prompt))
{
// HandleChat: 直接设置 400 状态码
// HandleCommand: 返回 Results.BadRequest(new { code = "INVALID_PROMPT", ... })
}影响文件
src/workflow/Aevatar.Workflow.Host.Api/Endpoints/ChatEndpoints.cs
新增测试(2 个用例)
文件:test/Aevatar.Workflow.Host.Api.Tests/ChatEndpointsInternalTests.cs
| 用例 | 验证内容 |
|---|---|
HandleChat_WithEmptyPrompt_ShouldReturn400 |
空 prompt SSE 端点返回 400 |
HandleCommand_WithEmptyPrompt_ShouldReturn400WithCode |
空 prompt Command 端点返回 400 + INVALID_PROMPT |
修复 4:XML 文档注释修复(LOW)
问题描述
WorkflowExecutionProjectionOptions.cs 末尾存在一个未闭合的 /// <summary> 标签,无内容,会产生编译器文档警告。
修复方案
直接删除该孤立注释行。
影响文件
src/workflow/Aevatar.Workflow.Projection/Configuration/WorkflowExecutionProjectionOptions.cs
降级说明:workflow_call 子流程执行
原始发现
PR 将 WorkflowLoopModule._activeRunIds(HashSet<string>)替换为 _executionActive(bool),同时从 proto 中移除了 RunId 字段。这导致 WorkflowCallModule 发布的子流程 StartWorkflowEvent 会被立即拒绝。
验证结果
通过 git diff dev...HEAD 比对发现,workflow_call 在 dev 分支上已存在功能缺陷:
- 子流程的
WorkflowCompletedEvent没有对应的StepCompletedEvent桥接回父流程 - 父流程会在
workflow_call步骤永远挂起,等待一个永远不会到来的完成事件
本 PR 将失败模式从"静默挂起"改为"立即拒绝并返回错误",属于行为变更而非新增回归。彻底修复需要架构级改动(为子流程创建独立执行 Actor,或实现完成事件桥接),不在本次修复范围内。
排除的发现(dev 分支上已存在,非本 PR 引入)
| 问题 | 排除原因 |
|---|---|
SSE \\n\\n 字面量 |
重构后的 ChatSseResponseWriter.cs 已使用正确的 \n\n |
WhileModule maxIterations=10 / StepType="llm_call" 硬编码 |
dev 上已存在;本 PR 仅移除了 RunId 字段 |
| ToolTruncationHook 在 hook 执行前已加入 messages | dev 上已存在;本 PR 仅修改了 tool call 构造方式 |
| WebSocket 无最大消息长度限制 | dev 上已存在(文件仅做了重命名迁移) |
测试验证
dotnet test test/Aevatar.Workflow.Host.Api.Tests/ → 58 passed (55 existing + 3 new)
dotnet test test/Aevatar.Integration.Tests/ --filter FileSystemPlatformCommandStateStore → 7 passed (all new)
dotnet build aevatar.slnx → 0 errors, 110 warnings (all pre-existing NU1507)
新增测试总计:10 个用例,覆盖所有修复的 bug 及其边界条件。
- Replaced the existing `Aevatar.Platform.*` projects with `Aevatar.Mainnet.*` projects, consolidating the architecture around Mainnet as the default capability host. - Updated solution files to reflect the new project structure, enhancing modularity and clarity. - Removed obsolete platform components to streamline the codebase and focus on Mainnet and Maker capabilities. - Enhanced documentation to outline the new architecture and capabilities, ensuring alignment with the refactored structure.
…cture - Deleted all Saga-related projects, including abstractions, core, and runtime, to streamline the architecture and eliminate redundancy. - Updated solution files to reflect the removal of Saga components, enhancing modularity and reducing complexity in the codebase. - Removed associated documentation files, including SAGA_ARCHITECTURE.md, to ensure clarity in the project's current architecture and responsibilities.
- Replaced previous capability registration methods with `AddAevatarDefaultHost(...)` and `UseAevatarDefaultHost()` for streamlined access to Mainnet and Maker capabilities. - Updated documentation to reflect new integration patterns and removed obsolete references to `Aevatar.Platform.*` components. - Introduced new extension methods for adding capabilities, enhancing modularity and clarity in the architecture. - Adjusted project files to ensure proper references and dependencies are maintained across the solution.
- Added a note specifying that work documents do not need to be included in the solution (`aevatar.slnx`), enhancing clarity in project documentation practices.
- Deleted the `Aevatar.Mainnet.Application` project and its associated files, streamlining the architecture and focusing on the core capabilities. - Updated solution and project files to reflect the removal of obsolete references, enhancing clarity and modularity in the codebase. - Adjusted documentation to remove references to the deleted components, ensuring alignment with the current architecture.
…rm Actor Stream refactor plans - Deleted `EVENT_ENVELOPE_CQRS_REFACTOR_PLAN.md` and `PLATFORM_ACTOR_STREAM_REFACTOR_PLAN.md` to streamline documentation and eliminate outdated architectural plans. - Ensured that the remaining documentation aligns with the current architecture and capabilities of the Aevatar project.
- Created a new `.gitkeep` file in the `agents-working-space` directory to ensure the directory is tracked in version control, maintaining the structure for future content additions.
- Added the `docs/agents-working-space/*` entry to the `.gitignore` file to prevent tracking of files in the agents-working-space directory, ensuring a cleaner version control environment.
- Introduced a new `Aevatar.Hosting` project to centralize hosting capabilities and streamline integration of various components. - Updated solution and project files to include references to the new hosting project. - Enhanced CI workflow to enforce documentation standards and prevent the addition of working audit documents to the solution. - Refactored existing code to utilize the new hosting extensions for capability registration, improving modularity and clarity in the architecture.
- Introduced a new `Aevatar.AI.Projection` project to centralize AI event handling and provide a base for AI-layer read models. - Updated event appliers to streamline the processing of AI events, ensuring that business layer read models can inherit capabilities without duplicating event handling logic. - Enhanced dependency injection configurations to support new AI projection components and simplify the registration of default appliers and reducers. - Improved documentation to clarify the new architecture and usage of AI projection components, including subscription mechanisms and event handling semantics. - Removed obsolete event appliers from the workflow projection, consolidating AI event handling within the new architecture.
- Deleted the `Aevatar.CQRS.Runtime.FileSystem` project, including all associated files and dependencies, to streamline the architecture and focus on more modular runtime implementations. - Updated architectural documentation to reflect the removal of the FileSystem runtime and its components. - Cleaned up project references in the solution to eliminate dependencies on the removed FileSystem implementation.
…mentations - Deleted the `Aevatar.CQRS.Runtime.Abstractions` and `Aevatar.CQRS.Runtime.Hosting` projects, along with their associated files, to streamline the CQRS architecture and eliminate unnecessary complexity. - Updated project references and documentation to reflect the removal of these components, ensuring clarity in the remaining architecture. - Adjusted the hosting integration to utilize direct command execution through the application layer, enhancing performance and reducing overhead.
…apter integration - Updated `README.md` to reflect the addition of the demo report accumulator and JSON/HTML output capabilities. - Modified project references in `Aevatar.Maker.Infrastructure.csproj` to include new workflow application abstractions and projection components. - Enhanced dependency injection in `ServiceCollectionExtensions.cs` to support workflow execution projection and AGUI adapter services. - Refactored `WorkflowMakerRunExecutionPort.cs` to integrate workflow projection handling, improving event processing and actor management during workflow execution.
- Updated CI workflow to enforce restrictions on Maker projects referencing Workflow.Host.Api directly, ensuring compliance with architectural guidelines. - Revised documentation to clarify the relationship and constraints between Maker and Workflow projects, emphasizing direct inheritance and prohibiting reverse dependencies. - Enhanced README and architectural documents to reflect the updated dependency rules and inheritance constraints for Maker capabilities.
- Updated AGENTS.md to introduce new constraints on mutable collections in intermediate layers, emphasizing the use of Actor-based state management. - Modified CI workflow to include architecture guards that prevent the addition of mutable state fields in intermediate layers and enforce proper lifecycle management for projections. - Refactored projection subscription interfaces to support keyed handlers and improve the clarity of subscription management. - Enhanced WorkflowMakerRunExecutionPort and related services to utilize projection leases, ensuring better control over workflow execution and event handling. - Updated documentation and README files to reflect changes in projection handling and architectural guidelines.
- Updated AGENTS.md to clarify constraints on in-memory state management in intermediate layers, emphasizing the use of actorized orchestration and subscription leases. - Introduced new interfaces for stream subscription context and lease management, improving clarity and control over actor stream subscriptions. - Refactored projection subscription registry to utilize the new subscription context, ensuring proper lifecycle management and preventing duplicate registrations. - Enhanced WorkflowExecutionProjectionContext to support stream subscription leases, improving the management of projection lifecycles. - Updated CI architecture guards to enforce restrictions on mutable state fields in the middle layer, ensuring compliance with architectural guidelines.
- Introduced new test projects for Aevatar.CQRS.Core and Aevatar.CQRS.Projection.Core, enhancing test coverage for core functionalities. - Implemented various unit tests for command context policies, command executors, and projection behaviors, ensuring robust validation of CQRS components. - Updated AGENTS.md to include requirements for testing non-abstract reducer classes, reinforcing the importance of test coverage in the architecture. - Enhanced CI architecture guards to enforce testing requirements for newly added reducer classes, ensuring compliance with architectural standards.
- Removed the dependency on Aevatar.Workflow.Core from Aevatar.Workflow.Application, streamlining project references. - Introduced IWorkflowRunActorPort to replace IActorRuntime in WorkflowRunActorResolver, enhancing the actor resolution process. - Updated ServiceCollectionExtensions to register IWorkflowRunActorPort, ensuring proper dependency injection. - Modified unit tests to accommodate the new actor port interface, improving test coverage and reliability.
- Added a new script `projection_route_mapping_guard.sh` to validate event type to reducer routing, ensuring compliance with architectural standards. - Updated CI workflow to include the new projection route mapping guard, enhancing the architecture validation process. - Revised AGENTS.md and other documentation to reflect the new requirements for routing and reducer class testing, reinforcing the importance of static checks in the architecture.
…rrency Management - Updated the `WorkflowExecutionProjectionService` to utilize an actorized projection coordinator for managing projection ownership, ensuring that only one projection can be active per root actor. - Introduced new gRPC message definitions for projection coordination, enhancing the communication between actors. - Refactored the projection lifecycle management to eliminate reliance on process-local synchronization mechanisms, improving scalability and compliance with architectural standards. - Enhanced unit tests to validate the new concurrency model, ensuring robust handling of projection leases and ownership. - Updated documentation to reflect changes in the projection architecture and the introduction of the new coordinator actor.
- Revised audit scope to encompass the entire `aevatar.slnx` project, including `src`, `test`, and `docs/guards`. - Adjusted scoring criteria to align with the standardized 100-point model outlined in `docs/audit-scorecard/README.md`. - Emphasized the focus on confirming the integration of Projection logic into the general CQRS layer and conducted a comprehensive re-evaluation of the architecture. - Updated overall score to 96/100 (A+) and refined subsystem scores to reflect improvements in CQRS and Workflow capabilities. - Enhanced documentation to clarify scoring dimensions and key evidence supporting the evaluation results.
- Introduced `Aevatar.Workflow.Abstractions` to encapsulate workflow execution event contracts, promoting a clear separation of concerns. - Updated `Maker` components to depend on the new abstractions instead of direct references to `Workflow.Core`, reducing coupling and improving modularity. - Refactored `WorkflowMakerRunExecutionPort` to utilize `IWorkflowExecutionCapability`, streamlining workflow execution processes. - Enhanced dependency injection in `Maker` infrastructure to support the new workflow abstractions, ensuring proper integration and functionality. - Updated documentation to reflect changes in project structure and clarify the relationship between `Maker` and `Workflow` capabilities.
- Renamed and refactored `IWorkflowExecutionCapability` to `IRunnableWorkflowActorCapability`, enhancing clarity and consistency in workflow execution contracts. - Updated `WorkflowMakerRunExecutionPort` to utilize the new `IRunnableWorkflowActorCapability`, streamlining the execution process and reducing direct dependencies on workflow implementations. - Introduced new request and result models, `RunnableWorkflowActorRequest` and `RunnableWorkflowActorResult`, to support the updated execution capability. - Enhanced dependency injection in `Maker` infrastructure to register the new capability, ensuring proper integration and functionality. - Updated documentation to reflect changes in the workflow execution architecture and clarify the relationship between Maker and workflow capabilities.
- Removed the standalone Maker capability, integrating it as a plugin within the Workflow framework to enhance modularity and reduce coupling. - Updated project references and dependencies to reflect the new structure, ensuring all Maker functionalities are accessed through the Workflow extensions. - Refactored related services and interfaces to utilize the new `Aevatar.Workflow.Extensions.Maker`, streamlining the execution process and enhancing clarity in capability interactions. - Revised documentation to clarify the new architecture and the relationship between Maker and Workflow capabilities, ensuring consistency across the project. - Enhanced CI validation to enforce new architectural constraints and ensure compliance with the updated project structure.
- Unified the module architecture by introducing `IWorkflowModulePack`, allowing both core and extension modules to register through a consistent model. - Removed the standalone `MakerModuleFactory`, integrating Maker functionalities into the `MakerModulePack` to enhance modularity and reduce coupling. - Updated service registration methods to utilize the new pack model, ensuring all modules are registered uniformly. - Enhanced documentation to clarify the new architecture and the relationship between Maker and Workflow capabilities. - Improved CI validation to enforce architectural constraints and ensure compliance with the updated project structure.
- Introduced new solution files for `Aevatar.CQRS`, `Aevatar.Hosting`, and `Aevatar.Workflow`, enabling modular project organization and independent builds. - Updated `aevatar.slnx` to include new project references for `Aevatar.Bootstrap.Extensions.AI` and workflow extensions, enhancing the integration of AI features. - Refactored existing project dependencies to streamline the architecture and improve maintainability. - Enhanced documentation to reflect the new project structure and clarify the relationships between modules. - Improved CI validation to ensure compliance with the updated modular architecture.
- Introduced a new scorecard document for the Aevatar CQRS subsolution, detailing audit scope, architecture analysis, and scoring results. - Added `IProjectionDispatchFailureReporter` interface to handle projection dispatch failures, improving error reporting mechanisms. - Implemented `WorkflowProjectionDispatchFailureReporter` to publish errors to the workflow run session event stream, enhancing observability. - Updated `ProjectionSubscriptionRegistry` to support failure reporting and cancellation token propagation during dispatch. - Enhanced unit tests to validate new failure reporting functionality and ensure robust error handling in projection processes.
…on Error Handling - Added a new scorecard document for the Aevatar Workflow subsolution, detailing audit scope, architecture analysis, and scoring results. - Updated `WorkflowExecutionProjectionService` to improve error handling by publishing sink failure events for backpressure and write errors. - Enhanced unit tests to validate the new error handling functionality, ensuring robust behavior during projection failures. - Revised documentation to reflect the new scorecard and error handling improvements, clarifying the architecture and scoring criteria.
- Introduced a new test project for Aevatar AI, including unit tests for tool management and configuration. - Implemented functionality in `AIGAgentBase` to track and refresh source-loaded tools, ensuring stale entries are removed during reconfiguration. - Enhanced `ToolManager` with an `Unregister` method to facilitate tool removal by name. - Updated service collection extensions for MEAI and Tornado providers to throw exceptions on multiple factory registrations, improving error handling. - Revised documentation in README files to reflect changes in dependencies and architecture.
- Introduced a new scorecard document for the Aevatar Foundation subsolution, detailing the audit scope, architecture analysis, and scoring results. - Included comprehensive sections on the subsolution composition, architectural analysis, and objective validation results. - Documented the scoring criteria and provided a breakdown of scores across various dimensions, achieving a total score of 99/100 (A+). - Enhanced the documentation with a visual representation of the subsolution structure and improvement suggestions for future development.
- Introduced new test projects for Aevatar.Hosting and Aevatar.Foundation.Runtime.Hosting, enhancing test coverage and modularity. - Updated solution files to include references for the new test projects, ensuring they are part of the build process. - Added comprehensive unit tests for service collection extensions and capability registration, validating functionality and error handling. - Created documentation for the new test projects, outlining their purpose and integration within the overall Aevatar architecture.
- Introduced new integration tests for the Workflow Core Modules, covering various scenarios including tool parameter validation, tool discovery, and error handling. - Implemented tests for the ForEachModule to ensure proper handling of empty inputs and sub-request dispatching. - Added coverage for the WorkflowRunOutputStreamer, validating event streaming behavior and custom stop predicates. - Enhanced overall test coverage to ensure robust functionality and error handling across workflow components.
…ub.com/aevatarAI/aevatar into refactor/core-cqrs-parallel-subsystems
- Introduced new unit tests for AI abstractions, focusing on the coverage of protocol message handling and validation. - Added tests for the ToolCallLoop and ToolManager, ensuring proper execution flow and error handling for tool calls. - Enhanced test coverage for the InMemoryStream, validating message dispatching and subscriber behavior. - Updated project references to include new test files, improving overall test coverage and modularity across the Aevatar AI framework.
- Introduced new unit tests for AI hooks and role factory, ensuring comprehensive coverage of built-in hooks and their execution paths. - Added tests for MCP tool providers, validating tool name sanitization and error handling during execution. - Enhanced existing tests for AI abstractions, focusing on protocol message handling and validation. - Updated project references to include new test files, improving overall test coverage across the Aevatar framework.
- Added coverage quality guard script to enforce line and branch coverage thresholds in CI. - Introduced test stability guard script to detect and prevent polling waits in tests, ensuring deterministic behavior. - Updated CI workflow to include coverage quality and test stability checks, improving overall test reliability. - Added xunit.runner.json configuration for test execution settings. - Created a new scorecard document for the Aevatar testing framework, detailing audit scope and results. - Refactored tests to utilize TaskCompletionSource for improved synchronization and stability.
- Split the Workflow application command side into distinct services: `WorkflowChatRunApplicationService`, `WorkflowRunContextFactory`, `WorkflowRunExecutionEngine`, `WorkflowRunCompletionPolicy`, and `WorkflowRunResourceFinalizer` for better separation of concerns. - Introduced new projection services: `WorkflowExecutionProjectionService`, `WorkflowProjectionActivationService`, `WorkflowProjectionReleaseService`, `WorkflowProjectionLeaseManager`, `WorkflowProjectionSinkSubscriptionManager`, `WorkflowProjectionLiveSinkForwarder`, `WorkflowProjectionSinkFailurePolicy`, and `WorkflowProjectionReadModelUpdater` to enhance modularity. - Added CI guards to enforce limits on the size and dependencies of orchestration classes, preventing excessive complexity. - Updated documentation to reflect the new architecture and component responsibilities, ensuring clarity in the workflow orchestration process.
This pull request introduces significant architectural improvements, enforces stricter CI/CD validation, and updates documentation to reflect a modularized host structure. The main changes include the removal of legacy host projects, the addition of new subsystem hosts (Platform, Workflow, Maker), enhanced architecture guard checks in CI, and updates to project references and documentation for clarity and maintainability.
Architectural and Project Structure Changes:
Aevatar.Host.ApiandAevatar.Host.Gateway) from the solution and replaced them with subsystem hosts:Aevatar.Platform.Host.Api,Aevatar.Workflow.Host.Api, andAevatar.Maker.Host.Api. Updated the solution file (aevatar.slnx) to reflect these changes.Aevatar.CQRS.Core,Aevatar.CQRS.Runtime.Hosting, and related implementations, as well as Maker and Platform subsystems.Aevatar.Host.Api.TestswithAevatar.Workflow.Host.Api.Tests).CI/CD and Architecture Guard Improvements:
.github/workflows/ci.ymlto:UseAevatarCqrsRuntimeandAddAevatarCqrsRuntime.AddCqrsCorein hosts/infrastructure.Documentation Updates:
README.mdandAGENTS.mdto:Dependency and Package Management:
WolverineFxas a new dependency inDirectory.Packages.propsto support CQRS runtime implementations. [1] [2]Demo and Abstractions Refactoring:
These changes collectively modernize the project structure, enforce best practices, and improve maintainability and clarity for both developers and contributors.