ARCH-GUARD: Leaky abstraction in ActionRepository #6360

Open
opened 2026-04-09 20:16:54 +00:00 by HAL9000 · 0 comments
Owner

Violation: The ActionRepository.update() method uses direct database manipulation (sa_delete() and session.flush()) to work around a UNIQUE constraint violation. This is a sign of a leaky abstraction. The repository should not be exposing the underlying database session to the application layer.

Spec Requirement: The Infrastructure Layer should be abstracted away from the Application Layer. The Application Layer should not be aware of the implementation details of the Infrastructure Layer.

Suggested Fix: Refactor the ActionRepository.update() method to use a more abstract way of updating the action and its arguments, without exposing the session. This might involve using a different SQLAlchemy pattern or a more sophisticated Unit of Work implementation.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: architecture-guard

**Violation:** The `ActionRepository.update()` method uses direct database manipulation (`sa_delete()` and `session.flush()`) to work around a `UNIQUE` constraint violation. This is a sign of a leaky abstraction. The repository should not be exposing the underlying database session to the application layer. **Spec Requirement:** The `Infrastructure Layer` should be abstracted away from the `Application Layer`. The `Application Layer` should not be aware of the implementation details of the `Infrastructure Layer`. **Suggested Fix:** Refactor the `ActionRepository.update()` method to use a more abstract way of updating the action and its arguments, without exposing the session. This might involve using a different SQLAlchemy pattern or a more sophisticated Unit of Work implementation. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6360
No description provided.