mneme-ai 1.6.0 → 1.7.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/dist/commands/court.d.ts +50 -8
- package/dist/commands/court.d.ts.map +1 -1
- package/dist/commands/court.js +463 -31
- package/dist/commands/court.js.map +1 -1
- package/dist/commands/court.test.d.ts +9 -0
- package/dist/commands/court.test.d.ts.map +1 -0
- package/dist/commands/court.test.js +131 -0
- package/dist/commands/court.test.js.map +1 -0
- package/dist/commands/daemon.d.ts +17 -7
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +327 -21
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/daemon.test.d.ts +13 -0
- package/dist/commands/daemon.test.d.ts.map +1 -0
- package/dist/commands/daemon.test.js +142 -0
- package/dist/commands/daemon.test.js.map +1 -0
- package/dist/commands/federation.d.ts +25 -10
- package/dist/commands/federation.d.ts.map +1 -1
- package/dist/commands/federation.js +267 -33
- package/dist/commands/federation.js.map +1 -1
- package/dist/commands/federation.test.d.ts +12 -0
- package/dist/commands/federation.test.d.ts.map +1 -0
- package/dist/commands/federation.test.js +175 -0
- package/dist/commands/federation.test.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/commands/court.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `mneme court` — Phase 4
|
|
2
|
+
* `mneme court` — Phase 4: 12-jury arbitration with Ed25519 signed ruling.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* For high-stakes commits (production deploy, security patch, contract
|
|
5
|
+
* code, EU AI Act compliance evidence), Mneme convenes a JURY OF 12
|
|
6
|
+
* specialized verifiers. Each votes; Mneme acts as foreman; outputs a
|
|
7
|
+
* cryptographically signed Markdown court ruling.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* v1.7.0 ships a 12-juror MVP:
|
|
10
|
+
* - 9 deterministic jurors (Bayesian, stylometric, entropy, citation,
|
|
11
|
+
* CWE, atrophy, incident, mutation, adversarial)
|
|
12
|
+
* - 3 "LLM judge" stubs that pass through to existing audit certify
|
|
13
|
+
* (will be wired to real Claude/GPT/Gemini in v1.8.0)
|
|
14
|
+
*
|
|
15
|
+
* The ruling output is a signed JSON envelope + a human-readable Markdown
|
|
16
|
+
* report. PDF rendering uses puppeteer-core if available (peer dep);
|
|
17
|
+
* otherwise the Markdown is the final artifact.
|
|
12
18
|
*/
|
|
13
19
|
export interface CourtOptions {
|
|
14
20
|
cwd: string;
|
|
@@ -17,5 +23,41 @@ export interface CourtOptions {
|
|
|
17
23
|
out?: string;
|
|
18
24
|
json?: boolean;
|
|
19
25
|
}
|
|
26
|
+
type Verdict = "GUILTY" | "ACQUITTED" | "MISTRIAL" | "ABSTAIN";
|
|
27
|
+
interface JurorVote {
|
|
28
|
+
jurorId: string;
|
|
29
|
+
jurorRole: string;
|
|
30
|
+
verdict: Verdict;
|
|
31
|
+
confidence: number;
|
|
32
|
+
reasoning: string;
|
|
33
|
+
}
|
|
34
|
+
interface CourtRuling {
|
|
35
|
+
rulingVersion: 1;
|
|
36
|
+
generatedAt: string;
|
|
37
|
+
generatedByMneme: string;
|
|
38
|
+
commit: string;
|
|
39
|
+
commitShortHash: string;
|
|
40
|
+
jurySize: number;
|
|
41
|
+
votes: JurorVote[];
|
|
42
|
+
consensus: number;
|
|
43
|
+
majorityVerdict: Verdict;
|
|
44
|
+
majorityOpinion: string;
|
|
45
|
+
dissent: string | null;
|
|
46
|
+
evidenceHashes: string[];
|
|
47
|
+
signature: string;
|
|
48
|
+
signatureAlgorithm: "ed25519";
|
|
49
|
+
signatureKeyId: string;
|
|
50
|
+
}
|
|
51
|
+
declare function tally(votes: JurorVote[]): {
|
|
52
|
+
majorityVerdict: Verdict;
|
|
53
|
+
consensus: number;
|
|
54
|
+
majorityOpinion: string;
|
|
55
|
+
dissent: string | null;
|
|
56
|
+
};
|
|
20
57
|
export declare function courtCommand(opts: CourtOptions): Promise<number>;
|
|
58
|
+
declare function renderRulingMarkdown(r: CourtRuling): string;
|
|
59
|
+
export declare const _tallyForTests: typeof tally;
|
|
60
|
+
export declare const _renderRulingMarkdownForTests: typeof renderRulingMarkdown;
|
|
61
|
+
export declare const _ALL_JURORS_COUNT_FOR_TESTS: number;
|
|
62
|
+
export {};
|
|
21
63
|
//# sourceMappingURL=court.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"court.d.ts","sourceRoot":"","sources":["../../src/commands/court.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"court.d.ts","sourceRoot":"","sources":["../../src/commands/court.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,aAAa,EAAE,CAAC,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB;AAwQD,iBAAS,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG;IAClC,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAgCA;AAmCD,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA+GtE;AAED,iBAAS,oBAAoB,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CA6CpD;AAED,eAAO,MAAM,cAAc,cAAQ,CAAC;AACpC,eAAO,MAAM,6BAA6B,6BAAuB,CAAC;AAClE,eAAO,MAAM,2BAA2B,QAAoB,CAAC"}
|
package/dist/commands/court.js
CHANGED
|
@@ -1,41 +1,473 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `mneme court` — Phase 4
|
|
2
|
+
* `mneme court` — Phase 4: 12-jury arbitration with Ed25519 signed ruling.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* For high-stakes commits (production deploy, security patch, contract
|
|
5
|
+
* code, EU AI Act compliance evidence), Mneme convenes a JURY OF 12
|
|
6
|
+
* specialized verifiers. Each votes; Mneme acts as foreman; outputs a
|
|
7
|
+
* cryptographically signed Markdown court ruling.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* v1.7.0 ships a 12-juror MVP:
|
|
10
|
+
* - 9 deterministic jurors (Bayesian, stylometric, entropy, citation,
|
|
11
|
+
* CWE, atrophy, incident, mutation, adversarial)
|
|
12
|
+
* - 3 "LLM judge" stubs that pass through to existing audit certify
|
|
13
|
+
* (will be wired to real Claude/GPT/Gemini in v1.8.0)
|
|
14
|
+
*
|
|
15
|
+
* The ruling output is a signed JSON envelope + a human-readable Markdown
|
|
16
|
+
* report. PDF rendering uses puppeteer-core if available (peer dep);
|
|
17
|
+
* otherwise the Markdown is the final artifact.
|
|
12
18
|
*/
|
|
19
|
+
import { writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
20
|
+
import { dirname } from "node:path";
|
|
21
|
+
import { spawnSync } from "node:child_process";
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
13
23
|
import kleur from "kleur";
|
|
14
24
|
import { ui } from "../ui.js";
|
|
25
|
+
import { git, audit, store } from "@mneme-ai/core";
|
|
26
|
+
import { dbPath } from "../paths.js";
|
|
27
|
+
function safeReadVersion() {
|
|
28
|
+
try {
|
|
29
|
+
const here = new URL(".", import.meta.url).pathname;
|
|
30
|
+
const fs = require("node:fs");
|
|
31
|
+
const path = require("node:path");
|
|
32
|
+
const pkgPath = path.resolve(here, "..", "..", "package.json");
|
|
33
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
34
|
+
return pkg.version ?? "0.0.0";
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return "0.0.0";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
41
|
+
// THE 12 JURORS — each is a small standalone evaluator
|
|
42
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
43
|
+
const bayesianJuror = ({ storeRef, commitHash }) => {
|
|
44
|
+
const commit = storeRef.getCommit(commitHash);
|
|
45
|
+
if (!commit) {
|
|
46
|
+
return {
|
|
47
|
+
jurorId: "j-bayesian",
|
|
48
|
+
jurorRole: "Bayesian prior",
|
|
49
|
+
verdict: "ABSTAIN",
|
|
50
|
+
confidence: 0,
|
|
51
|
+
reasoning: "Commit not found in indexed corpus.",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Naive prior: short subject + many files = elevated risk
|
|
55
|
+
const fileCount = commit.files.length;
|
|
56
|
+
const subjectLen = commit.subject.length;
|
|
57
|
+
const risk = fileCount > 20 || subjectLen < 12 ? "GUILTY" : "ACQUITTED";
|
|
58
|
+
return {
|
|
59
|
+
jurorId: "j-bayesian",
|
|
60
|
+
jurorRole: "Bayesian prior",
|
|
61
|
+
verdict: risk,
|
|
62
|
+
confidence: 0.55,
|
|
63
|
+
reasoning: `${fileCount} files touched · subject length ${subjectLen}. Prior ${risk === "GUILTY" ? "elevated" : "normal"}.`,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const stylometricJuror = ({ storeRef, commitHash }) => {
|
|
67
|
+
const commit = storeRef.getCommit(commitHash);
|
|
68
|
+
if (!commit)
|
|
69
|
+
return abstain("j-stylometric", "Stylometric voice", "Commit not indexed.");
|
|
70
|
+
const body = commit.body ?? "";
|
|
71
|
+
// Lots of repeated capitals + ALL CAPS lines = unusual
|
|
72
|
+
const allCapsLines = body.split("\n").filter((l) => l.length > 8 && l === l.toUpperCase()).length;
|
|
73
|
+
const verdict = allCapsLines >= 2 ? "GUILTY" : "ACQUITTED";
|
|
74
|
+
return {
|
|
75
|
+
jurorId: "j-stylometric",
|
|
76
|
+
jurorRole: "Stylometric voice",
|
|
77
|
+
verdict,
|
|
78
|
+
confidence: 0.5,
|
|
79
|
+
reasoning: `${allCapsLines} ALL-CAPS line(s) detected.`,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const entropyJuror = ({ storeRef, commitHash }) => {
|
|
83
|
+
const commit = storeRef.getCommit(commitHash);
|
|
84
|
+
if (!commit)
|
|
85
|
+
return abstain("j-entropy", "Information entropy", "Commit not indexed.");
|
|
86
|
+
const txt = (commit.subject + " " + (commit.body ?? "")).toLowerCase();
|
|
87
|
+
const freq = new Map();
|
|
88
|
+
for (const ch of txt)
|
|
89
|
+
freq.set(ch, (freq.get(ch) ?? 0) + 1);
|
|
90
|
+
let h = 0;
|
|
91
|
+
for (const f of freq.values()) {
|
|
92
|
+
const p = f / txt.length;
|
|
93
|
+
if (p > 0)
|
|
94
|
+
h -= p * Math.log2(p);
|
|
95
|
+
}
|
|
96
|
+
const verdict = h < 3.0 || h > 5.5 ? "GUILTY" : "ACQUITTED";
|
|
97
|
+
return {
|
|
98
|
+
jurorId: "j-entropy",
|
|
99
|
+
jurorRole: "Information entropy",
|
|
100
|
+
verdict,
|
|
101
|
+
confidence: 0.5,
|
|
102
|
+
reasoning: `Char entropy ${h.toFixed(2)} (healthy 3.0-5.5).`,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const citationJuror = ({ storeRef, commitHash }) => {
|
|
106
|
+
const commit = storeRef.getCommit(commitHash);
|
|
107
|
+
if (!commit)
|
|
108
|
+
return abstain("j-citation", "Citation density", "Commit not indexed.");
|
|
109
|
+
const body = commit.body ?? "";
|
|
110
|
+
const citations = body.match(/\b[a-f0-9]{7,40}\b|\b#\d+|\bPR\s*#?\d+/gi) ?? [];
|
|
111
|
+
const verdict = body.length > 100 && citations.length === 0 ? "GUILTY" : "ACQUITTED";
|
|
112
|
+
return {
|
|
113
|
+
jurorId: "j-citation",
|
|
114
|
+
jurorRole: "Citation density",
|
|
115
|
+
verdict,
|
|
116
|
+
confidence: 0.55,
|
|
117
|
+
reasoning: `${citations.length} citation(s) in commit body.`,
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const cweJuror = ({ storeRef, commitHash }) => {
|
|
121
|
+
const commit = storeRef.getCommit(commitHash);
|
|
122
|
+
if (!commit)
|
|
123
|
+
return abstain("j-cwe", "CWE pattern matcher", "Commit not indexed.");
|
|
124
|
+
const dangerous = /\b(eval|exec|setTimeout\s*\(\s*['"]|innerHTML|document\.write|os\.system)\b/i;
|
|
125
|
+
const text = `${commit.subject} ${commit.body ?? ""} ${commit.files.join(" ")}`;
|
|
126
|
+
const verdict = dangerous.test(text) ? "GUILTY" : "ACQUITTED";
|
|
127
|
+
return {
|
|
128
|
+
jurorId: "j-cwe",
|
|
129
|
+
jurorRole: "CWE pattern matcher",
|
|
130
|
+
verdict,
|
|
131
|
+
confidence: 0.6,
|
|
132
|
+
reasoning: dangerous.test(text)
|
|
133
|
+
? "Dangerous identifier (eval/exec/innerHTML/etc) referenced in commit text."
|
|
134
|
+
: "No CWE-pattern signals in commit text.",
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
const atrophyJuror = ({ storeRef, commitHash }) => {
|
|
138
|
+
const commit = storeRef.getCommit(commitHash);
|
|
139
|
+
if (!commit)
|
|
140
|
+
return abstain("j-atrophy", "Atrophy guard", "Commit not indexed.");
|
|
141
|
+
// Heuristic: if commit author has < 3 commits in the last 90 days, knowledge atrophy is high
|
|
142
|
+
const since = new Date(Date.now() - 90 * 86400_000).toISOString();
|
|
143
|
+
const recent = storeRef.db
|
|
144
|
+
.prepare("SELECT COUNT(*) AS n FROM commits WHERE author_email = ? AND author_date >= ?")
|
|
145
|
+
.get(commit.authorEmail ?? "", since);
|
|
146
|
+
const recentCount = recent?.n ?? 0;
|
|
147
|
+
const verdict = recentCount < 3 ? "GUILTY" : "ACQUITTED";
|
|
148
|
+
return {
|
|
149
|
+
jurorId: "j-atrophy",
|
|
150
|
+
jurorRole: "Atrophy guard",
|
|
151
|
+
verdict,
|
|
152
|
+
confidence: 0.5,
|
|
153
|
+
reasoning: `Author has ${recentCount} commits in last 90 days.`,
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
const incidentJuror = ({ storeRef, commitHash }) => {
|
|
157
|
+
const commit = storeRef.getCommit(commitHash);
|
|
158
|
+
if (!commit)
|
|
159
|
+
return abstain("j-incident", "Incident-history", "Commit not indexed.");
|
|
160
|
+
const incidents = storeRef.db.prepare("SELECT * FROM incidents").all();
|
|
161
|
+
const cFiles = new Set(commit.files.map((p) => p.replace(/\\/g, "/").toLowerCase()));
|
|
162
|
+
let overlapped = 0;
|
|
163
|
+
for (const i of incidents) {
|
|
164
|
+
const affected = i.affected_files ? JSON.parse(String(i.affected_files)) : [];
|
|
165
|
+
if (affected.some((f) => cFiles.has(f.replace(/\\/g, "/").toLowerCase())))
|
|
166
|
+
overlapped++;
|
|
167
|
+
}
|
|
168
|
+
const verdict = overlapped > 0 ? "GUILTY" : "ACQUITTED";
|
|
169
|
+
return {
|
|
170
|
+
jurorId: "j-incident",
|
|
171
|
+
jurorRole: "Incident-history",
|
|
172
|
+
verdict,
|
|
173
|
+
confidence: 0.6,
|
|
174
|
+
reasoning: `${overlapped} past incident(s) overlap with commit's file footprint.`,
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
const mutationJuror = ({ storeRef, commitHash }) => {
|
|
178
|
+
const commit = storeRef.getCommit(commitHash);
|
|
179
|
+
if (!commit)
|
|
180
|
+
return abstain("j-mutation", "Mutation counterfactual", "Commit not indexed.");
|
|
181
|
+
const body = (commit.subject + " " + (commit.body ?? "")).toLowerCase();
|
|
182
|
+
const absoluteWords = (body.match(/\b(definitely|always|never|must|guaranteed|certain)\b/g) ?? []).length;
|
|
183
|
+
const verdict = absoluteWords >= 2 ? "GUILTY" : "ACQUITTED";
|
|
184
|
+
return {
|
|
185
|
+
jurorId: "j-mutation",
|
|
186
|
+
jurorRole: "Mutation counterfactual",
|
|
187
|
+
verdict,
|
|
188
|
+
confidence: 0.45,
|
|
189
|
+
reasoning: `${absoluteWords} absolute claim(s) without hedging — answer brittle under mutation.`,
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
const adversarialJuror = ({ storeRef, commitHash }) => {
|
|
193
|
+
const commit = storeRef.getCommit(commitHash);
|
|
194
|
+
if (!commit)
|
|
195
|
+
return abstain("j-adversarial", "Adversarial probe", "Commit not indexed.");
|
|
196
|
+
const fab = /\b(fix\s+everything|all\s+bugs|major\s+overhaul|complete\s+rewrite)\b/i.test(commit.subject + " " + (commit.body ?? ""));
|
|
197
|
+
const verdict = fab ? "GUILTY" : "ACQUITTED";
|
|
198
|
+
return {
|
|
199
|
+
jurorId: "j-adversarial",
|
|
200
|
+
jurorRole: "Adversarial probe",
|
|
201
|
+
verdict,
|
|
202
|
+
confidence: 0.5,
|
|
203
|
+
reasoning: fab
|
|
204
|
+
? "Suspiciously sweeping claims in commit message."
|
|
205
|
+
: "No suspicious-specificity patterns detected.",
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
// 3 LLM judges — stubs that pass through to existing audit certify
|
|
209
|
+
const llmJudgeClaude = async ({ cwd, commitHash }) => {
|
|
210
|
+
return llmJudgeStub("j-llm-claude", "LLM judge — Claude", cwd, commitHash);
|
|
211
|
+
};
|
|
212
|
+
const llmJudgeGpt = async ({ cwd, commitHash }) => {
|
|
213
|
+
return llmJudgeStub("j-llm-gpt", "LLM judge — GPT-4", cwd, commitHash);
|
|
214
|
+
};
|
|
215
|
+
const llmJudgeGemini = async ({ cwd, commitHash }) => {
|
|
216
|
+
return llmJudgeStub("j-llm-gemini", "LLM judge — Gemini", cwd, commitHash);
|
|
217
|
+
};
|
|
218
|
+
async function llmJudgeStub(id, role, cwd, commitHash) {
|
|
219
|
+
// v1.7.0: pass through to mneme audit verify-head, which catches narrative
|
|
220
|
+
// contradictions. Real Claude/GPT/Gemini wiring lands in v1.8.0.
|
|
221
|
+
const r = spawnSync("mneme", ["audit", "--verify-head", "--max-commits", "1", "--json"], {
|
|
222
|
+
cwd,
|
|
223
|
+
stdio: "pipe",
|
|
224
|
+
});
|
|
225
|
+
if (r.status !== 0) {
|
|
226
|
+
return {
|
|
227
|
+
jurorId: id,
|
|
228
|
+
jurorRole: role,
|
|
229
|
+
verdict: "ABSTAIN",
|
|
230
|
+
confidence: 0,
|
|
231
|
+
reasoning: `audit verify-head returned ${r.status}; LLM judge cannot vote without baseline.`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
let parsed = {};
|
|
235
|
+
try {
|
|
236
|
+
parsed = JSON.parse(r.stdout.toString());
|
|
237
|
+
}
|
|
238
|
+
catch { }
|
|
239
|
+
const contradictions = parsed.contradictions ?? 0;
|
|
240
|
+
const verdict = contradictions > 0 ? "GUILTY" : "ACQUITTED";
|
|
241
|
+
return {
|
|
242
|
+
jurorId: id,
|
|
243
|
+
jurorRole: role,
|
|
244
|
+
verdict,
|
|
245
|
+
confidence: 0.6,
|
|
246
|
+
reasoning: `${contradictions} narrative-vs-diff contradiction(s) detected. (v1.7.0 stub — real ${role} engine wires up in v1.8.0.)`,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function abstain(id, role, reason) {
|
|
250
|
+
return { jurorId: id, jurorRole: role, verdict: "ABSTAIN", confidence: 0, reasoning: reason };
|
|
251
|
+
}
|
|
252
|
+
const ALL_JURORS = [
|
|
253
|
+
bayesianJuror,
|
|
254
|
+
stylometricJuror,
|
|
255
|
+
entropyJuror,
|
|
256
|
+
citationJuror,
|
|
257
|
+
cweJuror,
|
|
258
|
+
atrophyJuror,
|
|
259
|
+
incidentJuror,
|
|
260
|
+
mutationJuror,
|
|
261
|
+
adversarialJuror,
|
|
262
|
+
llmJudgeClaude,
|
|
263
|
+
llmJudgeGpt,
|
|
264
|
+
llmJudgeGemini,
|
|
265
|
+
];
|
|
266
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
267
|
+
// Foreman — synthesize the verdicts
|
|
268
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
269
|
+
function tally(votes) {
|
|
270
|
+
const counts = new Map();
|
|
271
|
+
for (const v of votes)
|
|
272
|
+
counts.set(v.verdict, (counts.get(v.verdict) ?? 0) + 1);
|
|
273
|
+
const sorted = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]);
|
|
274
|
+
const top = sorted[0];
|
|
275
|
+
const second = sorted[1];
|
|
276
|
+
const majorityVerdict = top?.[0] ?? "MISTRIAL";
|
|
277
|
+
const total = votes.length;
|
|
278
|
+
const consensus = total > 0 ? (top?.[1] ?? 0) / total : 0;
|
|
279
|
+
// Mistrial when no clear majority (top two tied or top below 50%)
|
|
280
|
+
const isMistrial = consensus < 0.5 || (second && second[1] === top?.[1]);
|
|
281
|
+
const final = isMistrial ? "MISTRIAL" : majorityVerdict;
|
|
282
|
+
const aligned = votes.filter((v) => v.verdict === majorityVerdict);
|
|
283
|
+
const dissenters = votes.filter((v) => v.verdict !== majorityVerdict && v.verdict !== "ABSTAIN");
|
|
284
|
+
const majorityOpinion = aligned.length === 0
|
|
285
|
+
? "No majority verdict reached."
|
|
286
|
+
: aligned
|
|
287
|
+
.map((v) => `${v.jurorRole}: ${v.reasoning}`)
|
|
288
|
+
.slice(0, 5)
|
|
289
|
+
.join("\n");
|
|
290
|
+
const dissent = dissenters.length === 0
|
|
291
|
+
? null
|
|
292
|
+
: dissenters
|
|
293
|
+
.map((v) => `${v.jurorRole} (voted ${v.verdict}): ${v.reasoning}`)
|
|
294
|
+
.slice(0, 3)
|
|
295
|
+
.join("\n");
|
|
296
|
+
return { majorityVerdict: final, consensus, majorityOpinion, dissent };
|
|
297
|
+
}
|
|
298
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
299
|
+
// Ed25519 signing — uses existing core/audit/ed25519 helper
|
|
300
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
301
|
+
function canonicalJson(obj) {
|
|
302
|
+
// Stable key order for deterministic signatures
|
|
303
|
+
return JSON.stringify(obj, Object.keys(obj).sort());
|
|
304
|
+
}
|
|
305
|
+
async function signRuling(rulingWithoutSig) {
|
|
306
|
+
// v1.7.0: real Ed25519 signing via core/audit/ed25519.
|
|
307
|
+
// Per-repo key persistence is a v1.8.0 follow-up; for now we generate a
|
|
308
|
+
// fresh keypair for each ruling and embed the public key id in keyId so
|
|
309
|
+
// downstream verifiers can recognise it as a fresh-key ruling.
|
|
310
|
+
try {
|
|
311
|
+
const kp = audit.generateEd25519KeyPair();
|
|
312
|
+
const sig = await audit.signObjectEd25519(rulingWithoutSig, kp.privateKeyPem);
|
|
313
|
+
const pubFingerprint = createHash("sha256").update(kp.publicKeyPem).digest("hex").slice(0, 16);
|
|
314
|
+
return { signature: sig, keyId: `ed25519:${pubFingerprint}` };
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
// Fallback if Ed25519 unavailable: SHA-256 hash (still tamper-evident).
|
|
318
|
+
const hash = createHash("sha256").update(canonicalJson(rulingWithoutSig)).digest("hex");
|
|
319
|
+
return { signature: `sha256:${hash}`, keyId: "fallback-sha256" };
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
323
|
+
// Main entry
|
|
324
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
15
325
|
export async function courtCommand(opts) {
|
|
16
|
-
|
|
326
|
+
if (!(await git.isGitRepo(opts.cwd))) {
|
|
327
|
+
ui.error("Not in a git repo. Run `mneme init` first.");
|
|
328
|
+
return 1;
|
|
329
|
+
}
|
|
330
|
+
const meta = await git.getRepoMeta(opts.cwd);
|
|
331
|
+
const dbPathStr = dbPath(meta.rootPath);
|
|
332
|
+
if (!existsSync(dbPathStr)) {
|
|
333
|
+
ui.error("No Mneme index found. Run `mneme index` first.");
|
|
334
|
+
return 1;
|
|
335
|
+
}
|
|
336
|
+
const s = new store.MnemeStore(dbPathStr);
|
|
337
|
+
// Resolve the commit
|
|
338
|
+
let commitHash = opts.commit ?? "HEAD";
|
|
339
|
+
const r = spawnSync("git", ["rev-parse", commitHash], { cwd: meta.rootPath });
|
|
340
|
+
if (r.status !== 0) {
|
|
341
|
+
ui.error(`Cannot resolve commit "${commitHash}".`);
|
|
342
|
+
return 1;
|
|
343
|
+
}
|
|
344
|
+
commitHash = r.stdout.toString().trim();
|
|
345
|
+
const shortHash = commitHash.slice(0, 8);
|
|
346
|
+
if (!opts.json) {
|
|
347
|
+
ui.banner();
|
|
348
|
+
process.stdout.write(kleur.bold("\n ⚖ Mneme Court — convening jury\n\n") +
|
|
349
|
+
` Defendant: commit ${kleur.cyan(shortHash)}\n` +
|
|
350
|
+
` Jury size: ${ALL_JURORS.length}\n\n`);
|
|
351
|
+
}
|
|
352
|
+
// Collect votes (some jurors are async)
|
|
353
|
+
const input = { cwd: meta.rootPath, commitHash, storeRef: s, shortHash };
|
|
354
|
+
const votes = [];
|
|
355
|
+
for (const juror of ALL_JURORS) {
|
|
356
|
+
const v = await juror(input);
|
|
357
|
+
votes.push(v);
|
|
358
|
+
if (!opts.json) {
|
|
359
|
+
const tag = v.verdict === "GUILTY"
|
|
360
|
+
? kleur.red("✗ GUILTY")
|
|
361
|
+
: v.verdict === "ACQUITTED"
|
|
362
|
+
? kleur.green("✓ ACQUITTED")
|
|
363
|
+
: v.verdict === "MISTRIAL"
|
|
364
|
+
? kleur.yellow("? MISTRIAL")
|
|
365
|
+
: kleur.gray("○ ABSTAIN");
|
|
366
|
+
process.stdout.write(` ${tag.padEnd(20)} ${v.jurorRole}\n ${kleur.dim(v.reasoning)}\n`);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const { majorityVerdict, consensus, majorityOpinion, dissent } = tally(votes);
|
|
370
|
+
// Collect cited evidence hashes from juror reasoning
|
|
371
|
+
const evidenceHashes = [];
|
|
372
|
+
for (const v of votes) {
|
|
373
|
+
const m = v.reasoning.match(/\b[a-f0-9]{7,40}\b/g);
|
|
374
|
+
if (m)
|
|
375
|
+
evidenceHashes.push(...m);
|
|
376
|
+
}
|
|
377
|
+
const partial = {
|
|
378
|
+
rulingVersion: 1,
|
|
379
|
+
generatedAt: new Date().toISOString(),
|
|
380
|
+
generatedByMneme: safeReadVersion(),
|
|
381
|
+
commit: commitHash,
|
|
382
|
+
commitShortHash: shortHash,
|
|
383
|
+
jurySize: ALL_JURORS.length,
|
|
384
|
+
votes,
|
|
385
|
+
consensus,
|
|
386
|
+
majorityVerdict,
|
|
387
|
+
majorityOpinion,
|
|
388
|
+
dissent,
|
|
389
|
+
evidenceHashes: Array.from(new Set(evidenceHashes)),
|
|
390
|
+
};
|
|
391
|
+
const { signature, keyId } = await signRuling(partial);
|
|
392
|
+
const ruling = {
|
|
393
|
+
...partial,
|
|
394
|
+
signature,
|
|
395
|
+
signatureAlgorithm: "ed25519",
|
|
396
|
+
signatureKeyId: keyId,
|
|
397
|
+
};
|
|
398
|
+
// Render outputs
|
|
399
|
+
const md = renderRulingMarkdown(ruling);
|
|
400
|
+
if (opts.out) {
|
|
401
|
+
if (!existsSync(dirname(opts.out)))
|
|
402
|
+
mkdirSync(dirname(opts.out), { recursive: true });
|
|
403
|
+
writeFileSync(opts.out, md, "utf8");
|
|
404
|
+
}
|
|
17
405
|
if (opts.json) {
|
|
18
|
-
process.stdout.write(JSON.stringify(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
process.stdout.write(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
406
|
+
process.stdout.write(JSON.stringify(ruling, null, 2) + "\n");
|
|
407
|
+
return ruling.majorityVerdict === "GUILTY" ? 1 : 0;
|
|
408
|
+
}
|
|
409
|
+
process.stdout.write("\n " + kleur.bold("Foreman's verdict: "));
|
|
410
|
+
const finalTag = ruling.majorityVerdict === "GUILTY"
|
|
411
|
+
? kleur.red().bold("GUILTY OF REGRESSION RISK")
|
|
412
|
+
: ruling.majorityVerdict === "ACQUITTED"
|
|
413
|
+
? kleur.green().bold("ACQUITTED")
|
|
414
|
+
: kleur.yellow().bold("MISTRIAL");
|
|
415
|
+
process.stdout.write(finalTag + "\n");
|
|
416
|
+
process.stdout.write(` Consensus: ${(ruling.consensus * 100).toFixed(0)}% of jurors agreed\n`);
|
|
417
|
+
process.stdout.write(` Signature: ${signature.slice(0, 32)}… (${keyId})\n`);
|
|
418
|
+
if (opts.out) {
|
|
419
|
+
process.stdout.write(` Ruling written to: ${opts.out}\n`);
|
|
420
|
+
}
|
|
421
|
+
process.stdout.write("\n");
|
|
422
|
+
return ruling.majorityVerdict === "GUILTY" ? 1 : 0;
|
|
423
|
+
}
|
|
424
|
+
function renderRulingMarkdown(r) {
|
|
425
|
+
const lines = [];
|
|
426
|
+
lines.push(`# Mneme Court — ruling for commit ${r.commitShortHash}`);
|
|
427
|
+
lines.push("");
|
|
428
|
+
lines.push(`**Verdict:** ${r.majorityVerdict}`);
|
|
429
|
+
lines.push(`**Consensus:** ${(r.consensus * 100).toFixed(0)}% of jurors`);
|
|
430
|
+
lines.push(`**Generated:** ${r.generatedAt}`);
|
|
431
|
+
lines.push(`**By:** Mneme ${r.generatedByMneme}`);
|
|
432
|
+
lines.push("");
|
|
433
|
+
lines.push("## Jury vote");
|
|
434
|
+
lines.push("");
|
|
435
|
+
lines.push("| # | Juror | Verdict | Confidence | Reasoning |");
|
|
436
|
+
lines.push("|---:|---|:---:|---:|---|");
|
|
437
|
+
r.votes.forEach((v, i) => {
|
|
438
|
+
lines.push(`| ${i + 1} | ${v.jurorRole} | ${v.verdict} | ${(v.confidence * 100).toFixed(0)}% | ${v.reasoning.replace(/\|/g, "\\|")} |`);
|
|
439
|
+
});
|
|
440
|
+
lines.push("");
|
|
441
|
+
lines.push("## Majority opinion");
|
|
442
|
+
lines.push("");
|
|
443
|
+
lines.push("```");
|
|
444
|
+
lines.push(r.majorityOpinion);
|
|
445
|
+
lines.push("```");
|
|
446
|
+
if (r.dissent) {
|
|
447
|
+
lines.push("");
|
|
448
|
+
lines.push("## Dissent");
|
|
449
|
+
lines.push("");
|
|
450
|
+
lines.push("```");
|
|
451
|
+
lines.push(r.dissent);
|
|
452
|
+
lines.push("```");
|
|
453
|
+
}
|
|
454
|
+
if (r.evidenceHashes.length > 0) {
|
|
455
|
+
lines.push("");
|
|
456
|
+
lines.push("## Cited evidence");
|
|
457
|
+
lines.push("");
|
|
458
|
+
for (const h of r.evidenceHashes.slice(0, 20)) {
|
|
459
|
+
lines.push(`- \`${h}\``);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
lines.push("");
|
|
463
|
+
lines.push("## Cryptographic signature");
|
|
464
|
+
lines.push("");
|
|
465
|
+
lines.push(`- algorithm: \`${r.signatureAlgorithm}\``);
|
|
466
|
+
lines.push(`- key id: \`${r.signatureKeyId}\``);
|
|
467
|
+
lines.push(`- signature: \`${r.signature}\``);
|
|
468
|
+
return lines.join("\n");
|
|
40
469
|
}
|
|
470
|
+
export const _tallyForTests = tally;
|
|
471
|
+
export const _renderRulingMarkdownForTests = renderRulingMarkdown;
|
|
472
|
+
export const _ALL_JURORS_COUNT_FOR_TESTS = ALL_JURORS.length;
|
|
41
473
|
//# sourceMappingURL=court.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"court.js","sourceRoot":"","sources":["../../src/commands/court.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAU9B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAkB;IACnD,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,CAAC,SAAS,CACZ;YACE,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,QAAQ;YACxB,IAAI,EAAE,mEAAmE;YACzE,IAAI,EACF,2GAA2G;gBAC3G,iFAAiF;SACpF,EACD,IAAI,EACJ,CAA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C,IAAI,CAAC,eAAe,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* court — unit tests for the foreman algorithm.
|
|
3
|
+
*
|
|
4
|
+
* The end-to-end juror voting touches store + git, covered by smoke tests
|
|
5
|
+
* elsewhere. We test the deterministic foreman + markdown rendering here,
|
|
6
|
+
* which are the fairness guarantees of the court.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=court.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"court.test.d.ts","sourceRoot":"","sources":["../../src/commands/court.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|