@erichll/pi-auto-review 0.18.2 → 0.19.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,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.0 - 2026-09-20
4
+
5
+ - Require Pi `^0.86.0` for both the development and peer dependency of
6
+ `@earendil-works/pi-ai` and `@earendil-works/pi-coding-agent`.
7
+ - Migrate the reviewer model call to Pi 0.86's normalized `TranscriptContext`:
8
+ a registered provider `streamSimple` (models.json or extension-registered
9
+ custom providers) now receives `normalizeContext(...)` so the reviewer system
10
+ prompt and tool declarations arrive as the transcript's leading system
11
+ message. Before this change such providers read the removed
12
+ `context.systemPrompt`/`context.tools` and silently reviewed with a fallback
13
+ system prompt and no tools.
14
+ - Read the normalized transcript in the authorizer integration tests
15
+ (`getCurrentSystemPrompt` plus the last user message) and assert the leading
16
+ system message, so the fake `streamSimple` observes the same shape the real
17
+ provider adapters receive.
18
+
19
+ ## 0.18.3 - 2026-09-20
20
+
21
+ - Move the `@gotgenes/pi-permission-system` development dependency to
22
+ `^33.0.1` and refresh the type-check/test surface to Pi `^0.85.1`.
23
+ - Add an MCP rule-semantics regression test that locks the 33.x behavior this
24
+ package depends on: a prefix-named tool such as `atlassian_getJiraIssue`
25
+ derives its bare server (`atlassian`) as a candidate instead of an
26
+ unmatchable double-prefixed alias, and MCP rules are evaluated
27
+ last-match-wins across those candidates. A ruleset that puts
28
+ `"*": "allow"` before `"atlassian": "deny"` now denies such a call, and the
29
+ reviewer is shown the tool name as the boundary value.
30
+ - Sync `examples/pi-permission-system.config.example.json` with the live
31
+ baseline: add the `mcp__atlassian` namespace-proxy allow and drop the
32
+ redundant bare `atlassian` allow (after 33.0.0 its only reachable effect was
33
+ silently allowing `mcp connect atlassian`, which starts the server). Ordinary
34
+ `atlassian` / `jira` / `confluence` tool calls stay allowed.
35
+ - No runtime behavior change in this package: the public authorizer API it
36
+ consumes and the normalized evidence shape are unchanged, and the peer range
37
+ stays `>=30.0.0`. The bump only moves the development surface, so MCP rule
38
+ semantics come from the installed permission-system (33.0.0 made
39
+ prefix-named tools resolve to their bare server and evaluated MCP rules
40
+ last-match-wins).
41
+
3
42
  ## 0.18.2 - 2026-09-17
4
43
 
5
44
  - Treat empty or whitespace-only `.pi/pi-auto-review.json` files as missing
package/README.md CHANGED
@@ -31,7 +31,8 @@ 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:
34
+ > extension. This release line supports permission-system 30.0.0 and later,
35
+ > validated through 33.0.1:
35
36
 
36
37
  Node.js 22.13.0 or newer is required. Permission auditing uses Node's built-in
37
38
  `node:sqlite`; it does not require a SQLite CLI, system SQLite library, or npm
@@ -117,6 +118,16 @@ read/write/edit, a read-only bash allowlist, an MCP discovery policy, and a
117
118
  `path` deny block for secret and credential files — see
118
119
  [`examples/pi-permission-system.config.example.json`](examples/pi-permission-system.config.example.json).
119
120
 
121
+ MCP rules are evaluated last-match-wins across the candidates derived for one
122
+ call: the tool name, its bare server, and `mcp_call`. Keep `"*"` first in the
123
+ `mcp` block and narrower server or tool entries after it, as the example does,
124
+ so a specific rule cannot be shadowed by the catch-all. A bare server entry
125
+ such as `"atlassian": "allow"` also matches the `mcp connect <server>`
126
+ candidate list, so it auto-allows starting that server — prefer the `server_*`
127
+ and `server:*` forms for tool calls. Any entry meant to narrow a broad allow
128
+ (such as a destructive-tool pattern) must be written after it, or
129
+ last-match-wins shadows it.
130
+
120
131
  Package defaults:
121
132
 
122
133
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-auto-review",
3
- "version": "0.18.2",
3
+ "version": "0.19.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",
@@ -47,15 +47,15 @@
47
47
  "test": "node --disable-warning=ExperimentalWarning --experimental-transform-types --import ./test/register-external-ts.mjs --test test/*.test.ts"
48
48
  },
49
49
  "peerDependencies": {
50
- "@earendil-works/pi-ai": "^0.85.0",
51
- "@earendil-works/pi-coding-agent": "^0.85.0",
50
+ "@earendil-works/pi-ai": "^0.86.0",
51
+ "@earendil-works/pi-coding-agent": "^0.86.0",
52
52
  "@gotgenes/pi-permission-system": ">=30.0.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@earendil-works/pi-ai": "^0.85.0",
56
- "@earendil-works/pi-coding-agent": "^0.85.0",
57
- "@earendil-works/pi-server": "^0.85.0",
58
- "@gotgenes/pi-permission-system": "31.1.1",
55
+ "@earendil-works/pi-ai": "^0.86.0",
56
+ "@earendil-works/pi-coding-agent": "^0.86.0",
57
+ "@earendil-works/pi-server": "^0.86.0",
58
+ "@gotgenes/pi-permission-system": "^33.0.1",
59
59
  "@types/node": "^26.2.0",
60
60
  "typescript": "^6.0.3"
61
61
  }
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
3
- import { completeSimple } from "@earendil-works/pi-ai/compat";
3
+ import { completeSimple, normalizeContext } from "@earendil-works/pi-ai/compat";
4
4
  import type { BoundaryRequest } from "../broker/index.ts";
5
5
  import type { UserReviewUsage } from "../user-feedback.ts";
6
6
  import type {
@@ -572,8 +572,17 @@ export async function modelCall(
572
572
  metadata.retryAfterMs = parseRetryAfterMs(response.headers);
573
573
  },
574
574
  };
575
+ // 0.86 moved the provider-facing request to a normalized transcript: the
576
+ // system prompt and tool declarations now travel as the transcript's leading
577
+ // system message. Providers registered by extensions receive that shape, so
578
+ // normalize before calling a registered streamSimple. completeSimple still
579
+ // accepts a Context and normalizes internally.
575
580
  return (runtime.streamSimple
576
- ? await runtime.streamSimple(runtime.model, context, options).result()
581
+ ? await runtime.streamSimple(
582
+ runtime.model,
583
+ normalizeContext(context),
584
+ options,
585
+ ).result()
577
586
  : await completeSimple(runtime.model, context, options)) as CompletionMessage;
578
587
  }
579
588