Add Copilot skill for Akces Framework internal development#336
Conversation
Agent-Logs-Url: https://github.com/elasticsoftwarefoundation/akces-framework/sessions/83ba810d-6324-4d6c-a60d-967cf9b0c8e6 Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Copilot skill document intended to guide contributors working on the Akces Framework internals (core modules, runtime internals, operator, and build/test workflows), complementing the existing Embabel-focused skill.
Changes:
- Introduces
.github/skills/akces-framework-development/SKILL.mdwith an internal development guide (module map, runtime/agentic internals, conventions, and common tasks). - Documents build/test commands and operational development notes for framework modules and the Kubernetes operator.
| - [FRAMEWORK_OVERVIEW.md](../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation | ||
| - [SERVICES.md](../../SERVICES.md) — Kubernetes services and deployment | ||
| - [README.md](../../README.md) — Project overview and getting started |
There was a problem hiding this comment.
The relative links in the Reference Links section point to ../../FRAMEWORK_OVERVIEW.md, ../../SERVICES.md, and ../../README.md, which resolves under .github/ (e.g. .github/FRAMEWORK_OVERVIEW.md) and does not exist. These links should go up one more level to the repo root (e.g. ../../../FRAMEWORK_OVERVIEW.md).
| - [FRAMEWORK_OVERVIEW.md](../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation | |
| - [SERVICES.md](../../SERVICES.md) — Kubernetes services and deployment | |
| - [README.md](../../README.md) — Project overview and getting started | |
| - [FRAMEWORK_OVERVIEW.md](../../../FRAMEWORK_OVERVIEW.md) — Detailed architecture documentation | |
| - [SERVICES.md](../../../SERVICES.md) — Kubernetes services and deployment | |
| - [README.md](../../../README.md) — Project overview and getting started |
| | `o.e.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` | | ||
| | `o.e.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` | | ||
| | `o.e.akces.commands` | `Command`, `CommandBus` interfaces | | ||
| | `o.e.akces.events` | `DomainEvent`, `ErrorEvent` interfaces | | ||
| | `o.e.akces.processmanager` | `ProcessManager<S, P>` interface | | ||
| | `o.e.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` | |
There was a problem hiding this comment.
The package names in the module tables use o.e.akces.*, but the actual packages in this repo are org.elasticsoftware.akces.*. Using the abbreviated prefix here is likely to confuse contributors searching/navigating the code (and the later task steps also reference o.e.akces.*).
| | `o.e.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` | | |
| | `o.e.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` | | |
| | `o.e.akces.commands` | `Command`, `CommandBus` interfaces | | |
| | `o.e.akces.events` | `DomainEvent`, `ErrorEvent` interfaces | | |
| | `o.e.akces.processmanager` | `ProcessManager<S, P>` interface | | |
| | `o.e.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` | | |
| | `org.elasticsoftware.akces.aggregate` | `Aggregate<S>`, `AgenticAggregate<S>`, `AggregateState`, `MemoryAwareState`, `TaskAwareState`, `CommandHandlerFunction`, `EventSourcingHandlerFunction`, `EventHandlerFunction`, `EventBridgeHandlerFunction`, `UpcastingHandlerFunction`, `CommandType`, `DomainEventType`, `AggregateStateType`, `SchemaType` | | |
| | `org.elasticsoftware.akces.annotations` | `@AggregateInfo`, `@AgenticAggregateInfo`, `@CommandInfo`, `@DomainEventInfo`, `@AggregateStateInfo`, `@CommandHandler`, `@EventSourcingHandler`, `@EventHandler`, `@EventBridgeHandler`, `@UpcastingHandler`, `@PIIData`, `@AggregateIdentifier`, `@QueryModelInfo`, `@QueryModelEventHandler`, `@DatabaseModelInfo`, `@DatabaseModelEventHandler`, `@QueryModelStateInfo`, `@ReflectorInfo`, `@ReflectorEventHandler` | | |
| | `org.elasticsoftware.akces.commands` | `Command`, `CommandBus` interfaces | | |
| | `org.elasticsoftware.akces.events` | `DomainEvent`, `ErrorEvent` interfaces | | |
| | `org.elasticsoftware.akces.processmanager` | `ProcessManager<S, P>` interface | | |
| | `org.elasticsoftware.akces.query` | `QueryModel<S>`, `QueryModelState`, `DatabaseModel` | |
|
|
||
| **Rules when modifying `api`:** | ||
| - Interfaces and annotations here are the public API. Changes are breaking. | ||
| - Keep the module dependency-free (no Kafka, no Spring, no Jackson). |
There was a problem hiding this comment.
The guidance 'Keep the module dependency-free (no Kafka, no Spring, no Jackson)' is inaccurate for main/api: it depends on spring-context and jackson-annotations (and uses com.fasterxml.jackson.annotation.* in the API types). Consider updating this to the real constraint (e.g. no Kafka/runtime deps, and only Jackson annotations).
| - Keep the module dependency-free (no Kafka, no Spring, no Jackson). | |
| - Keep the module free of Kafka and runtime implementation dependencies; only lightweight API-level dependencies such as Spring context support and Jackson annotations should be used here. |
| - **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors | ||
| - **RocksDB** — embedded key–value store for aggregate state snapshots | ||
| - **Confluent Schema Registry** — Avro schema management for commands, events, and state | ||
| - **Jackson 3.x** — JSON serialization via `tools.jackson` package (not `com.fasterxml.jackson`) |
There was a problem hiding this comment.
The Jackson note says to use tools.jackson and not com.fasterxml.jackson, but the codebase still uses com.fasterxml.jackson.annotation.* / jackson-annotations (notably in main/api). This should be clarified (e.g. tools.jackson for databind/core, com.fasterxml.jackson.annotation still used for annotations) to avoid misleading imports.
| - **Jackson 3.x** — JSON serialization via `tools.jackson` package (not `com.fasterxml.jackson`) | |
| - **Jackson 3.x** — use `tools.jackson` for core/databind JSON serialization APIs; `com.fasterxml.jackson.annotation` may still be used for annotations where the codebase depends on `jackson-annotations` (notably in `main/api`) |
| - **Spring Boot 4.x** — auto-configuration, dependency injection, Spring Kafka | ||
| - **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors | ||
| - **RocksDB** — embedded key–value store for aggregate state snapshots | ||
| - **Confluent Schema Registry** — Avro schema management for commands, events, and state |
There was a problem hiding this comment.
The tech stack claims 'Confluent Schema Registry' and 'Avro schema management', but the framework’s SchemaRegistry implementation is Kafka-topic based (Akces-Schemas) and schemas are generated/validated as JSON Schema. Also, protocol records are serialized via Protobuf in ProtocolRecordSerde, not Avro. Updating this would prevent incorrect guidance.
| - **Confluent Schema Registry** — Avro schema management for commands, events, and state | |
| - **Kafka-backed schema registry** — schemas are stored in the `Akces-Schemas` topic and generated/validated as JSON Schema; protocol records use Protobuf serialization |
| `STARTING` → `INITIALIZING` → `CATCHING_UP` → `PROCESSING` → `SHUTTING_DOWN` | ||
|
|
||
| For agentic aggregates, there is an additional `INITIALIZING_STATE` step between `INITIALIZING` and `CATCHING_UP` for auto-creating singleton state. |
There was a problem hiding this comment.
The partition lifecycle state list (STARTING → INITIALIZING → CATCHING_UP → PROCESSING → SHUTTING_DOWN) does not match the actual AggregatePartitionState enum (INITIALIZING, INITIALIZING_STATE, LOADING_GDPR_KEYS, LOADING_STATE, PROCESSING, SHUTTING_DOWN). This section should reflect the real state machine names to avoid confusion when debugging partition behavior.
| `STARTING` → `INITIALIZING` → `CATCHING_UP` → `PROCESSING` → `SHUTTING_DOWN` | |
| For agentic aggregates, there is an additional `INITIALIZING_STATE` step between `INITIALIZING` and `CATCHING_UP` for auto-creating singleton state. | |
| `INITIALIZING` → `INITIALIZING_STATE` → `LOADING_GDPR_KEYS` → `LOADING_STATE` → `PROCESSING` → `SHUTTING_DOWN` | |
| These names should be used as-is when correlating logs, metrics, and partition behavior during startup, state restoration, GDPR key loading, normal processing, and shutdown. |
| ### GDPR / PII | ||
|
|
||
| - Fields annotated with `@PIIData` are encrypted/decrypted transparently. | ||
| - Encryption keys are per-aggregate, stored in a dedicated `*-GDPRKeys` Kafka topic. |
There was a problem hiding this comment.
The GDPR section says encryption keys are stored in a dedicated *-GDPRKeys topic. In the current implementation the keys are stored in the shared Akces-GDPRKeys topic (partitioned), not per-aggregate topic. Please update this to match the actual topic layout.
| - Encryption keys are per-aggregate, stored in a dedicated `*-GDPRKeys` Kafka topic. | |
| - Encryption keys are stored in the shared partitioned `Akces-GDPRKeys` Kafka topic. |
| - **Spring Boot 4.x** — auto-configuration, dependency injection, Spring Kafka | ||
| - **Maven** — multi-module build, Bill of Materials (`bom/`), annotation processors | ||
| - **RocksDB** — embedded key–value store for aggregate state snapshots | ||
| - **Confluent Schema Registry** — Avro schema management for commands, events, and state |
There was a problem hiding this comment.
Fixed in ae94fc8 — updated to "Kafka-backed schema registry — schemas are stored in the Akces-Schemas compacted Kafka topic and generated/validated as JSON Schema".
|
|
||
| --- | ||
|
|
||
| ## Technology Stack |
There was a problem hiding this comment.
mention Protobuf 3.x for Internal Wire Protocol
There was a problem hiding this comment.
Added in ae94fc8 — new bullet: "Protobuf 3.x — internal wire protocol for all protocol records (ProtocolRecordSerde, SchemaRecordSerde) using Jackson's jackson-dataformat-protobuf".
| | `AgentProcessResultTranslator` | Drains `DomainEvent` objects from the Embabel Blackboard after each tick | | ||
| | `AgenticAggregateRuntimeFactory` | Spring bean factory — registers built-in memory/task events and adapters | | ||
|
|
||
| **Important agentic internals:** |
There was a problem hiding this comment.
mention here that AgenticAggrates are singleton instances with only 1 partition per topic type (add same table as for normal Aggregates). Also mention that the Framework takes care of creating the initital state (base on a DomainEvent and EventSourcingHandler provided by implementing class)
There was a problem hiding this comment.
Expanded in ae94fc8 — added singleton enforcement details, auto-creation via getCreateDomainEvent() + @EventSourcingHandler(create = true) during INITIALIZING_STATE, and a Kafka topic table for AgenticAggregates (same structure as normal aggregates but always 1 partition).
…e details Agent-Logs-Url: https://github.com/elasticsoftwarefoundation/akces-framework/sessions/4701bce1-6520-4321-9138-807dce4cd2cb Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
New Copilot cloud agent skill (
.github/skills/akces-framework-development/SKILL.md) for coding tasks on the framework internals. Complements the existingembabel-agent-frameworkskill which covers the Embabel/agentic side.api→shared→runtime→client→query-support→eventcatalog→agentic) with per-module package/class tables using fullorg.elasticsoftware.akcespackage namesAkces-Schemastopic), Protobuf 3.x internal wire protocol (jackson-dataformat-protobuf), Jackson 3.x (tools.jacksonfor core/databind,com.fasterxml.jackson.annotationfor annotations inapi)INITIALIZING→INITIALIZING_STATE→LOADING_GDPR_KEYS→LOADING_STATE→PROCESSING→SHUTTING_DOWN), handler function adapter pattern, Kafka topic layout, exactly-once transaction boundaries, RocksDB state snapshotsgetCreateDomainEvent()+@EventSourcingHandler(create = true), Kafka topic table, tick model, agent resolution — defers toembabel-agent-frameworkskill for Embabel conceptsAkces-GDPRKeystopic), Apache 2.0 headers-Dmaven.compiler.failOnError=falsefor controller compilation issues)