@erichll/pi-auto-review 0.20.0 → 0.21.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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.0 - 2026-09-25
4
+
5
+ - Raise the `@gotgenes/pi-permission-system` peer floor to `>=34.0.0` and update
6
+ the development baseline to `^34.0.0`. Version 34.0.0 introduces
7
+ syntax-level role projection for redirect targets so non-existent file
8
+ targets are governed by path rules without requiring pre-existence probes.
9
+ - Automatically dismiss deferred and pending review widgets when explicit
10
+ user permission decisions (`permissions:decision` with `allow`) occur or when
11
+ a new agent turn begins (`turn_start`), preventing stale `deferred` notices
12
+ from lingering in the TUI indefinitely.
13
+ - Unit tests added for deferred widget dismissal on local user confirmation.
14
+
15
+ ## 0.20.1 - 2026-09-24
16
+
17
+ - Upgrade the development baseline for `@gotgenes/pi-permission-system` to
18
+ `^33.1.1` (the runtime peer remains `>=30.0.0`). Version 33.1 changes how
19
+ permission-system derives its authorizer tool surface and stop-gap
20
+ `before_agent_start` guidance, while retaining a fail-closed runtime peer
21
+ check and schema validation.
22
+ - Upgrade the development `@types/node` baseline to `^26.6.2`; the resolved
23
+ version was already current under the previous range.
24
+ - Keep `typescript` at `6.0.3`, the latest 6.x release. TypeScript 7.0.2
25
+ remains incompatible with the published-source transform used by the
26
+ permission-system integration tests.
27
+ - Sync `examples/pi-permission-system.config.example.json` with the current
28
+ tool split: Pencil and `mcp__pencil`, `update_plan`, and the complete goal
29
+ lifecycle are explicitly allowed. The example passes the permission-system
30
+ 33.1.1 runtime schema.
31
+ - Type checking and the full package suite pass on the upgraded baselines
32
+ (186 tests).
33
+
3
34
  ## 0.20.0 - 2026-09-23
4
35
 
5
36
  - Require Pi `^0.87.1` for the development and peer dependency of
package/README.md CHANGED
@@ -31,8 +31,7 @@ that dependency is a hard prerequisite (see [Install and enable](#install-and-en
31
31
  > **Prerequisite:** pi-auto-review is an authorizer inside
32
32
  > `@gotgenes/pi-permission-system`. Pi does not auto-install peer packages, so
33
33
  > install the permission system separately (once per machine) before this
34
- > extension. This release line supports permission-system 30.0.0 and later,
35
- > validated through 33.0.8:
34
+ > extension. This release line supports permission-system 34.0.0 and later:
36
35
 
37
36
  Node.js 22.13.0 or newer is required. Permission auditing uses Node's built-in
38
37
  `node:sqlite`; it does not require a SQLite CLI, system SQLite library, or npm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-auto-review",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Fail-closed, model-backed approval broker for Pi: deterministically hard-denies dangerous operations, reviews dangerous boundaries with a reviewer model, and issues one-shot expiring grants that OS sandbox adapters must consume before retrying.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,14 +49,14 @@
49
49
  "peerDependencies": {
50
50
  "@earendil-works/pi-ai": "^0.87.1",
51
51
  "@earendil-works/pi-coding-agent": "^0.87.1",
52
- "@gotgenes/pi-permission-system": ">=30.0.0"
52
+ "@gotgenes/pi-permission-system": ">=34.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@earendil-works/pi-ai": "^0.87.1",
56
56
  "@earendil-works/pi-coding-agent": "^0.87.1",
57
57
  "@earendil-works/pi-server": "^0.87.1",
58
- "@gotgenes/pi-permission-system": "^33.0.8",
59
- "@types/node": "^26.2.0",
58
+ "@gotgenes/pi-permission-system": "^34.0.0",
59
+ "@types/node": "^26.6.2",
60
60
  "typescript": "^6.0.3"
61
61
  }
62
62
  }
package/src/index.ts CHANGED
@@ -241,6 +241,9 @@ export function createPiAutoReviewExtension(
241
241
  pi.on("ui_prompt_end", () => {
242
242
  reviewWidget.promptEnd();
243
243
  });
244
+ pi.on("turn_start", () => {
245
+ reviewWidget.clear(context);
246
+ });
244
247
  } catch {
245
248
  // Older pi: widget behavior is unchanged.
246
249
  }
@@ -779,10 +779,18 @@ export class UserReviewWidgetController {
779
779
  const record = event as Record<string, unknown>;
780
780
  const current = this.#current;
781
781
  if (
782
- record.result !== "deny" ||
783
782
  typeof record.requestId !== "string" ||
784
783
  record.requestId !== current?.requestId ||
785
- !current.data ||
784
+ !current.data
785
+ ) return;
786
+
787
+ if (record.result === "allow") {
788
+ this.#scheduleDismiss(current.generation, current.ctx);
789
+ return;
790
+ }
791
+
792
+ if (
793
+ record.result !== "deny" ||
786
794
  current.data.lines.includes("Local confirmation · denied")
787
795
  ) return;
788
796
  const data = {