ucn 3.2.0 → 3.3.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.
Potentially problematic release.
This version of ucn might be problematic. Click here for more details.
- package/README.md +6 -2
- package/cli/index.js +145 -43
- package/core/imports.js +153 -4
- package/core/output.js +129 -147
- package/core/project.js +365 -122
- package/languages/go.js +21 -10
- package/languages/java.js +25 -9
- package/languages/javascript.js +56 -37
- package/languages/python.js +39 -10
- package/languages/rust.js +36 -8
- package/package.json +1 -1
- package/test/parser.test.js +967 -7
- package/test/reliability-test-prompt.md +58 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Run UCN reliability tests on 5 real-world projects. IMPORTANT: use node /Users/mihail/ucn/cli/index.js (NOT the global ucn) to test the current dev version. Use --clear-cache on every command.
|
|
2
|
+
|
|
3
|
+
First run the unit tests: node --test test/parser.test.js — should be 212 pass, 0 fail.
|
|
4
|
+
|
|
5
|
+
1. Clone these repos to /tmp/ucn-reliability-test-2/ (shallow clone --depth 1):
|
|
6
|
+
- fastify: https://github.com/fastify/fastify.git (JavaScript)
|
|
7
|
+
- httpx: https://github.com/encode/httpx.git (Python)
|
|
8
|
+
- hugo: https://github.com/gohugoio/hugo.git (Go)
|
|
9
|
+
- alacritty: https://github.com/alacritty/alacritty.git (Rust)
|
|
10
|
+
- spring-boot: https://github.com/spring-projects/spring-boot.git (Java — use spring-boot-project/spring-boot/src/main/java/org/springframework/boot only, pass that as the target path)
|
|
11
|
+
|
|
12
|
+
2. Launch 5 parallel agents (one per project). Each agent should run ALL of these commands with --clear-cache and 30s timeout:
|
|
13
|
+
|
|
14
|
+
toc, toc --detailed, find <sym1>, find <sym2>, about <sym1>,
|
|
15
|
+
context <class>, context <function>, impact <sym1>, smart <sym1>,
|
|
16
|
+
trace <sym1> --depth=2, usages <sym2>, deadcode, fn <method>,
|
|
17
|
+
imports <file>, exporters <file>, search "<term>", verify <sym1>,
|
|
18
|
+
find nonexistentXYZ (edge case), context "" (edge case)
|
|
19
|
+
|
|
20
|
+
3. Key symbols per project:
|
|
21
|
+
- fastify: route, FastifyInstance, inject, Reply, register
|
|
22
|
+
- httpx: get, Client, request, Response, __init__
|
|
23
|
+
- hugo: Build, Site, Execute, Page, New
|
|
24
|
+
- alacritty: main, update, Display, build, new
|
|
25
|
+
- spring-boot: run, SpringApplication, main, ApplicationContext, refresh
|
|
26
|
+
|
|
27
|
+
For `fn` command, specifically test class methods (Python __init__, Java overloaded methods) — these were broken before and fixed in this version.
|
|
28
|
+
|
|
29
|
+
4. Focus areas for EVERY command — check ALL of the following (AST tree-sitter reliability is the main focus):
|
|
30
|
+
- toc shows correct file/function/class counts, no crashes on large projects
|
|
31
|
+
- toc --detailed lists all symbols with line ranges, no truncation errors
|
|
32
|
+
- find returns ranked results by usage count, no duplicates
|
|
33
|
+
- about prefers lib/src/core definitions over test/example files, shows usages/callers/callees/code
|
|
34
|
+
- context <class> shows class name (not "undefined"), lists methods with signatures
|
|
35
|
+
- context <function> shows callers and callees with correct counts and weights
|
|
36
|
+
- context for non-existent symbols returns "Symbol not found" (NOT empty callers/callees)
|
|
37
|
+
- impact groups call sites by file with code context, shows argument patterns
|
|
38
|
+
- smart shows function code + inlined dependency code, overloads show ALL overload callees
|
|
39
|
+
- trace builds correct call tree with depth levels, weights, and multiplicity
|
|
40
|
+
- usages categorizes by type (definition/call/import/reference), no false positives
|
|
41
|
+
- deadcode completes within timeout, correctly excludes entry points (main, init, __init__, #[test])
|
|
42
|
+
- fn extracts correct code for BOTH top-level functions AND class methods (previously broken, now fixed)
|
|
43
|
+
- fn auto-resolves best definition (prefers lib/src over test)
|
|
44
|
+
- imports shows internal + external imports with resolved paths
|
|
45
|
+
- exporters finds importers for the file (Python relative imports work, Java package imports resolve)
|
|
46
|
+
- search returns matches with file grouping, respects project ignores
|
|
47
|
+
- verify checks call signatures, totalCalls equals valid+mismatches+uncertain (no inflated counts from filtered method calls)
|
|
48
|
+
- Edge cases: find nonexistentXYZ returns clean "not found", context "" returns usage error (no crash)
|
|
49
|
+
|
|
50
|
+
5. Each agent reports: command, status (OK/ERROR/CRASH/UNEXPECTED), notes.
|
|
51
|
+
At the end: total pass/fail, issues by severity, patterns.
|
|
52
|
+
|
|
53
|
+
6. After all agents finish, compile a cross-project summary comparing results to the previous run (which had 85/95 = 89.5% before fixes, target is 95%+ with 0 crashes). The fixes applied were:
|
|
54
|
+
- fn command now uses symbol index startLine/endLine directly (fixes class method extraction)
|
|
55
|
+
- verify totalCalls now computed as valid+mismatches+uncertain (fixes inflated counts)
|
|
56
|
+
- context returns null for undefined symbols (CLI shows "Symbol not found")
|
|
57
|
+
|
|
58
|
+
All code uses tree-sitter AST parsing — reliability and correctness of AST-based analysis is the main focus. Any crash, incorrect result, or hang is a bug.
|