pi-permission-classifier 0.5.2 → 0.6.1

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.
@@ -1,5 +1,12 @@
1
1
  {
2
+ "mode": "quick-then-llm",
2
3
  "provider": "anthropic",
3
4
  "model": "claude-haiku-4-5",
4
- "timeoutMs": 5000
5
+ "timeoutMs": 5000,
6
+ "quickJudge": {
7
+ "provider": "typesafe",
8
+ "model": "jev-latest",
9
+ "guidance": true,
10
+ "timeoutMs": 5000
11
+ }
5
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-permission-classifier",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "description": "Auto-classifier Authorizer chain link for pi-permission-system: a light model reviews each ask and returns allow, deny, or defer",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,18 +44,21 @@
44
44
  "scripts": {
45
45
  "check": "tsc --noEmit",
46
46
  "test": "vitest run",
47
+ "eval:quick": "vitest run --config vitest.eval.config.ts",
48
+ "data:pull": "vitest run --config vitest.pull.config.ts",
47
49
  "test:watch": "vitest"
48
50
  },
49
51
  "dependencies": {
50
52
  "zod": "4.4.3"
51
53
  },
52
54
  "peerDependencies": {
53
- "@earendil-works/pi-coding-agent": ">=0.84.3",
55
+ "@earendil-works/pi-coding-agent": ">=1.0.0",
54
56
  "@gotgenes/pi-permission-system": ">=27.0.0"
55
57
  },
56
58
  "devDependencies": {
57
- "@earendil-works/pi-ai": "0.84.3",
58
- "@earendil-works/pi-coding-agent": "0.84.3",
59
+ "@earendil-works/pi-ai": "1.0.3",
60
+ "@earendil-works/pi-coding-agent": "1.0.3",
61
+ "@earendil-works/pi-tui": "1.0.3",
59
62
  "@gotgenes/pi-permission-system": "file:../pi-env/gh/pi-packages/packages/pi-permission-system",
60
63
  "@types/node": "24.13.3",
61
64
  "typescript": "6.0.3",
package/src/breaker.ts CHANGED
@@ -28,6 +28,17 @@ export class CircuitBreaker {
28
28
  private consecutiveFailures = 0;
29
29
  private openedAt: number | undefined;
30
30
 
31
+ /**
32
+ * @param judge The judge this breaker guards, written as `judge` on its
33
+ * open and close entries; untagged when absent.
34
+ */
35
+ constructor(private readonly judge?: "quick" | "llm") {}
36
+
37
+ /** The tag every entry of this breaker carries. */
38
+ private tag(): { judge?: "quick" | "llm" } {
39
+ return this.judge === undefined ? {} : { judge: this.judge };
40
+ }
41
+
31
42
  /**
32
43
  * Milliseconds of cooldown left: 0 while closed or once the cooldown has
33
44
  * elapsed, else the time until the next ask may try the model again.
@@ -58,6 +69,7 @@ export class CircuitBreaker {
58
69
  this.openedAt = Date.now();
59
70
  if (!reopening) {
60
71
  log.review(BREAKER_OPEN_EVENT, {
72
+ ...this.tag(),
61
73
  requestId,
62
74
  consecutiveFailures: this.consecutiveFailures,
63
75
  cooldownMs: BREAKER_COOLDOWN_MS,
@@ -71,7 +83,7 @@ export class CircuitBreaker {
71
83
  this.consecutiveFailures = 0;
72
84
  this.openedAt = undefined;
73
85
  if (wasOpen) {
74
- log.review(BREAKER_CLOSE_EVENT, { requestId });
86
+ log.review(BREAKER_CLOSE_EVENT, { ...this.tag(), requestId });
75
87
  }
76
88
  }
77
89
  }