@cleocode/nexus 2026.5.27 → 2026.5.29
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/dist/src/intelligence/providers/typescript.d.ts.map +1 -1
- package/dist/src/intelligence/providers/typescript.js +10 -3
- package/dist/src/intelligence/providers/typescript.js.map +1 -1
- package/dist/src/pipeline/call-processor.d.ts.map +1 -1
- package/dist/src/pipeline/call-processor.js +8 -2
- package/dist/src/pipeline/call-processor.js.map +1 -1
- package/dist/src/pipeline/community-processor.d.ts.map +1 -1
- package/dist/src/pipeline/community-processor.js +4 -1
- package/dist/src/pipeline/community-processor.js.map +1 -1
- package/dist/src/pipeline/extractors/generic-extractor.d.ts +69 -0
- package/dist/src/pipeline/extractors/generic-extractor.d.ts.map +1 -0
- package/dist/src/pipeline/extractors/generic-extractor.js +410 -0
- package/dist/src/pipeline/extractors/generic-extractor.js.map +1 -0
- package/dist/src/pipeline/extractors/java-extractor.d.ts +77 -0
- package/dist/src/pipeline/extractors/java-extractor.d.ts.map +1 -0
- package/dist/src/pipeline/extractors/java-extractor.js +290 -0
- package/dist/src/pipeline/extractors/java-extractor.js.map +1 -0
- package/dist/src/pipeline/extractors/language-config.d.ts +333 -0
- package/dist/src/pipeline/extractors/language-config.d.ts.map +1 -0
- package/dist/src/pipeline/extractors/language-config.js +21 -0
- package/dist/src/pipeline/extractors/language-config.js.map +1 -0
- package/dist/src/pipeline/extractors/typescript-extractor.d.ts.map +1 -1
- package/dist/src/pipeline/extractors/typescript-extractor.js +20 -2
- package/dist/src/pipeline/extractors/typescript-extractor.js.map +1 -1
- package/dist/src/pipeline/heritage-processor.d.ts +2 -0
- package/dist/src/pipeline/heritage-processor.d.ts.map +1 -1
- package/dist/src/pipeline/heritage-processor.js +100 -1
- package/dist/src/pipeline/heritage-processor.js.map +1 -1
- package/dist/src/pipeline/import-processor.d.ts.map +1 -1
- package/dist/src/pipeline/import-processor.js +7 -2
- package/dist/src/pipeline/import-processor.js.map +1 -1
- package/dist/src/pipeline/index.d.ts +6 -0
- package/dist/src/pipeline/index.d.ts.map +1 -1
- package/dist/src/pipeline/index.js +14 -2
- package/dist/src/pipeline/index.js.map +1 -1
- package/dist/src/pipeline/parse-loop.d.ts +6 -2
- package/dist/src/pipeline/parse-loop.d.ts.map +1 -1
- package/dist/src/pipeline/parse-loop.js +112 -8
- package/dist/src/pipeline/parse-loop.js.map +1 -1
- package/dist/src/pipeline/process-processor.d.ts.map +1 -1
- package/dist/src/pipeline/process-processor.js +7 -2
- package/dist/src/pipeline/process-processor.js.map +1 -1
- package/dist/src/pipeline/processors/access-processor.d.ts +133 -0
- package/dist/src/pipeline/processors/access-processor.d.ts.map +1 -0
- package/dist/src/pipeline/processors/access-processor.js +351 -0
- package/dist/src/pipeline/processors/access-processor.js.map +1 -0
- package/dist/src/pipeline/structure-processor.d.ts.map +1 -1
- package/dist/src/pipeline/structure-processor.js +4 -1
- package/dist/src/pipeline/structure-processor.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access processor — Phase 3f of the code intelligence ingestion pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Walks tree-sitter ASTs to detect field/property accesses and emits ACCESSES
|
|
5
|
+
* graph edges. Fills the gap identified in the T1042 audit (T1844-2): the
|
|
6
|
+
* `accesses` edge type was declared in `@cleocode/contracts` but no extractor
|
|
7
|
+
* produced it.
|
|
8
|
+
*
|
|
9
|
+
* Extraction strategy:
|
|
10
|
+
* - **Read access** (`member_expression`): Any `object.field` expression that
|
|
11
|
+
* is not the left-hand side of an assignment emits an ACCESSES edge with
|
|
12
|
+
* `accessMode: 'read'`.
|
|
13
|
+
* - **Write access** (`assignment_expression` / `assignment` whose left side
|
|
14
|
+
* is a `member_expression`): emits `accessMode: 'write'`.
|
|
15
|
+
* - **Read-write**: When the same source→target pair occurs as both read and
|
|
16
|
+
* write within the same enclosing scope, the pair is collapsed to
|
|
17
|
+
* `accessMode: 'readwrite'`.
|
|
18
|
+
*
|
|
19
|
+
* Resolution strategy follows the same tiered approach as `call-processor.ts`:
|
|
20
|
+
* - Tier 1 (same-file): target symbol defined in the same file
|
|
21
|
+
* - Tier 3 (global): target symbol found via global name lookup (exact match
|
|
22
|
+
* with single candidate only — ambiguous matches are skipped)
|
|
23
|
+
*
|
|
24
|
+
* Unresolved member names are still recorded in the {@link ExtractedAccess}
|
|
25
|
+
* record so future waves can add cross-file resolution (Tier 2a).
|
|
26
|
+
*
|
|
27
|
+
* Confidence for ACCESSES edges: 0.8 (matches the value documented in
|
|
28
|
+
* `packages/contracts/src/graph.ts`).
|
|
29
|
+
*
|
|
30
|
+
* @task T1837
|
|
31
|
+
* @module pipeline/processors/access-processor
|
|
32
|
+
*/
|
|
33
|
+
import { confidenceLabelFromNumeric } from '@cleocode/contracts';
|
|
34
|
+
import { TIER_CONFIDENCE } from '../resolution-context.js';
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Helpers
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
/** Derive a stable node ID from file path and symbol name. */
|
|
39
|
+
function makeNodeId(filePath, name) {
|
|
40
|
+
return `${filePath}::${name}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* AST node types that constitute a function/method definition boundary.
|
|
44
|
+
* Used to determine the enclosing scope for access sites.
|
|
45
|
+
*/
|
|
46
|
+
const ENCLOSING_FUNCTION_TYPES = new Set([
|
|
47
|
+
// TypeScript / JavaScript
|
|
48
|
+
'function_declaration',
|
|
49
|
+
'function_expression',
|
|
50
|
+
'arrow_function',
|
|
51
|
+
'generator_function_declaration',
|
|
52
|
+
'generator_function',
|
|
53
|
+
'method_definition',
|
|
54
|
+
// Python
|
|
55
|
+
'function_definition',
|
|
56
|
+
// Go
|
|
57
|
+
'function_declaration',
|
|
58
|
+
'method_declaration',
|
|
59
|
+
// Rust
|
|
60
|
+
'function_item',
|
|
61
|
+
]);
|
|
62
|
+
/**
|
|
63
|
+
* Build a stable source node ID for an access site.
|
|
64
|
+
*
|
|
65
|
+
* Walks up the AST to find the nearest enclosing function/method and returns
|
|
66
|
+
* its node ID (matching the format from definition extraction:
|
|
67
|
+
* `<filePath>::<qualifiedName>`). Falls back to `<filePath>::__file__` for
|
|
68
|
+
* module-level accesses.
|
|
69
|
+
*/
|
|
70
|
+
function buildSourceId(node, filePath) {
|
|
71
|
+
let current = node.parent;
|
|
72
|
+
while (current) {
|
|
73
|
+
if (ENCLOSING_FUNCTION_TYPES.has(current.type)) {
|
|
74
|
+
// method_definition (TS/JS)
|
|
75
|
+
if (current.type === 'method_definition') {
|
|
76
|
+
const nameNode = current.childForFieldName('name');
|
|
77
|
+
if (nameNode?.text) {
|
|
78
|
+
const classBody = current.parent;
|
|
79
|
+
const classDecl = classBody?.parent;
|
|
80
|
+
if (classDecl &&
|
|
81
|
+
(classDecl.type === 'class_declaration' ||
|
|
82
|
+
classDecl.type === 'abstract_class_declaration')) {
|
|
83
|
+
const classNameNode = classDecl.childForFieldName('name');
|
|
84
|
+
if (classNameNode?.text) {
|
|
85
|
+
return makeNodeId(filePath, `${classNameNode.text}.${nameNode.text}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return makeNodeId(filePath, nameNode.text);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// function_declaration / generator_function_declaration (TS/JS) or
|
|
92
|
+
// function_declaration (Go)
|
|
93
|
+
if (current.type === 'function_declaration' ||
|
|
94
|
+
current.type === 'generator_function_declaration') {
|
|
95
|
+
const nameNode = current.childForFieldName('name');
|
|
96
|
+
if (nameNode?.text) {
|
|
97
|
+
return makeNodeId(filePath, nameNode.text);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// function_expression / arrow_function (TS/JS) — look for named declarator
|
|
101
|
+
if (current.type === 'function_expression' || current.type === 'arrow_function') {
|
|
102
|
+
const parent = current.parent;
|
|
103
|
+
if (parent?.type === 'variable_declarator') {
|
|
104
|
+
const nameNode = parent.childForFieldName('name');
|
|
105
|
+
if (nameNode?.text) {
|
|
106
|
+
return makeNodeId(filePath, nameNode.text);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// function_definition (Python) or method_declaration (Go)
|
|
111
|
+
if (current.type === 'function_definition' || current.type === 'method_declaration') {
|
|
112
|
+
const nameNode = current.childForFieldName('name');
|
|
113
|
+
if (nameNode?.text) {
|
|
114
|
+
return makeNodeId(filePath, nameNode.text);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// function_item (Rust)
|
|
118
|
+
if (current.type === 'function_item') {
|
|
119
|
+
const nameNode = current.childForFieldName('name');
|
|
120
|
+
if (nameNode?.text) {
|
|
121
|
+
return makeNodeId(filePath, nameNode.text);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
current = current.parent;
|
|
126
|
+
}
|
|
127
|
+
return `${filePath}::__file__`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Determine whether a `member_expression` (or attribute access) node is the
|
|
131
|
+
* direct left-hand side of an assignment.
|
|
132
|
+
*
|
|
133
|
+
* Handles:
|
|
134
|
+
* - `assignment_expression` (TS/JS): `left = right`
|
|
135
|
+
* - `augmented_assignment_expression` (TS/JS): `left += right`
|
|
136
|
+
* - `assignment` (Python): `left = right`
|
|
137
|
+
* - `compound_assignment_expr` (Rust)
|
|
138
|
+
*
|
|
139
|
+
* Returns `true` when the node is the `left` (or `left_side`) field of one
|
|
140
|
+
* of these parent types.
|
|
141
|
+
*/
|
|
142
|
+
function isWriteTarget(node) {
|
|
143
|
+
const parent = node.parent;
|
|
144
|
+
if (!parent)
|
|
145
|
+
return false;
|
|
146
|
+
const writeParents = new Set([
|
|
147
|
+
'assignment_expression',
|
|
148
|
+
'augmented_assignment_expression',
|
|
149
|
+
'assignment',
|
|
150
|
+
'compound_assignment_expr',
|
|
151
|
+
]);
|
|
152
|
+
if (!writeParents.has(parent.type))
|
|
153
|
+
return false;
|
|
154
|
+
// Check that `node` is the left child, not the right
|
|
155
|
+
const leftNode = parent.childForFieldName('left') ??
|
|
156
|
+
parent.childForFieldName('left_side') ??
|
|
157
|
+
parent.childForFieldName('pattern');
|
|
158
|
+
if (leftNode && leftNode === node)
|
|
159
|
+
return true;
|
|
160
|
+
// For assignment nodes without a named `left` field, the first named child
|
|
161
|
+
// is conventionally the left-hand side.
|
|
162
|
+
if (!leftNode && parent.namedChild(0) === node)
|
|
163
|
+
return true;
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
// Main extraction function
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
/**
|
|
170
|
+
* Walk the full AST of a single file and collect all member-access sites.
|
|
171
|
+
*
|
|
172
|
+
* Extracted access forms:
|
|
173
|
+
* - `member_expression` (TS/JS): `object.property`
|
|
174
|
+
* - `attribute` (Python): `object.attribute`
|
|
175
|
+
* - `field_expression` (Rust): `expr.field`
|
|
176
|
+
* - `selector_expression` (Go): `expr.selector`
|
|
177
|
+
*
|
|
178
|
+
* Write accesses are detected when the member node is the left-hand side of
|
|
179
|
+
* an assignment-family node (see {@link isWriteTarget}).
|
|
180
|
+
*
|
|
181
|
+
* Consecutive read+write of the same source→target pair are collapsed to
|
|
182
|
+
* `readwrite` by {@link resolveAccesses} (deduplication happens there to keep
|
|
183
|
+
* extraction simple and fast).
|
|
184
|
+
*
|
|
185
|
+
* @param rootNode - AST root node (program, module, source_file, etc.)
|
|
186
|
+
* @param filePath - File path relative to repo root
|
|
187
|
+
* @returns Array of extracted access records
|
|
188
|
+
*/
|
|
189
|
+
export function extractAccesses(rootNode, filePath) {
|
|
190
|
+
const results = [];
|
|
191
|
+
/**
|
|
192
|
+
* Member-expression node types across all supported languages.
|
|
193
|
+
* Each value maps to a `{ object: fieldName, property: fieldName }` pair.
|
|
194
|
+
*/
|
|
195
|
+
const ACCESS_NODE_TYPES = {
|
|
196
|
+
member_expression: { object: 'object', property: 'property' },
|
|
197
|
+
attribute: { object: 'object', property: 'attribute' },
|
|
198
|
+
field_expression: { object: 'value', property: 'field' },
|
|
199
|
+
selector_expression: { object: 'operand', property: 'field' },
|
|
200
|
+
};
|
|
201
|
+
function walk(node) {
|
|
202
|
+
const spec = ACCESS_NODE_TYPES[node.type];
|
|
203
|
+
if (spec) {
|
|
204
|
+
const objNode = node.childForFieldName(spec.object);
|
|
205
|
+
const propNode = node.childForFieldName(spec.property);
|
|
206
|
+
if (propNode?.text) {
|
|
207
|
+
const memberName = propNode.text;
|
|
208
|
+
const receiverName = objNode?.type === 'identifier' || objNode?.type === 'this' ? objNode.text : undefined;
|
|
209
|
+
const accessMode = isWriteTarget(node) ? 'write' : 'read';
|
|
210
|
+
results.push({
|
|
211
|
+
filePath,
|
|
212
|
+
sourceId: buildSourceId(node, filePath),
|
|
213
|
+
memberName,
|
|
214
|
+
receiverName,
|
|
215
|
+
accessMode,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Recurse into all children
|
|
220
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
221
|
+
const child = node.namedChild(i);
|
|
222
|
+
if (child)
|
|
223
|
+
walk(child);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
walk(rootNode);
|
|
227
|
+
return results;
|
|
228
|
+
}
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// Resolution (emit ACCESSES graph edges)
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
/**
|
|
233
|
+
* Deduplicate extracted access records.
|
|
234
|
+
*
|
|
235
|
+
* When the same `sourceId → memberName` pair appears with both `'read'` and
|
|
236
|
+
* `'write'` access modes, collapse them into a single `'readwrite'` record.
|
|
237
|
+
* Keeps the first occurrence's `receiverName` for the merged record.
|
|
238
|
+
*/
|
|
239
|
+
function deduplicateAccesses(accesses) {
|
|
240
|
+
/** Key: `${sourceId}::${memberName}` */
|
|
241
|
+
const seen = new Map();
|
|
242
|
+
for (const acc of accesses) {
|
|
243
|
+
const key = `${acc.sourceId}::${acc.memberName}`;
|
|
244
|
+
const existing = seen.get(key);
|
|
245
|
+
if (!existing) {
|
|
246
|
+
seen.set(key, {
|
|
247
|
+
access: { ...acc },
|
|
248
|
+
hasRead: acc.accessMode === 'read',
|
|
249
|
+
hasWrite: acc.accessMode === 'write',
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
if (acc.accessMode === 'read')
|
|
254
|
+
existing.hasRead = true;
|
|
255
|
+
if (acc.accessMode === 'write')
|
|
256
|
+
existing.hasWrite = true;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const result = [];
|
|
260
|
+
for (const { access, hasRead, hasWrite } of seen.values()) {
|
|
261
|
+
if (hasRead && hasWrite) {
|
|
262
|
+
result.push({ ...access, accessMode: 'readwrite' });
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
result.push(access);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Attempt to resolve a single extracted access record to a target node ID.
|
|
272
|
+
*
|
|
273
|
+
* Resolution order:
|
|
274
|
+
* 1. Tier 1 — same-file exact lookup (`symbolTable.lookupExact`)
|
|
275
|
+
* 3. Tier 3 — global callable fallback (`symbolTable.lookupCallableByName`),
|
|
276
|
+
* only when exactly one candidate exists
|
|
277
|
+
*
|
|
278
|
+
* Returns `null` when neither tier resolves the name.
|
|
279
|
+
*/
|
|
280
|
+
function resolveSingleAccess(access, symbolTable) {
|
|
281
|
+
const { filePath, memberName } = access;
|
|
282
|
+
// Tier 1: same-file (capped at 0.8 — accesses have inherent indirection)
|
|
283
|
+
const tier1Id = symbolTable.lookupExact(filePath, memberName);
|
|
284
|
+
if (tier1Id) {
|
|
285
|
+
return {
|
|
286
|
+
nodeId: tier1Id,
|
|
287
|
+
confidence: Math.min(TIER_CONFIDENCE['same-file'], 0.8),
|
|
288
|
+
tier: 'same-file',
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
// Tier 3: global (single candidate only — skip ambiguous)
|
|
292
|
+
const candidates = symbolTable.lookupCallableByName(memberName);
|
|
293
|
+
if (candidates.length === 1) {
|
|
294
|
+
const candidate = candidates[0];
|
|
295
|
+
return {
|
|
296
|
+
nodeId: candidate.nodeId,
|
|
297
|
+
confidence: Math.min(TIER_CONFIDENCE.global, 0.8),
|
|
298
|
+
tier: 'global',
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Resolve all extracted access sites and emit ACCESSES edges into the graph.
|
|
305
|
+
*
|
|
306
|
+
* Must be called **after all files are parsed** so the SymbolTable is fully
|
|
307
|
+
* populated. Access records are first deduplicated (read+write pairs of the
|
|
308
|
+
* same source→target are collapsed to `'readwrite'`) before resolution.
|
|
309
|
+
*
|
|
310
|
+
* @param accesses - All access records accumulated during the parse loop
|
|
311
|
+
* @param graph - KnowledgeGraph to write ACCESSES edges into
|
|
312
|
+
* @param symbolTable - Fully-populated SymbolTable (all files parsed)
|
|
313
|
+
* @returns Resolution counters
|
|
314
|
+
*/
|
|
315
|
+
export async function resolveAccesses(accesses, graph, symbolTable) {
|
|
316
|
+
let tier1Count = 0;
|
|
317
|
+
let tier3Count = 0;
|
|
318
|
+
let unresolvedCount = 0;
|
|
319
|
+
// Deduplicate read+write pairs before resolution
|
|
320
|
+
const deduped = deduplicateAccesses(accesses);
|
|
321
|
+
let processed = 0;
|
|
322
|
+
for (const access of deduped) {
|
|
323
|
+
processed++;
|
|
324
|
+
// Yield to event loop periodically on large repos
|
|
325
|
+
if (processed % 100 === 0) {
|
|
326
|
+
await Promise.resolve();
|
|
327
|
+
}
|
|
328
|
+
const resolved = resolveSingleAccess(access, symbolTable);
|
|
329
|
+
if (!resolved) {
|
|
330
|
+
unresolvedCount++;
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
const rel = {
|
|
334
|
+
source: access.sourceId,
|
|
335
|
+
target: resolved.nodeId,
|
|
336
|
+
type: 'accesses',
|
|
337
|
+
confidence: resolved.confidence,
|
|
338
|
+
confidenceLabel: confidenceLabelFromNumeric(resolved.confidence),
|
|
339
|
+
reason: `${access.accessMode} access to ${access.memberName} (tier: ${resolved.tier})`,
|
|
340
|
+
};
|
|
341
|
+
graph.addRelation(rel);
|
|
342
|
+
if (resolved.tier === 'same-file') {
|
|
343
|
+
tier1Count++;
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
tier3Count++;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return { tier1Count, tier3Count, unresolvedCount };
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=access-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-processor.js","sourceRoot":"","sources":["../../../../src/pipeline/processors/access-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AA8E3D,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,8DAA8D;AAC9D,SAAS,UAAU,CAAC,QAAgB,EAAE,IAAY;IAChD,OAAO,GAAG,QAAQ,KAAK,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACvC,0BAA0B;IAC1B,sBAAsB;IACtB,qBAAqB;IACrB,gBAAgB;IAChB,gCAAgC;IAChC,oBAAoB;IACpB,mBAAmB;IACnB,SAAS;IACT,qBAAqB;IACrB,KAAK;IACL,sBAAsB;IACtB,oBAAoB;IACpB,OAAO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kD;QAClD,IAAI,SAAS,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;QAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,eAAe,EAAE,CAAC;YAClB,SAAS;QACX,CAAC;QAED,MAAM,GAAG,GAAkB;YACzB,MAAM,EAAE,MAAM,CAAC,QAAQ;YACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,IAAI,EAAE,UAAU;YAChB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,eAAe,EAAE,0BAA0B,CAAC,QAAQ,CAAC,UAAU,CAAC;YAChE,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,cAAc,MAAM,CAAC,UAAU,WAAW,QAAQ,CAAC,IAAI,GAAG;SACvF,CAAC;QAEF,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEvB,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAClC,UAAU,EAAE,CAAC;QACf,CAAC;aAAM,CAAC;YACN,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure-processor.d.ts","sourceRoot":"","sources":["../../../src/pipeline/structure-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"structure-processor.d.ts","sourceRoot":"","sources":["../../../src/pipeline/structure-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkC3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CA2DlF"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @task T532
|
|
22
22
|
* @module pipeline/structure-processor
|
|
23
23
|
*/
|
|
24
|
+
import { confidenceLabelFromNumeric } from '@cleocode/contracts';
|
|
24
25
|
// ---------------------------------------------------------------------------
|
|
25
26
|
// ID helpers
|
|
26
27
|
// ---------------------------------------------------------------------------
|
|
@@ -103,11 +104,13 @@ export function processStructure(files, graph) {
|
|
|
103
104
|
}
|
|
104
105
|
graph.addNode(node);
|
|
105
106
|
if (parentId) {
|
|
107
|
+
const confidence = 1.0;
|
|
106
108
|
const relation = {
|
|
107
109
|
source: parentId,
|
|
108
110
|
target: nodeId,
|
|
109
111
|
type: 'contains',
|
|
110
|
-
confidence
|
|
112
|
+
confidence,
|
|
113
|
+
confidenceLabel: confidenceLabelFromNumeric(confidence),
|
|
111
114
|
reason: 'filesystem structure',
|
|
112
115
|
};
|
|
113
116
|
graph.addRelation(relation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure-processor.js","sourceRoot":"","sources":["../../../src/pipeline/structure-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"structure-processor.js","sourceRoot":"","sources":["../../../src/pipeline/structure-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAIjE,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,YAAoB;IACtC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,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