@rigour-labs/mcp 6.2.3 → 6.2.5

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.
@@ -6,6 +6,7 @@
6
6
  * @since v4.0.0
7
7
  */
8
8
  import path from "path";
9
+ import { deepAnalysisError } from "@rigour-labs/core";
9
10
  import { notifyProgress } from '../utils/notifications.js';
10
11
  function resolveDeepExecution(args) {
11
12
  const requestedProvider = (args.provider || '').toLowerCase();
@@ -19,6 +20,12 @@ function resolveDeepExecution(args) {
19
20
  function isTestRuntime() {
20
21
  return !!(process.env.VITEST || process.env.VITEST_POOL_ID || process.env.NODE_ENV === 'test');
21
22
  }
23
+ /** First line of the deep result: an error when deep analysis did not run. */
24
+ function deepHeadline(report, deepError) {
25
+ if (deepError)
26
+ return `RIGOUR DEEP ANALYSIS: ERROR — deep analysis did not run: ${deepError}\n\n`;
27
+ return `RIGOUR DEEP ANALYSIS: ${report.status}\n\n`;
28
+ }
22
29
  /**
23
30
  * Run quality gates with deep LLM-powered analysis.
24
31
  */
@@ -61,7 +68,8 @@ export async function handleCheckDeep(runner, cwd, config, args) {
61
68
  const codeQuality = stats.code_quality_score ?? stats.structural_score ?? 100;
62
69
  const overall = stats.score ?? 100;
63
70
  const isLocal = execution.isLocal;
64
- let text = `RIGOUR DEEP ANALYSIS: ${report.status}\n\n`;
71
+ const deepError = deepAnalysisError(report);
72
+ let text = deepHeadline(report, deepError);
65
73
  text += `AI Health: ${aiHealth}/100\n`;
66
74
  text += `Code Quality: ${codeQuality}/100\n`;
67
75
  text += `Overall: ${overall}/100\n\n`;
@@ -105,6 +113,7 @@ export async function handleCheckDeep(runner, cwd, config, args) {
105
113
  text += `\nDuration: ${(stats.duration_ms / 1000).toFixed(1)}s`;
106
114
  const result = {
107
115
  content: [{ type: "text", text }],
116
+ isError: deepError ? true : undefined,
108
117
  };
109
118
  result._rigour_report = report;
110
119
  return result;
@@ -1,4 +1,11 @@
1
- import { parseDiff } from '../utils/config.js';
1
+ /**
2
+ * Code Review Tool Handler
3
+ *
4
+ * Handler for: rigour_review
5
+ *
6
+ * @since v2.17.0 — extracted from monolithic index.ts
7
+ */
8
+ import { parseDiff, normalizeScopePatterns } from "@rigour-labs/core";
2
9
  import { notifyProgress } from '../utils/notifications.js';
3
10
  export async function handleReview(runner, cwd, diff, changedFiles) {
4
11
  // 1. Map diff to line numbers for filtering
@@ -6,7 +13,7 @@ export async function handleReview(runner, cwd, diff, changedFiles) {
6
13
  const targetFiles = changedFiles || Object.keys(diffMapping);
7
14
  // 2. Run high-fidelity analysis on changed files
8
15
  notifyProgress("info", `Reviewing ${targetFiles.length} changed files...`);
9
- const report = await runner.run(cwd, targetFiles);
16
+ const report = await runner.run(cwd, await normalizeScopePatterns(cwd, targetFiles));
10
17
  // 3. Filter failures to only those on changed lines (or global gate failures)
11
18
  const filteredFailures = report.failures.filter(failure => {
12
19
  if (!failure.files || failure.files.length === 0)
@@ -13,9 +13,7 @@ export declare function loadConfig(cwd: string): Promise<{
13
13
  pro: boolean;
14
14
  provider: string;
15
15
  threads: number;
16
- max_tokens: number;
17
16
  temperature: number;
18
- timeout_ms: number;
19
17
  checks: {
20
18
  architecture: boolean;
21
19
  test_quality: boolean;
@@ -30,6 +28,8 @@ export declare function loadConfig(cwd: string): Promise<{
30
28
  api_base_url?: string | undefined;
31
29
  model_name?: string | undefined;
32
30
  model_path?: string | undefined;
31
+ max_tokens?: number | undefined;
32
+ timeout_ms?: number | undefined;
33
33
  };
34
34
  max_file_lines: number;
35
35
  forbid_todos: boolean;
@@ -267,4 +267,3 @@ export declare function getMcpSettingsPath(cwd: string): Promise<string>;
267
267
  export declare function loadMcpSettings(cwd: string): Promise<McpSettings>;
268
268
  export declare function saveMcpSettings(cwd: string, settings: McpSettings): Promise<void>;
269
269
  export declare function logStudioEvent(cwd: string, event: any): Promise<void>;
270
- export declare function parseDiff(diff: string): Record<string, Set<number>>;
@@ -99,32 +99,3 @@ export async function logStudioEvent(cwd, event) {
99
99
  // Silent fail — Studio logging is non-blocking and zero-telemetry
100
100
  }
101
101
  }
102
- // ─── Diff Parsing ─────────────────────────────────────────────────
103
- export function parseDiff(diff) {
104
- const lines = diff.split("\n");
105
- const mapping = {};
106
- let currentFile = "";
107
- let currentLine = 0;
108
- for (const line of lines) {
109
- if (line.startsWith("+++ b/")) {
110
- currentFile = line.slice(6);
111
- mapping[currentFile] = new Set();
112
- }
113
- else if (line.startsWith("@@")) {
114
- const match = line.match(/\+(\d+)/);
115
- if (match) {
116
- currentLine = parseInt(match[1], 10);
117
- }
118
- }
119
- else if (line.startsWith("+") && !line.startsWith("+++")) {
120
- if (currentFile) {
121
- mapping[currentFile].add(currentLine);
122
- }
123
- currentLine++;
124
- }
125
- else if (!line.startsWith("-")) {
126
- currentLine++;
127
- }
128
- }
129
- return mapping;
130
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/mcp",
3
- "version": "6.2.3",
3
+ "version": "6.2.5",
4
4
  "description": "MCP server + live dashboard for AI code governance — OWASP LLM Top 10 (10/10), real-time MCP App UI, 25+ security patterns, Bayesian learning Brain, hallucinated import detection, multi-agent governance. Works with Claude, Cursor, VS Code, ChatGPT, Goose, Windsurf. Industry presets for HIPAA, SOC2, FedRAMP.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://rigour.run",
@@ -62,7 +62,7 @@
62
62
  "execa": "^8.0.1",
63
63
  "fs-extra": "^11.4.0",
64
64
  "yaml": "^2.8.2",
65
- "@rigour-labs/core": "6.2.3"
65
+ "@rigour-labs/core": "6.2.5"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/node": "^25.0.3",