@nahisaho/musubix-core 1.0.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/bin/musubix.js +18 -0
- package/dist/__tests__/index.test.d.ts +2 -0
- package/dist/__tests__/index.test.d.ts.map +1 -0
- package/dist/__tests__/index.test.js +27 -0
- package/dist/__tests__/index.test.js.map +1 -0
- package/dist/auth/auth-manager.d.ts +320 -0
- package/dist/auth/auth-manager.d.ts.map +1 -0
- package/dist/auth/auth-manager.js +580 -0
- package/dist/auth/auth-manager.js.map +1 -0
- package/dist/cli/base.d.ts +58 -0
- package/dist/cli/base.d.ts.map +1 -0
- package/dist/cli/base.js +93 -0
- package/dist/cli/base.js.map +1 -0
- package/dist/cli/commands/help.d.ts +17 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +228 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/index.d.ts +14 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +25 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +38 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +258 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/codegen/coding-standards.d.ts +250 -0
- package/dist/codegen/coding-standards.d.ts.map +1 -0
- package/dist/codegen/coding-standards.js +976 -0
- package/dist/codegen/coding-standards.js.map +1 -0
- package/dist/codegen/coverage-reporter.d.ts +264 -0
- package/dist/codegen/coverage-reporter.d.ts.map +1 -0
- package/dist/codegen/coverage-reporter.js +697 -0
- package/dist/codegen/coverage-reporter.js.map +1 -0
- package/dist/codegen/dependency-analyzer.d.ts +271 -0
- package/dist/codegen/dependency-analyzer.d.ts.map +1 -0
- package/dist/codegen/dependency-analyzer.js +661 -0
- package/dist/codegen/dependency-analyzer.js.map +1 -0
- package/dist/codegen/generator.d.ts +275 -0
- package/dist/codegen/generator.d.ts.map +1 -0
- package/dist/codegen/generator.js +781 -0
- package/dist/codegen/generator.js.map +1 -0
- package/dist/codegen/index.d.ts +18 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +27 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/codegen/integration-test-generator.d.ts +312 -0
- package/dist/codegen/integration-test-generator.d.ts.map +1 -0
- package/dist/codegen/integration-test-generator.js +765 -0
- package/dist/codegen/integration-test-generator.js.map +1 -0
- package/dist/codegen/pattern-conformance.d.ts +309 -0
- package/dist/codegen/pattern-conformance.d.ts.map +1 -0
- package/dist/codegen/pattern-conformance.js +590 -0
- package/dist/codegen/pattern-conformance.js.map +1 -0
- package/dist/codegen/quality-metrics.d.ts +235 -0
- package/dist/codegen/quality-metrics.d.ts.map +1 -0
- package/dist/codegen/quality-metrics.js +439 -0
- package/dist/codegen/quality-metrics.js.map +1 -0
- package/dist/codegen/security-scanner.d.ts +179 -0
- package/dist/codegen/security-scanner.d.ts.map +1 -0
- package/dist/codegen/security-scanner.js +495 -0
- package/dist/codegen/security-scanner.js.map +1 -0
- package/dist/codegen/static-analyzer.d.ts +188 -0
- package/dist/codegen/static-analyzer.d.ts.map +1 -0
- package/dist/codegen/static-analyzer.js +490 -0
- package/dist/codegen/static-analyzer.js.map +1 -0
- package/dist/codegen/unit-test-generator.d.ts +289 -0
- package/dist/codegen/unit-test-generator.d.ts.map +1 -0
- package/dist/codegen/unit-test-generator.js +634 -0
- package/dist/codegen/unit-test-generator.js.map +1 -0
- package/dist/design/adr-generator.d.ts +227 -0
- package/dist/design/adr-generator.d.ts.map +1 -0
- package/dist/design/adr-generator.js +423 -0
- package/dist/design/adr-generator.js.map +1 -0
- package/dist/design/c4-generator.d.ts +267 -0
- package/dist/design/c4-generator.d.ts.map +1 -0
- package/dist/design/c4-generator.js +453 -0
- package/dist/design/c4-generator.js.map +1 -0
- package/dist/design/framework-optimizer.d.ts +190 -0
- package/dist/design/framework-optimizer.d.ts.map +1 -0
- package/dist/design/framework-optimizer.js +589 -0
- package/dist/design/framework-optimizer.js.map +1 -0
- package/dist/design/index.d.ts +12 -0
- package/dist/design/index.d.ts.map +1 -0
- package/dist/design/index.js +13 -0
- package/dist/design/index.js.map +1 -0
- package/dist/design/pattern-detector.d.ts +270 -0
- package/dist/design/pattern-detector.d.ts.map +1 -0
- package/dist/design/pattern-detector.js +621 -0
- package/dist/design/pattern-detector.js.map +1 -0
- package/dist/design/solid-validator.d.ts +188 -0
- package/dist/design/solid-validator.d.ts.map +1 -0
- package/dist/design/solid-validator.js +579 -0
- package/dist/design/solid-validator.js.map +1 -0
- package/dist/error/data-persistence.d.ts +311 -0
- package/dist/error/data-persistence.d.ts.map +1 -0
- package/dist/error/data-persistence.js +586 -0
- package/dist/error/data-persistence.js.map +1 -0
- package/dist/error/graceful-degradation.d.ts +309 -0
- package/dist/error/graceful-degradation.d.ts.map +1 -0
- package/dist/error/graceful-degradation.js +510 -0
- package/dist/error/graceful-degradation.js.map +1 -0
- package/dist/error/index.d.ts +11 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/error/index.js +19 -0
- package/dist/error/index.js.map +1 -0
- package/dist/explanation/explanation-generator.d.ts +228 -0
- package/dist/explanation/explanation-generator.d.ts.map +1 -0
- package/dist/explanation/explanation-generator.js +662 -0
- package/dist/explanation/explanation-generator.js.map +1 -0
- package/dist/explanation/index.d.ts +11 -0
- package/dist/explanation/index.d.ts.map +1 -0
- package/dist/explanation/index.js +19 -0
- package/dist/explanation/index.js.map +1 -0
- package/dist/explanation/reasoning-chain.d.ts +314 -0
- package/dist/explanation/reasoning-chain.d.ts.map +1 -0
- package/dist/explanation/reasoning-chain.js +414 -0
- package/dist/explanation/reasoning-chain.js.map +1 -0
- package/dist/explanation/visual-explanation.d.ts +315 -0
- package/dist/explanation/visual-explanation.d.ts.map +1 -0
- package/dist/explanation/visual-explanation.js +667 -0
- package/dist/explanation/visual-explanation.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/requirements/decomposer.d.ts +235 -0
- package/dist/requirements/decomposer.d.ts.map +1 -0
- package/dist/requirements/decomposer.js +587 -0
- package/dist/requirements/decomposer.js.map +1 -0
- package/dist/requirements/related-finder.d.ts +261 -0
- package/dist/requirements/related-finder.d.ts.map +1 -0
- package/dist/requirements/related-finder.js +629 -0
- package/dist/requirements/related-finder.js.map +1 -0
- package/dist/traceability/impact.d.ts +196 -0
- package/dist/traceability/impact.d.ts.map +1 -0
- package/dist/traceability/impact.js +438 -0
- package/dist/traceability/impact.js.map +1 -0
- package/dist/traceability/index.d.ts +9 -0
- package/dist/traceability/index.d.ts.map +1 -0
- package/dist/traceability/index.js +10 -0
- package/dist/traceability/index.js.map +1 -0
- package/dist/traceability/manager.d.ts +266 -0
- package/dist/traceability/manager.d.ts.map +1 -0
- package/dist/traceability/manager.js +412 -0
- package/dist/traceability/manager.js.map +1 -0
- package/dist/types/common.d.ts +294 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +15 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/ears.d.ts +158 -0
- package/dist/types/ears.d.ts.map +1 -0
- package/dist/types/ears.js +33 -0
- package/dist/types/ears.js.map +1 -0
- package/dist/types/errors.d.ts +176 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +55 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/data-protector.d.ts +122 -0
- package/dist/utils/data-protector.d.ts.map +1 -0
- package/dist/utils/data-protector.js +275 -0
- package/dist/utils/data-protector.js.map +1 -0
- package/dist/utils/error-handler.d.ts +101 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +324 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/i18n-manager.d.ts +259 -0
- package/dist/utils/i18n-manager.d.ts.map +1 -0
- package/dist/utils/i18n-manager.js +554 -0
- package/dist/utils/i18n-manager.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +120 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +237 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/performance-profiler.d.ts +251 -0
- package/dist/utils/performance-profiler.d.ts.map +1 -0
- package/dist/utils/performance-profiler.js +458 -0
- package/dist/utils/performance-profiler.js.map +1 -0
- package/dist/utils/scalability-optimizer.d.ts +294 -0
- package/dist/utils/scalability-optimizer.d.ts.map +1 -0
- package/dist/utils/scalability-optimizer.js +606 -0
- package/dist/utils/scalability-optimizer.js.map +1 -0
- package/dist/utils/structured-logger.d.ts +294 -0
- package/dist/utils/structured-logger.d.ts.map +1 -0
- package/dist/utils/structured-logger.js +630 -0
- package/dist/utils/structured-logger.js.map +1 -0
- package/dist/utils/version-compatibility.d.ts +217 -0
- package/dist/utils/version-compatibility.d.ts.map +1 -0
- package/dist/utils/version-compatibility.js +443 -0
- package/dist/utils/version-compatibility.js.map +1 -0
- package/dist/validators/ears-validator.d.ts +182 -0
- package/dist/validators/ears-validator.d.ts.map +1 -0
- package/dist/validators/ears-validator.js +357 -0
- package/dist/validators/ears-validator.js.map +1 -0
- package/dist/validators/index.d.ts +8 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +9 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Related Requirements Finder
|
|
3
|
+
*
|
|
4
|
+
* Finds related requirements based on semantic similarity
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module requirements/related-finder
|
|
8
|
+
*
|
|
9
|
+
* @see REQ-RA-003 - Related Requirements Finding
|
|
10
|
+
* @see Article III - Traceability
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Default configuration
|
|
14
|
+
*/
|
|
15
|
+
export const DEFAULT_FINDER_CONFIG = {
|
|
16
|
+
algorithm: 'tfidf',
|
|
17
|
+
minSimilarity: 0.3,
|
|
18
|
+
maxResults: 10,
|
|
19
|
+
inferRelationships: true,
|
|
20
|
+
stopWords: [
|
|
21
|
+
'the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for',
|
|
22
|
+
'of', 'with', 'by', 'from', 'as', 'is', 'was', 'are', 'were', 'been',
|
|
23
|
+
'be', 'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would',
|
|
24
|
+
'could', 'should', 'may', 'might', 'must', 'shall', 'can', 'need',
|
|
25
|
+
'this', 'that', 'these', 'those', 'it', 'its', 'they', 'their',
|
|
26
|
+
'when', 'where', 'which', 'who', 'what', 'how', 'why',
|
|
27
|
+
'system', 'shall', 'must', 'should', 'requirement', 'requirements',
|
|
28
|
+
],
|
|
29
|
+
synonyms: new Map([
|
|
30
|
+
['user', ['customer', 'client', 'end-user', 'operator']],
|
|
31
|
+
['display', ['show', 'present', 'render', 'visualize']],
|
|
32
|
+
['store', ['save', 'persist', 'record', 'keep']],
|
|
33
|
+
['retrieve', ['fetch', 'get', 'load', 'read']],
|
|
34
|
+
['authenticate', ['login', 'sign-in', 'verify-identity']],
|
|
35
|
+
['authorize', ['permit', 'allow', 'grant-access']],
|
|
36
|
+
['validate', ['verify', 'check', 'confirm']],
|
|
37
|
+
['error', ['failure', 'exception', 'fault']],
|
|
38
|
+
['performance', ['speed', 'efficiency', 'responsiveness']],
|
|
39
|
+
['security', ['protection', 'safety', 'secure']],
|
|
40
|
+
]),
|
|
41
|
+
titleWeight: 2.0,
|
|
42
|
+
descriptionWeight: 1.0,
|
|
43
|
+
tagWeight: 1.5,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Related Requirements Finder
|
|
47
|
+
*/
|
|
48
|
+
export class RelatedRequirementsFinder {
|
|
49
|
+
config;
|
|
50
|
+
requirements;
|
|
51
|
+
tfDocuments;
|
|
52
|
+
idfScores;
|
|
53
|
+
documentCount = 0;
|
|
54
|
+
constructor(config) {
|
|
55
|
+
this.config = { ...DEFAULT_FINDER_CONFIG, ...config };
|
|
56
|
+
this.requirements = new Map();
|
|
57
|
+
this.tfDocuments = new Map();
|
|
58
|
+
this.idfScores = new Map();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Add requirements to the index
|
|
62
|
+
*/
|
|
63
|
+
index(requirements) {
|
|
64
|
+
for (const req of requirements) {
|
|
65
|
+
this.requirements.set(req.id, req);
|
|
66
|
+
}
|
|
67
|
+
this.buildIndex();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Add a single requirement
|
|
71
|
+
*/
|
|
72
|
+
add(requirement) {
|
|
73
|
+
this.requirements.set(requirement.id, requirement);
|
|
74
|
+
this.buildIndex();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Remove a requirement
|
|
78
|
+
*/
|
|
79
|
+
remove(id) {
|
|
80
|
+
this.requirements.delete(id);
|
|
81
|
+
this.tfDocuments.delete(id);
|
|
82
|
+
this.buildIndex();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Find related requirements
|
|
86
|
+
*/
|
|
87
|
+
findRelated(requirementId, options) {
|
|
88
|
+
const startTime = Date.now();
|
|
89
|
+
const source = this.requirements.get(requirementId);
|
|
90
|
+
if (!source) {
|
|
91
|
+
return {
|
|
92
|
+
sourceId: requirementId,
|
|
93
|
+
related: [],
|
|
94
|
+
searchTime: Date.now() - startTime,
|
|
95
|
+
algorithm: options?.algorithm ?? this.config.algorithm,
|
|
96
|
+
candidatesAnalyzed: 0,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const algorithm = options?.algorithm ?? this.config.algorithm;
|
|
100
|
+
const minSimilarity = options?.minSimilarity ?? this.config.minSimilarity;
|
|
101
|
+
const maxResults = options?.maxResults ?? this.config.maxResults;
|
|
102
|
+
const candidates = [];
|
|
103
|
+
for (const [id, candidate] of this.requirements) {
|
|
104
|
+
if (id === requirementId)
|
|
105
|
+
continue;
|
|
106
|
+
const similarity = this.calculateSimilarity(source, candidate, algorithm);
|
|
107
|
+
if (similarity >= minSimilarity) {
|
|
108
|
+
const relationship = this.inferRelationship(source, candidate, similarity);
|
|
109
|
+
const sharedTerms = this.findSharedTerms(source, candidate);
|
|
110
|
+
candidates.push({
|
|
111
|
+
id: candidate.id,
|
|
112
|
+
title: candidate.title,
|
|
113
|
+
relationshipType: relationship.type,
|
|
114
|
+
similarity,
|
|
115
|
+
reason: relationship.reason,
|
|
116
|
+
sharedTerms,
|
|
117
|
+
confidence: relationship.confidence,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Sort by similarity
|
|
122
|
+
candidates.sort((a, b) => b.similarity - a.similarity);
|
|
123
|
+
// Filter by relationship type if specified
|
|
124
|
+
let results = candidates;
|
|
125
|
+
if (options?.relationshipTypes?.length) {
|
|
126
|
+
results = candidates.filter((r) => options.relationshipTypes.includes(r.relationshipType));
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
sourceId: requirementId,
|
|
130
|
+
related: results.slice(0, maxResults),
|
|
131
|
+
searchTime: Date.now() - startTime,
|
|
132
|
+
algorithm,
|
|
133
|
+
candidatesAnalyzed: this.requirements.size - 1,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Find requirements similar to text
|
|
138
|
+
*/
|
|
139
|
+
findByText(text, options) {
|
|
140
|
+
const virtualReq = {
|
|
141
|
+
id: '__search__',
|
|
142
|
+
title: text,
|
|
143
|
+
description: text,
|
|
144
|
+
};
|
|
145
|
+
const algorithm = options?.algorithm ?? this.config.algorithm;
|
|
146
|
+
const minSimilarity = options?.minSimilarity ?? this.config.minSimilarity;
|
|
147
|
+
const maxResults = options?.maxResults ?? this.config.maxResults;
|
|
148
|
+
const results = [];
|
|
149
|
+
for (const [_id, candidate] of this.requirements) {
|
|
150
|
+
const similarity = this.calculateSimilarity(virtualReq, candidate, algorithm);
|
|
151
|
+
if (similarity >= minSimilarity) {
|
|
152
|
+
const sharedTerms = this.findSharedTerms(virtualReq, candidate);
|
|
153
|
+
results.push({
|
|
154
|
+
id: candidate.id,
|
|
155
|
+
title: candidate.title,
|
|
156
|
+
relationshipType: 'similar',
|
|
157
|
+
similarity,
|
|
158
|
+
reason: `Matches search terms: ${sharedTerms.slice(0, 5).join(', ')}`,
|
|
159
|
+
sharedTerms,
|
|
160
|
+
confidence: similarity,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
results.sort((a, b) => b.similarity - a.similarity);
|
|
165
|
+
return results.slice(0, maxResults);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Cluster requirements by similarity
|
|
169
|
+
*/
|
|
170
|
+
cluster(options) {
|
|
171
|
+
const threshold = options?.threshold ?? 0.5;
|
|
172
|
+
const minSize = options?.minClusterSize ?? 2;
|
|
173
|
+
const clusters = [];
|
|
174
|
+
const assigned = new Set();
|
|
175
|
+
let clusterId = 0;
|
|
176
|
+
// Simple agglomerative clustering
|
|
177
|
+
for (const [id, req] of this.requirements) {
|
|
178
|
+
if (assigned.has(id))
|
|
179
|
+
continue;
|
|
180
|
+
const clusterMembers = [id];
|
|
181
|
+
assigned.add(id);
|
|
182
|
+
// Find similar requirements
|
|
183
|
+
for (const [otherId, otherReq] of this.requirements) {
|
|
184
|
+
if (assigned.has(otherId))
|
|
185
|
+
continue;
|
|
186
|
+
const similarity = this.calculateSimilarity(req, otherReq, this.config.algorithm);
|
|
187
|
+
if (similarity >= threshold) {
|
|
188
|
+
clusterMembers.push(otherId);
|
|
189
|
+
assigned.add(otherId);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (clusterMembers.length >= minSize) {
|
|
193
|
+
const keyTerms = this.extractClusterTerms(clusterMembers);
|
|
194
|
+
const cohesion = this.calculateClusterCohesion(clusterMembers);
|
|
195
|
+
clusters.push({
|
|
196
|
+
id: `cluster-${++clusterId}`,
|
|
197
|
+
name: keyTerms.slice(0, 3).join(', '),
|
|
198
|
+
requirements: clusterMembers,
|
|
199
|
+
centroid: clusterMembers[0],
|
|
200
|
+
cohesion,
|
|
201
|
+
keyTerms,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return clusters;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Find gaps in requirement coverage
|
|
209
|
+
*/
|
|
210
|
+
findGaps() {
|
|
211
|
+
const connectionCounts = new Map();
|
|
212
|
+
const missingRelationships = [];
|
|
213
|
+
// Count connections for each requirement
|
|
214
|
+
for (const [id] of this.requirements) {
|
|
215
|
+
const related = this.findRelated(id, { minSimilarity: 0.4, maxResults: 20 });
|
|
216
|
+
connectionCounts.set(id, related.related.length);
|
|
217
|
+
// Find potential missing relationships
|
|
218
|
+
for (const rel of related.related) {
|
|
219
|
+
if (rel.similarity >= 0.7 && rel.confidence >= 0.8) {
|
|
220
|
+
if (!this.hasExplicitRelationship(id, rel.id)) {
|
|
221
|
+
missingRelationships.push({
|
|
222
|
+
from: id,
|
|
223
|
+
to: rel.id,
|
|
224
|
+
suggestedType: rel.relationshipType,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const orphans = [];
|
|
231
|
+
const weaklyConnected = [];
|
|
232
|
+
for (const [id, count] of connectionCounts) {
|
|
233
|
+
if (count === 0) {
|
|
234
|
+
orphans.push(id);
|
|
235
|
+
}
|
|
236
|
+
else if (count <= 2) {
|
|
237
|
+
weaklyConnected.push(id);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
orphanRequirements: orphans,
|
|
242
|
+
weaklyConnected,
|
|
243
|
+
missingRelationships,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Get requirement by ID
|
|
248
|
+
*/
|
|
249
|
+
get(id) {
|
|
250
|
+
return this.requirements.get(id);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Get all requirements
|
|
254
|
+
*/
|
|
255
|
+
getAll() {
|
|
256
|
+
return [...this.requirements.values()];
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get statistics
|
|
260
|
+
*/
|
|
261
|
+
getStatistics() {
|
|
262
|
+
const clusters = this.cluster();
|
|
263
|
+
let totalSimilarity = 0;
|
|
264
|
+
let pairCount = 0;
|
|
265
|
+
const reqs = [...this.requirements.values()];
|
|
266
|
+
for (let i = 0; i < reqs.length; i++) {
|
|
267
|
+
for (let j = i + 1; j < reqs.length; j++) {
|
|
268
|
+
totalSimilarity += this.calculateSimilarity(reqs[i], reqs[j], this.config.algorithm);
|
|
269
|
+
pairCount++;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
totalRequirements: this.requirements.size,
|
|
274
|
+
avgSimilarity: pairCount > 0 ? totalSimilarity / pairCount : 0,
|
|
275
|
+
termCount: this.idfScores.size,
|
|
276
|
+
clusterCount: clusters.length,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Build TF-IDF index
|
|
281
|
+
*/
|
|
282
|
+
buildIndex() {
|
|
283
|
+
this.tfDocuments.clear();
|
|
284
|
+
this.idfScores.clear();
|
|
285
|
+
this.documentCount = this.requirements.size;
|
|
286
|
+
const documentFrequency = new Map();
|
|
287
|
+
// Calculate term frequencies
|
|
288
|
+
for (const [id, req] of this.requirements) {
|
|
289
|
+
const terms = this.tokenize(req);
|
|
290
|
+
const termFreq = new Map();
|
|
291
|
+
for (const term of terms) {
|
|
292
|
+
termFreq.set(term, (termFreq.get(term) ?? 0) + 1);
|
|
293
|
+
}
|
|
294
|
+
// Calculate magnitude for cosine similarity
|
|
295
|
+
let magnitude = 0;
|
|
296
|
+
for (const freq of termFreq.values()) {
|
|
297
|
+
magnitude += freq * freq;
|
|
298
|
+
}
|
|
299
|
+
this.tfDocuments.set(id, {
|
|
300
|
+
id,
|
|
301
|
+
terms: termFreq,
|
|
302
|
+
magnitude: Math.sqrt(magnitude),
|
|
303
|
+
});
|
|
304
|
+
// Update document frequency
|
|
305
|
+
for (const term of termFreq.keys()) {
|
|
306
|
+
documentFrequency.set(term, (documentFrequency.get(term) ?? 0) + 1);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// Calculate IDF scores
|
|
310
|
+
for (const [term, df] of documentFrequency) {
|
|
311
|
+
this.idfScores.set(term, Math.log(this.documentCount / df));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Tokenize a requirement
|
|
316
|
+
*/
|
|
317
|
+
tokenize(req) {
|
|
318
|
+
const text = [
|
|
319
|
+
...Array(Math.ceil(this.config.titleWeight)).fill(req.title),
|
|
320
|
+
...Array(Math.ceil(this.config.descriptionWeight)).fill(req.description),
|
|
321
|
+
...(req.tags ?? []).flatMap((t) => Array(Math.ceil(this.config.tagWeight)).fill(t)),
|
|
322
|
+
].join(' ');
|
|
323
|
+
// Tokenize and normalize
|
|
324
|
+
const tokens = text
|
|
325
|
+
.toLowerCase()
|
|
326
|
+
.replace(/[^a-z0-9\s-]/g, ' ')
|
|
327
|
+
.split(/\s+/)
|
|
328
|
+
.filter((t) => t.length > 2)
|
|
329
|
+
.filter((t) => !this.config.stopWords.includes(t));
|
|
330
|
+
// Expand synonyms
|
|
331
|
+
const expanded = [];
|
|
332
|
+
for (const token of tokens) {
|
|
333
|
+
expanded.push(token);
|
|
334
|
+
for (const [key, synonyms] of this.config.synonyms) {
|
|
335
|
+
if (token === key || synonyms.includes(token)) {
|
|
336
|
+
expanded.push(key);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return expanded;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Calculate similarity between two requirements
|
|
344
|
+
*/
|
|
345
|
+
calculateSimilarity(a, b, algorithm) {
|
|
346
|
+
switch (algorithm) {
|
|
347
|
+
case 'cosine':
|
|
348
|
+
return this.cosineSimilarity(a, b);
|
|
349
|
+
case 'jaccard':
|
|
350
|
+
return this.jaccardSimilarity(a, b);
|
|
351
|
+
case 'levenshtein':
|
|
352
|
+
return this.levenshteinSimilarity(a, b);
|
|
353
|
+
case 'tfidf':
|
|
354
|
+
return this.tfidfSimilarity(a, b);
|
|
355
|
+
case 'semantic':
|
|
356
|
+
// Fall back to TF-IDF for now (would use embeddings in production)
|
|
357
|
+
return this.tfidfSimilarity(a, b);
|
|
358
|
+
default:
|
|
359
|
+
return this.tfidfSimilarity(a, b);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Cosine similarity
|
|
364
|
+
*/
|
|
365
|
+
cosineSimilarity(a, b) {
|
|
366
|
+
const docA = this.tfDocuments.get(a.id);
|
|
367
|
+
const docB = this.tfDocuments.get(b.id);
|
|
368
|
+
if (!docA || !docB) {
|
|
369
|
+
// Calculate on the fly for virtual documents
|
|
370
|
+
const termsA = this.tokenize(a);
|
|
371
|
+
const termsB = this.tokenize(b);
|
|
372
|
+
return this.calculateCosineDirect(termsA, termsB);
|
|
373
|
+
}
|
|
374
|
+
let dotProduct = 0;
|
|
375
|
+
for (const [term, freqA] of docA.terms) {
|
|
376
|
+
const freqB = docB.terms.get(term);
|
|
377
|
+
if (freqB) {
|
|
378
|
+
dotProduct += freqA * freqB;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if (docA.magnitude === 0 || docB.magnitude === 0)
|
|
382
|
+
return 0;
|
|
383
|
+
return dotProduct / (docA.magnitude * docB.magnitude);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Calculate cosine similarity directly from terms
|
|
387
|
+
*/
|
|
388
|
+
calculateCosineDirect(termsA, termsB) {
|
|
389
|
+
const freqA = new Map();
|
|
390
|
+
const freqB = new Map();
|
|
391
|
+
for (const t of termsA)
|
|
392
|
+
freqA.set(t, (freqA.get(t) ?? 0) + 1);
|
|
393
|
+
for (const t of termsB)
|
|
394
|
+
freqB.set(t, (freqB.get(t) ?? 0) + 1);
|
|
395
|
+
let dotProduct = 0;
|
|
396
|
+
let magA = 0;
|
|
397
|
+
let magB = 0;
|
|
398
|
+
for (const [term, freq] of freqA) {
|
|
399
|
+
magA += freq * freq;
|
|
400
|
+
const fb = freqB.get(term);
|
|
401
|
+
if (fb)
|
|
402
|
+
dotProduct += freq * fb;
|
|
403
|
+
}
|
|
404
|
+
for (const freq of freqB.values()) {
|
|
405
|
+
magB += freq * freq;
|
|
406
|
+
}
|
|
407
|
+
if (magA === 0 || magB === 0)
|
|
408
|
+
return 0;
|
|
409
|
+
return dotProduct / (Math.sqrt(magA) * Math.sqrt(magB));
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Jaccard similarity
|
|
413
|
+
*/
|
|
414
|
+
jaccardSimilarity(a, b) {
|
|
415
|
+
const termsA = new Set(this.tokenize(a));
|
|
416
|
+
const termsB = new Set(this.tokenize(b));
|
|
417
|
+
const intersection = new Set([...termsA].filter((t) => termsB.has(t)));
|
|
418
|
+
const union = new Set([...termsA, ...termsB]);
|
|
419
|
+
if (union.size === 0)
|
|
420
|
+
return 0;
|
|
421
|
+
return intersection.size / union.size;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Levenshtein similarity
|
|
425
|
+
*/
|
|
426
|
+
levenshteinSimilarity(a, b) {
|
|
427
|
+
const textA = `${a.title} ${a.description}`.toLowerCase();
|
|
428
|
+
const textB = `${b.title} ${b.description}`.toLowerCase();
|
|
429
|
+
const distance = this.levenshteinDistance(textA, textB);
|
|
430
|
+
const maxLen = Math.max(textA.length, textB.length);
|
|
431
|
+
if (maxLen === 0)
|
|
432
|
+
return 1;
|
|
433
|
+
return 1 - distance / maxLen;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Calculate Levenshtein distance
|
|
437
|
+
*/
|
|
438
|
+
levenshteinDistance(a, b) {
|
|
439
|
+
if (a.length === 0)
|
|
440
|
+
return b.length;
|
|
441
|
+
if (b.length === 0)
|
|
442
|
+
return a.length;
|
|
443
|
+
// Limit for performance
|
|
444
|
+
if (a.length > 500 || b.length > 500) {
|
|
445
|
+
return Math.abs(a.length - b.length);
|
|
446
|
+
}
|
|
447
|
+
const matrix = [];
|
|
448
|
+
for (let i = 0; i <= b.length; i++) {
|
|
449
|
+
matrix[i] = [i];
|
|
450
|
+
}
|
|
451
|
+
for (let j = 0; j <= a.length; j++) {
|
|
452
|
+
matrix[0][j] = j;
|
|
453
|
+
}
|
|
454
|
+
for (let i = 1; i <= b.length; i++) {
|
|
455
|
+
for (let j = 1; j <= a.length; j++) {
|
|
456
|
+
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
|
457
|
+
matrix[i][j] = matrix[i - 1][j - 1];
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j] + 1);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return matrix[b.length][a.length];
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* TF-IDF similarity
|
|
468
|
+
*/
|
|
469
|
+
tfidfSimilarity(a, b) {
|
|
470
|
+
const termsA = this.tokenize(a);
|
|
471
|
+
const termsB = this.tokenize(b);
|
|
472
|
+
const tfidfA = this.calculateTFIDF(termsA);
|
|
473
|
+
const tfidfB = this.calculateTFIDF(termsB);
|
|
474
|
+
let dotProduct = 0;
|
|
475
|
+
let magA = 0;
|
|
476
|
+
let magB = 0;
|
|
477
|
+
for (const [term, scoreA] of tfidfA) {
|
|
478
|
+
magA += scoreA * scoreA;
|
|
479
|
+
const scoreB = tfidfB.get(term);
|
|
480
|
+
if (scoreB)
|
|
481
|
+
dotProduct += scoreA * scoreB;
|
|
482
|
+
}
|
|
483
|
+
for (const scoreB of tfidfB.values()) {
|
|
484
|
+
magB += scoreB * scoreB;
|
|
485
|
+
}
|
|
486
|
+
if (magA === 0 || magB === 0)
|
|
487
|
+
return 0;
|
|
488
|
+
return dotProduct / (Math.sqrt(magA) * Math.sqrt(magB));
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Calculate TF-IDF scores for terms
|
|
492
|
+
*/
|
|
493
|
+
calculateTFIDF(terms) {
|
|
494
|
+
const tf = new Map();
|
|
495
|
+
for (const term of terms) {
|
|
496
|
+
tf.set(term, (tf.get(term) ?? 0) + 1);
|
|
497
|
+
}
|
|
498
|
+
const tfidf = new Map();
|
|
499
|
+
for (const [term, freq] of tf) {
|
|
500
|
+
const idf = this.idfScores.get(term) ?? Math.log(this.documentCount + 1);
|
|
501
|
+
tfidf.set(term, freq * idf);
|
|
502
|
+
}
|
|
503
|
+
return tfidf;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Infer relationship between requirements
|
|
507
|
+
*/
|
|
508
|
+
inferRelationship(source, target, similarity) {
|
|
509
|
+
if (!this.config.inferRelationships) {
|
|
510
|
+
return { type: 'similar', reason: 'Similarity match', confidence: similarity };
|
|
511
|
+
}
|
|
512
|
+
// Check for parent-child relationship
|
|
513
|
+
if (target.parent === source.id) {
|
|
514
|
+
return { type: 'parent', reason: 'Explicit parent relationship', confidence: 1 };
|
|
515
|
+
}
|
|
516
|
+
if (source.parent === target.id) {
|
|
517
|
+
return { type: 'child', reason: 'Explicit child relationship', confidence: 1 };
|
|
518
|
+
}
|
|
519
|
+
// Check for derives/refines based on content
|
|
520
|
+
const sourceLower = source.description.toLowerCase();
|
|
521
|
+
if (sourceLower.includes('derived from') || sourceLower.includes('based on')) {
|
|
522
|
+
if (similarity > 0.5) {
|
|
523
|
+
return { type: 'derives', reason: 'Content indicates derivation', confidence: 0.8 };
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (sourceLower.includes('refines') || sourceLower.includes('elaborates')) {
|
|
527
|
+
if (similarity > 0.6) {
|
|
528
|
+
return { type: 'refines', reason: 'Content indicates refinement', confidence: 0.8 };
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
// Check for conflicts
|
|
532
|
+
const conflictIndicators = ['instead of', 'rather than', 'not', 'unlike', 'contrary'];
|
|
533
|
+
for (const indicator of conflictIndicators) {
|
|
534
|
+
if (sourceLower.includes(indicator) && similarity > 0.4) {
|
|
535
|
+
return { type: 'conflicts', reason: `Potential conflict: "${indicator}"`, confidence: 0.6 };
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
// Check for dependencies
|
|
539
|
+
const dependencyIndicators = ['requires', 'depends on', 'needs', 'prerequisite'];
|
|
540
|
+
for (const indicator of dependencyIndicators) {
|
|
541
|
+
if (sourceLower.includes(indicator)) {
|
|
542
|
+
return { type: 'depends', reason: `Dependency indicator: "${indicator}"`, confidence: 0.7 };
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
// Check for implementation relationship
|
|
546
|
+
if (source.type === 'design' && target.type === 'functional') {
|
|
547
|
+
return { type: 'implements', reason: 'Design implements functional requirement', confidence: 0.7 };
|
|
548
|
+
}
|
|
549
|
+
// Check for verification relationship
|
|
550
|
+
if (source.type === 'test' || source.category === 'verification') {
|
|
551
|
+
return { type: 'verifies', reason: 'Test/verification requirement', confidence: 0.8 };
|
|
552
|
+
}
|
|
553
|
+
// Default to similar
|
|
554
|
+
return { type: 'similar', reason: 'Content similarity', confidence: similarity };
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Find shared terms between requirements
|
|
558
|
+
*/
|
|
559
|
+
findSharedTerms(a, b) {
|
|
560
|
+
const termsA = new Set(this.tokenize(a));
|
|
561
|
+
const termsB = new Set(this.tokenize(b));
|
|
562
|
+
const shared = [...termsA].filter((t) => termsB.has(t));
|
|
563
|
+
// Sort by IDF (more important terms first)
|
|
564
|
+
shared.sort((x, y) => {
|
|
565
|
+
const idfX = this.idfScores.get(x) ?? 0;
|
|
566
|
+
const idfY = this.idfScores.get(y) ?? 0;
|
|
567
|
+
return idfY - idfX;
|
|
568
|
+
});
|
|
569
|
+
return shared.slice(0, 10);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Check if explicit relationship exists
|
|
573
|
+
*/
|
|
574
|
+
hasExplicitRelationship(_sourceId, _targetId) {
|
|
575
|
+
// Would check against explicit relationship data
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Extract key terms from cluster
|
|
580
|
+
*/
|
|
581
|
+
extractClusterTerms(memberIds) {
|
|
582
|
+
const termCounts = new Map();
|
|
583
|
+
for (const id of memberIds) {
|
|
584
|
+
const req = this.requirements.get(id);
|
|
585
|
+
if (!req)
|
|
586
|
+
continue;
|
|
587
|
+
const terms = this.tokenize(req);
|
|
588
|
+
for (const term of new Set(terms)) {
|
|
589
|
+
termCounts.set(term, (termCounts.get(term) ?? 0) + 1);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
// Sort by frequency * IDF
|
|
593
|
+
const scored = [...termCounts.entries()].map(([term, count]) => ({
|
|
594
|
+
term,
|
|
595
|
+
score: count * (this.idfScores.get(term) ?? 1),
|
|
596
|
+
}));
|
|
597
|
+
scored.sort((a, b) => b.score - a.score);
|
|
598
|
+
return scored.slice(0, 10).map((s) => s.term);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Calculate cluster cohesion
|
|
602
|
+
*/
|
|
603
|
+
calculateClusterCohesion(memberIds) {
|
|
604
|
+
if (memberIds.length <= 1)
|
|
605
|
+
return 1;
|
|
606
|
+
let totalSimilarity = 0;
|
|
607
|
+
let pairCount = 0;
|
|
608
|
+
for (let i = 0; i < memberIds.length; i++) {
|
|
609
|
+
const reqA = this.requirements.get(memberIds[i]);
|
|
610
|
+
if (!reqA)
|
|
611
|
+
continue;
|
|
612
|
+
for (let j = i + 1; j < memberIds.length; j++) {
|
|
613
|
+
const reqB = this.requirements.get(memberIds[j]);
|
|
614
|
+
if (!reqB)
|
|
615
|
+
continue;
|
|
616
|
+
totalSimilarity += this.calculateSimilarity(reqA, reqB, this.config.algorithm);
|
|
617
|
+
pairCount++;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return pairCount > 0 ? totalSimilarity / pairCount : 0;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Create related requirements finder instance
|
|
625
|
+
*/
|
|
626
|
+
export function createRelatedRequirementsFinder(config) {
|
|
627
|
+
return new RelatedRequirementsFinder(config);
|
|
628
|
+
}
|
|
629
|
+
//# sourceMappingURL=related-finder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-finder.js","sourceRoot":"","sources":["../../src/requirements/related-finder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA4HH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,SAAS,EAAE,OAAO;IAClB,aAAa,EAAE,GAAG;IAClB,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,IAAI;IACxB,SAAS,EAAE;QACT,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;QACnE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE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