@mzwing/pi-permission-auto-review 0.3.2 → 0.4.0

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/README.md CHANGED
@@ -35,9 +35,9 @@ pi install npm:@gotgenes/pi-permission-system # dependency
35
35
  pi install npm:@mzwing/pi-permission-auto-review
36
36
  ```
37
37
 
38
- Pi 0.84.2+ (0.84.x and 0.85.x) and `@gotgenes/pi-permission-system` 27.x, 28.x, 29.x, or 30.x are required.
38
+ Pi 0.84.2+ (0.84.x and 0.85.x) and `@gotgenes/pi-permission-system` 27.x - 32.x are required.
39
39
 
40
- The authorizer registers itself against the service keyed by its own session id, so a subagent's reviewer lands in the node whose gates actually read it.
40
+ The authorizer registers itself against the service keyed by its own session id, so a subagent's reviewer lands in its own node. A node that relays its asks to a live parent session runs no chain of its own, and the parent session's reviewer decides for it.
41
41
 
42
42
  ## Enable
43
43
 
@@ -135,6 +135,26 @@ Each `auto_review.decision` emitted after transcript construction adds content-f
135
135
 
136
136
  These fields distinguish missing or truncated authorization evidence from a model decision made after receiving trusted evidence. Transcript text and model rationale are not persisted. The records are written through pi-permission-system's existing permission-review log when that log is enabled.
137
137
 
138
+ ## Programmatic use
139
+
140
+ `@mzwing/pi-permission-auto-review/review` exposes the evidence, prompt, and verdict pipeline the live reviewer runs, for tools that test the classifier outside a Pi session.
141
+
142
+ ```ts
143
+ import {
144
+ buildReviewPrompt,
145
+ DEFAULT_CONFIG,
146
+ parseReviewAssessment,
147
+ renderTranscript,
148
+ } from '@mzwing/pi-permission-auto-review/review'
149
+
150
+ const prompt = buildReviewPrompt(DEFAULT_CONFIG, renderTranscript(sessionEntries), details)
151
+ const assessment = parseReviewAssessment(modelReply)
152
+ ```
153
+
154
+ `details` is a `PromptPermissionDetails` from `@gotgenes/pi-permission-system`. The subpath needs no Pi peer dependency at runtime.
155
+
156
+ `buildSystemPrompt`, `FIXED_REVIEW_PROTOCOL`, and `POLICY_REVISION` are exported alongside them. Prompt text tracks the bundled Guardian policy and changes with `POLICY_REVISION`; assert on that rather than on exact wording.
157
+
138
158
  ## License
139
159
 
140
160
  [MIT](LICENSE)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  //#region src/index.d.ts
3
- declare function permissionAutoReviewExtension(pi: ExtensionAPI): void;
3
+ export default function permissionAutoReviewExtension(pi: ExtensionAPI): void;
4
4
  //#endregion
5
- export { permissionAutoReviewExtension as default };
6
5
  //# sourceMappingURL=index.d.ts.map