Conversation
Agent-Logs-Url: https://github.com/elasticsoftwarefoundation/akces-framework/sessions/971d76bd-afa2-4835-8e58-6d5693b9f894 Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
…andType, AggregateServiceDomainEventType, and propagate from *Info annotations - Add nullable description field to AggregateServiceRecord (from @AggregateInfo/@AgenticAggregateInfo) - Add nullable description field to AggregateServiceCommandType (from @CommandInfo) - Add nullable description field to AggregateServiceDomainEventType (from @DomainEventInfo) - Add getDescription() to AggregateRuntime interface - Implement getDescription() in KafkaAggregateRuntime - Add normalizeDescription() utility (blank -> null) - Delegate getDescription() in KafkaAgenticAggregateRuntime - Populate descriptions in AkcesAggregateController.publishControlRecord() - Populate descriptions in AkcesAgenticAggregateController.publishControlRecord() - Update test constructors in AkcesAggregateControllerTests, RuntimeTests, AkcesClientTests Agent-Logs-Url: https://github.com/elasticsoftwarefoundation/akces-framework/sessions/155e062c-8ac3-4b61-a3dd-f44e26b2bf04 Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Propagates human-readable description metadata from @AggregateInfo / @AgenticAggregateInfo, @CommandInfo, and @DomainEventInfo into the Akces-Control service discovery record (AggregateServiceRecord) so the Agentic layer (and other clients) can surface richer context.
Changes:
- Extend
AggregateServiceRecord,AggregateServiceCommandType, andAggregateServiceDomainEventTypewith a nullable trailingdescriptioncomponent. - Add
AggregateRuntime.getDescription()and implement it inKafkaAggregateRuntime(with anormalizeDescription()helper). - Populate descriptions when publishing control records (standard + agentic) and update impacted tests/fixtures.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plans/aggregate-service-record-descriptions.md | Design/rollout plan documenting phases and compatibility approach. |
| main/shared/src/main/java/org/elasticsoftware/akces/control/AggregateServiceRecord.java | Adds nullable description to the published service record. |
| main/shared/src/main/java/org/elasticsoftware/akces/control/AggregateServiceCommandType.java | Adds nullable description to supported command type metadata. |
| main/shared/src/main/java/org/elasticsoftware/akces/control/AggregateServiceDomainEventType.java | Adds nullable description to produced/consumed domain-event metadata. |
| main/runtime/src/main/java/org/elasticsoftware/akces/aggregate/AggregateRuntime.java | Introduces getDescription() contract for runtimes. |
| main/runtime/src/main/java/org/elasticsoftware/akces/kafka/KafkaAggregateRuntime.java | Implements getDescription() and adds normalizeDescription() utility. |
| main/runtime/src/main/java/org/elasticsoftware/akces/AkcesAggregateController.java | Populates descriptions for commands/events and aggregate when publishing control records. |
| main/agentic/src/main/java/org/elasticsoftware/akces/agentic/runtime/KafkaAgenticAggregateRuntime.java | Delegates getDescription() to the wrapped runtime. |
| main/agentic/src/main/java/org/elasticsoftware/akces/agentic/runtime/AkcesAgenticAggregateController.java | Populates descriptions (built-in + aggregate-declared types) in the agentic control record. |
| main/runtime/src/test/java/org/elasticsoftware/akcestest/RuntimeTests.java | Updates control-record construction for the new description parameter. |
| main/runtime/src/test/java/org/elasticsoftware/akcestest/control/AkcesAggregateControllerTests.java | Updates control-record construction for the new description parameter (serde test present). |
| main/client/src/test/java/org/elasticsoftware/akces/client/AkcesClientTests.java | Updates control-record construction for the new description parameter. |
Comments suppressed due to low confidence (1)
main/runtime/src/test/java/org/elasticsoftware/akcestest/control/AkcesAggregateControllerTests.java:100
- The serde test was updated for the new constructor signature but still only asserts
aggregateName(). Since this PR introduces a newdescriptionfield and relies on backward-compatible JSON deserialization, it would be good to extend the assertions to (1) verify a non-nulldescriptionround-trips through the serde and (2) deserialize legacy JSON without adescriptionproperty and assert it becomesnull.
AkcesControlRecordSerde serde = new AkcesControlRecordSerde(new JsonMapper());
AggregateServiceRecord record = new AggregateServiceRecord(
"Account",
"Account-Commands",
"Account-DomainEvents",
AggregateServiceType.STANDARD,
List.of(new AggregateServiceCommandType("CreateAccount", 1, true, "commands.CreateAccount", null)),
List.of(new AggregateServiceDomainEventType("AccountCreated", 1, true, false, "domainevents.AccountCreated", null)),
Collections.emptyList(),
null);
byte[] serialized = serde.serializer().serialize("Akces-Control", record);
assertNotNull(serialized);
AkcesControlRecord deserialized = serde.deserializer().deserialize("Akces-Control", serialized);
assertNotNull(deserialized);
assertInstanceOf(AggregateServiceRecord.class, deserialized);
assertEquals("Account", ((AggregateServiceRecord) deserialized).aggregateName());
…ticAggregateController Agent-Logs-Url: https://github.com/elasticsoftwarefoundation/akces-framework/sessions/1c4014cc-cfcd-49c7-92ad-325f11a8dd05 Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Fixed in |
descriptionfield toAggregateServiceRecordrecord (main/shared)descriptionfield toAggregateServiceCommandTyperecord (main/shared)descriptionfield toAggregateServiceDomainEventTyperecord (main/shared)getDescription()toAggregateRuntimeinterface (main/runtime)getDescription()inKafkaAggregateRuntime(main/runtime)getDescription()inKafkaAgenticAggregateRuntime(main/agentic)AkcesAggregateController.publishControlRecord()to pass descriptions (main/runtime)AkcesAgenticAggregateController.publishControlRecord()to pass descriptions (main/agentic)AkcesAggregateControllerTests,RuntimeTests,AkcesClientTestsCommandInfo/DomainEventInfoimports inAkcesAgenticAggregateControllerafter merge from main