docs: clarify dependency flow and execution rules in README#15
docs: clarify dependency flow and execution rules in README#15ahmedshahriar merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves the architecture documentation by clarifying the dependency flow according to Domain-Driven Design (DDD) principles. The update makes explicit that source-code dependencies point inward (outer → inner layers) and removes a potentially confusing note about execution vs import flow.
- Rewrites the dependency flow section to emphasize DDD's "dependency rule" where inner layers are independent of outer layers
- Adds clarity about each layer's dependencies (domain → application → model → infrastructure)
- Includes a helpful note distinguishing between the
model/folder (ML/LLM code) and DDD's "domain model" concept - Removes the previous NOTE block that mixed execution flow with import dependencies
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Source-code dependencies **only point inward** (outer → inner). Inner layers know nothing about outer ones—this is the core *“dependency rule”* of DDD ([DDD Reference, PDF](https://www.domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf)). | ||
|
|
||
| - The `domain` layer is independent. | ||
| - The `application` layer depends on `domain` and exposes use cases. |
There was a problem hiding this comment.
The documentation states that "The domain layer is independent" and that "Source-code dependencies only point inward (outer → inner)," but this is inconsistent with the actual codebase.
The domain layer currently imports from both application (e.g., core/domain/base/vector.py line 14: from core.application.networks.embeddings import EmbeddingModelSingleton) and infrastructure (e.g., core/domain/base/vector.py line 17: from core.infrastructure.db.qdrant import connection and core/domain/base/nosql.py line 10: from core.infrastructure.db.mongo import connection).
This violates the DDD dependency rule described in the documentation. Either the documentation should accurately reflect the current architecture, or the code should be refactored to comply with the described dependency flow.
| Source-code dependencies **only point inward** (outer → inner). Inner layers know nothing about outer ones—this is the core *“dependency rule”* of DDD ([DDD Reference, PDF](https://www.domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf)). | |
| - The `domain` layer is independent. | |
| - The `application` layer depends on `domain` and exposes use cases. | |
| Source-code dependencies generally point inward (outer → inner), following the *“dependency rule”* of DDD ([DDD Reference, PDF](https://www.domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf)). However, in this codebase, the domain layer may import from application and infrastructure layers where necessary for practical reasons. | |
| - The `domain` layer is not strictly independent; it may depend on `application` and `infrastructure` in some cases. | |
| - The `application` layer depends on `domain` and may also interact with `infrastructure`. |
No description provided.