sparda-mcp 0.66.1 → 0.66.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparda-mcp",
3
- "version": "0.66.1",
3
+ "version": "0.66.2",
4
4
  "mcpName": "io.github.zyx77550/sparda-mcp",
5
5
  "description": "AI writes. SPARDA proves. A deterministic, offline gate that catches when an AI edit removes a guard, exposes a route, or breaks an invariant — no API key, right in the agent edit loop.",
6
6
  "type": "module",
@@ -61,19 +61,19 @@
61
61
  "author": "Residual Labs (residual-labs.fr)",
62
62
  "license": "BUSL-1.1",
63
63
  "dependencies": {
64
- "@babel/parser": "7.26.5",
65
- "@babel/traverse": "7.26.5",
66
- "@clack/prompts": "0.9.1",
67
64
  "@modelcontextprotocol/sdk": "1.29.0"
68
65
  },
69
66
  "devDependencies": {
70
- "@eslint/js": "^9.39.4",
71
- "@vitest/coverage-v8": "^3.2.6",
72
- "eslint": "^9.39.4",
73
- "eslint-config-prettier": "^9.1.2",
74
- "express": "^4.21.0",
75
- "globals": "^15.15.0",
67
+ "@babel/parser": "^8.0.4",
68
+ "@babel/traverse": "^8.0.4",
69
+ "@clack/prompts": "^1.7.0",
70
+ "@eslint/js": "^10.0.1",
71
+ "@vitest/coverage-v8": "^4.1.10",
72
+ "eslint": "^10.7.0",
73
+ "eslint-config-prettier": "^10.1.8",
74
+ "express": "^5.2.1",
75
+ "globals": "^17.7.0",
76
76
  "prettier": "^3.8.4",
77
- "vitest": "^3.2.6"
77
+ "vitest": "^4.1.10"
78
78
  }
79
79
  }
@@ -82,7 +82,7 @@ export async function runEvolve(opts) {
82
82
  },
83
83
  );
84
84
  }
85
- let exemplars = {};
85
+ let exemplars;
86
86
  try {
87
87
  exemplars = JSON.parse(fs.readFileSync(twinPath, 'utf8')).exemplars ?? {};
88
88
  } catch {
@@ -100,7 +100,7 @@ async function gate(opts, id, flight, healDir) {
100
100
  // 3. apocalypse: no new critical/high, nothing protected got removed
101
101
  const fixedGraph = canonicalizeGraph(compileUBG(opts.cwd, { write: false }).graph);
102
102
  const staticFindings = checkGraph(fixedGraph).findings;
103
- let regressions = [];
103
+ let regressions;
104
104
  const baselinePath = path.join(healDir, 'baseline.json');
105
105
  if (fs.existsSync(baselinePath)) {
106
106
  const baseline = JSON.parse(fs.readFileSync(baselinePath, 'utf8'));
@@ -277,7 +277,7 @@ export async function runSeed(opts, args) {
277
277
  if (opts.germinate) {
278
278
  const { buildGrammar } = await import('./grammar.js');
279
279
  const { twinFilePath } = await import('./twin.js');
280
- let exemplars = null;
280
+ let exemplars;
281
281
  try {
282
282
  exemplars =
283
283
  JSON.parse(fs.readFileSync(twinFilePath(opts.cwd), 'utf8')).exemplars ?? null;
@@ -27,7 +27,7 @@ export function evaluateHealing(flight, replay, expectation = null) {
27
27
  reasons.push('response is byte-identical to the recorded bug — nothing changed');
28
28
  }
29
29
 
30
- let expectationMet = null;
30
+ let expectationMet;
31
31
  if (expectation) {
32
32
  expectationMet = true;
33
33
  if (expectation.status !== undefined && replay.actual.status !== expectation.status) {
@@ -80,7 +80,7 @@ export function generateExpress({ cwd, entryFile, moduleType, port, routes }) {
80
80
  const isESM = moduleType === 'esm';
81
81
  const isTS = ext === '.ts';
82
82
 
83
- let importLine = '';
83
+ let importLine;
84
84
  let reqType = '';
85
85
  let resType = '';
86
86
  let nextType = '';
@@ -42,7 +42,7 @@ export function ensureSpardaKey(cwd, prevManifest = null) {
42
42
  // state (opt-in flags + observed circuits), and the `sparding` security
43
43
  // memory survive as long as the tool's method+path are unchanged.
44
44
  export function carryOverManifest(cwd, tools) {
45
- let prev = null;
45
+ let prev;
46
46
  try {
47
47
  prev = JSON.parse(fs.readFileSync(path.join(cwd, 'sparda.json'), 'utf8'));
48
48
  } catch {
@@ -30,6 +30,7 @@ export function parseFastAPIProject(cwd, entryFile, pythonCmd = 'python') {
30
30
  } catch (err) {
31
31
  throw new Error(
32
32
  `Failed to parse Python extractor output: ${err.message}. Raw output: ${res.stdout}`,
33
+ { cause: err },
33
34
  );
34
35
  }
35
36
  }
@@ -38,6 +38,7 @@ export function extractFastAPI(cwd, entryFile, pythonCmd = 'python') {
38
38
  } catch (err) {
39
39
  throw new Error(
40
40
  `FastAPI UBG extractor returned invalid JSON: ${err.message}. Raw: ${res.stdout.slice(0, 200)}`,
41
+ { cause: err },
41
42
  );
42
43
  }
43
44
  if (payload.error) throw new Error(payload.error);
package/src/ubg/genome.js CHANGED
@@ -134,7 +134,7 @@ export function verifyAntibody(ab) {
134
134
  const id = `${ANTIBODY_VERSION}_${sha256(body).slice(0, 32)}`;
135
135
  if (id !== ab.id) return { ok: false, reason: 'content-address' };
136
136
  // signature: Ed25519 over the same claim bytes the id commits to.
137
- let sigOk = false;
137
+ let sigOk;
138
138
  try {
139
139
  sigOk = crypto.verify(
140
140
  null,