guardian-framework 0.1.82 → 0.1.83
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.83", 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.83", 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
|
@@ -170,6 +170,8 @@ before the implementation issue can be closed. These ACs flow into the generated
|
|
|
170
170
|
## Error Handling
|
|
171
171
|
|
|
172
172
|
**Domain errors (domain/):**
|
|
173
|
+
|
|
174
|
+
TypeScript:
|
|
173
175
|
```typescript
|
|
174
176
|
class [ErrorType] extends Error {
|
|
175
177
|
constructor(code: string, message: string, retriable?: boolean) {
|
|
@@ -179,6 +181,23 @@ class [ErrorType] extends Error {
|
|
|
179
181
|
}
|
|
180
182
|
```
|
|
181
183
|
|
|
184
|
+
Java:
|
|
185
|
+
```java
|
|
186
|
+
// domain/error/DomainException.java — abstract base
|
|
187
|
+
public abstract class DomainException extends RuntimeException {
|
|
188
|
+
private final ErrorCode code;
|
|
189
|
+
protected DomainException(ErrorCode code, String message) {
|
|
190
|
+
super(message); this.code = code;
|
|
191
|
+
}
|
|
192
|
+
public ErrorCode getCode() { return code; }
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// domain/error/DomainError.java — concrete error
|
|
196
|
+
public class DomainError extends DomainException {
|
|
197
|
+
public DomainError(ErrorCode code, String message) { super(code, message); }
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
182
201
|
**Recovery:**
|
|
183
202
|
- [Error 1]: [Recovery strategy]
|
|
184
203
|
- [Error 2]: [Recovery strategy]
|
|
@@ -5,27 +5,32 @@
|
|
|
5
5
|
|
|
6
6
|
## Error Handling
|
|
7
7
|
|
|
8
|
-
{{
|
|
8
|
+
**Pattern:** {{ERROR_HANDLING_PATTERN}}
|
|
9
9
|
|
|
10
|
-
**Rule:**
|
|
10
|
+
**Rule:**
|
|
11
|
+
- **Java:** Domain errors extend `DomainException` (abstract base in `domain/error/`), never `RuntimeException` directly. Use `ErrorCode` enum for machine-readable types. Catch at controller advice layer.
|
|
12
|
+
- **TypeScript:** Use Result type pattern (`ok()`/`err()`) for recoverable errors. Throw typed `extends Error` classes for unrecoverable.
|
|
13
|
+
- **Rust:** Use `Result<T, E>` with custom error enums implementing `std::error::Error`.
|
|
14
|
+
- **Python:** Use custom exception classes inheriting from `Exception`.
|
|
15
|
+
- **Go:** Use sentinel errors with `errors.Is/As`.
|
|
11
16
|
|
|
12
17
|
## Tracing
|
|
13
18
|
|
|
14
|
-
{{
|
|
19
|
+
**Pattern:** {{TRACING_PATTERN}}
|
|
15
20
|
|
|
16
|
-
**Rule:**
|
|
21
|
+
**Rule:** Every handler must propagate trace context. Use correlation IDs across service boundaries.
|
|
17
22
|
|
|
18
23
|
## Cancellation
|
|
19
24
|
|
|
20
|
-
{{
|
|
25
|
+
**Pattern:** {{CANCELLATION_PATTERN}}
|
|
21
26
|
|
|
22
|
-
**Rule:**
|
|
27
|
+
**Rule:** Every async operation must respect cancellation signals. Clean up resources on cancellation.
|
|
23
28
|
|
|
24
29
|
## Atomic Writes
|
|
25
30
|
|
|
26
|
-
{{
|
|
31
|
+
**Pattern:** {{ATOMIC_WRITE_PATTERN}}
|
|
27
32
|
|
|
28
|
-
**Rule:**
|
|
33
|
+
**Rule:** Never write files in place. Use write-rename pattern (`.tmp` then rename) or transactional storage.
|
|
29
34
|
|
|
30
35
|
## Retry Logic
|
|
31
36
|
|