guardian-framework 0.1.81 → 0.1.82

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.81", 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;
3200
+ var name = "guardian-framework", version = "0.1.82", 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.81", 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;
1985
+ var name = "guardian-framework", version = "0.1.82", 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.81",
3
+ "version": "0.1.82",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-07-16T13:01:09Z",
2
+ "timestamp": "2026-07-16T13:04:53Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {
@@ -8,7 +8,7 @@
8
8
  "failed": 1,
9
9
  "skipped": 12
10
10
  },
11
- "duration_seconds": 1,
11
+ "duration_seconds": 0,
12
12
  "results": [
13
13
  {
14
14
  "name": "check_mr_traceability.sh",
@@ -56,7 +56,7 @@
56
56
  "name": "cargo test --lib",
57
57
  "status": "fail",
58
58
  "message": "unit test failures",
59
- "duration": 1
59
+ "duration": 0
60
60
  },
61
61
  {
62
62
  "name": "integration",
@@ -29,7 +29,9 @@ module/
29
29
  │ ├── repository/ # Repository interfaces
30
30
  │ │ └── EntityRepository.java
31
31
  │ └── error/ # Typed exception classes
32
- │ └── DomainError.java
32
+ │ ├── DomainException.java # Abstract base for all domain errors
33
+ │ ├── DomainError.java # Concrete domain error
34
+ │ └── ErrorCode.java # Machine-readable error codes
33
35
  ├── application/ # Service interfaces and DTOs
34
36
  │ ├── service/ # Service interfaces
35
37
  │ │ └── EntityService.java
@@ -177,25 +179,39 @@ public enum Status {
177
179
  ## 3. Domain Error Handling
178
180
 
179
181
  ```java
180
- // domain/error/DomainError.java
182
+ // domain/error/DomainException.java
181
183
 
182
184
  package com.project.module.domain.error;
183
185
 
184
- public class DomainError extends RuntimeException {
185
-
186
+ /**
187
+ * Base exception for all domain errors.
188
+ * Extending this (rather than RuntimeException directly) allows
189
+ * catching all domain-level errors in a single handler.
190
+ */
191
+ public abstract class DomainException extends RuntimeException {
186
192
  private final ErrorCode code;
187
193
 
188
- public DomainError(String message) {
189
- super(message);
190
- this.code = ErrorCode.VALIDATION;
191
- }
192
-
193
- public DomainError(ErrorCode code, String message) {
194
+ protected DomainException(ErrorCode code, String message) {
194
195
  super(message);
195
196
  this.code = code;
196
197
  }
197
198
 
198
199
  public ErrorCode getCode() { return code; }
200
+ }
201
+
202
+ // domain/error/DomainError.java
203
+
204
+ package com.project.module.domain.error;
205
+
206
+ public class DomainError extends DomainException {
207
+
208
+ public DomainError(String message) {
209
+ super(ErrorCode.VALIDATION, message);
210
+ }
211
+
212
+ public DomainError(ErrorCode code, String message) {
213
+ super(code, message);
214
+ }
199
215
 
200
216
  public static DomainError notFound(String id) {
201
217
  return new DomainError(ErrorCode.NOT_FOUND, "Resource " + id + " not found");
@@ -221,7 +237,8 @@ public enum ErrorCode {
221
237
  ```
222
238
 
223
239
  ### Rules
224
- - ✅ Use `RuntimeException` subclasses for domain errors
240
+ - ✅ Use `DomainException` subclasses for domain errors (never `RuntimeException` directly)
241
+ - ✅ Define `DomainException` as an abstract base in `domain/error/`
225
242
  - ✅ Use `ErrorCode` enum for machine-readable error types
226
243
  - ✅ Use `record` for value objects (Java 16+)
227
244
  - ❌ Don't use Spring annotations in domain layer