Skip to content

Add description field to AggregateServiceRecord and contained types#321

Merged
jwijgerd merged 4 commits intomainfrom
copilot/add-description-field-aggregate-service-record
Apr 10, 2026
Merged

Add description field to AggregateServiceRecord and contained types#321
jwijgerd merged 4 commits intomainfrom
copilot/add-description-field-aggregate-service-record

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

  • Add description field to AggregateServiceRecord record (main/shared)
  • Add description field to AggregateServiceCommandType record (main/shared)
  • Add description field to AggregateServiceDomainEventType record (main/shared)
  • Add getDescription() to AggregateRuntime interface (main/runtime)
  • Implement getDescription() in KafkaAggregateRuntime (main/runtime)
  • Delegate getDescription() in KafkaAgenticAggregateRuntime (main/agentic)
  • Update AkcesAggregateController.publishControlRecord() to pass descriptions (main/runtime)
  • Update AkcesAgenticAggregateController.publishControlRecord() to pass descriptions (main/agentic)
  • Update test files: AkcesAggregateControllerTests, RuntimeTests, AkcesClientTests
  • Fix missing CommandInfo/DomainEventInfo imports in AkcesAgenticAggregateController after merge from main

Copilot AI and others added 2 commits April 10, 2026 10:32
…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>
@jwijgerd jwijgerd marked this pull request as ready for review April 10, 2026 10:59
Copilot AI review requested due to automatic review settings April 10, 2026 10:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and AggregateServiceDomainEventType with a nullable trailing description component.
  • Add AggregateRuntime.getDescription() and implement it in KafkaAggregateRuntime (with a normalizeDescription() 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 new description field and relies on backward-compatible JSON deserialization, it would be good to extend the assertions to (1) verify a non-null description round-trips through the serde and (2) deserialize legacy JSON without a description property and assert it becomes null.
        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());

Copy link
Copy Markdown
Contributor

@jwijgerd jwijgerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix compIlation issues

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 10, 2026

Fix compIlation issues

Fixed in 803a396 — added the missing CommandInfo and DomainEventInfo imports to AkcesAgenticAggregateController. The merge from main removed BUILTIN_COMMAND_TYPES (StoreMemoryCommand/ForgetMemoryCommand refactor) but the annotation imports that my code added alongside them were also lost during the merge.

Copilot AI requested a review from jwijgerd April 10, 2026 11:26
@jwijgerd jwijgerd merged commit b54103d into main Apr 10, 2026
7 checks passed
@jwijgerd jwijgerd deleted the copilot/add-description-field-aggregate-service-record branch April 10, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants