@rigour-labs/mcp 6.5.3 → 6.5.4
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.
|
@@ -19,6 +19,7 @@ export declare function handleRunSupervised(opts: {
|
|
|
19
19
|
}): Promise<ToolResult>;
|
|
20
20
|
/**
|
|
21
21
|
* Fail-closed: timeout with no human decision → timeout-deny (not approve).
|
|
22
|
+
* Only a decision Studio signed with this request's token counts; any other line is ignored.
|
|
22
23
|
*/
|
|
23
|
-
export declare function pollArbitration(cwd: string, rid: string, timeout: number): Promise<string | null>;
|
|
24
|
+
export declare function pollArbitration(cwd: string, rid: string, token: string, timeout: number): Promise<string | null>;
|
|
24
25
|
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import fs from "fs-extra";
|
|
8
8
|
import path from "path";
|
|
9
|
-
import { FixPacketService, runTypedCommand, evaluateTypedCommand, issueArbitrationToken, } from "@rigour-labs/core";
|
|
9
|
+
import { FixPacketService, runTypedCommand, evaluateTypedCommand, issueArbitrationToken, verifyArbitrationDecision, } from "@rigour-labs/core";
|
|
10
10
|
import { logStudioEvent } from '../utils/config.js';
|
|
11
11
|
import { notifyProgress } from '../utils/notifications.js';
|
|
12
12
|
async function requireHumanApproval(cwd, command, requestId, tool) {
|
|
@@ -16,10 +16,9 @@ async function requireHumanApproval(cwd, command, requestId, tool) {
|
|
|
16
16
|
requestId,
|
|
17
17
|
tool,
|
|
18
18
|
command,
|
|
19
|
-
arbitrationToken,
|
|
20
19
|
});
|
|
21
20
|
console.error(`[RIGOUR] Waiting for human arbitration for command: ${command}`);
|
|
22
|
-
const decision = await pollArbitration(cwd, requestId, 60000);
|
|
21
|
+
const decision = await pollArbitration(cwd, requestId, arbitrationToken, 60000);
|
|
23
22
|
if (decision === 'approve')
|
|
24
23
|
return null;
|
|
25
24
|
await logStudioEvent(cwd, {
|
|
@@ -230,19 +229,20 @@ function formatFixPacketForSupervisor(fixPacket) {
|
|
|
230
229
|
}
|
|
231
230
|
/**
|
|
232
231
|
* Fail-closed: timeout with no human decision → timeout-deny (not approve).
|
|
232
|
+
* Only a decision Studio signed with this request's token counts; any other line is ignored.
|
|
233
233
|
*/
|
|
234
|
-
export async function pollArbitration(cwd, rid, timeout) {
|
|
234
|
+
export async function pollArbitration(cwd, rid, token, timeout) {
|
|
235
235
|
const eventsPath = path.join(cwd, '.rigour/events.jsonl');
|
|
236
236
|
const maxIterations = Math.max(1, Math.ceil(timeout / 1000));
|
|
237
237
|
for (let i = 0; i < maxIterations; i++) {
|
|
238
|
-
const found = await readArbitrationDecision(eventsPath, rid);
|
|
238
|
+
const found = await readArbitrationDecision(eventsPath, rid, token);
|
|
239
239
|
if (found)
|
|
240
240
|
return found;
|
|
241
241
|
await sleepMs(1000);
|
|
242
242
|
}
|
|
243
243
|
return "timeout-deny";
|
|
244
244
|
}
|
|
245
|
-
async function readArbitrationDecision(eventsPath, rid) {
|
|
245
|
+
async function readArbitrationDecision(eventsPath, rid, token) {
|
|
246
246
|
if (!(await fs.pathExists(eventsPath)))
|
|
247
247
|
return null;
|
|
248
248
|
const content = await fs.readFile(eventsPath, 'utf-8');
|
|
@@ -255,7 +255,8 @@ async function readArbitrationDecision(eventsPath, rid) {
|
|
|
255
255
|
catch {
|
|
256
256
|
continue;
|
|
257
257
|
}
|
|
258
|
-
if (event.tool === 'human_arbitration' && event.requestId === rid
|
|
258
|
+
if (event.tool === 'human_arbitration' && event.requestId === rid
|
|
259
|
+
&& verifyArbitrationDecision(token, rid, event.decision, event.proof)) {
|
|
259
260
|
return event.decision;
|
|
260
261
|
}
|
|
261
262
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/mcp",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.4",
|
|
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, memory and lessons recalled by meaning, hallucinated import detection, multi-agent governance. Works with Claude, Cursor, VS Code, ChatGPT, Goose, Windsurf. Industry presets for HIPAA, SOC2, FedRAMP.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"execa": "^8.0.1",
|
|
66
66
|
"fs-extra": "^11.4.0",
|
|
67
67
|
"yaml": "^2.8.2",
|
|
68
|
-
"@rigour-labs/core": "6.5.
|
|
68
|
+
"@rigour-labs/core": "6.5.4"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^25.0.3",
|