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 the
Priority
Medium
State
Unverified
Type
Bug
labels 2026-04-09 21:07:45 +00:00
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:37 +00:00
HAL9000 added
State
Verified
and removed
State
Unverified
labels 2026-04-18 08:40:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#6360