peaks-cli 2.0.2 → 2.0.3

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.
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "metadata": {
3
3
  "pluginRoot": ".",
4
- "version": "2.0.2"
4
+ "version": "2.0.3"
5
5
  },
6
6
  "plugins": [
7
7
  {
8
8
  "name": "peaks-cli",
9
9
  "description": "Cross-AI-IDE workflow-gating CLI + 11-skill family. Turns LLM improvisation into auditable engineering process. Skills cover PRD / R&D / UI / QA / change-control / context / SOP definition / orchestration. Soft-fail gates block irreversible actions mid-conversation (even under --dangerously-skip-permissions).",
10
- "version": "2.0.2",
10
+ "version": "2.0.3",
11
11
  "author": {
12
12
  "name": "SquabbyZ"
13
13
  },
package/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.0.3] — 2026-06-13
11
+
12
+ ### Fixed
13
+
14
+ - **`@alibaba-group/open-code-review` reverted to `optionalDependency`**
15
+ (was promoted to a hard `dependency` in 2.0.1 and carried through
16
+ 2.0.2). The ocr npm package's `postinstall` downloads a Go binary
17
+ via HTTPS, which fails in restricted/proxied environments and was
18
+ aborting the whole `npm i -g peaks-cli` flow. The 5-state detector
19
+ (`ready` / `package-missing` / `binary-missing` / `config-missing` /
20
+ `detection-failed`) and the soft-fail policy are unchanged — peaks-cli
21
+ never blocks on ocr being installed; it just no longer forces the
22
+ install. Users who want the second-opinion review run
23
+ `npm i -g @alibaba-group/open-code-review` explicitly. Under pnpm
24
+ they also need `pnpm approve-builds @alibaba-group/open-code-review`
25
+ for the binary download to run. Source-of-truth refactor (ocr config
26
+ under `peaksConfig.ocr.llm`) from 2.0.1 is unchanged.
27
+
28
+ ---
29
+
10
30
  ## [2.0.0] — 2026-06-12
11
31
 
12
32
  ### 🎯 Headline
@@ -29,6 +49,15 @@ alongside the LLM-only review. Soft-fails so missing ocr never blocks
29
49
  a slice. New CLI: `peaks code-review detect-ocr` / `run-ocr`. See
30
50
  `skills/peaks-rd/references/ocr-integration.md` for the contract.
31
51
 
52
+ > **Note:** This `optionalDependency` classification was briefly
53
+ > promoted to a hard `dependency` in 2.0.1 (alongside the source-of-truth
54
+ > refactor) because the user feedback was "peaks-cli should not leave
55
+ > install to the user". 2.0.3 reverts just the classification — the
56
+ > source-of-truth refactor stays — because the ocr postinstall
57
+ > downloads a Go binary via HTTPS, which fails in restricted/proxied
58
+ > environments and was aborting `npm i -g peaks-cli`. See the 2.0.3
59
+ > entry above for the full rationale.
60
+
32
61
  ### Breaking Changes
33
62
 
34
63
  - **`.claude/rules/` is no longer the source of truth for project standards.**
@@ -71,6 +100,14 @@ config surface.
71
100
  to download the platform binary still soft-fail at runtime
72
101
  (`binary-missing` state) — the install-time failure risk is the
73
102
  trade-off.
103
+
104
+ > **Reverted in 2.0.3.** The install-time failure risk turned out
105
+ > to bite too many real-world installs (corporate proxies, region
106
+ > firewalls, sandboxed dev environments all abort the whole
107
+ > `npm i -g peaks-cli`). 2.0.3 puts ocr back under
108
+ > `optionalDependencies`; everything else in this section
109
+ > (env-var injection, `config-template` CLI, `missingKeys`,
110
+ > source-of-truth under `peaksConfig.ocr.llm`) is unchanged.
74
111
  - **`detectOcr` / `runOcrReview` no longer read `~/.opencodereview/config.json`.**
75
112
  The source of truth is `peaksConfig.ocr.llm` (parsed by
76
113
  `getOcrLlmConfig()` in `config-service.ts`). Missing fields surface
@@ -5,7 +5,7 @@ import { fail, ok } from '../../shared/result.js';
5
5
  export function registerCodeReviewCommands(program, io) {
6
6
  const codeReview = program
7
7
  .command('code-review')
8
- .description('Code-review primitives for peaks-rd Gate B3. Wraps the soft-optional `@alibaba-group/open-code-review` (ocr) tool when it is installed + configured; peaks-rd uses the structured JSON output as a second-opinion review alongside its own LLM review. ocr ships as a peaks-cli dependency (not optional). LLM endpoint config lives under `peaksConfig.ocr.llm` in the user config — run `peaks code-review config-template` to see the JSON snippet to paste.');
8
+ .description('Code-review primitives for peaks-rd Gate B3. Wraps the soft-optional `@alibaba-group/open-code-review` (ocr) tool when it is installed + configured; peaks-rd uses the structured JSON output as a second-opinion review alongside its own LLM review. ocr is an optional dependency of peaks-cli 2.0.3+ (was briefly promoted to a hard dependency in 2.0.1/2.0.2 — reverted because its postinstall downloads a Go binary via HTTPS and would otherwise abort `npm i -g peaks-cli` in restricted environments). LLM endpoint config lives under `peaksConfig.ocr.llm` in the user config — run `peaks code-review config-template` to see the JSON snippet to paste.');
9
9
  addJsonOption(codeReview
10
10
  .command('detect-ocr')
11
11
  .description('Read-only probe: returns the ocr install + config state as a JSON envelope (5 reasons: ready / package-missing / binary-missing / config-missing / detection-failed). peaks-rd calls this first to decide whether to invoke `run-ocr`. Reads the LLM endpoint from `peaksConfig.ocr.llm` (not from ~/.opencodereview/config.json).')
@@ -36,12 +36,17 @@
36
36
  * To see the JSON template to paste, run:
37
37
  * `peaks code-review config-template`
38
38
  *
39
- * The ocr package is declared in package.json:dependencies (was
40
- * previously optionalDependencies) so `npm i -g peaks-cli@2.0.x`
41
- * pulls it automatically (npm runs the ocr postinstall by default,
42
- * which downloads the Go binary). pnpm-based installs need
43
- * `pnpm approve-builds @alibaba-group/open-code-review`. Either
44
- * way, peaks-cli detects the install state and reports it.
39
+ * The ocr package is declared in package.json:optionalDependencies
40
+ * (was promoted to `dependencies` in 2.0.1 and reverted in 2.0.3 —
41
+ * the ocr postinstall downloads a Go binary via HTTPS, which fails
42
+ * in restricted/proxied environments and would otherwise abort the
43
+ * whole `npm i -g peaks-cli` flow). Peaks-cli ships with ocr *not*
44
+ * installed; if the user wants it, they run
45
+ * `npm i -g @alibaba-group/open-code-review`
46
+ * and peaks-cli's 5-state detector (below) reports whether the
47
+ * binary is actually usable. pnpm-based installs additionally need
48
+ * `pnpm approve-builds @alibaba-group/open-code-review` for the
49
+ * binary download to run. Either way, peaks-cli never blocks on it.
45
50
  */
46
51
  import { spawnSync } from 'node:child_process';
47
52
  import { existsSync } from 'node:fs';
@@ -50,7 +55,7 @@ import { fileURLToPath } from 'node:url';
50
55
  import { dirname } from 'node:path';
51
56
  const OCR_DETECT_TIMEOUT_MS = 5000;
52
57
  const OCR_REVIEW_TIMEOUT_MS = 180000;
53
- const OCR_INSTALL_HINT = 'Install: `npm i -g @alibaba-group/open-code-review` (it is a hard dependency of peaks-cli 2.0.x and ships in the regular `npm install` flow). Then add your LLM endpoint to ~/.peaks/config.json — run `peaks code-review config-template` for the JSON snippet to paste.';
58
+ const OCR_INSTALL_HINT = 'Install: `npm i -g @alibaba-group/open-code-review` (peaks-cli 2.0.3 ships with ocr as an optional dependency — its postinstall downloads a Go binary via HTTPS, which fails in some restricted/proxied environments; that\'s why peaks-cli does not auto-install it). Then add your LLM endpoint to ~/.peaks/config.json — run `peaks code-review config-template` for the JSON snippet to paste. Under pnpm you also need `pnpm approve-builds @alibaba-group/open-code-review` to allow the binary download.';
54
59
  const OCR_CONFIG_TEMPLATE = JSON.stringify({
55
60
  ocr: {
56
61
  llm: {
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "2.0.2";
1
+ export declare const CLI_VERSION = "2.0.3";
@@ -1 +1 @@
1
- export const CLI_VERSION = "2.0.2";
1
+ export const CLI_VERSION = "2.0.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peaks-cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Cross-AI-IDE workflow-gating CLI + skill family (Claude Code shipped, Trae in progress; Codex / Cursor / Qoder / Tongyi Lingma on the roadmap).",
5
5
  "author": "SquabbyZ",
6
6
  "license": "MIT",
@@ -59,12 +59,14 @@
59
59
  "node": ">=20.0.0"
60
60
  },
61
61
  "dependencies": {
62
- "@alibaba-group/open-code-review": "1.3.1",
63
62
  "@colbymchenry/codegraph": "0.7.10",
64
63
  "commander": "^12.1.0",
65
64
  "fzf": "^0.5.2",
66
65
  "headroom-ai": "0.22.4"
67
66
  },
67
+ "optionalDependencies": {
68
+ "@alibaba-group/open-code-review": "1.3.1"
69
+ },
68
70
  "devDependencies": {
69
71
  "@types/node": "^22.10.2",
70
72
  "@vitest/coverage-v8": "^2.1.8",
@@ -2,11 +2,16 @@
2
2
 
3
3
  > Soft-optional second-opinion code review for peaks-rd Gate B3.
4
4
  > Mirrors the ECC 64-agents pattern (spec §7.2): peaks-cli ships
5
- > `@alibaba-group/open-code-review` as a **required dependency** and
6
- > reads the LLM endpoint config from `peaksConfig.ocr.llm` in the
7
- > user's `~/.peaks/config.json` (single source of truth, user-managed).
8
- > When present + configured, the wrapper turns the output into
9
- > structured `code-review.md` evidence.
5
+ > `@alibaba-group/open-code-review` as an **`optionalDependency`**
6
+ > (was promoted to `dependencies` in 2.0.1 and reverted in 2.0.3
7
+ > because its postinstall downloads a Go binary via HTTPS and would
8
+ > otherwise abort `npm i -g peaks-cli` in restricted/proxied
9
+ > environments). The LLM endpoint config still lives under
10
+ > `peaksConfig.ocr.llm` in the user's `~/.peaks/config.json` (single
11
+ > source of truth, user-managed). When the user installs + configures
12
+ > ocr, the wrapper turns its output into structured `code-review.md`
13
+ > evidence; when missing, peaks-rd proceeds LLM-only and the slice
14
+ > ships without the second opinion.
10
15
 
11
16
  ## What ocr is
12
17
 
@@ -34,9 +39,19 @@ ships without the second opinion.
34
39
 
35
40
  ## Install
36
41
 
37
- `@alibaba-group/open-code-review` is a **required `dependency`** of
38
- peaks-cli 2.0.1+. `npm i -g peaks-cli` pulls it automatically and
39
- downloads the platform binary in the postinstall step. Verify with:
42
+ `@alibaba-group/open-code-review` is an **`optionalDependency`** of
43
+ peaks-cli 2.0.3+ (was a required `dependency` in 2.0.1/2.0.2; reverted
44
+ because the postinstall downloads a Go binary via HTTPS, which fails in
45
+ restricted/proxied environments and would otherwise abort
46
+ `npm i -g peaks-cli`). peaks-cli does NOT auto-install it. To enable
47
+ the second-opinion review:
48
+
49
+ ```bash
50
+ npm i -g @alibaba-group/open-code-review
51
+ ```
52
+
53
+ (Under pnpm you also need `pnpm approve-builds @alibaba-group/open-code-review`
54
+ so the binary download script can run.) Verify with:
40
55
 
41
56
  ```bash
42
57
  peaks code-review detect-ocr --json
@@ -47,7 +62,7 @@ Five possible states:
47
62
  | state | Meaning | Recovery |
48
63
  |---|---|---|
49
64
  | `ready` | Installed + binary downloaded + peaks-cli's `peaksConfig.ocr.llm` valid | Nothing — `run-ocr` will work. |
50
- | `package-missing` | npm dep not installed (corrupt node_modules, or user removed it) | `npm i -g @alibaba-group/open-code-review` (peaks-cli 2.0.1+ does this automatically; this state is rare) |
65
+ | `package-missing` | npm dep not installed (peaks-cli 2.0.3+ ships with ocr as an `optionalDependency`, so the common cause is the user has not installed it yet, or it was removed from node_modules) | `npm i -g @alibaba-group/open-code-review` (peaks-cli no longer auto-installs it; under pnpm also run `pnpm approve-builds @alibaba-group/open-code-review`) |
51
66
  | `binary-missing` | npm dep present but Go binary did not download | `pnpm approve-builds @alibaba-group/open-code-review`, OR run `node node_modules/@alibaba-group/open-code-review/scripts/install.js`, OR manually fetch from https://github.com/alibaba/open-code-review/releases and place the binary at the path shown in `nextActions[2]`. |
52
67
  | `config-missing` | binary present but `peaksConfig.ocr.llm` is empty or partial | See "Configure" below. |
53
68
  | `detection-failed` | Unexpected error during detection | Inspect stderr; re-run probe. |