Phase 3: Akces Platform Development Goals, Actions, and Conditions
Replaces: #307 (please close that issue)
Incorporates changes from: PR #303
Tracking issue: #311
Module: main/agentic
Can start: After Phase 1 + Annotation Extensions (#312) is merged
Can run concurrently with: Phase 2 (#313)
Blocks: Phase 4
📋 Plan reference: Phase 3: Akces Platform Development Goals, Actions, and Conditions (lines 451–571)
Overview
Higher-level Goals, Actions, and Conditions that enable an agentic aggregate to reason about and extend an Akces-based platform. These components provide the core agent capabilities for command processing, event handling, aggregate state analysis, and cross-aggregate coordination.
Tasks
3.1 Condition: IsCommandProcessingCondition
@Condition(name = "isCommandProcessing")
- Returns
true if the current agent context contains a command to process (as opposed to an external event)
- Enables different goal planning for command-initiated vs. event-initiated agent loops
3.2 Condition: IsExternalEventCondition
@Condition(name = "isExternalEvent")
- Returns
true if the current agent context was triggered by an external domain event
- Complement to
isCommandProcessing — external events often require different reasoning strategies
3.3 Action: EmitDomainEventsAction — REMOVED
Removed in PR #303. Domain events produced by agent actions are placed on the Blackboard directly. The AgentProcessResultTranslator collects all DomainEvent objects from the blackboard after each tick() — no explicit "emit" action needed.
3.4 Action: SendCommandAction
@Action(description = "Send a command to another aggregate via the command bus")
- Takes a
Command object from the blackboard
- Routes it through the
CommandBus (AgenticAggregatePartition implements CommandBus)
- Enables cross-aggregate coordination from within the agent
3.5 Action: AnalyzeAggregateStateAction
@Action(description = "Analyze the current aggregate state using LLM reasoning", readOnly = true)
- Reads aggregate state from blackboard
- Serializes to structured representation
- Invokes LLM reasoning with context-specific prompts
- Returns analysis results on blackboard
- Framework building block — a reusable Action for higher-level Goals and future extensions (kept per architect decision)
3.6 Action: DiscoverAggregateServicesAction
@Action(description = "Discover other aggregates in the system and their supported commands", readOnly = true)
- Reads
List<AggregateServiceRecord> from the blackboard (populated by agentic handler adapters before agent invocation)
- For each record provides:
aggregateName, commandTopic, domainEventTopic, type (STANDARD/AGENTIC), supportedCommands, producedEvents, consumedEvents
- Returns structured summary for LLM reasoning about system topology
- Blackboard setup:
AkcesAgenticAggregateController maintains aggregateServices map; adapters place records on blackboard
3.7 Goal: ProcessCommandGoal
- Goal: "ProcessCommand" — "Process an incoming command through AI-assisted reasoning and produce domain events"
- Precondition:
isCommandProcessing
- Plan:
RecallMemoriesAction → load relevant prior knowledge
AnalyzeAggregateStateAction → understand current state
- (LLM reasoning with MCP tools) → determine actions and produce domain events on the blackboard (including error events from
agentProducedErrors)
LearnFromProcessGoal (sub-goal) → learn from experience
- Replaces deterministic
@CommandHandler for commands in agentHandledCommands
- Note: No
EmitDomainEventsAction step — events are collected from Blackboard by AgentProcessResultTranslator
3.8 Goal: ReactToExternalEventGoal
- Goal: "ReactToExternalEvent" — "React to an external domain event through AI-assisted reasoning"
- Precondition:
isExternalEvent
- Plan:
RecallMemoriesAction → load relevant prior knowledge
AnalyzeAggregateStateAction → understand current state
- (LLM reasoning) → determine appropriate response and produce domain events on the blackboard (including error events)
SendCommandAction → send commands if needed
LearnFromProcessGoal (sub-goal) → learn from experience
- Top-level goal for handling external events in
agentHandledEvents
3.9 Goal: ManageKnowledgeGoal — REMOVED
Removed in PR #303. Memory management (storing, recalling, forgetting, capacity enforcement) is fully handled by LearnFromProcessGoal (section 2.7), which runs as a sub-goal after every command/event processing cycle. A separate knowledge management goal would duplicate this responsibility.
Changes from PR #303
EmitDomainEventsAction (3.3) REMOVED — AgentProcessResultTranslator collects events from Blackboard directly
ManageKnowledgeGoal (3.9) REMOVED — redundant with LearnFromProcessGoal
ProcessCommandGoal plan updated — no longer includes EmitDomainEventsAction step; events produced directly on Blackboard
ReactToExternalEventGoal plan updated — same change
AnalyzeAggregateStateAction — explicitly marked as "framework building block" per architect decision
Acceptance Criteria
Phase 3: Akces Platform Development Goals, Actions, and Conditions
Tracking issue: #311
Module:
main/agenticCan start: After Phase 1 + Annotation Extensions (#312) is merged
Can run concurrently with: Phase 2 (#313)
Blocks: Phase 4
📋 Plan reference: Phase 3: Akces Platform Development Goals, Actions, and Conditions (lines 451–571)
Overview
Higher-level Goals, Actions, and Conditions that enable an agentic aggregate to reason about and extend an Akces-based platform. These components provide the core agent capabilities for command processing, event handling, aggregate state analysis, and cross-aggregate coordination.
Tasks
3.1 Condition:
IsCommandProcessingCondition@Condition(name = "isCommandProcessing")trueif the current agent context contains a command to process (as opposed to an external event)3.2 Condition:
IsExternalEventCondition@Condition(name = "isExternalEvent")trueif the current agent context was triggered by an external domain eventisCommandProcessing— external events often require different reasoning strategies3.3 Action:— REMOVEDEmitDomainEventsAction3.4 Action:
SendCommandAction@Action(description = "Send a command to another aggregate via the command bus")Commandobject from the blackboardCommandBus(AgenticAggregatePartitionimplementsCommandBus)3.5 Action:
AnalyzeAggregateStateAction@Action(description = "Analyze the current aggregate state using LLM reasoning", readOnly = true)3.6 Action:
DiscoverAggregateServicesAction@Action(description = "Discover other aggregates in the system and their supported commands", readOnly = true)List<AggregateServiceRecord>from the blackboard (populated by agentic handler adapters before agent invocation)aggregateName,commandTopic,domainEventTopic,type(STANDARD/AGENTIC),supportedCommands,producedEvents,consumedEventsAkcesAgenticAggregateControllermaintainsaggregateServicesmap; adapters place records on blackboard3.7 Goal:
ProcessCommandGoalisCommandProcessingRecallMemoriesAction→ load relevant prior knowledgeAnalyzeAggregateStateAction→ understand current stateagentProducedErrors)LearnFromProcessGoal(sub-goal) → learn from experience@CommandHandlerfor commands inagentHandledCommandsEmitDomainEventsActionstep — events are collected from Blackboard byAgentProcessResultTranslator3.8 Goal:
ReactToExternalEventGoalisExternalEventRecallMemoriesAction→ load relevant prior knowledgeAnalyzeAggregateStateAction→ understand current stateSendCommandAction→ send commands if neededLearnFromProcessGoal(sub-goal) → learn from experienceagentHandledEvents3.9 Goal:— REMOVEDManageKnowledgeGoalChanges from PR #303
EmitDomainEventsAction(3.3) REMOVED —AgentProcessResultTranslatorcollects events from Blackboard directlyManageKnowledgeGoal(3.9) REMOVED — redundant withLearnFromProcessGoalProcessCommandGoalplan updated — no longer includesEmitDomainEventsActionstep; events produced directly on BlackboardReactToExternalEventGoalplan updated — same changeAnalyzeAggregateStateAction— explicitly marked as "framework building block" per architect decisionAcceptance Criteria
IsCommandProcessingConditionandIsExternalEventConditioncorrectly evaluate blackboard contextSendCommandActionroutes commands throughCommandBusAnalyzeAggregateStateActionserializes state and invokes LLM reasoningDiscoverAggregateServicesActionexposesAggregateServiceRecords from blackboard with all fieldsProcessCommandGoalis correctly defined withisCommandProcessingpreconditionReactToExternalEventGoalis correctly defined withisExternalEventpreconditionEmitDomainEventsActionorManageKnowledgeGoalimplementations