guardian-framework 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -3197,7 +3197,7 @@ __export(exports_package, {
|
|
|
3197
3197
|
bin: () => bin,
|
|
3198
3198
|
author: () => author
|
|
3199
3199
|
});
|
|
3200
|
-
var name = "guardian-framework", version = "0.1.
|
|
3200
|
+
var name = "guardian-framework", version = "0.1.94", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
|
|
3201
3201
|
var init_package = __esm(() => {
|
|
3202
3202
|
exports = {
|
|
3203
3203
|
".": {
|
package/dist/exports.js
CHANGED
|
@@ -1982,7 +1982,7 @@ __export(exports_package, {
|
|
|
1982
1982
|
bin: () => bin,
|
|
1983
1983
|
author: () => author
|
|
1984
1984
|
});
|
|
1985
|
-
var name = "guardian-framework", version = "0.1.
|
|
1985
|
+
var name = "guardian-framework", version = "0.1.94", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
|
|
1986
1986
|
var init_package = __esm(() => {
|
|
1987
1987
|
exports = {
|
|
1988
1988
|
".": {
|
package/package.json
CHANGED
|
@@ -18,23 +18,28 @@ Every bounded context follows the same 4-layer structure:
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
module/
|
|
21
|
-
├── domain/ # Pure domain entities, value objects, events
|
|
21
|
+
├── domain/ # Pure domain entities, value objects, events, repository traits
|
|
22
22
|
│ ├── mod.rs # Re-exports + module-level documentation
|
|
23
|
-
│ ├── entity
|
|
24
|
-
│
|
|
25
|
-
│ ├──
|
|
26
|
-
│ └──
|
|
27
|
-
├──
|
|
23
|
+
│ ├── entity/ # Aggregate roots and entities
|
|
24
|
+
│ │ └── [entity].rs
|
|
25
|
+
│ ├── value/ # Value objects
|
|
26
|
+
│ │ └── [value].rs
|
|
27
|
+
│ ├── event/ # Domain event payloads
|
|
28
|
+
│ ├── repository/ # Repository TRAIT definitions (interfaces belong in domain!)
|
|
29
|
+
│ │ ├── mod.rs
|
|
30
|
+
│ │ └── [entity]_repository.rs
|
|
31
|
+
│ └── error/ # Typed error enum (thiserror)
|
|
32
|
+
├── application/ # Service traits, DTOs, use case orchestration
|
|
28
33
|
│ ├── mod.rs
|
|
29
34
|
│ ├── service.rs # Service trait definitions
|
|
30
|
-
│ ├──
|
|
31
|
-
│ └──
|
|
32
|
-
│
|
|
33
|
-
├── infrastructure/ # Repository
|
|
35
|
+
│ ├── dto/ # Input/Output DTOs
|
|
36
|
+
│ │ └── mod.rs
|
|
37
|
+
│ └── factory.rs # Factory trait interfaces
|
|
38
|
+
├── infrastructure/ # Repository IMPLEMENTATIONS, external adapters
|
|
34
39
|
│ ├── mod.rs
|
|
35
|
-
│ ├── repository/ # Repository
|
|
40
|
+
│ ├── repository/ # Repository IMPLEMENTATIONS (concrete, not traits)
|
|
36
41
|
│ │ ├── mod.rs
|
|
37
|
-
│ │ └── [entity]
|
|
42
|
+
│ │ └── [entity]_repository_impl.rs
|
|
38
43
|
│ └── persistence/ # ORM/database implementations
|
|
39
44
|
└── interfaces/ # API contracts (HTTP, events)
|
|
40
45
|
├── mod.rs
|
|
@@ -971,6 +976,26 @@ pub struct Order { pub customer: Customer } // BAD — use customer_id: Uuid
|
|
|
971
976
|
|
|
972
977
|
// ❌ Infrastructure leak in domain
|
|
973
978
|
use sqlx::PgPool; // BAD — domain NEVER imports infrastructure concerns
|
|
979
|
+
|
|
980
|
+
// ❌ Handler with trait (handlers are concrete only)
|
|
981
|
+
pub trait UserHandler { ... } // BAD — the route/handler fn IS the contract
|
|
982
|
+
pub struct UserHandlerImpl { ... } // BAD — pointless indirection
|
|
983
|
+
|
|
984
|
+
// ❌ Handler importing repository directly (bypasses service layer)
|
|
985
|
+
async fn get_users(repo: impl UserRepository) { // BAD — use application service
|
|
986
|
+
let users = repo.find_all().await;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
// ❌ Repository trait in infrastructure layer
|
|
990
|
+
// infrastructure/repository/user_repository.rs BAD — traits belong in domain/
|
|
991
|
+
pub trait UserRepository { ... }
|
|
992
|
+
|
|
993
|
+
// ✅ Correct: trait in domain/, impl in infrastructure/
|
|
994
|
+
// domain/repository/user_repository.rs
|
|
995
|
+
pub trait UserRepository { ... } // ✅
|
|
996
|
+
// infrastructure/repository/user_repository_impl.rs
|
|
997
|
+
pub struct PostgresUserRepository; // ✅
|
|
998
|
+
impl UserRepository for PostgresUserRepository { ... }
|
|
974
999
|
```
|
|
975
1000
|
|
|
976
1001
|
---
|