@rigour-labs/mcp 4.3.6 → 5.0.1

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.
@@ -20,6 +20,7 @@ export declare function handleCheckDeep(runner: GateRunner, cwd: string, config:
20
20
  }): Promise<ToolResult>;
21
21
  /**
22
22
  * Get deep analysis statistics from SQLite storage.
23
+ * v5: includes temporal drift report with per-provenance EWMA streams.
23
24
  */
24
25
  export declare function handleDeepStats(cwd: string, limit?: number): Promise<ToolResult>;
25
26
  export {};
@@ -107,6 +107,7 @@ export async function handleCheckDeep(runner, cwd, config, args) {
107
107
  }
108
108
  /**
109
109
  * Get deep analysis statistics from SQLite storage.
110
+ * v5: includes temporal drift report with per-provenance EWMA streams.
110
111
  */
111
112
  export async function handleDeepStats(cwd, limit = 10) {
112
113
  try {
@@ -144,6 +145,18 @@ export async function handleDeepStats(cwd, limit = 10) {
144
145
  text += ` ${issue.category}: ${issue.count} occurrences\n`;
145
146
  }
146
147
  }
148
+ // v5: Temporal Drift Report
149
+ try {
150
+ const { generateTemporalDriftReport, formatDriftSummary } = await import('@rigour-labs/core');
151
+ const driftReport = generateTemporalDriftReport(cwd);
152
+ if (driftReport && driftReport.totalScans >= 3) {
153
+ text += `\n${'═'.repeat(60)}\n`;
154
+ text += formatDriftSummary(driftReport);
155
+ }
156
+ }
157
+ catch {
158
+ // Temporal drift is advisory — never blocks stats output
159
+ }
147
160
  return { content: [{ type: "text", text }] };
148
161
  }
149
162
  catch (error) {
@@ -27,7 +27,7 @@ export async function handleHooksCheck(cwd, files, timeout, text, agent) {
27
27
  block_on_detection: true,
28
28
  audit_log: true,
29
29
  });
30
- // Log to audit trail
30
+ // Log to audit trail (with rotation to prevent unbounded growth)
31
31
  if (result.status !== 'clean') {
32
32
  try {
33
33
  const rigourDir = path.join(cwd, '.rigour');
@@ -37,6 +37,15 @@ export async function handleHooksCheck(cwd, files, timeout, text, agent) {
37
37
  agent: agent ?? 'mcp',
38
38
  });
39
39
  await fs.appendFile(eventsPath, JSON.stringify(auditEntry) + '\n');
40
+ // Rotate: only check when file exceeds ~500KB
41
+ const stat = await fs.stat(eventsPath);
42
+ if (stat.size >= 512 * 1024) {
43
+ const content = await fs.readFile(eventsPath, 'utf-8');
44
+ const lines = content.trim().split('\n');
45
+ if (lines.length > 2000) {
46
+ await fs.writeFile(eventsPath, lines.slice(-2000).join('\n') + '\n');
47
+ }
48
+ }
40
49
  }
41
50
  catch {
42
51
  // Silent
@@ -51,6 +51,10 @@ export declare function loadConfig(cwd: string): Promise<{
51
51
  };
52
52
  dependencies: {
53
53
  forbid: string[];
54
+ detect_unused: boolean;
55
+ detect_heavy_alternatives: boolean;
56
+ detect_duplicate_purpose: boolean;
57
+ unused_allowlist: string[];
54
58
  trusted_registry?: string | undefined;
55
59
  };
56
60
  architecture: {
@@ -218,6 +222,19 @@ export declare function loadConfig(cwd: string): Promise<{
218
222
  check_circular_triggers: boolean;
219
223
  check_auto_restart: boolean;
220
224
  };
225
+ style_drift: {
226
+ enabled: boolean;
227
+ deviation_threshold: number;
228
+ sample_size: number;
229
+ baseline_path: string;
230
+ };
231
+ logic_drift: {
232
+ enabled: boolean;
233
+ baseline_path: string;
234
+ track_operators: boolean;
235
+ track_branches: boolean;
236
+ track_returns: boolean;
237
+ };
221
238
  };
222
239
  hooks: {
223
240
  enabled: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/mcp",
3
- "version": "4.3.6",
3
+ "version": "5.0.1",
4
4
  "description": "MCP server for AI code governance — OWASP LLM Top 10 (10/10), real-time hooks, 25+ security patterns, hallucinated import detection, multi-agent governance. Works with Claude, Cursor, Cline, Windsurf, Gemini. Industry presets for HIPAA, SOC2, FedRAMP.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://rigour.run",
@@ -48,7 +48,7 @@
48
48
  "execa": "^8.0.1",
49
49
  "fs-extra": "^11.2.0",
50
50
  "yaml": "^2.8.2",
51
- "@rigour-labs/core": "4.3.6"
51
+ "@rigour-labs/core": "5.0.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^25.0.3",