ira-review 3.0.1 → 3.1.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.github.md CHANGED
@@ -98,7 +98,7 @@ flowchart LR
98
98
 
99
99
  ```
100
100
  src/
101
- ai/ AI provider abstraction (OpenAI, Anthropic, Azure, Ollama, AMP)
101
+ ai/ AI provider abstraction (OpenAI, Anthropic, Azure, Ollama, AMP, Copilot CLI)
102
102
  core/ Review engine, risk scorer, acceptance validator, test generator
103
103
  scm/ GitHub and Bitbucket clients (diff, comments, labels, build status)
104
104
  integrations/ JIRA client, Slack/Teams notifier
@@ -182,7 +182,7 @@ Each rule has a `message` (what to tell the developer), a `severity` (BLOCKER, C
182
182
  }
183
183
  ```
184
184
 
185
- Rules without `paths` apply to all files. Rules with `paths` are only checked against matching files. The file is validated at load time: invalid severity values and missing required fields are skipped with a warning. Maximum 100 rules per file. IRA rules are for nuanced, context-dependent standards that linters cannot express. Deterministic checks (naming conventions, import order, formatting) belong in ESLint.
185
+ Rules without `paths` apply to all files. Rules with `paths` are only checked against matching files. The file is validated at load time: invalid severity values and missing required fields are skipped with a warning. There is no hard cap on the number of rules; a soft warning is logged above 500 since large rulesets can inflate the AI prompt. IRA rules are for nuanced, context-dependent standards that linters cannot express. Deterministic checks (naming conventions, import order, formatting) belong in ESLint.
186
186
 
187
187
  Rules are enforced in all review surfaces (CLI, CI/CD, VS Code extension) with no license gating. In the VS Code extension, run `IRA: Init Rules File` from the command palette to scaffold an empty `.ira-rules.json`. The extension ships a JSON Schema for the file, so you get autocomplete and validation as you edit.
188
188
 
@@ -210,7 +210,7 @@ IRA is not a SaaS product. There is no hosted service, no telemetry, no analytic
210
210
  | | CLI | VS Code Extension |
211
211
  |---|---|---|
212
212
  | **Use case** | CI pipelines, scripting, headless environments | Interactive development |
213
- | **AI default** | OpenAI (requires API key) | GitHub Copilot (zero config), AMP CLI also supported |
213
+ | **AI default** | OpenAI (requires API key); GitHub Copilot CLI also supported for enterprise CI (`--ai-provider copilot-cli`, no API key) | GitHub Copilot (zero config), AMP CLI also supported |
214
214
  | **Auth** | Environment variables or CLI flags | VS Code OAuth + OS keychain |
215
215
  | **Output** | Terminal + PR comments | Inline diagnostics, CodeLens, TreeView, risk badge |
216
216
  | **JIRA/Sonar** | CLI flags or env vars | VS Code settings |
@@ -279,10 +279,10 @@ Suggested Fix: Use parameterized queries:
279
279
 
280
280
  1. Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ira-review.ira-review-vscode)
281
281
  2. Open a project with a GitHub or Bitbucket remote
282
- 3. `Cmd+Shift+P` > `IRA: Review Current PR`
283
- 4. Enter your PR number
282
+ 3. `Cmd+Shift+P` > `IRA: Quick Start` (auto-detects SCM, walks you through tokens, optionally sets up JIRA)
283
+ 4. `Cmd+Shift+P` > `IRA: Review Current PR` and enter your PR number
284
284
 
285
- If you have GitHub Copilot, that is all you need. No API keys, no configuration. Alternatively, set the AI provider to `amp` if you have the AMP CLI installed (`amp login`).
285
+ If you have GitHub Copilot, Quick Start finishes in seconds no API keys, no configuration. Alternatively, set the AI provider to `amp` if you have the AMP CLI installed (`amp login`). For Bitbucket Server / Data Center or JIRA, Quick Start gives you the right token-creation links inline.
286
286
 
287
287
  ### CLI
288
288
 
@@ -344,6 +344,101 @@ pipelines:
344
344
 
345
345
  ---
346
346
 
347
+ ## Enterprise: Bitbucket Server / Data Center
348
+
349
+ For self-hosted Bitbucket Server (a.k.a. Data Center), pass `--bitbucket-type server`
350
+ along with your Bitbucket base URL and a Personal Access Token. The `--repo` flag uses
351
+ `PROJECT/repo-slug` format (project keys are usually uppercase).
352
+
353
+ ```bash
354
+ npx ira-review review \
355
+ --pr 1234 \
356
+ --scm-provider bitbucket \
357
+ --bitbucket-type server \
358
+ --bitbucket-url https://bitbucket.example.com \
359
+ --bitbucket-token "$BITBUCKET_PAT" \
360
+ --repo MYPROJ/my-service \
361
+ --ai-api-key "$OPENAI_API_KEY"
362
+ ```
363
+
364
+ The type is auto-detected from `--bitbucket-url` (anything other than `api.bitbucket.org`
365
+ defaults to `server`), so the flag is usually optional. Set it explicitly if your
366
+ Server instance sits behind a CDN whose hostname looks like Cloud.
367
+
368
+ ## Enterprise: JIRA Server / Data Center
369
+
370
+ JIRA Server uses Bearer auth with a Personal Access Token (Profile → Personal Access
371
+ Tokens) — the email field is ignored. Pass `--jira-type server` if your URL is not
372
+ on `*.atlassian.net`:
373
+
374
+ ```bash
375
+ npx ira-review review \
376
+ --pr 1234 \
377
+ --scm-provider bitbucket \
378
+ --bitbucket-type server \
379
+ --bitbucket-url https://bitbucket.example.com \
380
+ --bitbucket-token "$BITBUCKET_PAT" \
381
+ --repo MYPROJ/my-service \
382
+ --jira-url https://jira.example.com \
383
+ --jira-type server \
384
+ --jira-token "$JIRA_PAT" \
385
+ --jira-ticket PROJ-123 \
386
+ --ai-api-key "$OPENAI_API_KEY"
387
+ ```
388
+
389
+ ## Enterprise: Jenkins quickstart
390
+
391
+ Works with Jenkins on Linux **and Windows agents** behind a corporate proxy. IRA
392
+ auto-detects `JENKINS_URL` and skips the first-run safety prompt.
393
+
394
+ ```groovy
395
+ stage('IRA Review') {
396
+ when { changeRequest() }
397
+ steps {
398
+ withCredentials([
399
+ string(credentialsId: 'bitbucket-pat', variable: 'BB_TOKEN'),
400
+ string(credentialsId: 'jira-pat', variable: 'JIRA_TOKEN'),
401
+ string(credentialsId: 'ai-api-key', variable: 'AI_KEY'),
402
+ ]) {
403
+ sh '''
404
+ npx --yes ira-review@latest review \\
405
+ --pr "$CHANGE_ID" \\
406
+ --scm-provider bitbucket \\
407
+ --bitbucket-type server \\
408
+ --bitbucket-url "$BITBUCKET_URL" \\
409
+ --bitbucket-token "$BB_TOKEN" \\
410
+ --repo "$BITBUCKET_PROJECT/$BITBUCKET_REPO" \\
411
+ --jira-url "$JIRA_URL" \\
412
+ --jira-type server \\
413
+ --jira-token "$JIRA_TOKEN" \\
414
+ --ai-api-key "$AI_KEY"
415
+ '''
416
+ }
417
+ }
418
+ environment {
419
+ HTTPS_PROXY = "${env.CORP_PROXY_URL}"
420
+ NODE_EXTRA_CA_CERTS = "${env.CORP_CA_BUNDLE_PEM}"
421
+ }
422
+ }
423
+ ```
424
+
425
+ Tips for Jenkins / corporate networks:
426
+
427
+ - **CI auto-detection** — IRA recognizes `JENKINS_URL`, `GITLAB_CI`, `GITHUB_ACTIONS`,
428
+ `TF_BUILD`, `BUILDKITE`, `CIRCLECI`, and `CI`.
429
+ - **Proxy + corporate CA** — set `HTTPS_PROXY` and `NODE_EXTRA_CA_CERTS` (path to your
430
+ PEM bundle). IRA fails fast with a clear error if `NODE_EXTRA_CA_CERTS` points to
431
+ a missing file, and prints the resolved AI endpoint / proxy / CA bundle on startup.
432
+ - **No full checkout?** — point `--rules-url` at the raw URL of your `.ira-rules.json`
433
+ in Bitbucket / GitHub instead of relying on a local file.
434
+ - **AI gateway** — point `--ai-base-url` at any OpenAI-compatible endpoint (GitHub
435
+ Models, an internal LLM proxy, LiteLLM, vLLM…). Keep `--ai-provider openai`.
436
+ - **Comment style** — use `--comment-style compact` (default) for terse,
437
+ severity-first inline comments. `--comment-style detailed` keeps the legacy
438
+ Explanation / Impact / Suggested Fix block.
439
+
440
+ ---
441
+
347
442
  ## Adding JIRA and SonarQube
348
443
 
349
444
  Both integrations are optional and additive. IRA works with just an SCM provider and an AI key.
@@ -393,8 +488,9 @@ npx ira-review review \
393
488
  | Provider | Notes |
394
489
  |---|---|
395
490
  | GitHub Copilot | VS Code only, zero config, uses existing session |
491
+ | GitHub Copilot CLI | CLI/CI via `--ai-provider copilot-cli`. Requires `@github/copilot` installed (`npm i -g @github/copilot`) and `GITHUB_TOKEN` set to a PAT with **Copilot Requests** permission. Honours `GH_HOST` for GitHub Enterprise tenants. Officially-sanctioned path for using Copilot from non-IDE contexts. |
396
492
  | AMP CLI | VS Code only, requires `amp` CLI installed and authenticated (`amp login`) |
397
- | OpenAI | Default for CLI |
493
+ | OpenAI | Default for CLI. Pass `--ai-base-url` to target any OpenAI-compatible gateway (GitHub Models, internal LLM proxy, LiteLLM, vLLM, …) |
398
494
  | Azure OpenAI | Requires `--ai-base-url` and `--ai-deployment` |
399
495
  | Anthropic | Pass key with `--ai-api-key` |
400
496
  | Ollama | Fully local, no API key needed |
package/README.md CHANGED
@@ -10,6 +10,8 @@ npx ira-review review --pr 42 --scm-provider github \
10
10
 
11
11
  No install required. Drop `--dry-run` to post comments directly on the PR. For Bitbucket, replace the GitHub flags with `--bitbucket-token` and `--repo`.
12
12
 
13
+ > 💡 **Prefer reviewing inside your editor?** IRA also ships as a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=ira-review.ira-review-vscode) (available since earlier 3.x versions) — same engine, with inline diagnostics, codelens, and one-click "Post to PR".
14
+
13
15
  ---
14
16
 
15
17
  ## What You Get
@@ -37,6 +39,7 @@ Each issue is posted as an inline comment on the exact PR line with explanation,
37
39
  - Evidence-based reviews — 7 categories (security, business logic, race conditions, data consistency, async, error handling, defensive coding), each with explicit false-positive exclusions. Issues without concrete evidence are filtered out.
38
40
  - Risk scoring (0-100) with severity breakdown and PR labels
39
41
  - Inline AI comments with explanation, impact, and minimal BEFORE → AFTER fix
42
+ - Two-pass critical review (`--ai-model-critical`) — bulk pass uses your everyday model; only `CRITICAL`/`BLOCKER` findings are re-run against a stronger model, keeping premium-request cost low while preserving deep analysis on what matters
40
43
  - JIRA acceptance criteria validation with per-criterion pass/fail and edge case detection
41
44
  - JIRA AC auto-detection — finds AC from custom field or description automatically
42
45
  - Custom team review rules via `.ira-rules.json` (see below)
@@ -78,7 +81,7 @@ Commit a `.ira-rules.json` to your repo root. Rules are injected into the AI pro
78
81
  **Rules:**
79
82
  - `message` + `severity` required. `bad`/`good` examples and `paths` are optional.
80
83
  - Rules without `paths` apply to all files. Rules with `paths` match only those directories.
81
- - Maximum 100 rules. Deterministic checks (naming, formatting) belong in ESLint.
84
+ - No hard cap on rules (soft warning above 500). Deterministic checks (naming, formatting) belong in ESLint.
82
85
  - Invalid rules are skipped with a warning, not a crash.
83
86
  - No license gating. Works in CLI, CI/CD, and VS Code extension.
84
87
 
@@ -134,7 +137,9 @@ All optional. IRA works with just an SCM token and an AI key.
134
137
 
135
138
  | What you want | Flags to add |
136
139
  |---|---|
137
- | JIRA validation | `--jira-url` `--jira-email` `--jira-token` `--jira-ticket PROJ-123` |
140
+ | JIRA Cloud validation | `--jira-url` `--jira-email` `--jira-token` `--jira-ticket PROJ-123` |
141
+ | JIRA Server / DC | `--jira-url` `--jira-type server` `--jira-token <PAT>` `--jira-ticket PROJ-123` |
142
+ | Bitbucket Server / DC | `--bitbucket-type server` `--bitbucket-url https://bitbucket.example.com` `--repo PROJECT/repo-slug` |
138
143
  | SonarQube enrichment | `--sonar-url` `--sonar-token` `--project-key my-project` |
139
144
  | Test generation | `--generate-tests --test-framework vitest` |
140
145
  | Slack notifications | `--slack-webhook https://hooks.slack.com/services/xxx` |
@@ -142,6 +147,10 @@ All optional. IRA works with just an SCM token and an AI key.
142
147
  | Only notify on high risk | `--notify-min-risk high` |
143
148
  | Use Anthropic | `--ai-provider anthropic` |
144
149
  | Use Ollama (free, local) | `--ai-provider ollama` |
150
+ | Use GitHub Copilot CLI (CI) | `--ai-provider copilot-cli` (needs `@github/copilot` installed + `GITHUB_TOKEN` with Copilot Requests scope; respects `GH_HOST`) |
151
+ | OpenAI-compatible gateway | `--ai-base-url https://your-llm-proxy/v1` (GitHub Models, LiteLLM, internal proxy…) |
152
+ | Rules from URL (no checkout) | `--rules-url https://bitbucket.example.com/.../.ira-rules.json` |
153
+ | Compact / detailed comments | `--comment-style compact` (default) or `--comment-style detailed` |
145
154
 
146
155
  ---
147
156
 
@@ -172,12 +181,12 @@ CLI flags override env vars, which override the config file. Token fields are bl
172
181
 
173
182
  **SCM:** GitHub, GitHub Enterprise, Bitbucket Cloud, Bitbucket Server/Data Center
174
183
 
175
- **AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), AMP CLI (VS Code extension)
184
+ **AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), GitHub Copilot CLI (CI-friendly, uses your Copilot entitlement, no API key), AMP CLI (VS Code extension)
176
185
 
177
186
  ## Requirements
178
187
 
179
188
  - Node.js 18+
180
- - An AI provider API key (or Ollama running locally, or AMP CLI / GitHub Copilot for the VS Code extension)
189
+ - An AI provider API key (or Ollama running locally, or GitHub Copilot CLI for headless / CI use, or AMP CLI / GitHub Copilot for the VS Code extension)
181
190
 
182
191
  ## Security
183
192
 
package/README.npm.md CHANGED
@@ -10,6 +10,8 @@ npx ira-review review --pr 42 --scm-provider github \
10
10
 
11
11
  No install required. Drop `--dry-run` to post comments directly on the PR. For Bitbucket, replace the GitHub flags with `--bitbucket-token` and `--repo`.
12
12
 
13
+ > 💡 **Prefer reviewing inside your editor?** IRA also ships as a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=ira-review.ira-review-vscode) (available since earlier 3.x versions) — same engine, with inline diagnostics, codelens, and one-click "Post to PR".
14
+
13
15
  ---
14
16
 
15
17
  ## What You Get
@@ -37,6 +39,7 @@ Each issue is posted as an inline comment on the exact PR line with explanation,
37
39
  - Evidence-based reviews — 7 categories (security, business logic, race conditions, data consistency, async, error handling, defensive coding), each with explicit false-positive exclusions. Issues without concrete evidence are filtered out.
38
40
  - Risk scoring (0-100) with severity breakdown and PR labels
39
41
  - Inline AI comments with explanation, impact, and minimal BEFORE → AFTER fix
42
+ - Two-pass critical review (`--ai-model-critical`) — bulk pass uses your everyday model; only `CRITICAL`/`BLOCKER` findings are re-run against a stronger model, keeping premium-request cost low while preserving deep analysis on what matters
40
43
  - JIRA acceptance criteria validation with per-criterion pass/fail and edge case detection
41
44
  - JIRA AC auto-detection — finds AC from custom field or description automatically
42
45
  - Custom team review rules via `.ira-rules.json` (see below)
@@ -78,7 +81,7 @@ Commit a `.ira-rules.json` to your repo root. Rules are injected into the AI pro
78
81
  **Rules:**
79
82
  - `message` + `severity` required. `bad`/`good` examples and `paths` are optional.
80
83
  - Rules without `paths` apply to all files. Rules with `paths` match only those directories.
81
- - Maximum 100 rules. Deterministic checks (naming, formatting) belong in ESLint.
84
+ - No hard cap on rules (soft warning above 500). Deterministic checks (naming, formatting) belong in ESLint.
82
85
  - Invalid rules are skipped with a warning, not a crash.
83
86
  - No license gating. Works in CLI, CI/CD, and VS Code extension.
84
87
 
@@ -134,7 +137,9 @@ All optional. IRA works with just an SCM token and an AI key.
134
137
 
135
138
  | What you want | Flags to add |
136
139
  |---|---|
137
- | JIRA validation | `--jira-url` `--jira-email` `--jira-token` `--jira-ticket PROJ-123` |
140
+ | JIRA Cloud validation | `--jira-url` `--jira-email` `--jira-token` `--jira-ticket PROJ-123` |
141
+ | JIRA Server / DC | `--jira-url` `--jira-type server` `--jira-token <PAT>` `--jira-ticket PROJ-123` |
142
+ | Bitbucket Server / DC | `--bitbucket-type server` `--bitbucket-url https://bitbucket.example.com` `--repo PROJECT/repo-slug` |
138
143
  | SonarQube enrichment | `--sonar-url` `--sonar-token` `--project-key my-project` |
139
144
  | Test generation | `--generate-tests --test-framework vitest` |
140
145
  | Slack notifications | `--slack-webhook https://hooks.slack.com/services/xxx` |
@@ -142,6 +147,10 @@ All optional. IRA works with just an SCM token and an AI key.
142
147
  | Only notify on high risk | `--notify-min-risk high` |
143
148
  | Use Anthropic | `--ai-provider anthropic` |
144
149
  | Use Ollama (free, local) | `--ai-provider ollama` |
150
+ | Use GitHub Copilot CLI (CI) | `--ai-provider copilot-cli` (needs `@github/copilot` installed + `GITHUB_TOKEN` with Copilot Requests scope; respects `GH_HOST`) |
151
+ | OpenAI-compatible gateway | `--ai-base-url https://your-llm-proxy/v1` (GitHub Models, LiteLLM, internal proxy…) |
152
+ | Rules from URL (no checkout) | `--rules-url https://bitbucket.example.com/.../.ira-rules.json` |
153
+ | Compact / detailed comments | `--comment-style compact` (default) or `--comment-style detailed` |
145
154
 
146
155
  ---
147
156
 
@@ -172,12 +181,12 @@ CLI flags override env vars, which override the config file. Token fields are bl
172
181
 
173
182
  **SCM:** GitHub, GitHub Enterprise, Bitbucket Cloud, Bitbucket Server/Data Center
174
183
 
175
- **AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), AMP CLI (VS Code extension)
184
+ **AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), GitHub Copilot CLI (CI-friendly, uses your Copilot entitlement, no API key), AMP CLI (VS Code extension)
176
185
 
177
186
  ## Requirements
178
187
 
179
188
  - Node.js 18+
180
- - An AI provider API key (or Ollama running locally, or AMP CLI / GitHub Copilot for the VS Code extension)
189
+ - An AI provider API key (or Ollama running locally, or GitHub Copilot CLI for headless / CI use, or AMP CLI / GitHub Copilot for the VS Code extension)
181
190
 
182
191
  ## Security
183
192