@eldrforge/kodrdriv 1.2.129 → 1.2.130
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/commands/tree.js +4 -4
- package/dist/commands/tree.js.map +1 -1
- package/dist/constants.js +1 -1
- package/package.json +3 -1
- package/dist/execution/CommandValidator.js +0 -192
- package/dist/execution/CommandValidator.js.map +0 -1
- package/dist/execution/DependencyChecker.js +0 -102
- package/dist/execution/DependencyChecker.js.map +0 -1
- package/dist/execution/DynamicTaskPool.js +0 -661
- package/dist/execution/DynamicTaskPool.js.map +0 -1
- package/dist/execution/RecoveryManager.js +0 -584
- package/dist/execution/RecoveryManager.js.map +0 -1
- package/dist/execution/ResourceMonitor.js +0 -150
- package/dist/execution/ResourceMonitor.js.map +0 -1
- package/dist/execution/Scheduler.js +0 -98
- package/dist/execution/Scheduler.js.map +0 -1
- package/dist/execution/TreeExecutionAdapter.js +0 -225
- package/dist/execution/TreeExecutionAdapter.js.map +0 -1
- package/dist/ui/ProgressFormatter.js +0 -250
- package/dist/ui/ProgressFormatter.js.map +0 -1
- package/dist/util/checkpointManager.js +0 -166
- package/dist/util/checkpointManager.js.map +0 -1
- package/dist/util/dependencyGraph.js +0 -222
- package/dist/util/dependencyGraph.js.map +0 -1
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os__default from 'os';
|
|
2
2
|
import path__default from 'path';
|
|
3
3
|
|
|
4
|
-
const VERSION = '1.2.
|
|
4
|
+
const VERSION = '1.2.130 (HEAD/6e04111 T:v1.2.130 2025-12-26 18:52:39 -0800) linux x64 v22.21.1';
|
|
5
5
|
const PROGRAM_NAME = 'kodrdriv';
|
|
6
6
|
const DEFAULT_OVERRIDES = false;
|
|
7
7
|
const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS = 'YYYY-MM-DD-HHmmss.SSS';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrforge/kodrdriv",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.130",
|
|
4
4
|
"description": "Create Intelligent Release Notes or Change Logs from Git",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"@eldrforge/git-tools": "^0.1.13",
|
|
44
44
|
"@eldrforge/github-tools": "^0.1.15",
|
|
45
45
|
"@eldrforge/shared": "^0.1.2",
|
|
46
|
+
"@eldrforge/tree-core": "^0.1.1",
|
|
47
|
+
"@eldrforge/tree-execution": "^0.1.1",
|
|
46
48
|
"@octokit/rest": "^22.0.0",
|
|
47
49
|
"@riotprompt/riotprompt": "^0.0.8",
|
|
48
50
|
"@theunwalked/cardigantime": "^0.0.16",
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { getLogger } from '../logging.js';
|
|
2
|
-
|
|
3
|
-
function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* CommandValidator checks if commands are safe for parallel execution
|
|
18
|
-
*/ class CommandValidator {
|
|
19
|
-
/**
|
|
20
|
-
* Validate a command for parallel execution
|
|
21
|
-
*/ static validateForParallel(command, builtInCommand) {
|
|
22
|
-
const issues = [];
|
|
23
|
-
const warnings = [];
|
|
24
|
-
const recommendations = [];
|
|
25
|
-
// Check for inherently unsafe operations
|
|
26
|
-
const unsafePatterns = [
|
|
27
|
-
{
|
|
28
|
-
pattern: /git\s+checkout/,
|
|
29
|
-
message: 'Branch switching is not safe for parallel execution'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
pattern: /git\s+switch/,
|
|
33
|
-
message: 'Branch switching is not safe for parallel execution'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
pattern: /git\s+rebase/,
|
|
37
|
-
message: 'Rebase operations should not run in parallel'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
pattern: /git\s+merge/,
|
|
41
|
-
message: 'Merge operations should not run in parallel'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
pattern: /rm\s+-rf\s+\//,
|
|
45
|
-
message: 'Dangerous deletion commands detected'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
pattern: /sudo/,
|
|
49
|
-
message: 'Sudo commands should not run in parallel'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
pattern: /format/,
|
|
53
|
-
message: 'Format commands may be destructive'
|
|
54
|
-
}
|
|
55
|
-
];
|
|
56
|
-
for (const { pattern, message } of unsafePatterns){
|
|
57
|
-
if (pattern.test(command)) {
|
|
58
|
-
issues.push(message);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Check for potentially problematic operations
|
|
62
|
-
const warningPatterns = [
|
|
63
|
-
{
|
|
64
|
-
pattern: /npm\s+(link|unlink)/,
|
|
65
|
-
message: 'npm link/unlink may conflict in parallel execution'
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
pattern: /npm\s+install/,
|
|
69
|
-
message: 'npm install in parallel may cause lock file conflicts'
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
pattern: /npm\s+ci/,
|
|
73
|
-
message: 'npm ci in parallel may cause lock file conflicts'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
pattern: /package-lock\.json/,
|
|
77
|
-
message: 'Operations modifying package-lock.json may conflict'
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
pattern: /node_modules/,
|
|
81
|
-
message: 'Operations in node_modules may conflict'
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
for (const { pattern, message } of warningPatterns){
|
|
85
|
-
if (pattern.test(command)) {
|
|
86
|
-
warnings.push(message);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Built-in command specific checks
|
|
90
|
-
if (builtInCommand === 'commit') {
|
|
91
|
-
warnings.push('Parallel commits: Recommend max concurrency of 2 to avoid conflicts');
|
|
92
|
-
recommendations.push('Use: --max-concurrency 2');
|
|
93
|
-
}
|
|
94
|
-
if (builtInCommand === 'publish') {
|
|
95
|
-
warnings.push('Parallel publish: PR checks may take significant time');
|
|
96
|
-
warnings.push('Version propagation happens automatically between dependency levels');
|
|
97
|
-
recommendations.push('Use: --max-concurrency 2-3 for publish operations');
|
|
98
|
-
recommendations.push('Monitor with: kodrdriv tree --status-parallel');
|
|
99
|
-
}
|
|
100
|
-
if (builtInCommand === 'link' || builtInCommand === 'unlink') {
|
|
101
|
-
warnings.push('Link operations may have filesystem race conditions');
|
|
102
|
-
recommendations.push('Consider sequential execution for link/unlink');
|
|
103
|
-
}
|
|
104
|
-
// Check for output redirection
|
|
105
|
-
if (command.includes('>') || command.includes('>>')) {
|
|
106
|
-
warnings.push('Output redirection in parallel may interleave output');
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
valid: issues.length === 0,
|
|
110
|
-
issues,
|
|
111
|
-
warnings,
|
|
112
|
-
recommendations
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Log validation results
|
|
117
|
-
*/ static logValidation(result) {
|
|
118
|
-
if (!result.valid) {
|
|
119
|
-
this.logger.error('VALIDATOR_FAILED: Command validation failed for parallel execution | Error Count: ' + result.issues.length + ' | Impact: Cannot proceed safely');
|
|
120
|
-
for (const issue of result.issues){
|
|
121
|
-
this.logger.error(`VALIDATOR_ERROR_DETAIL: Validation issue | Issue: ${issue}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (result.warnings.length > 0) {
|
|
125
|
-
this.logger.warn('VALIDATOR_WARNINGS: Command validation warnings for parallel execution | Warning Count: ' + result.warnings.length + ' | Impact: May cause issues');
|
|
126
|
-
for (const warning of result.warnings){
|
|
127
|
-
this.logger.warn(`VALIDATOR_WARNING_DETAIL: Validation warning | Warning: ${warning}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (result.recommendations.length > 0 && this.logger.verbose) {
|
|
131
|
-
this.logger.info('VALIDATOR_RECOMMENDATIONS: Command validation recommendations | Count: ' + result.recommendations.length + ' | Purpose: Improve parallel execution');
|
|
132
|
-
for (const rec of result.recommendations){
|
|
133
|
-
this.logger.info(`VALIDATOR_RECOMMENDATION_DETAIL: ${rec}`);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Get recommended concurrency for a command type
|
|
139
|
-
*/ static getRecommendedConcurrency(builtInCommand, cpuCount = 4, command) {
|
|
140
|
-
// If command is provided, check for memory-intensive patterns
|
|
141
|
-
if (command) {
|
|
142
|
-
const memoryIntensivePatterns = [
|
|
143
|
-
{
|
|
144
|
-
pattern: /npm\s+test/,
|
|
145
|
-
message: 'Test execution is memory intensive'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
pattern: /npm\s+run\s+test/,
|
|
149
|
-
message: 'Test execution is memory intensive'
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
pattern: /vitest/,
|
|
153
|
-
message: 'Vitest execution is memory intensive'
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
pattern: /coverage/,
|
|
157
|
-
message: 'Coverage generation is memory intensive'
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
pattern: /npm\s+run\s+precommit/,
|
|
161
|
-
message: 'Precommit tasks (build+lint+test) are resource intensive'
|
|
162
|
-
}
|
|
163
|
-
];
|
|
164
|
-
for (const { pattern } of memoryIntensivePatterns){
|
|
165
|
-
if (pattern.test(command)) {
|
|
166
|
-
// Return lower concurrency for memory intensive tasks: 25% of CPUs, min 2, max 4
|
|
167
|
-
const recommended = Math.max(2, Math.min(4, Math.floor(cpuCount * 0.25)));
|
|
168
|
-
return Math.min(recommended, cpuCount);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
switch(builtInCommand){
|
|
173
|
-
case 'commit':
|
|
174
|
-
// Lower concurrency for commit to reduce conflicts
|
|
175
|
-
return Math.min(2, cpuCount);
|
|
176
|
-
case 'publish':
|
|
177
|
-
// Moderate concurrency for publish (long-running)
|
|
178
|
-
return Math.max(2, Math.floor(cpuCount / 2));
|
|
179
|
-
case 'link':
|
|
180
|
-
case 'unlink':
|
|
181
|
-
// Very conservative for link operations
|
|
182
|
-
return 1; // Sequential recommended
|
|
183
|
-
default:
|
|
184
|
-
// Full concurrency for general commands
|
|
185
|
-
return cpuCount;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
_define_property(CommandValidator, "logger", getLogger());
|
|
190
|
-
|
|
191
|
-
export { CommandValidator };
|
|
192
|
-
//# sourceMappingURL=CommandValidator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandValidator.js","sources":["../../src/execution/CommandValidator.ts"],"sourcesContent":["import { getLogger } from '../logging';\n\nexport interface ValidationResult {\n valid: boolean;\n issues: string[];\n warnings: string[];\n recommendations: string[];\n}\n\n/**\n * CommandValidator checks if commands are safe for parallel execution\n */\nexport class CommandValidator {\n private static logger = getLogger();\n\n /**\n * Validate a command for parallel execution\n */\n static validateForParallel(command: string, builtInCommand?: string): ValidationResult {\n const issues: string[] = [];\n const warnings: string[] = [];\n const recommendations: string[] = [];\n\n // Check for inherently unsafe operations\n const unsafePatterns = [\n { pattern: /git\\s+checkout/, message: 'Branch switching is not safe for parallel execution' },\n { pattern: /git\\s+switch/, message: 'Branch switching is not safe for parallel execution' },\n { pattern: /git\\s+rebase/, message: 'Rebase operations should not run in parallel' },\n { pattern: /git\\s+merge/, message: 'Merge operations should not run in parallel' },\n { pattern: /rm\\s+-rf\\s+\\//, message: 'Dangerous deletion commands detected' },\n { pattern: /sudo/, message: 'Sudo commands should not run in parallel' },\n { pattern: /format/, message: 'Format commands may be destructive' }\n ];\n\n for (const { pattern, message } of unsafePatterns) {\n if (pattern.test(command)) {\n issues.push(message);\n }\n }\n\n // Check for potentially problematic operations\n const warningPatterns = [\n { pattern: /npm\\s+(link|unlink)/, message: 'npm link/unlink may conflict in parallel execution' },\n { pattern: /npm\\s+install/, message: 'npm install in parallel may cause lock file conflicts' },\n { pattern: /npm\\s+ci/, message: 'npm ci in parallel may cause lock file conflicts' },\n { pattern: /package-lock\\.json/, message: 'Operations modifying package-lock.json may conflict' },\n { pattern: /node_modules/, message: 'Operations in node_modules may conflict' }\n ];\n\n for (const { pattern, message } of warningPatterns) {\n if (pattern.test(command)) {\n warnings.push(message);\n }\n }\n\n // Built-in command specific checks\n if (builtInCommand === 'commit') {\n warnings.push('Parallel commits: Recommend max concurrency of 2 to avoid conflicts');\n recommendations.push('Use: --max-concurrency 2');\n }\n\n if (builtInCommand === 'publish') {\n warnings.push('Parallel publish: PR checks may take significant time');\n warnings.push('Version propagation happens automatically between dependency levels');\n recommendations.push('Use: --max-concurrency 2-3 for publish operations');\n recommendations.push('Monitor with: kodrdriv tree --status-parallel');\n }\n\n if (builtInCommand === 'link' || builtInCommand === 'unlink') {\n warnings.push('Link operations may have filesystem race conditions');\n recommendations.push('Consider sequential execution for link/unlink');\n }\n\n // Check for output redirection\n if (command.includes('>') || command.includes('>>')) {\n warnings.push('Output redirection in parallel may interleave output');\n }\n\n return {\n valid: issues.length === 0,\n issues,\n warnings,\n recommendations\n };\n }\n\n /**\n * Log validation results\n */\n static logValidation(result: ValidationResult): void {\n if (!result.valid) {\n this.logger.error('VALIDATOR_FAILED: Command validation failed for parallel execution | Error Count: ' + result.issues.length + ' | Impact: Cannot proceed safely');\n for (const issue of result.issues) {\n this.logger.error(`VALIDATOR_ERROR_DETAIL: Validation issue | Issue: ${issue}`);\n }\n }\n\n if (result.warnings.length > 0) {\n this.logger.warn('VALIDATOR_WARNINGS: Command validation warnings for parallel execution | Warning Count: ' + result.warnings.length + ' | Impact: May cause issues');\n for (const warning of result.warnings) {\n this.logger.warn(`VALIDATOR_WARNING_DETAIL: Validation warning | Warning: ${warning}`);\n }\n }\n\n if (result.recommendations.length > 0 && (this.logger as any).verbose) {\n this.logger.info('VALIDATOR_RECOMMENDATIONS: Command validation recommendations | Count: ' + result.recommendations.length + ' | Purpose: Improve parallel execution');\n for (const rec of result.recommendations) {\n this.logger.info(`VALIDATOR_RECOMMENDATION_DETAIL: ${rec}`);\n }\n }\n }\n\n /**\n * Get recommended concurrency for a command type\n */\n static getRecommendedConcurrency(builtInCommand?: string, cpuCount: number = 4, command?: string): number {\n // If command is provided, check for memory-intensive patterns\n if (command) {\n const memoryIntensivePatterns = [\n { pattern: /npm\\s+test/, message: 'Test execution is memory intensive' },\n { pattern: /npm\\s+run\\s+test/, message: 'Test execution is memory intensive' },\n { pattern: /vitest/, message: 'Vitest execution is memory intensive' },\n { pattern: /coverage/, message: 'Coverage generation is memory intensive' },\n { pattern: /npm\\s+run\\s+precommit/, message: 'Precommit tasks (build+lint+test) are resource intensive' }\n ];\n\n for (const { pattern } of memoryIntensivePatterns) {\n if (pattern.test(command)) {\n // Return lower concurrency for memory intensive tasks: 25% of CPUs, min 2, max 4\n const recommended = Math.max(2, Math.min(4, Math.floor(cpuCount * 0.25)));\n return Math.min(recommended, cpuCount);\n }\n }\n }\n\n switch (builtInCommand) {\n case 'commit':\n // Lower concurrency for commit to reduce conflicts\n return Math.min(2, cpuCount);\n\n case 'publish':\n // Moderate concurrency for publish (long-running)\n return Math.max(2, Math.floor(cpuCount / 2));\n\n case 'link':\n case 'unlink':\n // Very conservative for link operations\n return 1; // Sequential recommended\n\n default:\n // Full concurrency for general commands\n return cpuCount;\n }\n }\n}\n"],"names":["CommandValidator","validateForParallel","command","builtInCommand","issues","warnings","recommendations","unsafePatterns","pattern","message","test","push","warningPatterns","includes","valid","length","logValidation","result","logger","error","issue","warn","warning","verbose","info","rec","getRecommendedConcurrency","cpuCount","memoryIntensivePatterns","recommended","Math","max","min","floor","getLogger"],"mappings":";;;;;;;;;;;;;;;AASA;;AAEC,IACM,MAAMA,gBAAAA,CAAAA;AAGT;;AAEC,QACD,OAAOC,mBAAAA,CAAoBC,OAAe,EAAEC,cAAuB,EAAoB;AACnF,QAAA,MAAMC,SAAmB,EAAE;AAC3B,QAAA,MAAMC,WAAqB,EAAE;AAC7B,QAAA,MAAMC,kBAA4B,EAAE;;AAGpC,QAAA,MAAMC,cAAAA,GAAiB;AACnB,YAAA;gBAAEC,OAAAA,EAAS,gBAAA;gBAAkBC,OAAAA,EAAS;AAAsD,aAAA;AAC5F,YAAA;gBAAED,OAAAA,EAAS,cAAA;gBAAgBC,OAAAA,EAAS;AAAsD,aAAA;AAC1F,YAAA;gBAAED,OAAAA,EAAS,cAAA;gBAAgBC,OAAAA,EAAS;AAA+C,aAAA;AACnF,YAAA;gBAAED,OAAAA,EAAS,aAAA;gBAAeC,OAAAA,EAAS;AAA8C,aAAA;AACjF,YAAA;gBAAED,OAAAA,EAAS,eAAA;gBAAiBC,OAAAA,EAAS;AAAuC,aAAA;AAC5E,YAAA;gBAAED,OAAAA,EAAS,MAAA;gBAAQC,OAAAA,EAAS;AAA2C,aAAA;AACvE,YAAA;gBAAED,OAAAA,EAAS,QAAA;gBAAUC,OAAAA,EAAS;AAAqC;AACtE,SAAA;AAED,QAAA,KAAK,MAAM,EAAED,OAAO,EAAEC,OAAO,EAAE,IAAIF,cAAAA,CAAgB;YAC/C,IAAIC,OAAAA,CAAQE,IAAI,CAACR,OAAAA,CAAAA,EAAU;AACvBE,gBAAAA,MAAAA,CAAOO,IAAI,CAACF,OAAAA,CAAAA;AAChB,YAAA;AACJ,QAAA;;AAGA,QAAA,MAAMG,eAAAA,GAAkB;AACpB,YAAA;gBAAEJ,OAAAA,EAAS,qBA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CAAAA;YAEvB,KAAK,SAAA;;AAED,gBAAA,OAAOG,KAAKC,GAAG,CAAC,GAAGD,IAAAA,CAAKG,KAAK,CAACN,QAAAA,GAAW,CAAA,CAAA,CAAA;YAE7C,KAAK,MAAA;YACL,KAAK,QAAA;;AAED,gBAAA,OAAO;AAEX,YAAA;;gBAEI,OAAOA,QAAAA;AACf;AACJ,IAAA;AACJ;AA7II,gBAAA,CADS3B,kBACMkB,QAAAA,EAASgB,SAAAA,EAAAA,CAAAA;;;;"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* DependencyChecker validates package readiness and provides dependency information
|
|
16
|
-
* for the task pool scheduler.
|
|
17
|
-
*/ class DependencyChecker {
|
|
18
|
-
/**
|
|
19
|
-
* Check if a package is ready to execute
|
|
20
|
-
* A package is ready when all its dependencies are completed and none have failed
|
|
21
|
-
*/ isReady(packageName, state) {
|
|
22
|
-
const dependencies = this.graph.edges.get(packageName) || new Set();
|
|
23
|
-
for (const dep of dependencies){
|
|
24
|
-
// If any dependency is not completed, not ready
|
|
25
|
-
if (!state.completed.includes(dep)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
// If any dependency failed, should be skipped (not ready)
|
|
29
|
-
if (state.failed.some((f)=>f.name === dep)) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Get count of packages that depend on this one
|
|
37
|
-
* Higher count = higher priority (unlocks more packages)
|
|
38
|
-
*/ getDependentCount(packageName) {
|
|
39
|
-
return (this.graph.reverseEdges.get(packageName) || new Set()).size;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Get depth of package in dependency tree
|
|
43
|
-
* Depth = longest path from a root package (package with no dependencies)
|
|
44
|
-
* Lower depth = higher priority (can unlock dependent packages sooner)
|
|
45
|
-
*/ getDepth(packageName) {
|
|
46
|
-
const visited = new Set();
|
|
47
|
-
const calculateDepth = (pkg)=>{
|
|
48
|
-
if (visited.has(pkg)) return 0;
|
|
49
|
-
visited.add(pkg);
|
|
50
|
-
const deps = this.graph.edges.get(pkg) || new Set();
|
|
51
|
-
if (deps.size === 0) return 0;
|
|
52
|
-
return 1 + Math.max(...Array.from(deps).map((dep)=>calculateDepth(dep)));
|
|
53
|
-
};
|
|
54
|
-
return calculateDepth(packageName);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get all dependencies for a package
|
|
58
|
-
*/ getDependencies(packageName) {
|
|
59
|
-
return this.graph.edges.get(packageName) || new Set();
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get all dependents (packages that depend on this one)
|
|
63
|
-
*/ getDependents(packageName) {
|
|
64
|
-
return this.graph.reverseEdges.get(packageName) || new Set();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Check if package has any dependencies
|
|
68
|
-
*/ hasDependencies(packageName) {
|
|
69
|
-
const deps = this.graph.edges.get(packageName);
|
|
70
|
-
return deps !== undefined && deps.size > 0;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Check if package has any dependents
|
|
74
|
-
*/ hasDependents(packageName) {
|
|
75
|
-
const dependents = this.graph.reverseEdges.get(packageName);
|
|
76
|
-
return dependents !== undefined && dependents.size > 0;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Get packages that are blocked by a failed package
|
|
80
|
-
*/ getBlockedPackages(failedPackage, state) {
|
|
81
|
-
const blocked = new Set();
|
|
82
|
-
// Add all pending and ready packages that depend on the failed package
|
|
83
|
-
const allPending = [
|
|
84
|
-
...state.pending,
|
|
85
|
-
...state.ready
|
|
86
|
-
];
|
|
87
|
-
for (const pkg of allPending){
|
|
88
|
-
const deps = this.graph.edges.get(pkg) || new Set();
|
|
89
|
-
if (deps.has(failedPackage)) {
|
|
90
|
-
blocked.add(pkg);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return blocked;
|
|
94
|
-
}
|
|
95
|
-
constructor(graph){
|
|
96
|
-
_define_property(this, "graph", void 0);
|
|
97
|
-
this.graph = graph;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { DependencyChecker };
|
|
102
|
-
//# sourceMappingURL=DependencyChecker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DependencyChecker.js","sources":["../../src/execution/DependencyChecker.ts"],"sourcesContent":["import { DependencyGraph } from '../util/dependencyGraph';\nimport { ExecutionState } from '../types/parallelExecution';\n\n/**\n * DependencyChecker validates package readiness and provides dependency information\n * for the task pool scheduler.\n */\nexport class DependencyChecker {\n private graph: DependencyGraph;\n\n constructor(graph: DependencyGraph) {\n this.graph = graph;\n }\n\n /**\n * Check if a package is ready to execute\n * A package is ready when all its dependencies are completed and none have failed\n */\n isReady(packageName: string, state: ExecutionState): boolean {\n const dependencies = this.graph.edges.get(packageName) || new Set();\n\n for (const dep of dependencies) {\n // If any dependency is not completed, not ready\n if (!state.completed.includes(dep)) {\n return false;\n }\n\n // If any dependency failed, should be skipped (not ready)\n if (state.failed.some(f => f.name === dep)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Get count of packages that depend on this one\n * Higher count = higher priority (unlocks more packages)\n */\n getDependentCount(packageName: string): number {\n return (this.graph.reverseEdges.get(packageName) || new Set()).size;\n }\n\n /**\n * Get depth of package in dependency tree\n * Depth = longest path from a root package (package with no dependencies)\n * Lower depth = higher priority (can unlock dependent packages sooner)\n */\n getDepth(packageName: string): number {\n const visited = new Set<string>();\n\n const calculateDepth = (pkg: string): number => {\n if (visited.has(pkg)) return 0;\n visited.add(pkg);\n\n const deps = this.graph.edges.get(pkg) || new Set();\n if (deps.size === 0) return 0;\n\n return 1 + Math.max(...Array.from(deps).map(dep => calculateDepth(dep)));\n };\n\n return calculateDepth(packageName);\n }\n\n /**\n * Get all dependencies for a package\n */\n getDependencies(packageName: string): Set<string> {\n return this.graph.edges.get(packageName) || new Set();\n }\n\n /**\n * Get all dependents (packages that depend on this one)\n */\n getDependents(packageName: string): Set<string> {\n return this.graph.reverseEdges.get(packageName) || new Set();\n }\n\n /**\n * Check if package has any dependencies\n */\n hasDependencies(packageName: string): boolean {\n const deps = this.graph.edges.get(packageName);\n return deps !== undefined && deps.size > 0;\n }\n\n /**\n * Check if package has any dependents\n */\n hasDependents(packageName: string): boolean {\n const dependents = this.graph.reverseEdges.get(packageName);\n return dependents !== undefined && dependents.size > 0;\n }\n\n /**\n * Get packages that are blocked by a failed package\n */\n getBlockedPackages(failedPackage: string, state: ExecutionState): Set<string> {\n const blocked = new Set<string>();\n\n // Add all pending and ready packages that depend on the failed package\n const allPending = [...state.pending, ...state.ready];\n\n for (const pkg of allPending) {\n const deps = this.graph.edges.get(pkg) || new Set();\n if (deps.has(failedPackage)) {\n blocked.add(pkg);\n }\n }\n\n return blocked;\n }\n}\n"],"names":["DependencyChecker","isReady","packageName","state","dependencies","graph","edges","get","Set","dep","completed","includes","failed","some","f","name","getDependentCount","reverseEdges","size","getDepth","visited","calculateDepth","pkg","has","add","deps","Math","max","Array","from","map","getDependencies","getDependents","hasDependencies","undefined","hasDependents","dependents","getBlockedPackages","failedPackage","blocked","allPending","pending","ready"],"mappings":";;;;;;;;;;;;;AAGA;;;AAGC,IACM,MAAMA,iBAAAA,CAAAA;AAOT;;;AAGC,QACDC,OAAAA,CAAQC,WAAmB,EAAEC,KAAqB,EAAW;QACzD,MAAMC,YAAAA,GAAe,IAAI,CAACC,KAAK,CAACC,KAA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