@sdsrs/code-graph 0.82.0 → 0.82.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.
|
@@ -285,7 +285,7 @@ function runDiagnostics() {
|
|
|
285
285
|
|
|
286
286
|
const STATUS_ICONS = { ok: '\u2705', warn: '\u26a0\ufe0f', error: '\u274c', skip: '\u2796' };
|
|
287
287
|
|
|
288
|
-
function formatReport(results) {
|
|
288
|
+
function formatReport(results, { checkOnly = false } = {}) {
|
|
289
289
|
const pluginVersion = getPluginVersion();
|
|
290
290
|
const lines = [`\ud83d\udd0d code-graph doctor v${pluginVersion}`, ''];
|
|
291
291
|
|
|
@@ -302,7 +302,15 @@ function formatReport(results) {
|
|
|
302
302
|
lines.push(' All checks passed.');
|
|
303
303
|
} else {
|
|
304
304
|
const fixable = issues.filter(r => r.fixId);
|
|
305
|
-
|
|
305
|
+
// `--check-only` is read-only (it never reaches runRepairs), so it must not
|
|
306
|
+
// claim "Fixing..." — that contradicts the documented contract and alarms
|
|
307
|
+
// the user into thinking their settings.json/MEMORY.md was just rewritten.
|
|
308
|
+
const suffix = fixable.length === 0
|
|
309
|
+
? ''
|
|
310
|
+
: checkOnly
|
|
311
|
+
? ' Run without --check-only to fix.'
|
|
312
|
+
: ' Fixing...';
|
|
313
|
+
lines.push(` ${issues.length} issue(s) found.${suffix}`);
|
|
306
314
|
}
|
|
307
315
|
|
|
308
316
|
return lines.join('\n');
|
|
@@ -526,7 +534,7 @@ function runRepairs(results) {
|
|
|
526
534
|
|
|
527
535
|
function runDoctor(opts = {}) {
|
|
528
536
|
const results = runDiagnostics();
|
|
529
|
-
console.log(formatReport(results));
|
|
537
|
+
console.log(formatReport(results, { checkOnly: opts.checkOnly }));
|
|
530
538
|
|
|
531
539
|
const issues = results.filter(r => r.status === 'warn' || r.status === 'error');
|
|
532
540
|
|
|
@@ -48,6 +48,22 @@ test('formatReport shows issue count when problems exist', () => {
|
|
|
48
48
|
assert.ok(output.includes('issue'));
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
test('formatReport: --check-only never says "Fixing..." (it does not repair)', () => {
|
|
52
|
+
const results = [
|
|
53
|
+
{ name: 'Hook coverage', status: 'warn', detail: 'missing', fixId: 'hooks' },
|
|
54
|
+
];
|
|
55
|
+
// Default (repair mode) announces the fix.
|
|
56
|
+
assert.ok(formatReport(results).includes('Fixing...'),
|
|
57
|
+
'repair mode should announce Fixing...');
|
|
58
|
+
// --check-only is read-only: it must NOT claim to fix, and should point the
|
|
59
|
+
// user at the repair command instead.
|
|
60
|
+
const checkOnly = formatReport(results, { checkOnly: true });
|
|
61
|
+
assert.ok(!checkOnly.includes('Fixing...'),
|
|
62
|
+
`--check-only must not say "Fixing..."; got: ${checkOnly}`);
|
|
63
|
+
assert.ok(checkOnly.includes('--check-only'),
|
|
64
|
+
`--check-only should hint how to fix; got: ${checkOnly}`);
|
|
65
|
+
});
|
|
66
|
+
|
|
51
67
|
test('formatReport shows all-clear when no problems', () => {
|
|
52
68
|
const results = [
|
|
53
69
|
{ name: 'Binary version', status: 'ok', detail: 'v0.7.16' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"node": ">=16"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@sdsrs/code-graph-linux-x64": "0.82.
|
|
39
|
-
"@sdsrs/code-graph-linux-arm64": "0.82.
|
|
40
|
-
"@sdsrs/code-graph-darwin-x64": "0.82.
|
|
41
|
-
"@sdsrs/code-graph-darwin-arm64": "0.82.
|
|
42
|
-
"@sdsrs/code-graph-win32-x64": "0.82.
|
|
38
|
+
"@sdsrs/code-graph-linux-x64": "0.82.1",
|
|
39
|
+
"@sdsrs/code-graph-linux-arm64": "0.82.1",
|
|
40
|
+
"@sdsrs/code-graph-darwin-x64": "0.82.1",
|
|
41
|
+
"@sdsrs/code-graph-darwin-arm64": "0.82.1",
|
|
42
|
+
"@sdsrs/code-graph-win32-x64": "0.82.1"
|
|
43
43
|
}
|
|
44
44
|
}
|