@gotgenes/pi-permission-model-judge 1.0.0 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.1](https://github.com/gotgenes/pi-packages/compare/pi-permission-model-judge-v1.0.0...pi-permission-model-judge-v1.0.1) (2026-07-20)
4
+
5
+
6
+ ### Documentation
7
+
8
+ * **pi-permission-model-judge:** feature the doubled-package typo pattern ([abcfa23](https://github.com/gotgenes/pi-packages/commit/abcfa23eac678b42b2e031b0bb1092db4b601c55))
9
+
3
10
  ## 1.0.0 (2026-07-20)
4
11
 
5
12
 
package/README.md CHANGED
@@ -49,8 +49,9 @@ Two independent config files are involved — the safety policy lives in pi-perm
49
49
  {
50
50
  "provider": "anthropic",
51
51
  "model": "claude-haiku-4-5",
52
- "instructions": "Deny a path that repeats a directory segment…",
53
- "typoPatterns": ["pi-permission-system/packages/pi-permission-system"]
52
+ "instructions": "Deny a path that repeats a package name around `packages/`…",
53
+ // Catches a doubled package segment (`<name>/packages/<name>/…`) for any package.
54
+ "typoPatterns": ["([^/]+)/packages/\\1(/|$)"]
54
55
  }
55
56
  ```
56
57
 
@@ -2,10 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/gotgenes/pi-packages/main/packages/pi-permission-model-judge/schemas/model-judge.schema.json",
3
3
  "provider": "anthropic",
4
4
  "model": "claude-haiku-4-5",
5
- "instructions": "You review a filesystem path a tool is about to access outside the working directory. A typo path repeats a directory segment that should appear once for example a path containing `pi-permission-system/packages/pi-permission-system`, where the first segment should be `pi-packages`. Deny only a clear typo, and in the reason state the wrong segment and the correct location so the caller can self-correct. When unsure, defer.",
6
- "typoPatterns": [
7
- "pi-permission-system/packages/pi-permission-system",
8
- "pi-packages/packages/[^/]+/packages/"
9
- ],
5
+ "instructions": "You review a filesystem path a tool is about to access outside the working directory. The common typo is a doubled package segment a package name repeated around `packages/`, for example `pi-permission-system/packages/pi-permission-system/…`, where the correct path names the package only once under the repository's `packages/` directory. When the path repeats a package name like that, deny it and give the single corrected absolute path in the reason so the caller can retry against the right location. If the path looks intentional or you are unsure, defer. Reply with strict JSON: {\"verdict\":\"deny\",\"reason\":\"…\"} to reject, or {\"verdict\":\"defer\"} otherwise.",
6
+ "typoPatterns": ["([^/]+)/packages/\\1(/|$)"],
10
7
  "timeoutMs": 5000
11
8
  }
@@ -59,6 +59,15 @@ Only a path that matches at least one pattern is sent to the model — this is t
59
59
  An invalid regular expression is skipped with a warning.
60
60
  An empty list (the default) matches nothing, so the reviewer defers everything.
61
61
 
62
+ The canonical typo is a **doubled package segment** — a package name repeated around `packages/`, e.g. `pi-permission-system/packages/pi-permission-system/…`.
63
+ A backreference matches this for *any* package name in one pattern:
64
+
65
+ ```json
66
+ "typoPatterns": ["([^/]+)/packages/\\1(/|$)"]
67
+ ```
68
+
69
+ The `\1` backreference requires the segment before and after `packages/` to be identical, so it catches `<name>/packages/<name>` for every `<name>` while leaving a correct `packages/<name>/…` path untouched. (In JSON the backslash is doubled — `\\1` — so the parsed string is the regex `\1`.)
70
+
62
71
  ### `timeoutMs`
63
72
 
64
73
  The model call is aborted after this many milliseconds, and an aborted call defers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotgenes/pi-permission-model-judge",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Deny-first typo-path model judge — a pi-permission-system Authorizer chain link",
5
5
  "type": "module",
6
6
  "imports": {