@mzwing/pi-permission-auto-review 0.3.3 → 0.5.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
@@ -10,7 +10,7 @@ A [Pi](https://github.com/earendil-works/pi) extension that adds Codex-style aut
10
10
 
11
11
  Ours is mostly specialized for OpenAI's `codex-auto-review` model, which is trained to evaluate permission requests in the context of a coding assistant. Our extension aims at providing Codex-style automatic permission reviews for Pi's coding agent.
12
12
 
13
- The bundled baseline is a Pi-specific adaptation of OpenAI Codex Guardian's [`policy_template.md`](https://github.com/openai/codex/blob/6478a751fde8884b2fdc76486fe23175a8e795d4/codex-rs/core/assets/guardian/policy_template.md) and [`policy.md`](https://github.com/openai/codex/blob/6478a751fde8884b2fdc76486fe23175a8e795d4/codex-rs/core/assets/guardian/policy.md) at revision [`6478a751fde8884b2fdc76486fe23175a8e795d4`](https://github.com/openai/codex/commit/6478a751fde8884b2fdc76486fe23175a8e795d4). It is bundled at build time; the extension never fetches policy text while reviewing an action.
13
+ The bundled baseline is a Pi-specific adaptation of OpenAI Codex Guardian's [`policy_template.md`](https://github.com/openai/codex/blob/a8c36ca6d265800c1b2c67d19d3583e23dee8382/codex-rs/prompts/templates/guardian/policy_template.md) and [`policy.md`](https://github.com/openai/codex/blob/a8c36ca6d265800c1b2c67d19d3583e23dee8382/codex-rs/prompts/templates/guardian/policy.md) at revision [`a8c36ca6d265800c1b2c67d19d3583e23dee8382`](https://github.com/openai/codex/commit/a8c36ca6d265800c1b2c67d19d3583e23dee8382). It is bundled at build time; the extension never fetches policy text while reviewing an action.
14
14
 
15
15
  Upstream's `Execution Environment` section and its MCP `connected_account_email` rule are deliberately left out: both describe Codex's sandbox and tool surface, which Pi's tool-free reviewer does not have. Upstream's `node_repl_policy.md` is likewise out of scope — it governs `node_repl` / `cua_repl` computer-use tools that Pi does not expose.
16
16
 
@@ -35,7 +35,7 @@ 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 - 32.x are required.
38
+ Pi 0.86.0+ and `@gotgenes/pi-permission-system` 33.x are required.
39
39
 
40
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
 
@@ -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)