@noppu-labs/opencode-permission-reviewer 0.0.0-stage → 2.4.2

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 ADDED
@@ -0,0 +1,652 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [2.4.2] - 2026-10-09
11
+
12
+ ### Added
13
+
14
+ - Record Jev's own scores in an additive `systemOne` audit field whenever it
15
+ returns a valid decision, on V1 and V2 hosts, including after a hand-off to
16
+ the reasoning reviewer, which previously kept only the System One model and
17
+ reason. The README's audit section lists the fields and when the field is
18
+ absent. Outcomes and routing are unchanged. Audit `schemaVersion` stays 3.
19
+
20
+ ### Changed
21
+
22
+ - Update the `@opencode/client` dependency to 2.0.26, from upstream.
23
+
24
+ ### Fixed
25
+
26
+ - Audit records credit the reasoning reviewer, not Jev, when a configuration
27
+ or evidence gate downgrades its allow, and when it fails after a hand-off
28
+ (the failure reason now names the reasoning reviewer).
29
+
30
+ ## [2.4.1] - 2026-10-09
31
+
32
+ ### Changed
33
+
34
+ - Publish this fork to npm as `@noppu-labs/opencode-permission-reviewer`. The
35
+ CLI command stays `opencode-permission-reviewer`.
36
+
37
+ ## [2.4.1-noppu] - 2026-10-09
38
+
39
+ ### Fixed
40
+
41
+ - Keep MCP servers that other plugins add from code, such as
42
+ `@upstash/context7-opencode`, out of the OpenCode V2 reviewer Location. They
43
+ previously made every review fail closed.
44
+
45
+ ## [2.4.0] - 2026-10-02
46
+
47
+ ### Added
48
+
49
+ - Git remote evidence for network subcommands: `git push`, `fetch`, `pull`,
50
+ `ls-remote`, and `git remote` now report each remote operand as a configured
51
+ remote (with the push/fetch URLs it resolves to, credential userinfo
52
+ redacted), a literal URL, or unmatched, plus the default remote an
53
+ operand-less command would contact. The reviewer judges the destination
54
+ from this evidence instead of treating an unresolved alias as unknown.
55
+
56
+ - Recognize `deno` and `tsx` as local script interpreters, attaching the
57
+ executed file as evidence for direct invocations (`deno <file>`,
58
+ `tsx <file>`), `deno run/serve/watch`, and `tsx watch` file targets. Deno
59
+ tasks, package specifiers (`jsr:`/`npm:`/URLs), manifest scripts, and
60
+ ambiguous option forms gather no evidence rather than risk attaching the
61
+ wrong file. Node-family value flags (`--test-reporter-destination` and
62
+ siblings) are skipped for `node` and `tsx` for the same reason.
63
+ - Inspect manifest definitions and bounded local script chains for Bun, npm,
64
+ pnpm, and Yarn script invocations. Referenced local code and conditional
65
+ lifecycle hooks are included as evidence without executing package code or
66
+ assuming the invocation needs network access.
67
+
68
+ ### Changed
69
+
70
+ - Verify compatibility with OpenCode V1 1.18.34 and V2 2.0.21.
71
+ - No lifecycle scripts ship with the package: the `prepare` build hook is
72
+ gone, so installs execute nothing from this repository. The npm registry is
73
+ the supported install source (Git/local installs yield a package without
74
+ `dist/`); build from source explicitly with `bun install && bun run build`.
75
+
76
+ ### Fixed
77
+
78
+ - Attach local script evidence only for the executed interpreter, preserve
79
+ leading-dash file names after `--`, and inspect equally named scripts in
80
+ different working directories separately. Remote commands and interpreter
81
+ mentions no longer attach unrelated local code.
82
+ - Resolve Git repository evidence only for a local Git executable; remote
83
+ commands and command mentions no longer inherit the local repository's state
84
+ or configured destinations.
85
+ - Prevent OpenCode V1's isolated reviewer location from starting another copy
86
+ of globally configured MCP servers. Its local bootstrap excludes MCP, and
87
+ reviews fail closed if the host reports servers or an invalid inventory.
88
+ Isolation files are replaced atomically and reject links and special files.
89
+ Thanks @jg33 for the fix ([#62](https://github.com/warc0s/opencode-permission-reviewer/pull/62)).
90
+ - Preserve reviewer cancellation and timeout errors across garbage collection,
91
+ including waits admitted after a review has already ended.
92
+ - Normalize shell redirections before resolving executables, including glued,
93
+ leading, file-descriptor, clobber, and command-string forms. Redirections can
94
+ no longer hide root destruction, credential reads, network clients, or
95
+ external write targets; heredoc payload text is no longer treated as an
96
+ executed command.
97
+ - Classify `git add`, remote/config/ref mutations, fetch/pull, `dd of=...`,
98
+ attached `sort -o...`, and writes inside worktrees under temporary roots with
99
+ their actual mutation, network, and path effects.
100
+ - Treat V1 inline plugin options as unknown-origin input, matching V2, and keep
101
+ reviewer selection, policy, resource limits, and debug logging under trusted
102
+ global configuration.
103
+ - Redact URL userinfo even when a credential occupies only the username slot,
104
+ and block GitHub config and token-shaped content from file enrichment.
105
+ - Refuse symlinked config files in `init`; planning, backups, and updates now
106
+ hold a no-follow regular-file descriptor through their operation. Config
107
+ parsing and change detection use the same file snapshot.
108
+ - Recognize shell `-c` flag clusters, options after `-c`, `exec`, clustered SSH
109
+ flags, and value-taking wrapper options so they cannot hide destructive
110
+ commands from the emergency brake. Direct `cp` and `install` overwrites of
111
+ block devices are also rejected.
112
+ - Preserve file mutation effects for target-directory options, optional
113
+ option values, rename operands, implicit link destinations, and rsync
114
+ source removal.
115
+ - Keep relative `cd` targets unresolved when the preceding working directory
116
+ is ambiguous, instead of throwing or assuming the initial directory.
117
+ - Resolve attached and trailing Git push `--repo` overrides, and redact URL
118
+ passwords before bounding evidence, including unavailable Git snapshots.
119
+ - Withhold Git snapshots when a successful status process returns incomplete
120
+ output, preserving the planned action without inventing repository state.
121
+ - Include the executed file as local script evidence for `bun run <file>`
122
+ commands; package manifest scripts (`bun run check`) and bun option values
123
+ are not mistaken for the run target.
124
+ - Emergency brake: peel `systemd-run`, `strace`, `ltrace`, and `script -c`
125
+ wrappers (including clustered value-taking options such as `sudo -nu root`
126
+ and `env -iS`), treat a live root glob (`rm -rf /*`) as root destruction,
127
+ and reject shell redirections onto real block devices (`> /dev/sda`,
128
+ glued `2>/dev/sda`, `tee /dev/sda`) in direct and command-string forms.
129
+ - Audit records always land in a mode `0600` file: a pre-existing audit path
130
+ with looser permissions is tightened before receiving new records instead of
131
+ being extended as-is.
132
+ - Recover literal user intent after long operational histories, compaction,
133
+ and host restarts, while keeping synthetic control messages and inherited
134
+ fork messages out of direct authorization evidence.
135
+
136
+ ## [2.3.1] - 2026-09-28
137
+
138
+ ### Fixed
139
+
140
+ - Prevent OpenCode V2 permission reviews from starting additional configured
141
+ MCP processes for each review. Reviews now share an isolated Location without
142
+ MCP servers while keeping their sessions independent.
143
+ - Retry reviewer Location setup after a transient failure and clean up reviewer
144
+ hooks registered after a Location reload.
145
+
146
+ ## [2.3.0] - 2026-09-24
147
+
148
+ ### Added
149
+
150
+ - Add Jev as a reviewer model choice through OpenCode Zen, TypeSafe AI, or the
151
+ Command Code Provider API. Use Jev alone, or configure a second LLM such as
152
+ Luna for difficult decisions. See the [Jev setup
153
+ guide](./README.md#jev-system-one-reviewer).
154
+
155
+ ### Changed
156
+
157
+ - Default to GPT-6 Luna at medium effort and share trusted V1 reviewer settings
158
+ between the server and TUI.
159
+ - Verify compatibility with OpenCode V2 2.0.15.
160
+
161
+ ## [2.2.1] - 2026-09-22
162
+
163
+ ### Changed
164
+
165
+ - Verify compatibility with OpenCode V1 1.18.32 and V2 2.0.14, update the
166
+ matching SDK and client packages, update Zod, and refresh the documented
167
+ support matrix.
168
+
169
+ ## [2.2.0] - 2026-09-20
170
+
171
+ ### Changed
172
+
173
+ - Add a compatibility layer for every stable OpenCode V2 release from 2.0.3
174
+ through 2.0.11. Service connection no longer depends on changing discovery
175
+ endpoints, and the supported host range now covers `>=2.0.3 <3`. Bumped
176
+ `@opencode/client` to 2.0.11; newer V2 releases remain best-effort until
177
+ exercised by the compatibility suite.
178
+ - Negotiate the V2 session wait route by response, use a unique ID for each
179
+ isolated reviewer plugin, dispose host registrations on unload, and load TUI
180
+ snapshots without waiting for an unrelated host event.
181
+
182
+ ### Added
183
+
184
+ - Add a deterministic `credentialRead` capability signal: known file readers
185
+ (`cat`, `head`, `tail`, `less`, `more`, `grep`, `rg`, `sed`, `awk`,
186
+ `base64`, `xxd`, `od`, `strings`, `source`, `.`) with a literal credential
187
+ path operand, or any command with a literal credential path as an input
188
+ (`<`) redirect target, report `credentialRead: true` (otherwise
189
+ `"unknown"`, never `false`). Example and public-key suffixes (`.example`,
190
+ `.sample`, `.template`, `.dist`, `.pub`) never match.
191
+ - Add a `credentialRead` policy condition key (positive-only, AND-composable
192
+ with `networkObserved` and the other keys). No built-in rule uses it; the
193
+ default rule set is unchanged.
194
+ - Record a flattened `credentialRead: true` field in the audit capability
195
+ snapshot (present only when true). Audit `schemaVersion` stays 3.
196
+
197
+ Note: configs using `credentialRead` degrade fail-closed on older plugin
198
+ versions that reject unknown condition keys (the rule is dropped and trusted
199
+ configs block automatic approval until fixed).
200
+
201
+ ### Fixed
202
+
203
+ - Failure-safe denial reasons now include the failure phase and the underlying
204
+ error cause instead of a bare SDK reason word.
205
+
206
+ ## [2.1.0] - 2026-09-17
207
+
208
+ ### Added
209
+
210
+ - Inspect verified remote SSH scripts from bounded local evidence, with a
211
+ SHA-256 check of the staged script before remote execution.
212
+ - Add `script command` to generate the guarded SSH invocation from a local file.
213
+ - Add the repository-only PRB-600 synthetic reviewer benchmark and publish
214
+ results for nine complete model evaluations.
215
+ - Test V2 host connection rejection for unsafe URLs, missing authentication,
216
+ and instance identity mismatch.
217
+
218
+ ### Changed
219
+
220
+ - Clarify V1 and V2 configuration paths and document the limits of automatic
221
+ approval and failure handling.
222
+
223
+ ## [2.0.0] - 2026-09-16
224
+
225
+ ### Added
226
+
227
+ - Separate OpenCode V1 and V2 server adapters with a shared evaluation engine.
228
+ - Isolated V2 reviewer sessions, validated structured output, authenticated
229
+ cleanup, total review deadlines, and generation-aware status RPC.
230
+ - Dual raw TSX interface, host-aware installation, and separate pytest host harnesses.
231
+ - Compact V2 review progress strip with model, action, and elapsed time.
232
+
233
+ ### Changed
234
+
235
+ - Require OpenCode V1 1.18.29 or newer, or the pinned V2 2.0.3 release.
236
+ - Preserve JSONC comments during installation and distinguish planned writes.
237
+ - Record independent review identity and application state for both hosts with audit schema 3.
238
+ - Verify compatibility with OpenCode V1 1.18.31 and reject missing TUI runtime
239
+ dependencies during the build.
240
+
241
+ ### Fixed
242
+
243
+ - Preserve valid denials below the automatic approval confidence threshold.
244
+ - Show unknown UI status after a watchdog timeout instead of inventing a manual request.
245
+ - Preserve reply acknowledgement ordering and bounded failure handling during shutdown or overload.
246
+ - Reject misspelled trusted policy condition values without allowing an unsafe
247
+ fallback, and align UI review deadlines with the server budget.
248
+
249
+ ## [1.3.3] - 2026-09-13
250
+
251
+ ### Changed
252
+
253
+ - Bumped `@opencode-ai/plugin` to 1.18.30 and `@opentui/core`/`@opentui/solid`
254
+ to 0.5.11, with `bun.lock` synchronized (dependency bumps only; no behavior
255
+ change). `solid-js` stays pinned at 1.9.12, matching the exact peer
256
+ requirement of `@opentui/solid`.
257
+
258
+ ### Fixed
259
+
260
+ - The audit report reader no longer drops a complete line at the start of its
261
+ bounded tail window: when the file exceeds the 64 MiB read cap, the reader
262
+ peeks at the byte before the window and only strips the first line when it
263
+ may be partial (no preceding newline). A window that starts at a line
264
+ boundary now summarizes every line it read.
265
+ - A failed audit directory creation degrades the same way an append failure
266
+ does: the record is lost, the failure is logged, and the writer never
267
+ throws. Previously the mkdir rejection propagated to the caller and stuck
268
+ to the cached promise; the writer now logs, drops the record, and retries
269
+ the mkdir on the next record.
270
+
271
+ ## [1.3.2] - 2026-09-12
272
+
273
+ ### Added
274
+
275
+ - The TUI overlay now covers pending reviews: an in-flight review renders in
276
+ the overlay panel while it runs, with resolved results kept below, so the
277
+ user sees what is being decided instead of only learning the outcome.
278
+ - A live host-regression harness exercises provider tools and end-to-end
279
+ review decisions against a real server, guarding the reviewer transport and
280
+ the deterministic brake paths outside unit tests.
281
+
282
+ ### Changed
283
+
284
+ - Bumped `@opencode-ai/plugin` to 1.18.28 and `@opentui/core`/`@opentui/solid`
285
+ to 0.5.10, with `bun.lock` synchronized (dependency bumps only; no behavior
286
+ change).
287
+ - The exact pending action now leads the reviewer evidence and reserves the
288
+ head of the context budget, with actor, lineage, and intent sections
289
+ following it — previously the action could be truncated away while context
290
+ survived. Session lineage additionally records its origin (human root vs
291
+ delegated), and whether the action evidence survived truncation is tracked
292
+ explicitly so the reviewer judges a complete view of the action or the
293
+ decision escalates.
294
+
295
+ ### Fixed
296
+
297
+ - The redaction rule for auth-scheme tokens (`Bearer`/`Basic`/`Token`)
298
+ treated the `-` in its character class as a range, so tokens containing
299
+ dashes were never matched as a whole and could reach the reviewer
300
+ unredacted; the dash is now a literal member of the class.
301
+ - Reviewer sessions now run in a scratch directory outside the project, so
302
+ repository instructions (`AGENTS.md`, project config instructions, project
303
+ MCP context) never enter the reviewer's system prompt; every tool is denied
304
+ by a wildcard session permission rule that also covers MCP tools. If the
305
+ isolated directory cannot be established, the review escalates to the human
306
+ as a reviewer failure instead of running inside the project with degraded
307
+ isolation.
308
+ - Automatic approval is now blocked while the trusted configuration is
309
+ degraded or a material part of the pending action was elided from the
310
+ evidence: invalid policy rules in trusted (global/inline) layers are
311
+ rejected at load and keep auto-approval disabled until fixed, instead of a
312
+ narrowed config silently permitting more.
313
+ - The shared per-directory git conversion-filter scan now parses
314
+ NUL-delimited (`-z`) output, so a legal filter subsection containing a
315
+ space (e.g. `[filter "a b"]`) is neutralized like any other instead of
316
+ being mis-parsed and silently left active. A name containing `=` cannot be
317
+ expressed through `-c` overrides, so it withholds the snapshot (fail
318
+ closed) rather than arming the wrong key — same as the existing over-limit
319
+ refusals.
320
+ - The deterministic emergency brake now peels `timeout`, `xargs`, and `watch`
321
+ wrappers before judging the executable, so `timeout 5 curl …`, `watch -n 5
322
+ curl …`, and piped `xargs curl …` trip the secret-export brake and
323
+ `timeout --signal=KILL 10s rm -rf /` trips root destruction. `timeout`
324
+ skips its mandatory duration operand explicitly; benign commands under
325
+ these wrappers (`watch ls`, `timeout 5 make`) stay quiet.
326
+ - Project config can no longer weaken trusted layers: null and wrong-type
327
+ overrides are dropped instead of resetting defaults, the reviewer model
328
+ and policy text are not project-settable, and malformed config files warn
329
+ instead of silently degrading. User intent is attributed by session origin,
330
+ so no child-session message counts as human authorization.
331
+ - Filesystem reads and writes in the decision path go through explicitly
332
+ opened, verified descriptors: config layers are rejected when symlinked,
333
+ non-regular, or oversized (a committed link to a FIFO or an endless source
334
+ can no longer hang or exhaust startup); audit records are appended through
335
+ a descriptor that refuses symlinked and non-regular targets and applies
336
+ `0600` on creation; evidence file reads loop to completion so a short read
337
+ is reported as truncated instead of partially included; and the audit
338
+ report reader takes its size and bytes from the open descriptor instead of
339
+ a racy stat-then-open pair.
340
+ - `opencode-permission-reviewer init` re-verifies each planned write against
341
+ the current file before touching it: a file that drifted since planning
342
+ (created, deleted, or turned malformed) aborts with a refusal instead of
343
+ being merged or clobbered, new files are created exclusively, and backups
344
+ claim their destination atomically instead of overwriting a collision.
345
+
346
+ ## [1.3.1] - 2026-09-03
347
+
348
+ ### Fixed
349
+
350
+ - The elapsed-time counter in the TUI review panel froze at its mount value:
351
+ the elapsed text read no signal while evaluating, so the renderer evaluated
352
+ it once and never again (the spinner kept animating, masking it). The text
353
+ now reads the 250ms tick signal and advances for the lifetime of the panel,
354
+ and negative clock skew is clamped. Regression-guarded by a headless render
355
+ test that compiles the TUI with the same solid transform the host uses.
356
+
357
+ ## [1.3.0] - 2026-09-01
358
+
359
+ ### Added
360
+
361
+ - The reviewer now sees what the user answered in agent ask dialogs as scoped
362
+ authorization evidence (`USER_ASK_DECISIONS` prompt section plus an additive
363
+ `askDecisions` audit field; only the question and the selected option are
364
+ captured). Configure with `askDecisions` (default `true`).
365
+
366
+ ### Fixed
367
+
368
+ - The TUI overlay never rendered for npm-installed plugins: the app-slot
369
+ factory rendered once at boot and never re-rendered, because it read no
370
+ signal directly in its own scope. The factory now renders from direct signal
371
+ reads, and `solid-js` is pinned to `@opentui/solid`'s exact peer so npm
372
+ installs keep a single Solid runtime. Regression-guarded by headless slot
373
+ contract tests and tarball-install checks.
374
+
375
+ ## [1.2.4] - 2026-09-01
376
+
377
+ ### Changed
378
+
379
+ - Bumped `@opencode-ai/plugin` to 1.18.25 and `@opentui/core`/`@opentui/solid`
380
+ to 0.5.9, with `bun.lock` synchronized (dependency bumps only; no behavior
381
+ change).
382
+
383
+ ## [1.2.3] - 2026-08-25
384
+
385
+ ### Changed
386
+
387
+ - Bumped `@opencode-ai/plugin` to 1.18.21, `@opentui/core`/`@opentui/solid`
388
+ to 0.5.6, and `solid-js` to 1.9.15, with `bun.lock` synchronized
389
+ (dependency bumps only; no behavior change). The OpenTUI updates pull in
390
+ renderer fixes (stale mouse input, GNU Screen OSC 52 passthrough, Sixel
391
+ fallback on Kitty).
392
+ - The live smoke harness now uses `opencode/mimo-v2.5-free` as its driver
393
+ model after `opencode/deepseek-v4-flash-free` was retired from the gateway.
394
+
395
+ ## [1.2.2] - 2026-08-20
396
+
397
+ ### Fixed
398
+
399
+ - Text-mode reviews now re-prompt the reviewer once when the first response is
400
+ missing, invalid, or unparseable, mirroring the auto-retry that `json_schema`
401
+ mode already gets from OpenCode's `retryCount`. This absorbs the occasional
402
+ flaky response from weaker models (e.g. `opencode-go/deepseek-v4-flash`) that
403
+ previously escalated straight to "Manual review required". The retry is
404
+ parsed with the same strict, fail-closed extractor, so it can never approve
405
+ anything the first parse would not; a response that is still invalid after
406
+ the retry escalates as before.
407
+ - Text-mode prompt now explicitly tells the reviewer not to echo the schema as
408
+ an example (a schema copy plus a decision object in one response is
409
+ ambiguous and escalates).
410
+
411
+ ## [1.2.1] - 2026-08-18
412
+
413
+ ### Changed
414
+
415
+ - Bumped `@opencode-ai/plugin` to 1.18.18 and `@opentui/core`/`@opentui/solid`
416
+ to 0.5.3, with `bun.lock` synchronized (dependency bumps only; no behavior
417
+ change).
418
+
419
+ ## [1.2.0] - 2026-08-18
420
+
421
+ ### Added
422
+
423
+ - New `outputFormat` config option (`json_schema` | `text`, default
424
+ `json_schema`). `text` lets reviewer models that do not support OpenCode's
425
+ `json_schema` structured-output format (e.g. `opencode-go/deepseek-v4-flash`)
426
+ be used: the model emits its decision as plain JSON, which the plugin parses
427
+ locally through the same strict `parseDecision` validation and
428
+ `enforceDecision` invariants. Text-mode parsing is fail-closed: the response
429
+ must be exactly one JSON object (optionally in a single code fence); any
430
+ ambiguity escalates to a human. Text mode is safe but produces more
431
+ escalations than structured output.
432
+
433
+ ## [1.1.1] - 2026-08-08
434
+
435
+ ### Fixed
436
+
437
+ - Fail-closed escalate→deny no longer invents a synthetic `ReviewDecision`
438
+ (`risk_level: high`, `confidence: 1`) or a `reviewerOutcome` when no valid
439
+ structured decision existed (timeout, invalid output, policy-manual, etc.).
440
+ Real LLM `escalate` decisions keep `decision.outcome: "escalate"` under
441
+ fail-closed deny.
442
+ - `ACTION_PURPOSE` now recovers prose from the exact assistant message that
443
+ issued the tool call (`request.tool.messageID` / `callID`) before falling
444
+ back to intent-derived evidence.
445
+ - Plugin no longer registers a no-op `tool.execute.after` hook; deprecated
446
+ `annotateToolResult` remains exported for API compatibility.
447
+
448
+ ## [1.1.0] - 2026-08-08
449
+
450
+ Non-interactive fail-closed mode and asymmetric agent feedback, without changing
451
+ the default interactive behavior.
452
+
453
+ ### Added
454
+
455
+ - `escalationMode: "manual" | "deny"` (default `manual`). In `deny` mode every
456
+ final internal escalation is converted to a reject with the original reason,
457
+ so autonomous agents can run without human prompts while remaining fail-closed.
458
+ - Wired `riskPolicy.onInvalidDecision` and `riskPolicy.onReviewerFailure` so
459
+ they harden invalid structured output and reviewer transport/timeout failures
460
+ respectively (under `escalationMode: "manual"`). `escalationMode: "deny"`
461
+ hardens every escalate path globally. Restrictive settings only block more.
462
+ - Central escalation disposition boundary (`applyEscalationDisposition`) applied
463
+ after reviewer/policy/fail-safe produce `allow | deny | escalate`.
464
+ `manual-superseded` is never converted.
465
+ - `ACTION_PURPOSE` evidence section in the reviewer prompt (agent-context →
466
+ intent-derived → unavailable). Never invented; does not prove authorization.
467
+ - Additive audit/UI fields `reviewerOutcome` and `escalationDisposition` so
468
+ reports and the TUI can distinguish an explicit deny from fail-closed
469
+ escalate→deny (`schemaVersion` stays `2`).
470
+ - Trust-boundary clamps for `escalationMode` and risk-policy failure knobs
471
+ (project config can only harden, never relax a trusted deny).
472
+
473
+ ### Changed
474
+
475
+ - Approvals no longer annotate tool results. Allow is silent to the primary
476
+ agent; deny still returns actionable feedback. `annotateToolResult` remains
477
+ as a deprecated no-op for 1.x API compatibility.
478
+ - Reviewer system prompt version bumped to `2.1.0` (ACTION_PURPOSE guidance).
479
+ Structured decision schema stays at version `2`.
480
+
481
+ ### Fixed
482
+
483
+ - Partial project `riskPolicy` objects no longer wipe trusted
484
+ `onInvalidDecision` / `onReviewerFailure` values back to defaults.
485
+
486
+ ## [1.0.0] - 2026-08-07
487
+
488
+ The first stable release. The public configuration schema, the audit schema
489
+ (v2), and the OpenCode 1.x adapter contract are frozen for the 1.x line.
490
+
491
+ ### Added
492
+
493
+ - Reference documentation: migration guide, threat model, policy reference,
494
+ capability model, actor resolution, compatibility policy, and architecture
495
+ decision records (`docs/`).
496
+ - Community health files: code of conduct, issue templates (bug report with
497
+ adapter-diagnostics requirement, feature request with a safety checklist),
498
+ pull-request template, and code owners.
499
+ - Release pipeline: tag-driven workflow that builds, publishes to npm with
500
+ build provenance, generates SHA-256 checksums and a CycloneDX SBOM, and
501
+ creates a GitHub Release with all artifacts attached (`.github/workflows/release.yml`).
502
+ - Security automation: CodeQL scan and Dependabot configuration.
503
+ - Coverage gate: `bun run test:coverage` enforces ≥ 90% global line coverage
504
+ and 100% on safety-critical modules (decision, policy, emergency brake,
505
+ event normalization, reply transport, redaction).
506
+
507
+ ### Fixed
508
+
509
+ - TUI overlay renders again: the `./tui` export points at raw
510
+ `dist/tui/tui.tsx` (copied by `scripts/copy-tui.ts`) instead of a prebundled
511
+ JS file, so the OpenCode host compiles it with its own Solid/OpenTUI
512
+ pipeline. The shipped TUI graph no longer pulls the server engine into the
513
+ TUI process.
514
+ - Overlay selection no longer hides later reviews behind a stale manual toast:
515
+ manual entries are excluded from the panel slot, in-flight reviews win over
516
+ terminal results, and the start grace before "manual" is 15s (was 3s).
517
+ - UI status publishing treats the typed SDK `{ data, error }` resolve shape as
518
+ a failure when `error` is set, and the declarative manual policy route emits
519
+ a UI status. A failed `mode.push` no longer leaves the overlay half-registered.
520
+
521
+ ### Changed
522
+
523
+ - Dropped the unused `@opentui/keymap` dependency.
524
+
525
+ ## [0.9.0] - 2026-08-07
526
+
527
+ ### Added
528
+
529
+ - Layered configuration: merges builtin defaults, global
530
+ (`~/.config/opencode/permission-reviewer.jsonc`), project
531
+ (`.opencode/permission-reviewer.jsonc`), and inline plugin options, with JSONC
532
+ parsing support.
533
+ - Reviewer decision schema v2: `version: 2` is now required, and decisions must
534
+ declare `scope_alignment` and `evidence_completeness`. In enforce mode, new
535
+ deterministic gates escalate allows with misaligned scope or insufficient
536
+ evidence. A model output that omits `version: 2` is rejected and routed to
537
+ manual review, so a model that does not follow the v2 schema never produces an
538
+ automatic decision.
539
+ - Audit schema v2: every record now carries `schemaVersion: 2`, `decisionSource`,
540
+ an `actionHash` for cross-record correlation, per-phase timings, the reviewer
541
+ model, evidence completeness, scope alignment, and actor
542
+ `identitySource`/`confidence`. Capability and policy-trace objects remain
543
+ additive, so v1 readers keep working.
544
+ - Isolated reply transport: permission replies flow through a dedicated module
545
+ with a documented priority chain (public SDK reply with message, then public
546
+ reply plus a feedback channel, then the authenticated raw transport, then
547
+ refuse startup). Host capabilities are probed once at startup.
548
+ - Version gate: refuses to start against OpenCode v2-generation clients until
549
+ their reply contract is verified.
550
+ - CLI subcommands via the `opencode-permission-reviewer` binary (no subcommand
551
+ still runs `explain` for backward compatibility):
552
+ - `doctor` — package/runtime versions, config sources with hashes, resolved
553
+ model, policy mode and rule count, effective policy hash, audit-path
554
+ writability.
555
+ - `config print-effective` — resolved config and engine-equivalent policy hash.
556
+ - `audit report` — summarizes the JSONL audit trail and flags unknown actors
557
+ and records missing required fields.
558
+ - Public npm package: drops the private flag, points `main`/`types`/`exports` at
559
+ the built `dist/` bundle, generates d.ts, rebuilds on install, and ships only
560
+ `dist` plus docs (verified by a pack smoke test).
561
+ - TUI status publishing migrated to the typed v1 `client.tui.publish` API.
562
+ - Reviewer prompt v2.0.0 with new `EFFECTIVE_POLICY_SUMMARY`,
563
+ `LOCAL_SESSION_CONTEXT`, and `REPOSITORY_CONTEXT` sections.
564
+
565
+ ### Security
566
+
567
+ - Trust boundary: project config can no longer redirect or silence the audit
568
+ trail (`auditPath`) or grant its own agent a higher-privilege profile
569
+ (`actorProfiles`) — both are restricted to global/inline config.
570
+ - Project config can no longer downgrade a global `enforcementMode: "enforce"`
571
+ to `observe`.
572
+ - Project policy rules are now combined with trusted (global/inline) rules
573
+ instead of replacing them, so a repository can no longer erase a user's deny
574
+ or manual rules by declaring an empty or narrower set.
575
+
576
+ ### Changed
577
+
578
+ - Model decisions missing `version: 2` are rejected instead of defaulting
579
+ missing v2 fields to unknown.
580
+
581
+ ### Fixed
582
+
583
+ - Bare backtick command substitution (e.g. `echo \`whoami\``) is now correctly
584
+ detected as dynamic instead of being treated as complete.
585
+ - Single-quoted literal strings (e.g. `echo 'literal $VAR'`) are no longer
586
+ misdetected as dynamic.
587
+ - Malformed policy rule conditions no longer crash the engine — the rule is
588
+ dropped defensively.
589
+ - JSONC trailing-comma stripping is now string-aware; `,}` or `,]` inside a
590
+ string value is no longer corrupted.
591
+ - `audit report` expands `~` in `--path`, and `actionHash` excludes
592
+ per-invocation tool IDs so identical commands correlate across runs.
593
+ - Importing the CLI module no longer runs the dispatcher, and the audit
594
+ writability probe creates files with mode `0600`.
595
+
596
+ ## [0.8.0] - 2026-08-06
597
+
598
+ ### Added
599
+
600
+ - Static capability analysis for bash commands: structured facts for code
601
+ execution, write effects, network, process side-effects, remote/git mutation,
602
+ and privilege escalation, with heredoc bodies extracted before lexing and an
603
+ honest completeness marker (complete / partial / opaque).
604
+ - Capability assessment threaded into the reviewer prompt as a new
605
+ `CAPABILITY_ASSESSMENT` section and into the audit record as an additive
606
+ capability snapshot.
607
+ - Declarative policy engine: evaluates capability and actor facts against
608
+ declarative rules with most-restrictive resolution. Default rules ship empty,
609
+ so observe mode produces zero behavior change.
610
+ - Enforce mode: manual/deny policy routes skip the LLM entirely; the emergency
611
+ brake always runs first and is never weakened.
612
+ - `explain` CLI: dry-runs a bash command through the capability analyzer and
613
+ policy engine without a running opencode, reading a permission request from a
614
+ JSON fixture or stdin and printing the capability assessment and policy trace
615
+ as JSON.
616
+ - Configurable risk × authorization matrix via `RiskPolicy` with conservative
617
+ defaults that reproduce the previous behavior exactly, plus a
618
+ `RepositoryTrust` type.
619
+ - Policy traces (effective policy hash, matched rules, final route, mode) in the
620
+ audit record, with a counterfactual trace in observe mode.
621
+
622
+ ## [0.7.0] - 2026-08-06
623
+
624
+ ### Added
625
+
626
+ - Agent-aware context: the requesting tool's `agent`/`mode` is resolved from the
627
+ session, walking parent sessions via the SDK with cycle/depth guards, and
628
+ degrading honestly to "unknown" on any failure — a review always proceeds.
629
+ - Reviewer prompt sections `ACTOR_CONTEXT`, `SESSION_LINEAGE`,
630
+ `DIRECT_USER_INTENT`, `DELEGATED_TASK`, and `EVIDENCE_COMPLETENESS` before
631
+ `PENDING_PERMISSION`.
632
+ - Audit records gain an additive actor snapshot (identity completeness) and
633
+ `rootSessionID`; the TUI shows the actor name.
634
+ - New config knobs: `enforcementMode` (default `observe`), `maxSessionDepth`,
635
+ `maxParentSessions`, and `actorProfiles`.
636
+
637
+ ### Changed
638
+
639
+ - Observe-only release: the decision schema and enforcement gates are
640
+ untouched, so reviewer decisions do not change.
641
+
642
+ ## [0.6.0] - 2026-08-06
643
+
644
+ ### Changed
645
+
646
+ - Internal architecture boundary: the approval pipeline is extracted into a
647
+ dedicated adapter, review coordinator, and evidence providers with
648
+ byte-identical behavior — no user-facing behavior change versus 0.5.2.
649
+ - Audit records now carry an additive `schemaVersion: 1` (readers default
650
+ missing values to 1).
651
+ - Tooling: ESLint 9, tsup ESM build, and Prettier are added; `bun run check`
652
+ now runs format, lint, typecheck, tests, and build as a single gate.