Pull Request Review Guidelines
Criteria for reviewing code contributions in the Arda backend ecosystem. These criteria ensure contributions adhere to core design patterns and architectural principles.
1. Domain Modeling and Immutability
Section titled “1. Domain Modeling and Immutability”- Immutability: Are all domain objects (Payloads, Value Objects) immutable data classes?
- Optics: Does the entity define
@opticsto allow clean immutable updates? - Payloads: Does the data class implement
EntityPayload? - Value Objects: Are existing value objects used (
Money.Value,DateTime) instead of primitives where applicable? - Data Authority DSL: If creating a standard CRUD endpoint, is
DataAuthorityEndpointNew.reifyused instead of manual coding?
2. Bitemporal Persistence
Section titled “2. Bitemporal Persistence”- Universe Pattern: Does the service layer interact with the database only via a
Universe? No direct Exposed DAO access. - Time Coordinates:
- Red flag: Is
TimeCoordinates.now()called inside a loop? It must be passed in from the top level. - Are
effective(valid time) andrecorded(transaction time) handled correctly?
- Red flag: Is
- Validation: Does the
UniverseorValidatorenforce business rules before create/update?
3. State Management (State Engine)
Section titled “3. State Management (State Engine)”- Lifecycle: Are complex state transitions defined in a
Lifecycleengine rather than ad-hoc if/else blocks? - Guards: Are sensitive transitions protected by
guardoperations? - Signals: Are signals meaningful enums (
OrderSignal.SUBMIT) representing user or system intent?
4. Service Layer and Actions
Section titled “4. Service Layer and Actions”- Action Pattern: Are mutations encapsulated as
Actionobjects (inheriting fromAbstractSimpleAction)? - Transactions: Is action execution wrapped in
inTx(db)to ensure atomicity? - Red flag: Is
transaction { }used directly in the service layer? It should be wrapped in an Action or Universe.
5. Error Handling
Section titled “5. Error Handling”- Functional Approach: Is
Result<T>used instead of throwing exceptions? - Error Mapping: Are infrastructure errors correctly normalized to
AppError? - Red flag: Are there
try/catchblocks? They should berunCatching { }orResult.failure().
6. API and Security
Section titled “6. API and Security”- DTOs: Are request/response objects separate from internal domain entities?
- Security: Are routes registered in
configureSecureRoutesunless they explicitly must be public?
7. Testing and Quality
Section titled “7. Testing and Quality”- Unit Tests: Are complex domain logic and calculations covered by unit tests?
- Integration Tests: Does
Module.ktinitialization allow easy dependency injection in tests? - API Tests: Are
.brufiles updated or added for new endpoints?
Copyright: © Arda Systems 2025-2026, All rights reserved