ucn 5.5.1 → 5.5.2
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 +35 -9
- package/.claude/skills/ucn/references/commands.md +38 -16
- package/.claude/skills/ucn/references/resolution-rules.md +126 -20
- package/.claude/skills/ucn/references/trust-contract.md +5 -3
- package/README.md +30 -21
- package/cli/index.js +1 -1
- package/core/accessors.js +341 -54
- package/core/account.js +74 -20
- package/core/analysis.js +257 -125
- package/core/ast-analysis.js +12 -3
- package/core/brief.js +8 -4
- package/core/build-worker.js +2 -1
- package/core/cache.js +137 -6
- package/core/call-name-cache.js +134 -0
- package/core/callable-scope.js +21 -0
- package/core/callers.js +4726 -940
- package/core/check.js +22 -5
- package/core/class-identity.js +399 -12
- package/core/constructor-calls.js +831 -0
- package/core/constructor-hierarchy.js +147 -0
- package/core/constructor-protocol.js +196 -0
- package/core/contract-membership.js +346 -140
- package/core/cpp-conversion-constraints.js +123 -0
- package/core/cpp-conversion-syntax.js +216 -0
- package/core/cpp-conversions.js +414 -0
- package/core/cpp-scope.js +245 -44
- package/core/deadcode.js +35 -15
- package/core/decorator-binding.js +137 -3
- package/core/enum-reference-syntax.js +134 -0
- package/core/execute.js +17 -1
- package/core/external-macros.js +42 -10
- package/core/go-packages.js +171 -0
- package/core/graph-build.js +2 -0
- package/core/graph.js +75 -59
- package/core/ignore-rules.js +2 -1
- package/core/imports.js +145 -19
- package/core/index-ir.js +41 -4
- package/core/ir.js +27 -6
- package/core/macro-expansion.js +38 -2
- package/core/out-of-class-members.js +182 -0
- package/core/output/analysis-ext.js +4 -2
- package/core/output/analysis.js +89 -20
- package/core/output/graph.js +12 -3
- package/core/output/lines.js +4 -3
- package/core/output/public.js +1 -0
- package/core/output/reporting.js +6 -1
- package/core/output/shared.js +2 -0
- package/core/output/tracing.js +28 -22
- package/core/output-budget.js +2 -2
- package/core/parallel-build.js +52 -1
- package/core/project.js +217 -112
- package/core/provenance-constructor-base.js +161 -0
- package/core/provenance-facts.js +257 -27
- package/core/provenance-overload.js +458 -54
- package/core/provenance-type.js +487 -0
- package/core/provenance.js +234 -15
- package/core/public-command.js +17 -2
- package/core/query-bodies.js +159 -0
- package/core/reflection.js +255 -2
- package/core/rename-token-syntax.js +111 -0
- package/core/reporting.js +13 -7
- package/core/rust-macro-expansion.js +151 -19
- package/core/rust-modules.js +1 -1
- package/core/rust-names.js +607 -0
- package/core/search.js +70 -17
- package/core/shared.js +98 -1
- package/core/source-memo.js +201 -0
- package/core/text-usage-syntax.js +38 -0
- package/core/tracing.js +7 -1
- package/core/type-denotation.js +124 -37
- package/core/type-references.js +615 -246
- package/core/value-references.js +2777 -0
- package/core/verify.js +1097 -281
- package/languages/adapter.js +28 -4
- package/languages/c-family.js +1118 -164
- package/languages/constructor-bases.js +105 -0
- package/languages/cpp-platform.js +26 -0
- package/languages/cpp-site-syntax.js +83 -0
- package/languages/csharp-scope.js +439 -0
- package/languages/csharp.js +428 -68
- package/languages/go.js +385 -207
- package/languages/html.js +4 -2
- package/languages/index.js +397 -2
- package/languages/java-platform.js +226 -0
- package/languages/java-unicode.js +269 -0
- package/languages/java.js +461 -117
- package/languages/javascript.js +418 -66
- package/languages/lexical-scope.js +190 -23
- package/languages/python.js +404 -54
- package/languages/rust.js +510 -82
- package/languages/utils.js +67 -8
- package/mcp/server.js +8 -2
- package/package.json +2 -2
package/languages/adapter.js
CHANGED
|
@@ -13,6 +13,7 @@ const REQUIRED_ADAPTER_OPERATIONS = Object.freeze([
|
|
|
13
13
|
]);
|
|
14
14
|
|
|
15
15
|
const OPTIONAL_HELPERS = Object.freeze([
|
|
16
|
+
'annotatedReceiverType',
|
|
16
17
|
'findFunctions',
|
|
17
18
|
'findClasses',
|
|
18
19
|
'findStateObjects',
|
|
@@ -27,13 +28,18 @@ const OPTIONAL_HELPERS = Object.freeze([
|
|
|
27
28
|
'findTestCallRanges',
|
|
28
29
|
'getBuiltinCallReturnType',
|
|
29
30
|
'getBuiltinFieldType',
|
|
31
|
+
'getPrimitiveTypeInfo',
|
|
32
|
+
'getDerefTypeInfo',
|
|
30
33
|
'findPytestFunctions',
|
|
31
34
|
'findPythonModuleEvidence',
|
|
32
35
|
'findScopeAlternativeBindings',
|
|
33
36
|
'isPlatformConcreteCall',
|
|
34
37
|
'isPlatformConcreteType',
|
|
38
|
+
'selectorReceiverIsLocal',
|
|
35
39
|
'queryTree',
|
|
36
40
|
'queryTreeIsPlain',
|
|
41
|
+
'queryUsingDirectives',
|
|
42
|
+
'implicitBaseCallsOf',
|
|
37
43
|
]);
|
|
38
44
|
|
|
39
45
|
function adapterCapabilities(languageModule) {
|
|
@@ -87,10 +93,17 @@ function createLanguageAdapter(config) {
|
|
|
87
93
|
return languageModule.findExportsInCode(code, parser);
|
|
88
94
|
},
|
|
89
95
|
findUsages(code, name, parser, tree, options) {
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
// Account callers have already classified indexed call records.
|
|
97
|
+
// Only parsers of call-shaped macros recover calls here. Kind-only
|
|
98
|
+
// scans are a separate opt-in; other parsers keep their usual path.
|
|
99
|
+
const skipCallRecovery = options?.skipCallRecovery && config.traits?.macroInvocationSyntax === 'call';
|
|
100
|
+
const usageKindsOnly = options?.usageKindsOnly && !options.lexicalScopes && config.traits?.usageKindsOnly;
|
|
101
|
+
return options?.lexicalScopes || skipCallRecovery || usageKindsOnly
|
|
102
|
+
? languageModule.findUsagesInCode(code, name, parser, tree, {
|
|
103
|
+
...(options.lexicalScopes && { lexicalScopes: true }),
|
|
104
|
+
...(skipCallRecovery && { skipCallRecovery: true }),
|
|
105
|
+
...(usageKindsOnly && { usageKindsOnly: true }),
|
|
106
|
+
})
|
|
94
107
|
: languageModule.findUsagesInCode(code, name, parser, tree);
|
|
95
108
|
},
|
|
96
109
|
getEntryPointKind(symbol) {
|
|
@@ -105,6 +118,7 @@ function createLanguageAdapter(config) {
|
|
|
105
118
|
// may release analysis-only trees as soon as those records have
|
|
106
119
|
// been extracted. Direct parser/query calls omit this option and
|
|
107
120
|
// retain their bounded cross-operation cache.
|
|
121
|
+
require('./index').captureLiteralParse(parser, code);
|
|
108
122
|
const parsed = languageModule.parse(code, parser, {
|
|
109
123
|
releaseAnalysisTree: true,
|
|
110
124
|
// Macro definitions the file's include closure supplies
|
|
@@ -141,6 +155,16 @@ function createLanguageAdapter(config) {
|
|
|
141
155
|
const sites = reflectionSitesInTree(analysisTree, config.name, code);
|
|
142
156
|
if (sites.length > 0) parsed.reflectionSites = sites;
|
|
143
157
|
}
|
|
158
|
+
// Computed dispatch sites (`handlers[name]()`) of the literal
|
|
159
|
+
// parse the doctor's blind-spot inventory reads (fix #436): a
|
|
160
|
+
// query reads them from the index instead of parsing every file.
|
|
161
|
+
const literalTree = require('./index').takeLiteralParse();
|
|
162
|
+
if (!Array.isArray(parsed.computedDispatchSites)) {
|
|
163
|
+
const { safeParse } = require('./index');
|
|
164
|
+
const { computedDispatchSites } = require('../core/ast-analysis');
|
|
165
|
+
const tree = literalTree || (parser ? safeParse(parser, code) : null);
|
|
166
|
+
parsed.computedDispatchSites = tree ? computedDispatchSites(code, config.name, tree) : [];
|
|
167
|
+
}
|
|
144
168
|
return createFileIR({
|
|
145
169
|
language: config.name,
|
|
146
170
|
file,
|