guardian-framework 0.1.92 → 0.1.93
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 +1 -1
- package/dist/exports.js +1 -1
- package/package.json +1 -1
- package/templates/pi/preflight_report.json +1 -1
- package/templates/pi/scripts/languages/java/validate-spring-architecture.sh +2 -2
- package/templates/pi/skills/go-enterprise-codegen.md +18 -0
- package/templates/pi/skills/java-spring-enterprise-codegen.md +22 -0
- package/templates/pi/skills/python-enterprise-codegen.md +14 -0
- package/templates/pi/skills/typescript-enterprise-codegen.md +17 -0
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.93", 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.93", 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
|
@@ -123,7 +123,7 @@ if [ -n "$APP_DIR" ]; then
|
|
|
123
123
|
BAD_IMPORTS=0
|
|
124
124
|
for f in $(find "$APP_DIR" -name "*.java" 2>/dev/null); do
|
|
125
125
|
while IFS= read -r line; do
|
|
126
|
-
if echo "$line" | grep -qE "import\s+.*\.(infrastructure|web|interfaces|controller
|
|
126
|
+
if echo "$line" | grep -qE "import\s+.*\.(infrastructure|web|interfaces|controller)\." 2>/dev/null; then
|
|
127
127
|
# Skip Java/Spring standard imports
|
|
128
128
|
if echo "$line" | grep -qE "import\s+(java\.|javax\.|org\.springframework\.|org\.slf4j\.)"; then
|
|
129
129
|
continue
|
|
@@ -176,7 +176,7 @@ if [ -n "$WEB_DIR" ]; then
|
|
|
176
176
|
BAD_IMPORTS=0
|
|
177
177
|
for f in $(find "$WEB_DIR" -name "*.java" 2>/dev/null); do
|
|
178
178
|
while IFS= read -r line; do
|
|
179
|
-
if echo "$line" | grep -qE "import\s+.*\.(infrastructure
|
|
179
|
+
if echo "$line" | grep -qE "import\s+.*\.(infrastructure)\." 2>/dev/null; then
|
|
180
180
|
if echo "$line" | grep -qE "import\s+(java\.|javax\.|org\.springframework\.|org\.slf4j\.)"; then
|
|
181
181
|
continue
|
|
182
182
|
fi
|
|
@@ -421,6 +421,24 @@ json.NewEncoder(w).Encode(data) // BAD — always handle errors
|
|
|
421
421
|
|
|
422
422
|
// ❌ Background goroutines in handlers
|
|
423
423
|
go doSomething() // BAD — use proper worker pools with lifecycle management
|
|
424
|
+
|
|
425
|
+
// ❌ Controller/handler with interface (handlers are concrete only)
|
|
426
|
+
type UserHandler interface { ... } // BAD — http.HandlerFunc IS the contract
|
|
427
|
+
type userHandlerImpl struct { ... } // BAD — pointless indirection
|
|
428
|
+
|
|
429
|
+
// ❌ Handler importing repository directly (bypasses service layer)
|
|
430
|
+
func Handler(w http.ResponseWriter, r *http.Request) {
|
|
431
|
+
repo.FindAll() // BAD — use application service, not repository
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// ❌ Repository interface in infrastructure layer
|
|
435
|
+
// BAD: interfaces belong in domain/
|
|
436
|
+
type UserRepository interface { ... } // put this in domain/repository.go
|
|
437
|
+
|
|
438
|
+
// ✅ Correct: repository interface in domain/
|
|
439
|
+
type UserRepository interface { ... } // ✅ in domain/repository.go
|
|
440
|
+
// Implementation in infrastructure/repository/
|
|
441
|
+
type postgresUserRepository struct { ... }
|
|
424
442
|
```
|
|
425
443
|
|
|
426
444
|
---
|
|
@@ -480,6 +480,28 @@ public class Money {
|
|
|
480
480
|
public class User {
|
|
481
481
|
// used directly in REST responses // BAD — use DTOs
|
|
482
482
|
}
|
|
483
|
+
|
|
484
|
+
// ❌ Controller with interface (controllers are concrete only)
|
|
485
|
+
public interface UserController { ... } // BAD — @RestController is the contract
|
|
486
|
+
public class UserControllerImpl implements UserController { ... } // BAD — pointless indirection
|
|
487
|
+
|
|
488
|
+
// ❌ Controller importing repository directly (bypasses service layer)
|
|
489
|
+
@RestController
|
|
490
|
+
public class UserController {
|
|
491
|
+
private final UserRepository repo; // BAD — use application service, not repository
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// ❌ Repository interface in infrastructure layer
|
|
495
|
+
package com.project.module.infrastructure.repository; // BAD — interfaces belong in domain/repository/
|
|
496
|
+
public interface UserRepository { ... }
|
|
497
|
+
|
|
498
|
+
// ✅ Correct: repository interface in domain, impl in infrastructure
|
|
499
|
+
package com.project.module.domain.repository; // ✅ interface in domain
|
|
500
|
+
public interface UserRepository { ... }
|
|
501
|
+
|
|
502
|
+
package com.project.module.infrastructure.repository; // ✅ impl in infrastructure
|
|
503
|
+
@Repository
|
|
504
|
+
public class JpaUserRepository implements UserRepository { ... }
|
|
483
505
|
```
|
|
484
506
|
|
|
485
507
|
---
|
|
@@ -345,6 +345,20 @@ except Exception: # BAD — catch specific exceptions
|
|
|
345
345
|
# ❌ Business logic in FastAPI routes
|
|
346
346
|
@router.post("/")
|
|
347
347
|
async def handler(payload: dict): # BAD — use pydantic models + service layer
|
|
348
|
+
|
|
349
|
+
# ❌ Route importing repository directly (bypasses service layer)
|
|
350
|
+
@router.get("/")
|
|
351
|
+
async def handler(repo=Depends(get_repo)): # BAD — use service, not repository
|
|
352
|
+
data = await repo.find_all()
|
|
353
|
+
|
|
354
|
+
# ❌ Repository interface/ABC in infrastructure layer
|
|
355
|
+
class AbstractUserRepository(ABC): ... # BAD — interfaces belong in domain/
|
|
356
|
+
|
|
357
|
+
# ✅ Correct: repository ABC in domain/, impl in infrastructure/
|
|
358
|
+
# domain/repository.py
|
|
359
|
+
class AbstractUserRepository(ABC): ... # ✅
|
|
360
|
+
# infrastructure/repository.py
|
|
361
|
+
class PostgresUserRepository(AbstractUserRepository): ...
|
|
348
362
|
```
|
|
349
363
|
|
|
350
364
|
---
|
|
@@ -379,6 +379,23 @@ throw 'something went wrong' // BAD
|
|
|
379
379
|
|
|
380
380
|
// ❌ Ignoring promise rejections
|
|
381
381
|
processAsync() // BAD — missing await
|
|
382
|
+
|
|
383
|
+
// ❌ Controller with interface (controllers are concrete only)
|
|
384
|
+
export interface UserController { ... } // BAD — the router/handler IS the contract
|
|
385
|
+
export class UserControllerImpl implements UserController { ... } // BAD — pointless indirection
|
|
386
|
+
|
|
387
|
+
// ❌ Controller importing repository directly (bypasses service layer)
|
|
388
|
+
router.get('/', async (req, res) => {
|
|
389
|
+
const data = await repo.findAll(); // BAD — use service, not repository
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
// ❌ Repository interface in infrastructure layer
|
|
393
|
+
export interface UserRepository {} // BAD — interfaces belong in domain/
|
|
394
|
+
|
|
395
|
+
// ✅ Correct: repository interface in domain/
|
|
396
|
+
export interface UserRepository {} // ✅ in domain/repository.ts
|
|
397
|
+
// Implementation in infrastructure/repository/ (without interface)
|
|
398
|
+
export class PostgresUserRepository implements UserRepository {}
|
|
382
399
|
```
|
|
383
400
|
|
|
384
401
|
---
|