ucn 5.4.2 → 5.5.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 +58 -236
- package/.claude/skills/ucn/references/commands.md +144 -68
- package/.claude/skills/ucn/references/resolution-rules.md +171 -0
- package/.claude/skills/ucn/references/trust-contract.md +27 -33
- package/README.md +27 -16
- package/cli/index.js +45 -14
- package/core/accessors.js +118 -3
- package/core/account.js +62 -11
- package/core/analysis.js +517 -266
- package/core/ast-analysis.js +76 -117
- package/core/async-producers.js +1729 -0
- package/core/bridge.js +1877 -268
- package/core/brief.js +6 -0
- package/core/build-worker.js +78 -14
- package/core/cache.js +529 -31
- package/core/callers.js +12228 -921
- package/core/check.js +30 -38
- package/core/class-identity.js +1028 -0
- package/core/command-contracts.js +6 -6
- package/core/configuration-items.js +86 -0
- package/core/contract-membership.js +2262 -0
- package/core/cpp-scope.js +532 -0
- package/core/deadcode.js +171 -49
- package/core/decorator-binding.js +260 -0
- package/core/discovery.js +281 -164
- package/core/errors.js +52 -0
- package/core/execute.js +21 -9
- package/core/external-macros.js +326 -0
- package/core/graph-build.js +277 -8
- package/core/graph.js +35 -2
- package/core/ignore-rules.js +472 -0
- package/core/imports.js +504 -42
- package/core/index-ir.js +94 -11
- package/core/inprocess-clients.js +636 -0
- package/core/ir.js +87 -8
- package/core/macro-expansion.js +1416 -0
- package/core/output/analysis.js +18 -2
- package/core/output/brief.js +3 -0
- package/core/output/doctor.js +4 -0
- package/core/output/endpoints.js +15 -6
- package/core/output/find.js +7 -2
- package/core/output/refactoring.js +121 -14
- package/core/output/reporting.js +31 -3
- package/core/output/shared.js +14 -0
- package/core/output-budget.js +305 -122
- package/core/parallel-build.js +124 -47
- package/core/parser.js +3 -2
- package/core/project.js +472 -66
- package/core/provenance-facts.js +156 -12
- package/core/provenance-overload.js +30 -3
- package/core/provenance.js +104 -30
- package/core/pytest-fixtures.js +434 -0
- package/core/python-fixture-flow.js +17 -3
- package/core/python-modules.js +173 -0
- package/core/reflection.js +877 -0
- package/core/registry.js +1 -1
- package/core/reporting.js +234 -52
- package/core/request-helpers.js +561 -0
- package/core/route-graph.js +1922 -0
- package/core/route-lists.js +2414 -0
- package/core/rust-macro-expansion.js +3026 -0
- package/core/rust-modules.js +203 -0
- package/core/search.js +121 -29
- package/core/shared.js +19 -1
- package/core/test-name-bindings.js +256 -0
- package/core/type-denotation.js +1185 -0
- package/core/type-references.js +3229 -0
- package/core/verify.js +3360 -672
- package/languages/adapter.js +31 -5
- package/languages/c-family.js +4061 -212
- package/languages/c-macro-invocations.js +380 -0
- package/languages/c-preprocessor.js +254 -0
- package/languages/csharp.js +1406 -49
- package/languages/go.js +1243 -70
- package/languages/index.js +728 -6
- package/languages/java.js +473 -61
- package/languages/javascript.js +1270 -197
- package/languages/lexical-scope.js +1280 -0
- package/languages/python.js +1557 -72
- package/languages/rust-macro-rules.js +1020 -0
- package/languages/rust-value-flow.js +416 -0
- package/languages/rust.js +2265 -112
- package/languages/utils.js +298 -4
- package/mcp/server.js +22 -8
- package/package.json +1 -1
package/languages/adapter.js
CHANGED
|
@@ -19,6 +19,7 @@ const OPTIONAL_HELPERS = Object.freeze([
|
|
|
19
19
|
'findMacros',
|
|
20
20
|
'findCallbackUsages',
|
|
21
21
|
'findInstanceAttributeTypes',
|
|
22
|
+
'findClassFieldFacts',
|
|
22
23
|
'findReExports',
|
|
23
24
|
'extractScriptBlocks',
|
|
24
25
|
'buildVirtualJSContent',
|
|
@@ -28,8 +29,11 @@ const OPTIONAL_HELPERS = Object.freeze([
|
|
|
28
29
|
'getBuiltinFieldType',
|
|
29
30
|
'findPytestFunctions',
|
|
30
31
|
'findPythonModuleEvidence',
|
|
32
|
+
'findScopeAlternativeBindings',
|
|
31
33
|
'isPlatformConcreteCall',
|
|
32
34
|
'isPlatformConcreteType',
|
|
35
|
+
'queryTree',
|
|
36
|
+
'queryTreeIsPlain',
|
|
33
37
|
]);
|
|
34
38
|
|
|
35
39
|
function adapterCapabilities(languageModule) {
|
|
@@ -70,8 +74,11 @@ function createLanguageAdapter(config) {
|
|
|
70
74
|
parse(code, parser) {
|
|
71
75
|
return languageModule.parse(code, parser);
|
|
72
76
|
},
|
|
73
|
-
findCalls(code, parser) {
|
|
74
|
-
|
|
77
|
+
findCalls(code, parser, options) {
|
|
78
|
+
// Options carry what the build passes too (Go import names, fix
|
|
79
|
+
// #400): a query-time re-read must see the same file.
|
|
80
|
+
return options ? languageModule.findCallsInCode(code, parser, options)
|
|
81
|
+
: languageModule.findCallsInCode(code, parser);
|
|
75
82
|
},
|
|
76
83
|
findImports(code, parser) {
|
|
77
84
|
return languageModule.findImportsInCode(code, parser);
|
|
@@ -79,8 +86,12 @@ function createLanguageAdapter(config) {
|
|
|
79
86
|
findExports(code, parser) {
|
|
80
87
|
return languageModule.findExportsInCode(code, parser);
|
|
81
88
|
},
|
|
82
|
-
findUsages(code, name, parser, tree) {
|
|
83
|
-
|
|
89
|
+
findUsages(code, name, parser, tree, options) {
|
|
90
|
+
// Only the lexical-scope request (fix #392) reaches the parser;
|
|
91
|
+
// other query options keep the adapter's historical behavior.
|
|
92
|
+
return options?.lexicalScopes
|
|
93
|
+
? languageModule.findUsagesInCode(code, name, parser, tree, { lexicalScopes: true })
|
|
94
|
+
: languageModule.findUsagesInCode(code, name, parser, tree);
|
|
84
95
|
},
|
|
85
96
|
getEntryPointKind(symbol) {
|
|
86
97
|
return languageModule.getEntryPointKind(symbol);
|
|
@@ -88,7 +99,7 @@ function createLanguageAdapter(config) {
|
|
|
88
99
|
isEntryPoint(symbol) {
|
|
89
100
|
return languageModule.isEntryPoint(symbol);
|
|
90
101
|
},
|
|
91
|
-
analyze(code, parser, file = null) {
|
|
102
|
+
analyze(code, parser, file = null, analyzeOptions = {}) {
|
|
92
103
|
// Full-file indexing consumes immutable records, not native ASTs.
|
|
93
104
|
// Parsers with a heavier internal recovery cache (notably C/C++)
|
|
94
105
|
// may release analysis-only trees as soon as those records have
|
|
@@ -96,6 +107,9 @@ function createLanguageAdapter(config) {
|
|
|
96
107
|
// retain their bounded cross-operation cache.
|
|
97
108
|
const parsed = languageModule.parse(code, parser, {
|
|
98
109
|
releaseAnalysisTree: true,
|
|
110
|
+
// Macro definitions the file's include closure supplies
|
|
111
|
+
// (C/C++ recovery, fix #396).
|
|
112
|
+
...(analyzeOptions.externalMacros && { externalMacros: analyzeOptions.externalMacros }),
|
|
99
113
|
});
|
|
100
114
|
const parseProvidesFacts = !!languageModule.parseProvidesAnalysisFacts;
|
|
101
115
|
const imports = parseProvidesFacts
|
|
@@ -115,6 +129,18 @@ function createLanguageAdapter(config) {
|
|
|
115
129
|
const calls = parseProvidesFacts && Array.isArray(parsed.calls)
|
|
116
130
|
? parsed.calls
|
|
117
131
|
: languageModule.findCallsInCode(code, parser, callOptions);
|
|
132
|
+
// Reflective member accesses (fix #363), from the same parse:
|
|
133
|
+
// safeParse returns the tree the extractors above just built.
|
|
134
|
+
if (config.traits?.reflectionApi && !parsed.reflectionSites) {
|
|
135
|
+
const { safeParse } = require('./index');
|
|
136
|
+
const { reflectionSitesInTree } = require('../core/reflection');
|
|
137
|
+
// A language reading the file through its own view (C#
|
|
138
|
+
// conditional compilation, fix #391) supplies that tree.
|
|
139
|
+
const analysisTree = typeof languageModule.analysisTree === 'function'
|
|
140
|
+
? languageModule.analysisTree(code, parser) : safeParse(parser, code);
|
|
141
|
+
const sites = reflectionSitesInTree(analysisTree, config.name, code);
|
|
142
|
+
if (sites.length > 0) parsed.reflectionSites = sites;
|
|
143
|
+
}
|
|
118
144
|
return createFileIR({
|
|
119
145
|
language: config.name,
|
|
120
146
|
file,
|