Skip to content

docs: clarify dependency flow and execution rules in README#15

Merged
ahmedshahriar merged 3 commits intomainfrom
staging
Nov 8, 2025
Merged

docs: clarify dependency flow and execution rules in README#15
ahmedshahriar merged 3 commits intomainfrom
staging

Conversation

@ahmedshahriar
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 8, 2025 06:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ahmedshahriar ahmedshahriar requested a review from Copilot November 8, 2025 06:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings November 8, 2025 06:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +209 to +212
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.
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
@ahmedshahriar ahmedshahriar merged commit c54c709 into main Nov 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants