@ngockhoale/ukit 3.5.3 → 3.5.5
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/CHANGELOG.md +36 -0
- package/manifests/documentation.yaml +12 -1
- package/manifests/platform.full.yaml +12 -0
- package/package.json +29 -2
- package/src/cli/commands/doctor.js +41 -0
- package/src/cli/commands/indexTools.js +10 -4
- package/src/cli/commands/memory.js +88 -6
- package/src/core/memory/episodes.js +106 -7
- package/src/core/memory/memoryCheck.js +241 -0
- package/src/core/memory/memoryCheckRun.js +39 -0
- package/src/core/memory/memoryHit.js +31 -15
- package/src/core/memory/mutateMemory.js +37 -1
- package/src/core/memory/observations.js +192 -0
- package/src/core/memory/recallEngine.js +159 -10
- package/src/core/memory/recallLanes.js +182 -0
- package/src/core/memory/records.js +23 -0
- package/src/core/memory/retrieval.js +13 -1
- package/src/core/memory/topicCommand.js +75 -0
- package/src/core/memory/topicPages.js +545 -0
- package/src/core/memory/writeGate.js +137 -0
- package/src/core/runtimeConfig.js +56 -1
- package/src/decision/registry.js +17 -0
- package/src/index/buildIndex.js +312 -5
- package/src/index/languageTools.js +100 -0
- package/src/index/paths.js +4 -1
- package/src/index/queryIndex.js +356 -14
- package/src/index/resolveContext.js +1 -1
- package/template_project/.claude/hooks/edit-hint.mjs +64 -17
- package/template_project/.claude/hooks/session-episode-start.mjs +35 -0
- package/template_project/.claude/hooks/session-episode.sh +9 -4
- package/template_project/.claude/settings.json +2 -2
- package/template_project/.claude/ukit/index/lib/index-core.mjs +769 -18
- package/template_project/.claude/ukit/index/query-index.mjs +14 -3
- package/template_project/.claude/ukit/index/refresh-index.mjs +11 -0
- package/template_project/.claude/ukit/index/route-task.mjs +4 -1
- package/template_project/.claude/ukit/runtime/memory-check.mjs +241 -0
- package/template_project/.claude/ukit/runtime/memory-lanes.mjs +9 -2
- package/template_project/.claude/ukit/runtime/memory-recall.mjs +159 -10
- package/template_project/.claude/ukit/runtime/memory-topics.mjs +545 -0
- package/template_project/.claude/ukit/runtime/memory-validity.mjs +28 -1
- package/template_project/.claude/ukit/runtime/self-improve-trigger.mjs +212 -5
- package/template_project/.omp/hooks/pre/ukit-bridge.js +2 -1
- package/template_project/ukit/storage/config.json +21 -2
- package/manifests/instructionRules.yaml +0 -442
- package/src/core/agentRuntime/completionGate.js +0 -179
- package/src/core/agentRuntime/context.js +0 -571
- package/src/core/agentRuntime/qualityComparison.js +0 -112
- package/src/core/agentRuntime/resourcePolicy.js +0 -78
- package/src/core/agentRuntime/runtimeSupport.js +0 -255
- package/src/core/codeintel/manifest.js +0 -176
- package/src/core/experiments/deliberation.js +0 -327
- package/src/core/experiments/dynamicWorkflow.js +0 -507
- package/src/core/handoffDocValidator.js +0 -154
- package/src/core/memory/deltaOverlays.js +0 -493
- package/src/core/memory/learningCandidates.js +0 -347
- package/src/core/observability/emit/sessionBoot.js +0 -407
- package/src/core/observability/evaluation/replay.js +0 -149
- package/src/core/observability/evaluation/scorecard.js +0 -465
- package/src/core/observability/schema/compatibility.js +0 -180
- package/src/core/observability/support/renderer.js +0 -130
- package/src/core/reviewPanelAggregate.js +0 -204
- package/src/core/taskBudgetValidator.js +0 -251
- package/src/core/taskProgressGuard.js +0 -227
- package/src/decision/reviewVerdict.js +0 -339
- package/src/decision/runtimeFilter.js +0 -150
- package/src/decision/runtimeScheduler.js +0 -239
- package/src/index/contextPack.js +0 -285
- package/src/index/impactContext.js +0 -360
- package/src/index/reviewPolicy.js +0 -368
- package/src/index/sensitivePath.js +0 -21
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
import { getArtifactPath, INDEX_ARTIFACTS, isLikelyTestFilePath } from './paths.js';
|
|
5
|
-
import { loadEditGraph, neighboursOf } from '../../template_project/.claude/ukit/index/edit-graph.mjs';
|
|
6
|
-
import { classifyImpactRisk, findMirrorCounterparts } from './impactCatalog.js';
|
|
7
|
-
import { inferRelatedTestsFromArtifacts, loadRelatedTestArtifacts } from './relatedTests.js';
|
|
8
|
-
import { importsNeedAliasContext, loadImportAliasContext, resolveImportSpecifier } from './importResolution.js';
|
|
9
|
-
|
|
10
|
-
const DEFAULT_IMPACT_LIMITS = {
|
|
11
|
-
maxCallers: 8,
|
|
12
|
-
maxCallees: 8,
|
|
13
|
-
maxImporters: 8,
|
|
14
|
-
maxTests: 8,
|
|
15
|
-
maxMirrors: 4,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const RISK_TEST_RECOMMENDATIONS = {
|
|
19
|
-
'shared-index-runtime': ['tests/index/indexing.test.js', 'tests/index/taskRouting.test.js'],
|
|
20
|
-
'shared-install-runtime': ['tests/integration/installPipeline.test.js'],
|
|
21
|
-
'installed-hook-runtime': ['tests/hooks/skillRouterHook.test.js', 'tests/integration/installPipeline.test.js'],
|
|
22
|
-
'published-template-surface': ['tests/integration/packageArtifact.test.js', 'tests/integration/installPipeline.test.js'],
|
|
23
|
-
'install-manifest': ['tests/integration/packageArtifact.test.js', 'tests/integration/installPipeline.test.js'],
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
async function readArtifact(rootDir, artifactName) {
|
|
27
|
-
try {
|
|
28
|
-
const raw = await fs.readFile(getArtifactPath(path.resolve(rootDir), artifactName), 'utf8');
|
|
29
|
-
return JSON.parse(raw);
|
|
30
|
-
} catch {
|
|
31
|
-
return { items: [] };
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Returns the artifact's item rows as plain objects, dropping poisoned rows
|
|
36
|
-
// (null, undefined, primitives). Hand-corrupted or truncated `.cache/index/*.json`
|
|
37
|
-
// files can carry `items: [null]` or `items: "corrupted"` — every consumer that
|
|
38
|
-
// dereferences `item.filePath` must see only object rows.
|
|
39
|
-
function safeItems(artifact) {
|
|
40
|
-
if (!artifact || typeof artifact !== 'object' || !Array.isArray(artifact.items)) {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
return artifact.items.filter((entry) => entry && typeof entry === 'object');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function normalizePath(filePath) {
|
|
47
|
-
return String(filePath ?? '').trim().replace(/\\/g, '/').replace(/^\.\//, '');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function unique(values = []) {
|
|
51
|
-
return [...new Set(values.filter(Boolean))];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function dedupeCallers(callers = []) {
|
|
55
|
-
const byKey = new Map();
|
|
56
|
-
for (const caller of callers) {
|
|
57
|
-
const key = `${caller.filePath}\0${caller.symbol}`;
|
|
58
|
-
if (!byKey.has(key)) {
|
|
59
|
-
byKey.set(key, caller);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return [...byKey.values()];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function resolveImportTarget(fromFilePath, specifier) {
|
|
66
|
-
const from = normalizePath(fromFilePath);
|
|
67
|
-
const to = String(specifier ?? '').trim();
|
|
68
|
-
if (!from || !to || !to.startsWith('.')) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const fromDir = path.posix.dirname(from);
|
|
73
|
-
const base = path.posix.normalize(path.posix.join(fromDir, to));
|
|
74
|
-
const candidates = [
|
|
75
|
-
base,
|
|
76
|
-
`${base}.js`,
|
|
77
|
-
`${base}.mjs`,
|
|
78
|
-
`${base}.cjs`,
|
|
79
|
-
`${base}.ts`,
|
|
80
|
-
`${base}.tsx`,
|
|
81
|
-
`${base}.jsx`,
|
|
82
|
-
`${base}.vue`,
|
|
83
|
-
path.posix.join(base, 'index.js'),
|
|
84
|
-
path.posix.join(base, 'index.ts'),
|
|
85
|
-
path.posix.join(base, 'index.mjs'),
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
return unique(candidates);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export async function resolveImpactContext({
|
|
92
|
-
rootDir = process.cwd(),
|
|
93
|
-
changedFiles = [],
|
|
94
|
-
changedSymbols = [],
|
|
95
|
-
limits = {},
|
|
96
|
-
} = {}) {
|
|
97
|
-
const absoluteRoot = path.resolve(rootDir);
|
|
98
|
-
const budget = { ...DEFAULT_IMPACT_LIMITS, ...(limits ?? {}) };
|
|
99
|
-
const normalizedChangedFiles = unique(changedFiles.map(normalizePath));
|
|
100
|
-
const normalizedChangedSymbols = unique(changedSymbols.map((symbol) => String(symbol ?? '').trim()));
|
|
101
|
-
|
|
102
|
-
const [callsArtifact, importsArtifact, filesArtifact, symbolsArtifact, relatedArtifacts] = await Promise.all([
|
|
103
|
-
readArtifact(absoluteRoot, INDEX_ARTIFACTS.calls),
|
|
104
|
-
readArtifact(absoluteRoot, INDEX_ARTIFACTS.imports),
|
|
105
|
-
readArtifact(absoluteRoot, INDEX_ARTIFACTS.files),
|
|
106
|
-
readArtifact(absoluteRoot, INDEX_ARTIFACTS.symbols),
|
|
107
|
-
loadRelatedTestArtifacts({ rootDir: absoluteRoot }),
|
|
108
|
-
]);
|
|
109
|
-
const callItems = safeItems(callsArtifact);
|
|
110
|
-
const importItems = safeItems(importsArtifact);
|
|
111
|
-
const risk = classifyImpactRisk(normalizedChangedFiles);
|
|
112
|
-
const editGraph = await loadEditGraph(absoluteRoot);
|
|
113
|
-
const mirrorCounterparts = [...findMirrorCounterparts(normalizedChangedFiles)];
|
|
114
|
-
for (const changed of normalizedChangedFiles) {
|
|
115
|
-
for (const mirror of neighboursOf(editGraph, changed).mirrors) {
|
|
116
|
-
if (!mirrorCounterparts.some((m) => m.filePath === mirror.path && m.source === changed)) {
|
|
117
|
-
mirrorCounterparts.push({ filePath: mirror.path, reason: `edit-graph ${mirror.kind} mirror`, source: changed });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
mirrorCounterparts.splice(budget.maxMirrors);
|
|
122
|
-
|
|
123
|
-
const changedFileSet = new Set(normalizedChangedFiles);
|
|
124
|
-
const changedSymbolSet = new Set(normalizedChangedSymbols);
|
|
125
|
-
|
|
126
|
-
const changedRecords = callItems.filter((item) => {
|
|
127
|
-
const fileMatched = changedFileSet.has(normalizePath(item.filePath));
|
|
128
|
-
if (!fileMatched) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
if (changedSymbolSet.size === 0) {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
return changedSymbolSet.has(item.symbol);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
const callees = [];
|
|
138
|
-
for (const record of changedRecords) {
|
|
139
|
-
for (const symbol of record.calls ?? []) {
|
|
140
|
-
callees.push({ filePath: record.filePath, fromSymbol: record.symbol, symbol });
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const callers = [];
|
|
145
|
-
const callerTargets = new Set([
|
|
146
|
-
...normalizedChangedSymbols,
|
|
147
|
-
...changedRecords.map((record) => record.symbol),
|
|
148
|
-
]);
|
|
149
|
-
// Global-registered symbols (window.X / app.config.globalProperties.$X /
|
|
150
|
-
// app.component(...)) are reachable without imports, so a bare-name call is
|
|
151
|
-
// already proof for them.
|
|
152
|
-
const changedGlobalSymbols = new Set(
|
|
153
|
-
safeItems(symbolsArtifact)
|
|
154
|
-
.filter((item) => item.type === 'global' && changedFileSet.has(normalizePath(item.filePath)))
|
|
155
|
-
.map((item) => item.name),
|
|
156
|
-
);
|
|
157
|
-
const candidateCallers = [];
|
|
158
|
-
if (callerTargets.size > 0) {
|
|
159
|
-
for (const record of callItems) {
|
|
160
|
-
const matchedSymbol = (record.calls ?? []).find((name) => callerTargets.has(name));
|
|
161
|
-
if (!matchedSymbol) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (changedFileSet.has(normalizePath(record.filePath))) {
|
|
166
|
-
continue;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
candidateCallers.push({
|
|
170
|
-
filePath: record.filePath,
|
|
171
|
-
symbol: record.symbol,
|
|
172
|
-
reason: `calls ${matchedSymbol}`,
|
|
173
|
-
matchedSymbol,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const importers = [];
|
|
179
|
-
const dependencies = [];
|
|
180
|
-
// Non-relative specifiers (aliases like `@/x`, `~/x`, tsconfig paths) resolve
|
|
181
|
-
// through the same machinery the index builder uses; relative specifiers keep
|
|
182
|
-
// the candidate-list match so a changed file absent from files.json (e.g. a
|
|
183
|
-
const indexedFileSet = new Set(safeItems(filesArtifact).map((item) => item.filePath));
|
|
184
|
-
const importAliasContext = importsNeedAliasContext(importItems)
|
|
185
|
-
? await loadImportAliasContext({ rootDir: absoluteRoot }).catch(() => null)
|
|
186
|
-
: null;
|
|
187
|
-
for (const imp of importItems) {
|
|
188
|
-
const from = normalizePath(imp.from);
|
|
189
|
-
const specifier = String(imp.to ?? '').trim();
|
|
190
|
-
const targets = specifier.startsWith('.')
|
|
191
|
-
? resolveImportTarget(from, specifier)
|
|
192
|
-
: [resolveImportSpecifier({
|
|
193
|
-
rootDir: absoluteRoot,
|
|
194
|
-
fromFilePath: from,
|
|
195
|
-
specifier,
|
|
196
|
-
indexedFileSet,
|
|
197
|
-
aliasContext: importAliasContext,
|
|
198
|
-
})].filter(Boolean);
|
|
199
|
-
const matched = targets.find((candidate) => changedFileSet.has(normalizePath(candidate)));
|
|
200
|
-
|
|
201
|
-
if (matched) {
|
|
202
|
-
importers.push(from);
|
|
203
|
-
dependencies.push(matched);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Callers only count with proof: an import edge into a changed file
|
|
208
|
-
// (directly / re-export / alias), an explicit SQL reference record, or a
|
|
209
|
-
// global-registered changed symbol. Name-only matches are reported as
|
|
210
|
-
// unverifiedImpact instead of pretending exhaustive caller knowledge.
|
|
211
|
-
const importerSet = new Set(importers);
|
|
212
|
-
const isVerifiedCaller = (entry) => importerSet.has(entry.filePath)
|
|
213
|
-
|| String(entry.filePath ?? '').toLowerCase().endsWith('.sql')
|
|
214
|
-
|| changedGlobalSymbols.has(entry.matchedSymbol);
|
|
215
|
-
// Output rows keep the historical { filePath, symbol, reason } shape.
|
|
216
|
-
const toCallerRow = ({ filePath, symbol, reason }) => ({ filePath, symbol, reason });
|
|
217
|
-
const verifiedCallers = candidateCallers.filter(isVerifiedCaller).map(toCallerRow);
|
|
218
|
-
const unverifiedImpact = unique(
|
|
219
|
-
candidateCallers
|
|
220
|
-
.filter((entry) => !isVerifiedCaller(entry))
|
|
221
|
-
.map((entry) => entry.filePath),
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
const candidateFiles = unique([
|
|
225
|
-
...normalizedChangedFiles,
|
|
226
|
-
...importers,
|
|
227
|
-
...verifiedCallers.map((item) => item.filePath),
|
|
228
|
-
...mirrorCounterparts.map((item) => item.filePath),
|
|
229
|
-
]);
|
|
230
|
-
const relatedTestsFromArtifacts = inferRelatedTestsFromArtifacts({
|
|
231
|
-
candidateFiles,
|
|
232
|
-
analogsMap: relatedArtifacts.analogsMap,
|
|
233
|
-
relationsMap: relatedArtifacts.relationsMap,
|
|
234
|
-
limit: budget.maxTests,
|
|
235
|
-
}).map((entry) => entry.filePath);
|
|
236
|
-
// Importer test files are related tests by definition: they import the
|
|
237
|
-
// changed file and live under a test directory.
|
|
238
|
-
const importerTestFiles = importers.filter((filePath) => isLikelyTestFilePath(filePath));
|
|
239
|
-
const relatedTests = unique([...importerTestFiles, ...relatedTestsFromArtifacts]);
|
|
240
|
-
|
|
241
|
-
const recommendedTestFiles = unique([
|
|
242
|
-
...relatedTests,
|
|
243
|
-
...risk.riskLabels.flatMap((label) => RISK_TEST_RECOMMENDATIONS[label] ?? []),
|
|
244
|
-
]);
|
|
245
|
-
|
|
246
|
-
// Stale-entry guard: a renamed/deleted file must not surface as impact.
|
|
247
|
-
// Only the capped output lists are stat-checked, so the cost stays bounded.
|
|
248
|
-
const existingRelatedTests = await filterExistingPaths(absoluteRoot, relatedTests);
|
|
249
|
-
const dedupedCallers = await filterExistingCallers(absoluteRoot, dedupeCallers(verifiedCallers));
|
|
250
|
-
const existingImporters = await filterExistingPaths(absoluteRoot, unique(importers));
|
|
251
|
-
const existingUnverifiedImpact = await filterExistingPaths(absoluteRoot, unverifiedImpact);
|
|
252
|
-
|
|
253
|
-
const dedupedCallerList = dedupedCallers.slice(0, budget.maxCallers);
|
|
254
|
-
const importerList = existingImporters.slice(0, budget.maxImporters);
|
|
255
|
-
const calleeList = unique(callees.map((item) => JSON.stringify(item))).map((value) => JSON.parse(value));
|
|
256
|
-
const relatedTestList = existingRelatedTests.slice(0, budget.maxTests);
|
|
257
|
-
const unverifiedList = existingUnverifiedImpact.slice(0, budget.maxCallers);
|
|
258
|
-
|
|
259
|
-
return {
|
|
260
|
-
changedFiles: normalizedChangedFiles,
|
|
261
|
-
changedSymbols: normalizedChangedSymbols,
|
|
262
|
-
riskLabels: risk.riskLabels,
|
|
263
|
-
requiresImpactCheck: risk.requiresImpactCheck,
|
|
264
|
-
callees: calleeList.slice(0, budget.maxCallees),
|
|
265
|
-
callers: dedupedCallerList,
|
|
266
|
-
importers: importerList,
|
|
267
|
-
dependencies: unique(dependencies).slice(0, budget.maxImporters),
|
|
268
|
-
mirrorCounterparts,
|
|
269
|
-
relatedTests: relatedTestList,
|
|
270
|
-
recommendedTestFiles,
|
|
271
|
-
unverifiedImpact: unverifiedList,
|
|
272
|
-
truncated: {
|
|
273
|
-
callers: Math.max(dedupedCallers.length - dedupedCallerList.length, 0),
|
|
274
|
-
importers: Math.max(existingImporters.length - importerList.length, 0),
|
|
275
|
-
callees: Math.max(calleeList.length - budget.maxCallees, 0),
|
|
276
|
-
relatedTests: Math.max(existingRelatedTests.length - relatedTestList.length, 0),
|
|
277
|
-
unverifiedImpact: Math.max(existingUnverifiedImpact.length - unverifiedList.length, 0),
|
|
278
|
-
},
|
|
279
|
-
explanations: {
|
|
280
|
-
callees: changedRecords.map((record) => `${record.filePath}:${record.symbol}`),
|
|
281
|
-
callers: dedupedCallerList.map((entry) => `${entry.filePath}:${entry.symbol}`),
|
|
282
|
-
importers,
|
|
283
|
-
relatedTests,
|
|
284
|
-
mirrorCounterparts: mirrorCounterparts.map((entry) => `${entry.source} -> ${entry.filePath}`),
|
|
285
|
-
unverifiedImpact: unverifiedList,
|
|
286
|
-
},
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
async function pathExists(rootDir, relativePath) {
|
|
291
|
-
try {
|
|
292
|
-
await fs.access(path.join(rootDir, relativePath));
|
|
293
|
-
return true;
|
|
294
|
-
} catch {
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
async function filterExistingPaths(rootDir, values = []) {
|
|
300
|
-
const checks = await Promise.all(values.map(async (value) => ({ value, exists: await pathExists(rootDir, value) })));
|
|
301
|
-
return checks.filter((check) => check.exists).map((check) => check.value);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
async function filterExistingCallers(rootDir, callers = []) {
|
|
305
|
-
const checks = await Promise.all(callers.map(async (entry) => ({ entry, exists: await pathExists(rootDir, entry.filePath) })));
|
|
306
|
-
return checks.filter((check) => check.exists).map((check) => check.entry);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
export function formatImpactConfidenceSummary(impact = {}) {
|
|
310
|
-
const lines = ['Impact checked:'];
|
|
311
|
-
|
|
312
|
-
if ((impact.changedFiles ?? []).length > 0) {
|
|
313
|
-
lines.push(`- Changed: ${(impact.changedFiles ?? []).slice(0, 3).join(', ')}`);
|
|
314
|
-
}
|
|
315
|
-
if ((impact.changedSymbols ?? []).length > 0) {
|
|
316
|
-
lines.push(`- Symbols: ${(impact.changedSymbols ?? []).slice(0, 5).join(', ')}`);
|
|
317
|
-
}
|
|
318
|
-
if ((impact.riskLabels ?? []).length > 0) {
|
|
319
|
-
lines.push(`- Risk: ${(impact.riskLabels ?? []).join(', ')}`);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const calleeSymbols = (impact.callees ?? []).map((item) => item?.symbol).filter(Boolean).slice(0, 5);
|
|
323
|
-
if (calleeSymbols.length > 0) {
|
|
324
|
-
lines.push(`- Callees: ${calleeSymbols.join(', ')}`);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
const callerFiles = (impact.callers ?? []).map((item) => item?.filePath).filter(Boolean).slice(0, 5);
|
|
328
|
-
if (callerFiles.length > 0) {
|
|
329
|
-
lines.push(`- Callers: ${callerFiles.join(', ')}`);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
const importers = (impact.importers ?? []).slice(0, 5);
|
|
333
|
-
if (importers.length > 0) {
|
|
334
|
-
lines.push(`- Importers: ${importers.join(', ')}`);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
const mirrors = (impact.mirrorCounterparts ?? []).map((item) => item?.filePath).filter(Boolean).slice(0, 3);
|
|
338
|
-
if (mirrors.length > 0) {
|
|
339
|
-
lines.push(`- Mirrors: ${mirrors.join(', ')}`);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const unverified = (impact.unverifiedImpact ?? []).slice(0, 3);
|
|
343
|
-
if (unverified.length > 0) {
|
|
344
|
-
lines.push(`- Unverified impact (name-only): ${unverified.join(', ')}`);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
const relatedTests = (impact.relatedTests ?? []).slice(0, 4);
|
|
348
|
-
if (relatedTests.length > 0) {
|
|
349
|
-
lines.push(`- Related tests: ${relatedTests.join(', ')}`);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
const recommendedTests = (impact.recommendedTestFiles ?? []).slice(0, 4);
|
|
353
|
-
if (recommendedTests.length > 0) {
|
|
354
|
-
lines.push(`- Recommended tests: ${recommendedTests.join(', ')}`);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return lines.join('\n');
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export { DEFAULT_IMPACT_LIMITS };
|