ucn 5.4.2 → 5.5.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.
- 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 +18 -12
- package/cli/index.js +40 -14
- package/core/accessors.js +118 -3
- package/core/account.js +30 -0
- package/core/analysis.js +508 -264
- 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 +522 -31
- package/core/callers.js +12053 -1047
- 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 +457 -60
- 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 +2113 -0
- package/core/rust-modules.js +185 -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 +1161 -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 +2237 -115
- package/languages/utils.js +298 -4
- package/mcp/server.js +22 -8
- package/package.json +1 -1
package/core/check.js
CHANGED
|
@@ -136,12 +136,12 @@ function check(index, options = {}) {
|
|
|
136
136
|
});
|
|
137
137
|
continue;
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
139
|
+
// The base revision decides which call sites the changed
|
|
140
|
+
// declaration bound before (fix #394). An exception inside verify is
|
|
141
|
+
// an internal error, never a silently skipped check.
|
|
142
|
+
const verifyResult = index.verify(fn.name, {
|
|
143
|
+
file: filePath, line: fn.startLine, base: options.staged ? 'HEAD' : (options.base || 'HEAD'),
|
|
144
|
+
});
|
|
145
145
|
// Note: verify() returns `mismatches` as a COUNT and `mismatchDetails` as the array.
|
|
146
146
|
const mismatches = verifyResult && Array.isArray(verifyResult.mismatchDetails)
|
|
147
147
|
? verifyResult.mismatchDetails
|
|
@@ -152,22 +152,22 @@ function check(index, options = {}) {
|
|
|
152
152
|
let callers = Array.isArray(fn.callers) ? fn.callers : [];
|
|
153
153
|
let unverifiedCallers = Array.isArray(fn.unverifiedCallers) ? fn.unverifiedCallers : [];
|
|
154
154
|
let account = fn.account || null;
|
|
155
|
+
// An exception here is an internal error, never a silent orphan claim
|
|
156
|
+
// (fix #394).
|
|
155
157
|
if (callers.length === 0 && fn._kind === 'added') {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
unverifiedCallers = unverifiedCallers.concat(callNotResolvedEntries(index, account));
|
|
170
|
-
} catch (e) { /* skip */ }
|
|
158
|
+
const definitions = (index.symbols.get(fn.name) || []).filter(d =>
|
|
159
|
+
(d.relativePath === filePath || d.file === fn.filePath) &&
|
|
160
|
+
(!fn.startLine || d.startLine === fn.startLine));
|
|
161
|
+
const raw = index.findCallers(fn.name, {
|
|
162
|
+
includeMethods: true,
|
|
163
|
+
collectAccount: true,
|
|
164
|
+
targetDefinitions: definitions.length > 0 ? definitions : undefined,
|
|
165
|
+
}) || [];
|
|
166
|
+
callers = raw.filter(c => c.tier !== 'unverified');
|
|
167
|
+
unverifiedCallers = raw.filter(c => c.tier === 'unverified')
|
|
168
|
+
.concat(raw.unverifiedEntries || []);
|
|
169
|
+
account = composeAccount(index, fn.name, raw);
|
|
170
|
+
unverifiedCallers = unverifiedCallers.concat(callNotResolvedEntries(index, account));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
const item = {
|
|
@@ -189,14 +189,8 @@ function check(index, options = {}) {
|
|
|
189
189
|
// would be the exact silent-drop the contract forbids).
|
|
190
190
|
if (item.kind === 'added' && callers.length === 0 && unverifiedCallers.length === 0) {
|
|
191
191
|
// Check entry points: if the symbol is a known entry-point pattern, not orphan
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const ep = require('./entrypoints');
|
|
195
|
-
if (typeof ep.detectEntrypoints === 'function') {
|
|
196
|
-
const eps = ep.detectEntrypoints(index) || [];
|
|
197
|
-
isEntry = eps.some(e => e.name === fn.name && (e.file === filePath || e.relativePath === filePath));
|
|
198
|
-
}
|
|
199
|
-
} catch (e) { /* skip */ }
|
|
192
|
+
const eps = require('./entrypoints').detectEntrypoints(index) || [];
|
|
193
|
+
const isEntry = eps.some(e => e.name === fn.name && (e.file === filePath || e.relativePath === filePath));
|
|
200
194
|
item.orphan = !isEntry;
|
|
201
195
|
}
|
|
202
196
|
|
|
@@ -229,17 +223,15 @@ function check(index, options = {}) {
|
|
|
229
223
|
let testFiles = [];
|
|
230
224
|
let testCount = 0;
|
|
231
225
|
for (const fn of changed.slice(0, 10)) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
testCount += tf.testCount || 0;
|
|
239
|
-
}
|
|
226
|
+
const t = index.affectedTests(fn.name, { depth: 2 });
|
|
227
|
+
if (t && t.testFiles) {
|
|
228
|
+
for (const tf of t.testFiles) {
|
|
229
|
+
if (!testFiles.find(x => x.file === tf.file)) {
|
|
230
|
+
testFiles.push(tf);
|
|
231
|
+
testCount += tf.testCount || 0;
|
|
240
232
|
}
|
|
241
233
|
}
|
|
242
|
-
}
|
|
234
|
+
}
|
|
243
235
|
}
|
|
244
236
|
|
|
245
237
|
// Action items
|