@veewo/gitnexus 1.3.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.
- package/README.md +234 -0
- package/dist/benchmark/agent-context/evaluators.d.ts +9 -0
- package/dist/benchmark/agent-context/evaluators.js +196 -0
- package/dist/benchmark/agent-context/evaluators.test.d.ts +1 -0
- package/dist/benchmark/agent-context/evaluators.test.js +39 -0
- package/dist/benchmark/agent-context/io.d.ts +2 -0
- package/dist/benchmark/agent-context/io.js +23 -0
- package/dist/benchmark/agent-context/io.test.d.ts +1 -0
- package/dist/benchmark/agent-context/io.test.js +19 -0
- package/dist/benchmark/agent-context/report.d.ts +2 -0
- package/dist/benchmark/agent-context/report.js +59 -0
- package/dist/benchmark/agent-context/report.test.d.ts +1 -0
- package/dist/benchmark/agent-context/report.test.js +85 -0
- package/dist/benchmark/agent-context/runner.d.ts +46 -0
- package/dist/benchmark/agent-context/runner.js +111 -0
- package/dist/benchmark/agent-context/runner.test.d.ts +1 -0
- package/dist/benchmark/agent-context/runner.test.js +79 -0
- package/dist/benchmark/agent-context/tool-runner.d.ts +7 -0
- package/dist/benchmark/agent-context/tool-runner.js +18 -0
- package/dist/benchmark/agent-context/tool-runner.test.d.ts +1 -0
- package/dist/benchmark/agent-context/tool-runner.test.js +11 -0
- package/dist/benchmark/agent-context/types.d.ts +40 -0
- package/dist/benchmark/agent-context/types.js +1 -0
- package/dist/benchmark/analyze-runner.d.ts +16 -0
- package/dist/benchmark/analyze-runner.js +51 -0
- package/dist/benchmark/analyze-runner.test.d.ts +1 -0
- package/dist/benchmark/analyze-runner.test.js +37 -0
- package/dist/benchmark/evaluators.d.ts +6 -0
- package/dist/benchmark/evaluators.js +10 -0
- package/dist/benchmark/evaluators.test.d.ts +1 -0
- package/dist/benchmark/evaluators.test.js +12 -0
- package/dist/benchmark/io.d.ts +7 -0
- package/dist/benchmark/io.js +25 -0
- package/dist/benchmark/io.test.d.ts +1 -0
- package/dist/benchmark/io.test.js +35 -0
- package/dist/benchmark/neonspark-candidates.d.ts +19 -0
- package/dist/benchmark/neonspark-candidates.js +94 -0
- package/dist/benchmark/neonspark-candidates.test.d.ts +1 -0
- package/dist/benchmark/neonspark-candidates.test.js +43 -0
- package/dist/benchmark/neonspark-materialize.d.ts +19 -0
- package/dist/benchmark/neonspark-materialize.js +111 -0
- package/dist/benchmark/neonspark-materialize.test.d.ts +1 -0
- package/dist/benchmark/neonspark-materialize.test.js +124 -0
- package/dist/benchmark/neonspark-sync.d.ts +3 -0
- package/dist/benchmark/neonspark-sync.js +53 -0
- package/dist/benchmark/neonspark-sync.test.d.ts +1 -0
- package/dist/benchmark/neonspark-sync.test.js +20 -0
- package/dist/benchmark/report.d.ts +1 -0
- package/dist/benchmark/report.js +7 -0
- package/dist/benchmark/runner.d.ts +48 -0
- package/dist/benchmark/runner.js +302 -0
- package/dist/benchmark/runner.test.d.ts +1 -0
- package/dist/benchmark/runner.test.js +50 -0
- package/dist/benchmark/scoring.d.ts +16 -0
- package/dist/benchmark/scoring.js +27 -0
- package/dist/benchmark/scoring.test.d.ts +1 -0
- package/dist/benchmark/scoring.test.js +24 -0
- package/dist/benchmark/tool-runner.d.ts +6 -0
- package/dist/benchmark/tool-runner.js +17 -0
- package/dist/benchmark/types.d.ts +36 -0
- package/dist/benchmark/types.js +1 -0
- package/dist/cli/ai-context.d.ts +22 -0
- package/dist/cli/ai-context.js +184 -0
- package/dist/cli/ai-context.test.d.ts +1 -0
- package/dist/cli/ai-context.test.js +30 -0
- package/dist/cli/analyze-multi-scope-regression.test.d.ts +1 -0
- package/dist/cli/analyze-multi-scope-regression.test.js +22 -0
- package/dist/cli/analyze-options.d.ts +7 -0
- package/dist/cli/analyze-options.js +56 -0
- package/dist/cli/analyze-options.test.d.ts +1 -0
- package/dist/cli/analyze-options.test.js +36 -0
- package/dist/cli/analyze.d.ts +14 -0
- package/dist/cli/analyze.js +384 -0
- package/dist/cli/augment.d.ts +13 -0
- package/dist/cli/augment.js +33 -0
- package/dist/cli/benchmark-agent-context.d.ts +29 -0
- package/dist/cli/benchmark-agent-context.js +61 -0
- package/dist/cli/benchmark-agent-context.test.d.ts +1 -0
- package/dist/cli/benchmark-agent-context.test.js +80 -0
- package/dist/cli/benchmark-unity.d.ts +15 -0
- package/dist/cli/benchmark-unity.js +31 -0
- package/dist/cli/benchmark-unity.test.d.ts +1 -0
- package/dist/cli/benchmark-unity.test.js +18 -0
- package/dist/cli/claude-hooks.d.ts +22 -0
- package/dist/cli/claude-hooks.js +97 -0
- package/dist/cli/clean.d.ts +10 -0
- package/dist/cli/clean.js +60 -0
- package/dist/cli/eval-server.d.ts +30 -0
- package/dist/cli/eval-server.js +372 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +182 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +33 -0
- package/dist/cli/mcp.d.ts +8 -0
- package/dist/cli/mcp.js +34 -0
- package/dist/cli/repo-manager-alias.test.d.ts +1 -0
- package/dist/cli/repo-manager-alias.test.js +40 -0
- package/dist/cli/scope-filter.test.d.ts +1 -0
- package/dist/cli/scope-filter.test.js +49 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +6 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +311 -0
- package/dist/cli/setup.test.d.ts +1 -0
- package/dist/cli/setup.test.js +31 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.js +27 -0
- package/dist/cli/tool.d.ts +40 -0
- package/dist/cli/tool.js +94 -0
- package/dist/cli/version.test.d.ts +1 -0
- package/dist/cli/version.test.js +19 -0
- package/dist/cli/wiki.d.ts +15 -0
- package/dist/cli/wiki.js +361 -0
- package/dist/config/ignore-service.d.ts +1 -0
- package/dist/config/ignore-service.js +210 -0
- package/dist/config/supported-languages.d.ts +12 -0
- package/dist/config/supported-languages.js +15 -0
- package/dist/core/augmentation/engine.d.ts +26 -0
- package/dist/core/augmentation/engine.js +213 -0
- package/dist/core/embeddings/embedder.d.ts +60 -0
- package/dist/core/embeddings/embedder.js +251 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +51 -0
- package/dist/core/embeddings/embedding-pipeline.js +329 -0
- package/dist/core/embeddings/index.d.ts +9 -0
- package/dist/core/embeddings/index.js +9 -0
- package/dist/core/embeddings/text-generator.d.ts +24 -0
- package/dist/core/embeddings/text-generator.js +182 -0
- package/dist/core/embeddings/types.d.ts +87 -0
- package/dist/core/embeddings/types.js +32 -0
- package/dist/core/graph/graph.d.ts +2 -0
- package/dist/core/graph/graph.js +66 -0
- package/dist/core/graph/types.d.ts +61 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/ingestion/ast-cache.d.ts +11 -0
- package/dist/core/ingestion/ast-cache.js +34 -0
- package/dist/core/ingestion/call-processor.d.ts +15 -0
- package/dist/core/ingestion/call-processor.js +327 -0
- package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
- package/dist/core/ingestion/cluster-enricher.js +170 -0
- package/dist/core/ingestion/community-processor.d.ts +39 -0
- package/dist/core/ingestion/community-processor.js +312 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +39 -0
- package/dist/core/ingestion/entry-point-scoring.js +260 -0
- package/dist/core/ingestion/filesystem-walker.d.ts +28 -0
- package/dist/core/ingestion/filesystem-walker.js +80 -0
- package/dist/core/ingestion/framework-detection.d.ts +39 -0
- package/dist/core/ingestion/framework-detection.js +235 -0
- package/dist/core/ingestion/heritage-processor.d.ts +20 -0
- package/dist/core/ingestion/heritage-processor.js +197 -0
- package/dist/core/ingestion/import-processor.d.ts +38 -0
- package/dist/core/ingestion/import-processor.js +778 -0
- package/dist/core/ingestion/parsing-processor.d.ts +15 -0
- package/dist/core/ingestion/parsing-processor.js +291 -0
- package/dist/core/ingestion/pipeline.d.ts +5 -0
- package/dist/core/ingestion/pipeline.js +323 -0
- package/dist/core/ingestion/process-processor.d.ts +51 -0
- package/dist/core/ingestion/process-processor.js +309 -0
- package/dist/core/ingestion/scope-filter.d.ts +25 -0
- package/dist/core/ingestion/scope-filter.js +100 -0
- package/dist/core/ingestion/structure-processor.d.ts +2 -0
- package/dist/core/ingestion/structure-processor.js +36 -0
- package/dist/core/ingestion/symbol-table.d.ts +33 -0
- package/dist/core/ingestion/symbol-table.js +38 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -0
- package/dist/core/ingestion/tree-sitter-queries.js +398 -0
- package/dist/core/ingestion/utils.d.ts +10 -0
- package/dist/core/ingestion/utils.js +50 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +59 -0
- package/dist/core/ingestion/workers/parse-worker.js +672 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +16 -0
- package/dist/core/ingestion/workers/worker-pool.js +120 -0
- package/dist/core/kuzu/csv-generator.d.ts +29 -0
- package/dist/core/kuzu/csv-generator.js +336 -0
- package/dist/core/kuzu/kuzu-adapter.d.ts +101 -0
- package/dist/core/kuzu/kuzu-adapter.js +753 -0
- package/dist/core/kuzu/schema.d.ts +53 -0
- package/dist/core/kuzu/schema.js +407 -0
- package/dist/core/search/bm25-index.d.ts +23 -0
- package/dist/core/search/bm25-index.js +95 -0
- package/dist/core/search/hybrid-search.d.ts +49 -0
- package/dist/core/search/hybrid-search.js +118 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +4 -0
- package/dist/core/tree-sitter/parser-loader.js +44 -0
- package/dist/core/wiki/generator.d.ts +110 -0
- package/dist/core/wiki/generator.js +786 -0
- package/dist/core/wiki/graph-queries.d.ts +80 -0
- package/dist/core/wiki/graph-queries.js +238 -0
- package/dist/core/wiki/html-viewer.d.ts +10 -0
- package/dist/core/wiki/html-viewer.js +297 -0
- package/dist/core/wiki/llm-client.d.ts +40 -0
- package/dist/core/wiki/llm-client.js +162 -0
- package/dist/core/wiki/prompts.d.ts +53 -0
- package/dist/core/wiki/prompts.js +174 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +108 -0
- package/dist/mcp/core/kuzu-adapter.d.ts +34 -0
- package/dist/mcp/core/kuzu-adapter.js +231 -0
- package/dist/mcp/local/local-backend.d.ts +160 -0
- package/dist/mcp/local/local-backend.js +1646 -0
- package/dist/mcp/resources.d.ts +31 -0
- package/dist/mcp/resources.js +407 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +251 -0
- package/dist/mcp/staleness.d.ts +15 -0
- package/dist/mcp/staleness.js +29 -0
- package/dist/mcp/tools.d.ts +24 -0
- package/dist/mcp/tools.js +195 -0
- package/dist/server/api.d.ts +10 -0
- package/dist/server/api.js +344 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +100 -0
- package/dist/storage/git.d.ts +6 -0
- package/dist/storage/git.js +32 -0
- package/dist/storage/repo-manager.d.ts +125 -0
- package/dist/storage/repo-manager.js +257 -0
- package/dist/types/pipeline.d.ts +34 -0
- package/dist/types/pipeline.js +18 -0
- package/hooks/claude/gitnexus-hook.cjs +135 -0
- package/hooks/claude/pre-tool-use.sh +78 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +92 -0
- package/skills/gitnexus-cli.md +82 -0
- package/skills/gitnexus-debugging.md +89 -0
- package/skills/gitnexus-exploring.md +78 -0
- package/skills/gitnexus-guide.md +64 -0
- package/skills/gitnexus-impact-analysis.md +97 -0
- package/skills/gitnexus-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { writeAgentContextReports } from './report.js';
|
|
7
|
+
test('writes benchmark-report.json and benchmark-summary.md with scenario breakdown', async () => {
|
|
8
|
+
const outDir = await fs.mkdtemp(path.join(os.tmpdir(), 'agent-context-report-'));
|
|
9
|
+
const result = {
|
|
10
|
+
pass: true,
|
|
11
|
+
failures: [],
|
|
12
|
+
reportDir: outDir,
|
|
13
|
+
metrics: {
|
|
14
|
+
avgCoverage: 1,
|
|
15
|
+
avgToolCalls: 3,
|
|
16
|
+
mandatoryTargetPassRate: 1,
|
|
17
|
+
},
|
|
18
|
+
scenarios: [
|
|
19
|
+
{
|
|
20
|
+
scenarioId: 'sample-refactor-context',
|
|
21
|
+
targetUid: 'Class:Sample:Target',
|
|
22
|
+
toolCalls: 3,
|
|
23
|
+
coverage: 1,
|
|
24
|
+
gatePass: true,
|
|
25
|
+
checks: [
|
|
26
|
+
{ id: 'T', pass: true },
|
|
27
|
+
{ id: 'E', pass: true },
|
|
28
|
+
],
|
|
29
|
+
stepOutputs: [],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
await writeAgentContextReports(outDir, result);
|
|
34
|
+
const jsonPath = path.join(outDir, 'benchmark-report.json');
|
|
35
|
+
const mdPath = path.join(outDir, 'benchmark-summary.md');
|
|
36
|
+
await fs.access(jsonPath);
|
|
37
|
+
await fs.access(mdPath);
|
|
38
|
+
const summary = await fs.readFile(mdPath, 'utf-8');
|
|
39
|
+
assert.match(summary, /sample-refactor-context/);
|
|
40
|
+
assert.match(summary, /coverage/i);
|
|
41
|
+
});
|
|
42
|
+
test('summary includes failure classes and triage order for failing runs', async () => {
|
|
43
|
+
const outDir = await fs.mkdtemp(path.join(os.tmpdir(), 'agent-context-report-fail-'));
|
|
44
|
+
const result = {
|
|
45
|
+
pass: false,
|
|
46
|
+
failures: ['scenario.a.coverage', 'suite.coverage'],
|
|
47
|
+
reportDir: outDir,
|
|
48
|
+
metrics: {
|
|
49
|
+
avgCoverage: 0.6,
|
|
50
|
+
avgToolCalls: 3,
|
|
51
|
+
mandatoryTargetPassRate: 1,
|
|
52
|
+
},
|
|
53
|
+
scenarios: [
|
|
54
|
+
{
|
|
55
|
+
scenarioId: 'a',
|
|
56
|
+
targetUid: 'Class:Sample:A',
|
|
57
|
+
toolCalls: 3,
|
|
58
|
+
coverage: 0.5,
|
|
59
|
+
gatePass: false,
|
|
60
|
+
checks: [
|
|
61
|
+
{ id: 'U', pass: false, detail: 'incoming refs 1 < 8' },
|
|
62
|
+
{ id: 'D', pass: false, detail: 'outgoing refs 2 < 8' },
|
|
63
|
+
],
|
|
64
|
+
stepOutputs: [],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
scenarioId: 'b',
|
|
68
|
+
targetUid: 'Class:Sample:B',
|
|
69
|
+
toolCalls: 3,
|
|
70
|
+
coverage: 0.7,
|
|
71
|
+
gatePass: false,
|
|
72
|
+
checks: [
|
|
73
|
+
{ id: 'U', pass: false, detail: 'incoming refs 2 < 6' },
|
|
74
|
+
{ id: 'I', pass: false, detail: 'internal anchors matched 0 < 2' },
|
|
75
|
+
],
|
|
76
|
+
stepOutputs: [],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
await writeAgentContextReports(outDir, result);
|
|
81
|
+
const summary = await fs.readFile(path.join(outDir, 'benchmark-summary.md'), 'utf-8');
|
|
82
|
+
assert.match(summary, /Top Failure Classes/i);
|
|
83
|
+
assert.match(summary, /Recommended Triage Order/i);
|
|
84
|
+
assert.match(summary, /U/);
|
|
85
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AgentContextCheckResult, AgentContextDataset, AgentContextToolStep } from './types.js';
|
|
2
|
+
export interface AgentContextToolRunner {
|
|
3
|
+
query: (params: any) => Promise<any>;
|
|
4
|
+
context: (params: any) => Promise<any>;
|
|
5
|
+
impact: (params: any) => Promise<any>;
|
|
6
|
+
cypher: (params: any) => Promise<any>;
|
|
7
|
+
close: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface AgentContextScenarioRun {
|
|
10
|
+
scenarioId: string;
|
|
11
|
+
targetUid: string;
|
|
12
|
+
toolCalls: number;
|
|
13
|
+
coverage: number;
|
|
14
|
+
checks: AgentContextCheckResult[];
|
|
15
|
+
gatePass: boolean;
|
|
16
|
+
stepOutputs: Array<{
|
|
17
|
+
tool: string;
|
|
18
|
+
input: Record<string, unknown>;
|
|
19
|
+
output: any;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export interface AgentContextBenchmarkResult {
|
|
23
|
+
pass: boolean;
|
|
24
|
+
failures: string[];
|
|
25
|
+
reportDir: string;
|
|
26
|
+
metrics: {
|
|
27
|
+
avgCoverage: number;
|
|
28
|
+
avgToolCalls: number;
|
|
29
|
+
mandatoryTargetPassRate: number;
|
|
30
|
+
};
|
|
31
|
+
scenarios: AgentContextScenarioRun[];
|
|
32
|
+
}
|
|
33
|
+
export interface RunAgentContextBenchmarkOptions {
|
|
34
|
+
repo?: string;
|
|
35
|
+
reportDir?: string;
|
|
36
|
+
profile?: {
|
|
37
|
+
maxScenarios: number;
|
|
38
|
+
};
|
|
39
|
+
runner?: AgentContextToolRunner;
|
|
40
|
+
}
|
|
41
|
+
export declare function executeToolPlan(plan: AgentContextToolStep[], runner: AgentContextToolRunner, repo?: string): Promise<Array<{
|
|
42
|
+
tool: string;
|
|
43
|
+
input: Record<string, unknown>;
|
|
44
|
+
output: any;
|
|
45
|
+
}>>;
|
|
46
|
+
export declare function runAgentContextBenchmark(dataset: AgentContextDataset, options: RunAgentContextBenchmarkOptions): Promise<AgentContextBenchmarkResult>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { evaluateScenarioChecks } from './evaluators.js';
|
|
3
|
+
import { createAgentContextToolRunner } from './tool-runner.js';
|
|
4
|
+
function buildToolInput(step, repo) {
|
|
5
|
+
const input = { ...step.input };
|
|
6
|
+
if (repo) {
|
|
7
|
+
input.repo = repo;
|
|
8
|
+
}
|
|
9
|
+
// LocalBackend impact contract uses `target_uid`, while dataset rows may carry `uid`.
|
|
10
|
+
if (step.tool === 'impact') {
|
|
11
|
+
const uid = input.uid;
|
|
12
|
+
if (typeof uid === 'string' && uid.trim() && !input.target_uid) {
|
|
13
|
+
input.target_uid = uid;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return input;
|
|
17
|
+
}
|
|
18
|
+
function callTool(runner, step, repo) {
|
|
19
|
+
const params = buildToolInput(step, repo);
|
|
20
|
+
if (step.tool === 'query') {
|
|
21
|
+
return runner.query(params);
|
|
22
|
+
}
|
|
23
|
+
if (step.tool === 'context') {
|
|
24
|
+
return runner.context(params);
|
|
25
|
+
}
|
|
26
|
+
if (step.tool === 'impact') {
|
|
27
|
+
return runner.impact(params);
|
|
28
|
+
}
|
|
29
|
+
return runner.cypher(params);
|
|
30
|
+
}
|
|
31
|
+
export async function executeToolPlan(plan, runner, repo) {
|
|
32
|
+
const outputs = [];
|
|
33
|
+
for (const step of plan) {
|
|
34
|
+
const input = buildToolInput(step, repo);
|
|
35
|
+
const output = await callTool(runner, step, repo);
|
|
36
|
+
outputs.push({ tool: step.tool, input, output });
|
|
37
|
+
}
|
|
38
|
+
return outputs;
|
|
39
|
+
}
|
|
40
|
+
function computeCoverage(checks) {
|
|
41
|
+
if (checks.length === 0) {
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
const passed = checks.filter((check) => check.pass).length;
|
|
45
|
+
return passed / checks.length;
|
|
46
|
+
}
|
|
47
|
+
export async function runAgentContextBenchmark(dataset, options) {
|
|
48
|
+
const reportDir = path.resolve(options.reportDir || '.gitnexus/benchmark-agent-context');
|
|
49
|
+
const scenariosToRun = options.profile?.maxScenarios && Number.isFinite(options.profile.maxScenarios)
|
|
50
|
+
? dataset.scenarios.slice(0, options.profile.maxScenarios)
|
|
51
|
+
: dataset.scenarios;
|
|
52
|
+
const runner = options.runner || (await createAgentContextToolRunner());
|
|
53
|
+
const ownsRunner = !options.runner;
|
|
54
|
+
const scenarioRuns = [];
|
|
55
|
+
const failures = [];
|
|
56
|
+
try {
|
|
57
|
+
for (const scenario of scenariosToRun) {
|
|
58
|
+
const stepOutputs = await executeToolPlan(scenario.tool_plan, runner, options.repo);
|
|
59
|
+
const checkResults = evaluateScenarioChecks(stepOutputs.map((entry) => entry.output), scenario.checks, {
|
|
60
|
+
targetUid: scenario.target_uid,
|
|
61
|
+
toolCalls: stepOutputs.length,
|
|
62
|
+
});
|
|
63
|
+
const coverage = computeCoverage(checkResults);
|
|
64
|
+
const targetCheck = checkResults.find((check) => check.id === 'T');
|
|
65
|
+
const gatePass = Boolean(targetCheck?.pass) && coverage >= dataset.thresholds.coverage.minPerScenario;
|
|
66
|
+
scenarioRuns.push({
|
|
67
|
+
scenarioId: scenario.scenario_id,
|
|
68
|
+
targetUid: scenario.target_uid,
|
|
69
|
+
toolCalls: stepOutputs.length,
|
|
70
|
+
coverage,
|
|
71
|
+
checks: checkResults,
|
|
72
|
+
gatePass,
|
|
73
|
+
stepOutputs,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
if (ownsRunner) {
|
|
79
|
+
await runner.close();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const avgCoverage = scenarioRuns.length === 0 ? 0 : scenarioRuns.reduce((acc, scenario) => acc + scenario.coverage, 0) / scenarioRuns.length;
|
|
83
|
+
const avgToolCalls = scenarioRuns.length === 0 ? 0 : scenarioRuns.reduce((acc, scenario) => acc + scenario.toolCalls, 0) / scenarioRuns.length;
|
|
84
|
+
const targetPassCount = scenarioRuns.filter((scenario) => scenario.checks.some((check) => check.id === 'T' && check.pass)).length;
|
|
85
|
+
const mandatoryTargetPassRate = scenarioRuns.length === 0 ? 0 : targetPassCount / scenarioRuns.length;
|
|
86
|
+
for (const scenario of scenarioRuns) {
|
|
87
|
+
if (!scenario.checks.some((check) => check.id === 'T' && check.pass)) {
|
|
88
|
+
failures.push(`scenario.${scenario.scenarioId}.target`);
|
|
89
|
+
}
|
|
90
|
+
if (scenario.coverage < dataset.thresholds.coverage.minPerScenario) {
|
|
91
|
+
failures.push(`scenario.${scenario.scenarioId}.coverage`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (avgCoverage < dataset.thresholds.coverage.suiteAvgMin) {
|
|
95
|
+
failures.push('suite.coverage');
|
|
96
|
+
}
|
|
97
|
+
if (avgToolCalls > dataset.thresholds.efficiency.suiteAvgMax) {
|
|
98
|
+
failures.push('suite.efficiency');
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
pass: failures.length === 0,
|
|
102
|
+
failures,
|
|
103
|
+
reportDir,
|
|
104
|
+
metrics: {
|
|
105
|
+
avgCoverage,
|
|
106
|
+
avgToolCalls,
|
|
107
|
+
mandatoryTargetPassRate,
|
|
108
|
+
},
|
|
109
|
+
scenarios: scenarioRuns,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { executeToolPlan, runAgentContextBenchmark } from './runner.js';
|
|
4
|
+
test('runner computes per-scenario coverage and suite averages', async () => {
|
|
5
|
+
const dataset = {
|
|
6
|
+
thresholds: {
|
|
7
|
+
coverage: { minPerScenario: 0.5, suiteAvgMin: 0.5 },
|
|
8
|
+
efficiency: { maxToolCallsPerScenario: 4, suiteAvgMax: 4 },
|
|
9
|
+
},
|
|
10
|
+
scenarios: [
|
|
11
|
+
{
|
|
12
|
+
scenario_id: 'sample-refactor-context',
|
|
13
|
+
target_uid: 'Class:Sample:Target',
|
|
14
|
+
tool_plan: [
|
|
15
|
+
{ tool: 'query', input: { query: 'Target' } },
|
|
16
|
+
{ tool: 'context', input: { uid: 'Class:Sample:Target' } },
|
|
17
|
+
{ tool: 'impact', input: { target: 'Target', direction: 'upstream' } },
|
|
18
|
+
],
|
|
19
|
+
checks: [
|
|
20
|
+
{ id: 'T', required_uid: 'Class:Sample:Target' },
|
|
21
|
+
{ id: 'U', min_incoming: 1 },
|
|
22
|
+
{ id: 'D', min_outgoing: 1 },
|
|
23
|
+
{ id: 'B', min_impacted: 1 },
|
|
24
|
+
{ id: 'I', internal_anchors: ['AddMinion'], min_internal_hits: 1 },
|
|
25
|
+
{ id: 'E', max_tool_calls: 4 },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
const fakeRunner = {
|
|
31
|
+
query: async () => ({
|
|
32
|
+
process_symbols: [{ id: 'Class:Sample:Target', name: 'Target' }],
|
|
33
|
+
definitions: [{ id: 'Method:Sample:AddMinion', name: 'AddMinion' }],
|
|
34
|
+
symbol: { uid: 'Class:Sample:Target', name: 'Target' },
|
|
35
|
+
}),
|
|
36
|
+
context: async () => ({
|
|
37
|
+
incoming: { depth_1: [{ id: 'Caller:1' }] },
|
|
38
|
+
outgoing: { depth_1: [{ id: 'Callee:1' }] },
|
|
39
|
+
symbol: { uid: 'Class:Sample:Target', name: 'Target' },
|
|
40
|
+
}),
|
|
41
|
+
impact: async () => ({
|
|
42
|
+
impactedCount: 3,
|
|
43
|
+
target: { id: 'Class:Sample:Target', name: 'Target' },
|
|
44
|
+
}),
|
|
45
|
+
cypher: async () => ({ rows: [] }),
|
|
46
|
+
close: async () => { },
|
|
47
|
+
};
|
|
48
|
+
const result = await runAgentContextBenchmark(dataset, {
|
|
49
|
+
repo: 'sample-repo',
|
|
50
|
+
runner: fakeRunner,
|
|
51
|
+
});
|
|
52
|
+
assert.ok(result.metrics.avgCoverage > 0);
|
|
53
|
+
assert.ok(result.scenarios[0].checks.length > 0);
|
|
54
|
+
});
|
|
55
|
+
test('executeToolPlan maps impact uid to target_uid for backend impact contract', async () => {
|
|
56
|
+
const calls = [];
|
|
57
|
+
const fakeRunner = {
|
|
58
|
+
query: async () => ({}),
|
|
59
|
+
context: async () => ({}),
|
|
60
|
+
impact: async (params) => {
|
|
61
|
+
calls.push(params);
|
|
62
|
+
return { impactedCount: 1 };
|
|
63
|
+
},
|
|
64
|
+
cypher: async () => ({}),
|
|
65
|
+
close: async () => { },
|
|
66
|
+
};
|
|
67
|
+
await executeToolPlan([
|
|
68
|
+
{
|
|
69
|
+
tool: 'impact',
|
|
70
|
+
input: {
|
|
71
|
+
target: 'MirrorNetMgr',
|
|
72
|
+
uid: 'Class:Assets/NEON/Code/NetworkCode/NeonMgr/MirrorNetMgr.cs:MirrorNetMgr',
|
|
73
|
+
direction: 'upstream',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
], fakeRunner, 'neonspark-v1-subset');
|
|
77
|
+
assert.equal(calls.length, 1);
|
|
78
|
+
assert.equal(calls[0].target_uid, 'Class:Assets/NEON/Code/NetworkCode/NeonMgr/MirrorNetMgr.cs:MirrorNetMgr');
|
|
79
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { closeKuzu } from '../../mcp/core/kuzu-adapter.js';
|
|
2
|
+
import { LocalBackend } from '../../mcp/local/local-backend.js';
|
|
3
|
+
export async function createAgentContextToolRunner() {
|
|
4
|
+
const backend = new LocalBackend();
|
|
5
|
+
const ok = await backend.init();
|
|
6
|
+
if (!ok) {
|
|
7
|
+
throw new Error('No indexed repositories found. Run analyze first.');
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
query: (params) => backend.callTool('query', params),
|
|
11
|
+
context: (params) => backend.callTool('context', params),
|
|
12
|
+
impact: (params) => backend.callTool('impact', params),
|
|
13
|
+
cypher: (params) => backend.callTool('cypher', params),
|
|
14
|
+
close: async () => {
|
|
15
|
+
await closeKuzu();
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createAgentContextToolRunner } from './tool-runner.js';
|
|
4
|
+
test('agent-context tool runner exposes query/context/impact/cypher', async () => {
|
|
5
|
+
const runner = await createAgentContextToolRunner();
|
|
6
|
+
assert.equal(typeof runner.query, 'function');
|
|
7
|
+
assert.equal(typeof runner.context, 'function');
|
|
8
|
+
assert.equal(typeof runner.impact, 'function');
|
|
9
|
+
assert.equal(typeof runner.cypher, 'function');
|
|
10
|
+
await runner.close();
|
|
11
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface AgentContextThresholds {
|
|
2
|
+
coverage: {
|
|
3
|
+
minPerScenario: number;
|
|
4
|
+
suiteAvgMin: number;
|
|
5
|
+
};
|
|
6
|
+
efficiency: {
|
|
7
|
+
maxToolCallsPerScenario: number;
|
|
8
|
+
suiteAvgMax: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface AgentContextToolStep {
|
|
12
|
+
tool: 'query' | 'context' | 'impact' | 'cypher';
|
|
13
|
+
input: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface AgentContextCheck {
|
|
16
|
+
id: 'T' | 'U' | 'D' | 'B' | 'I' | 'E' | string;
|
|
17
|
+
required_uid?: string;
|
|
18
|
+
forbidden_uid?: string;
|
|
19
|
+
min_incoming?: number;
|
|
20
|
+
min_outgoing?: number;
|
|
21
|
+
min_impacted?: number;
|
|
22
|
+
internal_anchors?: string[];
|
|
23
|
+
min_internal_hits?: number;
|
|
24
|
+
max_tool_calls?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface AgentContextScenario {
|
|
27
|
+
scenario_id: string;
|
|
28
|
+
target_uid: string;
|
|
29
|
+
tool_plan: AgentContextToolStep[];
|
|
30
|
+
checks: AgentContextCheck[];
|
|
31
|
+
}
|
|
32
|
+
export interface AgentContextDataset {
|
|
33
|
+
thresholds: AgentContextThresholds;
|
|
34
|
+
scenarios: AgentContextScenario[];
|
|
35
|
+
}
|
|
36
|
+
export interface AgentContextCheckResult {
|
|
37
|
+
id: string;
|
|
38
|
+
pass: boolean;
|
|
39
|
+
detail?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AnalyzeRunOptions {
|
|
2
|
+
extensions: string;
|
|
3
|
+
repoAlias?: string;
|
|
4
|
+
scopeManifest?: string;
|
|
5
|
+
scopePrefix?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function parseAnalyzeSummary(output: string): {
|
|
8
|
+
totalSeconds: number;
|
|
9
|
+
nodes: number;
|
|
10
|
+
edges: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function buildAnalyzeArgs(repoPath: string, options: AnalyzeRunOptions): string[];
|
|
13
|
+
export declare function runAnalyze(repoPath: string, options: AnalyzeRunOptions): Promise<{
|
|
14
|
+
stdout: string;
|
|
15
|
+
stderr: string;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
export function parseAnalyzeSummary(output) {
|
|
3
|
+
const timeMatch = output.match(/indexed successfully \(([\d.]+)s\)/i);
|
|
4
|
+
const graphMatch = output.match(/([\d,]+)\s+nodes\s+\|\s+([\d,]+)\s+edges/i);
|
|
5
|
+
return {
|
|
6
|
+
totalSeconds: timeMatch ? Number(timeMatch[1]) : Number.NaN,
|
|
7
|
+
nodes: graphMatch ? Number(graphMatch[1].replace(/,/g, '')) : Number.NaN,
|
|
8
|
+
edges: graphMatch ? Number(graphMatch[2].replace(/,/g, '')) : Number.NaN,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function buildAnalyzeArgs(repoPath, options) {
|
|
12
|
+
const args = [
|
|
13
|
+
'dist/cli/index.js',
|
|
14
|
+
'analyze',
|
|
15
|
+
'--force',
|
|
16
|
+
'--extensions',
|
|
17
|
+
options.extensions,
|
|
18
|
+
repoPath,
|
|
19
|
+
];
|
|
20
|
+
if (options.repoAlias) {
|
|
21
|
+
args.push('--repo-alias', options.repoAlias);
|
|
22
|
+
}
|
|
23
|
+
if (options.scopeManifest) {
|
|
24
|
+
args.push('--scope-manifest', options.scopeManifest);
|
|
25
|
+
}
|
|
26
|
+
for (const prefix of options.scopePrefix || []) {
|
|
27
|
+
args.push('--scope-prefix', prefix);
|
|
28
|
+
}
|
|
29
|
+
return args;
|
|
30
|
+
}
|
|
31
|
+
export async function runAnalyze(repoPath, options) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const child = spawn('node', buildAnalyzeArgs(repoPath, options), { cwd: process.cwd() });
|
|
34
|
+
let stdout = '';
|
|
35
|
+
let stderr = '';
|
|
36
|
+
child.stdout.on('data', (d) => {
|
|
37
|
+
stdout += d.toString();
|
|
38
|
+
});
|
|
39
|
+
child.stderr.on('data', (d) => {
|
|
40
|
+
stderr += d.toString();
|
|
41
|
+
});
|
|
42
|
+
child.on('close', (code) => {
|
|
43
|
+
if (code !== 0) {
|
|
44
|
+
reject(new Error(`analyze failed: ${code}`));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
resolve({ stdout, stderr });
|
|
48
|
+
});
|
|
49
|
+
child.on('error', reject);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { buildAnalyzeArgs, parseAnalyzeSummary } from './analyze-runner.js';
|
|
4
|
+
test('parseAnalyzeSummary extracts nodes/edges/time', () => {
|
|
5
|
+
const sample = `
|
|
6
|
+
Repository indexed successfully (42.3s)
|
|
7
|
+
51,172 nodes | 108,578 edges | 2,545 clusters | 300 flows
|
|
8
|
+
`;
|
|
9
|
+
const parsed = parseAnalyzeSummary(sample);
|
|
10
|
+
assert.equal(parsed.totalSeconds, 42.3);
|
|
11
|
+
assert.equal(parsed.nodes, 51172);
|
|
12
|
+
assert.equal(parsed.edges, 108578);
|
|
13
|
+
});
|
|
14
|
+
test('buildAnalyzeArgs forwards alias and scope options', () => {
|
|
15
|
+
const args = buildAnalyzeArgs('/repo/path', {
|
|
16
|
+
extensions: '.cs,.ts',
|
|
17
|
+
repoAlias: 'neonspark-v1-subset',
|
|
18
|
+
scopeManifest: '/tmp/scope-manifest.txt',
|
|
19
|
+
scopePrefix: ['Assets/NEON/Code', 'Packages/com.veewo.*'],
|
|
20
|
+
});
|
|
21
|
+
assert.deepEqual(args, [
|
|
22
|
+
'dist/cli/index.js',
|
|
23
|
+
'analyze',
|
|
24
|
+
'--force',
|
|
25
|
+
'--extensions',
|
|
26
|
+
'.cs,.ts',
|
|
27
|
+
'/repo/path',
|
|
28
|
+
'--repo-alias',
|
|
29
|
+
'neonspark-v1-subset',
|
|
30
|
+
'--scope-manifest',
|
|
31
|
+
'/tmp/scope-manifest.txt',
|
|
32
|
+
'--scope-prefix',
|
|
33
|
+
'Assets/NEON/Code',
|
|
34
|
+
'--scope-prefix',
|
|
35
|
+
'Packages/com.veewo.*',
|
|
36
|
+
]);
|
|
37
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function buildFailureTriage(failures) {
|
|
2
|
+
const counts = new Map();
|
|
3
|
+
for (const failure of failures) {
|
|
4
|
+
counts.set(failure.kind, (counts.get(failure.kind) || 0) + 1);
|
|
5
|
+
}
|
|
6
|
+
return [...counts.entries()]
|
|
7
|
+
.map(([kind, count]) => ({ kind, count }))
|
|
8
|
+
.sort((a, b) => b.count - a.count)
|
|
9
|
+
.slice(0, 10);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { buildFailureTriage } from './evaluators.js';
|
|
4
|
+
test('buildFailureTriage groups repeated failure classes', () => {
|
|
5
|
+
const triage = buildFailureTriage([
|
|
6
|
+
{ kind: 'ambiguous-name-wrong-hit' },
|
|
7
|
+
{ kind: 'ambiguous-name-wrong-hit' },
|
|
8
|
+
{ kind: 'impact-downstream-zero' },
|
|
9
|
+
]);
|
|
10
|
+
assert.equal(triage[0].kind, 'ambiguous-name-wrong-hit');
|
|
11
|
+
assert.equal(triage[0].count, 2);
|
|
12
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export async function loadBenchmarkDataset(root) {
|
|
4
|
+
const thresholds = JSON.parse(await fs.readFile(path.join(root, 'thresholds.json'), 'utf-8'));
|
|
5
|
+
const symbols = await readJsonl(path.join(root, 'symbols.jsonl'), ['symbol_uid', 'file_path', 'symbol_name', 'symbol_type', 'start_line', 'end_line']);
|
|
6
|
+
const relations = await readJsonl(path.join(root, 'relations.jsonl'), ['src_uid', 'edge_type', 'dst_uid', 'must_exist']);
|
|
7
|
+
const tasks = await readJsonl(path.join(root, 'tasks.jsonl'), ['tool', 'input', 'must_hit_uids', 'must_not_hit_uids']);
|
|
8
|
+
return { thresholds, symbols, relations, tasks };
|
|
9
|
+
}
|
|
10
|
+
async function readJsonl(file, required) {
|
|
11
|
+
const raw = await fs.readFile(file, 'utf-8');
|
|
12
|
+
const rows = raw
|
|
13
|
+
.split('\n')
|
|
14
|
+
.map((line) => line.trim())
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.map((line) => JSON.parse(line));
|
|
17
|
+
for (const row of rows) {
|
|
18
|
+
for (const key of required) {
|
|
19
|
+
if (!(key in row)) {
|
|
20
|
+
throw new Error(`missing required field: ${key}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return rows;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { loadBenchmarkDataset } from './io.js';
|
|
5
|
+
test('loadBenchmarkDataset parses thresholds and jsonl rows', async () => {
|
|
6
|
+
const root = path.resolve('../benchmarks/unity-baseline/v1');
|
|
7
|
+
const ds = await loadBenchmarkDataset(root);
|
|
8
|
+
assert.equal(typeof ds.thresholds.query.precisionMin, 'number');
|
|
9
|
+
assert.ok(ds.symbols.length > 0);
|
|
10
|
+
assert.ok(ds.relations.length > 0);
|
|
11
|
+
assert.ok(ds.tasks.length > 0);
|
|
12
|
+
});
|
|
13
|
+
test('loadBenchmarkDataset rejects missing required fields', async () => {
|
|
14
|
+
const badRoot = path.resolve('src/benchmark/__fixtures__/bad-dataset');
|
|
15
|
+
await assert.rejects(() => loadBenchmarkDataset(badRoot), /missing required field/i);
|
|
16
|
+
});
|
|
17
|
+
test('loadBenchmarkDataset parses neonspark-v1 dataset', async () => {
|
|
18
|
+
const root = path.resolve('../benchmarks/unity-baseline/neonspark-v1');
|
|
19
|
+
const ds = await loadBenchmarkDataset(root);
|
|
20
|
+
assert.equal(ds.symbols.length, 20);
|
|
21
|
+
assert.ok(ds.relations.length > 0);
|
|
22
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'query'));
|
|
23
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'context'));
|
|
24
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'impact'));
|
|
25
|
+
});
|
|
26
|
+
test('loadBenchmarkDataset parses neonspark-v2 dataset', async () => {
|
|
27
|
+
const root = path.resolve('../benchmarks/unity-baseline/neonspark-v2');
|
|
28
|
+
const ds = await loadBenchmarkDataset(root);
|
|
29
|
+
assert.ok(ds.symbols.length >= 40 && ds.symbols.length <= 60);
|
|
30
|
+
assert.ok(ds.relations.length > 0);
|
|
31
|
+
assert.ok(ds.tasks.length >= 24);
|
|
32
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'query'));
|
|
33
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'context'));
|
|
34
|
+
assert.ok(ds.tasks.some((t) => t.tool === 'impact'));
|
|
35
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function filterNeonsparkPaths<T extends {
|
|
2
|
+
file_path?: string;
|
|
3
|
+
}>(rows: T[]): T[];
|
|
4
|
+
export declare function toCandidateRow(row: any): {
|
|
5
|
+
symbol_uid: string;
|
|
6
|
+
file_path: string;
|
|
7
|
+
symbol_name: string;
|
|
8
|
+
symbol_type: string;
|
|
9
|
+
start_line: number;
|
|
10
|
+
end_line: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function extractCandidates(repoName: string, outFile: string): Promise<number>;
|
|
13
|
+
export interface CandidatesCliArgs {
|
|
14
|
+
repoName: string;
|
|
15
|
+
outFile: string;
|
|
16
|
+
}
|
|
17
|
+
export type ExtractCandidatesFn = (repoName: string, outFile: string) => Promise<number>;
|
|
18
|
+
export declare function parseCandidatesCliArgs(argv: string[]): CandidatesCliArgs;
|
|
19
|
+
export declare function mainCandidatesCli(argv?: string[], runExtract?: ExtractCandidatesFn): Promise<number>;
|