ucn 3.8.26 → 4.0.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.
- package/.claude/skills/ucn/SKILL.md +31 -17
- package/README.md +95 -28
- package/cli/index.js +32 -7
- package/core/account.js +354 -0
- package/core/analysis.js +335 -15
- package/core/build-worker.js +21 -1
- package/core/cache.js +52 -3
- package/core/callers.js +3421 -159
- package/core/confidence.js +82 -19
- package/core/deadcode.js +211 -21
- package/core/execute.js +6 -1
- package/core/graph-build.js +45 -3
- package/core/imports.js +118 -1
- package/core/output/analysis.js +345 -83
- package/core/output/reporting.js +19 -3
- package/core/output/shared.js +33 -2
- package/core/output/tracing.js +208 -10
- package/core/project.js +19 -2
- package/core/registry.js +15 -3
- package/core/shared.js +21 -0
- package/core/tracing.js +534 -190
- package/languages/go.js +317 -6
- package/languages/index.js +79 -0
- package/languages/java.js +243 -16
- package/languages/javascript.js +357 -24
- package/languages/python.js +423 -28
- package/languages/rust.js +377 -8
- package/languages/utils.js +72 -18
- package/mcp/server.js +5 -4
- package/package.json +9 -3
- package/.github/workflows/ci.yml +0 -45
- package/.github/workflows/publish.yml +0 -79
package/mcp/server.js
CHANGED
|
@@ -261,8 +261,9 @@ server.registerTool(
|
|
|
261
261
|
exclude: z.string().optional().describe('Comma-separated patterns to exclude (e.g. "test,mock,vendor")'),
|
|
262
262
|
include_tests: z.boolean().optional().describe('Include test files in results (excluded by default)'),
|
|
263
263
|
exclude_tests: z.boolean().optional().describe('Exclude test files from results. Used by entrypoints (where tests are included by default).'),
|
|
264
|
-
include_methods: z.boolean().optional().describe('Include obj.method() calls (
|
|
265
|
-
include_uncertain: z.boolean().optional().describe('Include uncertain/
|
|
264
|
+
include_methods: z.boolean().optional().describe('Include obj.method() calls in trace/blast/smart/verify (implied for about/context/impact — method calls tiered by receiver evidence)'),
|
|
265
|
+
include_uncertain: z.boolean().optional().describe('Include uncertain matches in smart/verify (implied for about/context/impact/trace/blast/reverse_trace/affected_tests — unverified candidates always shown, tiered)'),
|
|
266
|
+
expand_unverified: z.boolean().optional().describe('blast/reverse_trace: follow unverified caller edges in the tree — downstream nodes are marked as unverified chains (possible, not confirmed, impact)'),
|
|
266
267
|
min_confidence: z.number().min(0).max(1).optional().describe('Minimum confidence threshold (0.0-1.0) to filter caller/callee edges'),
|
|
267
268
|
show_confidence: z.boolean().optional().describe('Show confidence scores per edge (default: true). Set false to hide.'),
|
|
268
269
|
hide_confidence: z.boolean().optional().describe('Hide confidence scores per edge (alias of show_confidence=false).'),
|
|
@@ -392,7 +393,6 @@ server.registerTool(
|
|
|
392
393
|
if (!ok) return te(error);
|
|
393
394
|
let aboutText = output.formatAbout(result, {
|
|
394
395
|
allHint: 'Repeat with all=true to show all.',
|
|
395
|
-
methodsHint: 'Note: obj.method() callers/callees excluded. Use include_methods=true to include them.',
|
|
396
396
|
showConfidence: ep.showConfidence !== false,
|
|
397
397
|
});
|
|
398
398
|
if (note) aboutText += '\n\n' + note;
|
|
@@ -576,7 +576,8 @@ server.registerTool(
|
|
|
576
576
|
let dcText = output.formatDeadcode(result, {
|
|
577
577
|
top: ep.top || 0,
|
|
578
578
|
decoratedHint: !ep.includeDecorated && result.excludedDecorated > 0 ? `${result.excludedDecorated} decorated/annotated symbol(s) hidden (framework-registered). Use include_decorated=true to include them.` : undefined,
|
|
579
|
-
exportedHint: !ep.includeExported && result.excludedExported > 0 ? `${result.excludedExported} exported symbol(s) excluded (all have callers). Use include_exported=true to audit them.` : undefined
|
|
579
|
+
exportedHint: !ep.includeExported && result.excludedExported > 0 ? `${result.excludedExported} exported symbol(s) excluded (all have callers). Use include_exported=true to audit them.` : undefined,
|
|
580
|
+
externalContractHint: !ep.includeExported && result.excludedExternalContract > 0 ? `${result.excludedExternalContract} symbol(s) hidden (override an out-of-tree base class — reachable via external contract, not dead). Use include_exported=true to include them.` : undefined
|
|
580
581
|
});
|
|
581
582
|
if (dcNote) dcText += '\n\n' + dcNote;
|
|
582
583
|
return tr(dcText);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ucn",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"mcpName": "io.github.mleoca/ucn",
|
|
5
5
|
"description": "Code intelligence toolkit for AI agents — extract functions, trace call chains, find callers, detect dead code without reading entire files. Works as MCP server, CLI, or agent skill. Supports JS/TS, Python, Go, Rust, Java.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
"ucn-mcp": "mcp/server.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"test": "node --test test/parser-unit.test.js test/integration.test.js test/cache.test.js test/formatter.test.js test/interactive.test.js test/feature.test.js test/regression-js.test.js test/regression-py.test.js test/regression-go.test.js test/regression-java.test.js test/regression-rust.test.js test/regression-cross.test.js test/regression-mcp.test.js test/regression-parser.test.js test/regression-commands.test.js test/regression-fixes.test.js test/regression-bugfixes.test.js test/cross-language.test.js test/accuracy.test.js test/command-coverage.test.js test/perf-optimizations.test.js test/systematic-test.js test/mcp-edge-cases.js test/parity-test.js",
|
|
12
|
+
"test": "node --test test/parser-unit.test.js test/integration.test.js test/cache.test.js test/formatter.test.js test/interactive.test.js test/feature.test.js test/regression-js.test.js test/regression-py.test.js test/regression-go.test.js test/regression-java.test.js test/regression-rust.test.js test/regression-cross.test.js test/regression-mcp.test.js test/regression-parser.test.js test/regression-commands.test.js test/regression-fixes.test.js test/regression-bugfixes.test.js test/cross-language.test.js test/accuracy.test.js test/command-coverage.test.js test/perf-optimizations.test.js test/systematic-test.js test/mcp-edge-cases.js test/conservation.test.js test/parity-test.js",
|
|
13
13
|
"benchmark:agent": "node test/agent-understanding-benchmark.js",
|
|
14
|
+
"eval:conservation": "node eval/conservation-real.js",
|
|
15
|
+
"eval:oracle": "node eval/run-oracle-eval.js",
|
|
16
|
+
"eval:deadcode": "node eval/run-deadcode-eval.js",
|
|
14
17
|
"lint": "eslint core/ cli/ mcp/ languages/"
|
|
15
18
|
},
|
|
16
19
|
"keywords": [
|
|
@@ -72,6 +75,9 @@
|
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
74
77
|
"@eslint/js": "^10.0.1",
|
|
75
|
-
"eslint": "^10.0.3"
|
|
78
|
+
"eslint": "^10.0.3",
|
|
79
|
+
"pyright": "1.1.410",
|
|
80
|
+
"ts-morph": "^28.0.0",
|
|
81
|
+
"typescript": "^6.0.3"
|
|
76
82
|
}
|
|
77
83
|
}
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
strategy:
|
|
13
|
-
matrix:
|
|
14
|
-
node-version: [18, 20, 22]
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v5
|
|
17
|
-
|
|
18
|
-
- name: Configure git identity for tests
|
|
19
|
-
run: |
|
|
20
|
-
git config --global user.email "ci@github.com"
|
|
21
|
-
git config --global user.name "CI"
|
|
22
|
-
|
|
23
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
24
|
-
uses: actions/setup-node@v5
|
|
25
|
-
with:
|
|
26
|
-
node-version: ${{ matrix.node-version }}
|
|
27
|
-
cache: npm
|
|
28
|
-
|
|
29
|
-
- name: Install dependencies
|
|
30
|
-
run: npm ci
|
|
31
|
-
|
|
32
|
-
- name: Run tests
|
|
33
|
-
run: npm test 2>&1 | tee test-output.txt
|
|
34
|
-
|
|
35
|
-
- name: Update test count badge
|
|
36
|
-
if: matrix.node-version == 22 && github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
37
|
-
run: |
|
|
38
|
-
PASS=$(grep '# pass ' test-output.txt | tail -1 | awk '{print $3}')
|
|
39
|
-
TOTAL=$(grep '# tests ' test-output.txt | tail -1 | awk '{print $3}')
|
|
40
|
-
echo "{\"schemaVersion\":1,\"label\":\"tests\",\"message\":\"${PASS}/${TOTAL} passing\",\"color\":\"brightgreen\"}" > badge.json
|
|
41
|
-
curl -s -X PATCH \
|
|
42
|
-
-H "Authorization: token ${{ secrets.GIST_TOKEN }}" \
|
|
43
|
-
-H "Accept: application/vnd.github+json" \
|
|
44
|
-
https://api.github.com/gists/0e10a790e16ab61ddd233e05645e203e \
|
|
45
|
-
-d "{\"files\":{\"ucn-tests.json\":{\"content\":$(cat badge.json | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read()))')}}}"
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags: ['v*']
|
|
6
|
-
|
|
7
|
-
permissions:
|
|
8
|
-
contents: read
|
|
9
|
-
id-token: write # Required for MCP Registry OIDC authentication
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
test:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v5
|
|
16
|
-
|
|
17
|
-
- name: Configure git identity for tests
|
|
18
|
-
run: |
|
|
19
|
-
git config --global user.email "ci@github.com"
|
|
20
|
-
git config --global user.name "CI"
|
|
21
|
-
|
|
22
|
-
- uses: actions/setup-node@v5
|
|
23
|
-
with:
|
|
24
|
-
node-version: 22
|
|
25
|
-
cache: npm
|
|
26
|
-
|
|
27
|
-
- run: npm ci
|
|
28
|
-
- run: npm test
|
|
29
|
-
|
|
30
|
-
publish-npm:
|
|
31
|
-
needs: test
|
|
32
|
-
runs-on: ubuntu-latest
|
|
33
|
-
steps:
|
|
34
|
-
- uses: actions/checkout@v5
|
|
35
|
-
|
|
36
|
-
- name: Set version from tag
|
|
37
|
-
run: |
|
|
38
|
-
VERSION="${GITHUB_REF_NAME#v}"
|
|
39
|
-
npm version "$VERSION" --no-git-tag-version
|
|
40
|
-
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" server.json
|
|
41
|
-
|
|
42
|
-
- uses: actions/setup-node@v5
|
|
43
|
-
with:
|
|
44
|
-
node-version: 22
|
|
45
|
-
registry-url: https://registry.npmjs.org
|
|
46
|
-
|
|
47
|
-
- run: npm ci
|
|
48
|
-
- run: npm publish
|
|
49
|
-
env:
|
|
50
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
51
|
-
|
|
52
|
-
publish-mcp:
|
|
53
|
-
needs: publish-npm
|
|
54
|
-
runs-on: ubuntu-latest
|
|
55
|
-
permissions:
|
|
56
|
-
contents: read
|
|
57
|
-
id-token: write
|
|
58
|
-
steps:
|
|
59
|
-
- uses: actions/checkout@v5
|
|
60
|
-
|
|
61
|
-
- name: Set version from tag
|
|
62
|
-
run: |
|
|
63
|
-
VERSION="${GITHUB_REF_NAME#v}"
|
|
64
|
-
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" server.json
|
|
65
|
-
|
|
66
|
-
- uses: actions/setup-node@v5
|
|
67
|
-
with:
|
|
68
|
-
node-version: 22
|
|
69
|
-
|
|
70
|
-
- name: Install mcp-publisher
|
|
71
|
-
run: |
|
|
72
|
-
curl -sL https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz | tar xz
|
|
73
|
-
sudo mv mcp-publisher /usr/local/bin/
|
|
74
|
-
|
|
75
|
-
- name: Authenticate with MCP Registry via OIDC
|
|
76
|
-
run: mcp-publisher login github-oidc
|
|
77
|
-
|
|
78
|
-
- name: Publish to MCP Registry
|
|
79
|
-
run: mcp-publisher publish
|